Expand description
Proc-macro Actix-Web authorization attributes for the AXIAM Rust SDK.
This crate is an implementation detail of axiam-sdk; do not depend on
it directly. The three attribute macros it exports are re-exported from
axiam-sdk behind its macros feature, so consumers write
use axiam_sdk::require_access; and never name this crate.
The macros implement the CONTRACT.md §11 declarative authorization
helpers on top of the §10 AxiamUser route-guard extractor. They are
deliberately thin: each one expands to a small wrapper that delegates
to the runtime helpers in axiam_sdk::middleware (RequireAccess,
resource_from_path, require_role_check, …), so the enforcement logic
lives in ordinary, unit-testable library code rather than inside macro
expansion.
require_auth— require an authenticated AXIAM identity (401 on failure).require_access— require the authenticated caller to pass an AXIAM authorization check for anactionon a request-resolved resource (401 unauthenticated, 403 denied, 400 unresolvable resource, 503 authz transport failure — fail closed).require_role— require one of a set of roles, checked locally against the verified token’s claims (403 on failure).
Attribute Macros§
- reactor_
handler - Bind an
async fnto one reactor hook event (CONTRACT.md §22.14). - require_
access - Require the authenticated caller to pass an AXIAM authorization check on an
Actix-Web handler (CONTRACT.md §11
require_access). - require_
auth - Require an authenticated AXIAM identity on an Actix-Web handler
(CONTRACT.md §11
require_auth). - require_
role - Require one of a set of roles on an Actix-Web handler (CONTRACT.md §11
require_role).