Skip to main content

Module middleware

Module middleware 

Source
Expand description

Middleware for authentication, logging, and request processing

Structs§

AuthenticatedUser
Authenticated identity extracted from token
RateLimiter
Fixed-window per-subject rate limiter.

Functions§

auth_middleware
JWT authentication middleware
browser_provisioning_rate_limit_middleware
Rate-limit the public browser-provisioning route before accepted-state resolution or hybrid projection signing. A single stable bucket is intentional: this boundary may run without trustworthy peer-address metadata, and client-controlled forwarding headers must not select buckets.
cors_layer
CORS middleware configuration
extract_iss_from_token
Extract the iss claim from a JWT payload without signature verification. Exported for use in other middleware-like contexts (e.g. MCP inline auth). Returns an empty string on any parse failure.
extract_kid_from_token
Extract kid from a JWT header without full validation.
logging_middleware
Request logging middleware
public_route_rate_limit_middleware
Rate-limit public metadata and pre-upgrade routes with one stable bucket.
rate_limit_middleware
Rate limiting middleware — enforces per-authenticated-subject request quotas.