Skip to main content

Module auth

Module auth 

Source
Available on crate feature serve only.
Expand description

Bearer-token authentication for /v1/*. Constant-time comparison via subtle; the Authorization header is the only accepted credential.

Functionsยง

authorize_header
Validate a raw Authorization header value against the expected token.
require_auth
Axum middleware enforcing bearer auth on /v1/*. A no-op when the server was started with --no-auth. CORS preflight (OPTIONS) is allowed through so browsers (which omit Authorization on preflight) work behind a CORS policy.