Expand description
Authentication / authorization middleware macros for Axess.
Generates Axum middleware (tower Layers) that enforce authentication
state (require_authn!, require_partial_authn!) or Cedar
authorization decisions (require_authz!, behind the authz feature).
All variants support both 401/403 status responses (API endpoints) and
redirect responses (HTML endpoints).
§Macro family
| Macro | Concern | Feature |
|---|---|---|
predicate_required! | foundation: gate by custom predicate | always on |
require_authn! | gate: caller must be Authenticated | always on |
require_partial_authn! | gate: caller mid-MFA (Authenticating) | always on |
require_authz! | gate: Cedar policy decision (RBAC + ABAC + ReBAC) | authz |
Re-exports§
Macros§
- predicate_
required - Predicate middleware.
- require_
authn - Authentication-required middleware macro.
- require_
authz - Cedar authorization gate for Axum routes. Implies authentication, then evaluates a Cedar policy decision and rejects with 403 on deny.
- require_
partial_ authn - Partial authentication-required middleware macro.
Structs§
- Auth
Session - Axum request extractor providing typed, mutable session access.
- Uri
- The URI component of a request.