Skip to main content

Module auth

Module auth 

Source
Expand description

API key authentication middleware.

When api_keys is non-empty, all requests except those to public paths (e.g. GET /health) must include a valid Authorization: Bearer <key> header. When api_keys is empty, authentication is disabled (local dev mode).

Structs§

AuthState
Shared authentication state injected into the middleware.

Functions§

auth_middleware
Axum middleware function for API key authentication.