Expand description
Authentication middleware for the AuthZEN HTTP server.
Modes:
AuthConfig::Disabled— no auth. Suitable for development or loopback-only deployments. The server refuses to start withDisabledauth on a non-loopback bind unlessAGENTGUARD_ALLOW_LOOPBACK_BYPASS=1is set.AuthConfig::ApiKey—Authorization: Bearer <raw>against the configuredApiKeyStore. Argon2id is the verification path; the cost (~150 ms) is acceptable on the auth path.
Health probes (/healthz, /readyz) are always unauthenticated
so Kubernetes can poll them without a credential.
Structs§
- Authenticated
Identity - Authenticated identity and tenant asserted by a verified, bound API key.
Enums§
- Auth
Layer - What the auth layer needs to validate requests. Built once at startup and shared across Axum workers.
- Authentication
Failure
Functions§
- auth_
layer_ fn - Middleware function. Wire via
axum::middleware::from_fn_with_statebecause the router’s state is needed for the auth layer reference.