plugins/dapr/skills/middleware-validator/SKILL.md
Automatically validate DAPR HTTP middleware configuration files. Checks for correct middleware types, proper secret references, pipeline ordering, and security best practices. Use when configuring OAuth2, Bearer tokens, OPA policies, rate limiting, or other middleware.
npx skillsauth add sahib-sawhney-wh/sahibs-claude-plugin-marketplace dapr-middleware-validatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill validates DAPR HTTP middleware components for security and correctness.
Claude automatically uses this skill when:
| Type | Component Type | Purpose |
|------|---------------|---------|
| OAuth2 | middleware.http.oauth2 | Authorization Code flow |
| OAuth2 CC | middleware.http.oauth2clientcredentials | Service-to-service auth |
| Bearer | middleware.http.bearer | JWT/OIDC token validation |
| Type | Component Type | Purpose |
|------|---------------|---------|
| OPA | middleware.http.opa | Policy-based authorization |
| Type | Component Type | Purpose |
|------|---------------|---------|
| Rate Limit | middleware.http.ratelimit | Request throttling |
| Sentinel | middleware.http.sentinel | Circuit breaker/flow control |
| Type | Component Type | Purpose |
|------|---------------|---------|
| Router Alias | middleware.http.routeralias | Route rewriting |
| Router Checker | middleware.http.routerchecker | Route validation |
| WASM | middleware.http.wasm | Custom WebAssembly logic |
| Uppercase | middleware.http.uppercase | Testing only |
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: oauth2
spec:
type: middleware.http.oauth2
version: v1
metadata:
- name: clientId
secretKeyRef: # REQUIRED: Use secretKeyRef
name: oauth-secrets
key: client-id
- name: clientSecret
secretKeyRef: # REQUIRED: Use secretKeyRef
name: oauth-secrets
key: client-secret
- name: scopes
value: "openid profile" # REQUIRED
- name: authURL
value: "https://..." # REQUIRED: Must be HTTPS
- name: tokenURL
value: "https://..." # REQUIRED: Must be HTTPS
- name: redirectURL
value: "..." # REQUIRED
- name: forceHTTPS
value: "true" # RECOMMENDED for production
Checks performed:
clientId uses secretKeyRef (not plain value)clientSecret uses secretKeyRef (not plain value)authURL uses HTTPS protocoltokenURL uses HTTPS protocolforceHTTPS is "true" for productionspec:
type: middleware.http.bearer
metadata:
- name: audience
value: "api://..." # REQUIRED
- name: issuer
value: "https://..." # REQUIRED: Must be HTTPS
Checks performed:
audience is specifiedissuer uses HTTPS protocolspec:
type: middleware.http.opa
metadata:
- name: defaultStatus
value: "403" # RECOMMENDED: 403 for authz failures
- name: rego
value: |
package http
default allow = false # REQUIRED: Default deny
Checks performed:
default allow = falsepackage httpincludedHeaders contains Authorization if JWT checkingspec:
type: middleware.http.ratelimit
metadata:
- name: maxRequestsPerSecond
value: "100" # REQUIRED: Reasonable limit
Checks performed:
maxRequestsPerSecond is specifiedspec:
type: middleware.http.sentinel
metadata:
- name: appName
value: "my-service" # REQUIRED
- name: flowRules
value: | # At least one rule type required
[...]
Checks performed:
appName is specifiedspec:
type: middleware.http.wasm
metadata:
- name: url
value: "file://..." # REQUIRED
Checks performed:
url is specified with valid scheme (file://, http://, https://)spec:
type: middleware.http.routeralias
metadata:
- name: routes
value: | # REQUIRED
{"/api": "/v1.0/invoke/..."}
Checks performed:
routes is valid JSON or YAMLspec:
type: middleware.http.routerchecker
metadata:
- name: rule
value: "^[A-Za-z0-9/._-]+$" # REQUIRED: Valid regex
Checks performed:
rule is valid regex patternCorrect middleware ordering:
spec:
httpPipeline:
handlers:
- name: routerchecker # 1. Block invalid requests first
type: middleware.http.routerchecker
- name: ratelimit # 2. Rate limit before auth
type: middleware.http.ratelimit
- name: bearer-auth # 3. Authenticate
type: middleware.http.bearer
- name: opa-authz # 4. Authorize (after auth)
type: middleware.http.opa
- name: routeralias # 5. Transform routes last
type: middleware.http.routeralias
Order checks:
DAPR Middleware Validation Report
==================================
✓ components/oauth2-auth.yaml - Valid
- Type: middleware.http.oauth2
- Credentials use secretKeyRef: Yes
- HTTPS enforced: Yes
⚠ components/ratelimit.yaml - Warning
- Type: middleware.http.ratelimit
- Warning: Rate limit of 10000 RPS is very high
- Recommendation: Consider lower limit for public APIs
✗ components/bearer-auth.yaml - Invalid
- Type: middleware.http.bearer
- Error: Missing required field 'audience'
- Error: 'issuer' uses HTTP instead of HTTPS
Pipeline Analysis:
✗ Rate limiting should come BEFORE authentication middleware
Current order: [bearer-auth, ratelimit]
Recommended: [ratelimit, bearer-auth]
Security Summary:
- Critical: 1 (plain-text credentials)
- Warnings: 2
- Valid: 3
# BAD (security risk)
- name: clientSecret
value: "my-secret-key"
# GOOD (use secret reference)
- name: clientSecret
secretKeyRef:
name: oauth-secrets
key: client-secret
# BAD (insecure)
- name: tokenURL
value: "http://auth.example.com/token"
# GOOD
- name: tokenURL
value: "https://auth.example.com/token"
# BAD (insecure - allows everything by default)
package http
default allow = true
# GOOD (secure - denies by default)
package http
default allow = false
allow { ... specific conditions ... }
# BAD (auth before rate limit allows DoS via auth endpoints)
handlers:
- name: oauth2
type: middleware.http.oauth2
- name: ratelimit
type: middleware.http.ratelimit
# GOOD (rate limit protects auth endpoints)
handlers:
- name: ratelimit
type: middleware.http.ratelimit
- name: oauth2
type: middleware.http.oauth2
This skill integrates with:
middleware-expert agent for detailed configuration helpsecurity-scanner skill for broader security analysis/dapr:middleware command to generate valid configs/dapr:security command for pre-deployment checkstools
# dataverse-web-apps This skill provides guidance on building web applications (any language) that connect to Microsoft Dataverse. Use when users ask about ".NET Dataverse", "Node.js Dataverse", "JavaScript Dataverse", "REST API Dataverse", "web app Dataverse", "OAuth Dataverse", or need help with web application integration. ## Dataverse Web API All languages can access Dataverse via the OData Web API. **Base URL:** `https://yourorg.api.crm.dynamics.com/api/data/v9.2/` ### Authentication
tools
# dataverse-sdk This skill provides guidance on using the PowerPlatform Dataverse Client SDK for Python. Use when users ask about "Dataverse SDK", "Dataverse Python", "DataverseClient", "Dataverse authentication", "Dataverse CRUD operations", "create Dataverse records", "query Dataverse", "Dataverse connection", or need help with the Microsoft Dataverse Python SDK. ## Quick Start Install the SDK: ```bash pip install PowerPlatform-Dataverse-Client azure-identity ``` Basic setup: ```python fro
tools
# dataverse-schema-design This skill provides guidance on designing Dataverse table schemas and data models. Use when users ask about "Dataverse table design", "Dataverse schema", "Dataverse relationships", "Dataverse columns", "data modeling Dataverse", "Dataverse best practices", or need help designing their data structure. ## Table Design Fundamentals ### Naming Conventions - **Table prefix**: Use publisher prefix (e.g., `new_`, `cr123_`) - **Table names**: PascalCase, singular (e.g., `new
tools
# dataverse-queries This skill provides guidance on querying data from Microsoft Dataverse. Use when users ask about "Dataverse query", "OData filter", "Dataverse SQL", "FetchXML", "query Dataverse records", "Dataverse filter syntax", "search Dataverse", or need help constructing queries. ## Query Methods The Dataverse SDK supports two query methods: 1. **OData queries** - Standard Web API query syntax 2. **SQL queries** - T-SQL-like syntax (read-only) ## OData Query Basics ```python # Basi