Skip to main content

Crate axess_macros

Crate axess_macros 

Source
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

MacroConcernFeature
predicate_required!foundation: gate by custom predicatealways on
require_authn!gate: caller must be Authenticatedalways on
require_partial_authn!gate: caller mid-MFA (Authenticating)always on
require_authz!gate: Cedar policy decision (RBAC + ABAC + ReBAC)authz

Re-exports§

pub use axess_core::axum;
pub use axess_core::axum::http;
pub use axess_core::tracing;

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§

AuthSession
Axum request extractor providing typed, mutable session access.
Uri
The URI component of a request.