auth_middleware

Function auth_middleware 

Source
pub async fn auth_middleware(
    state: State<AppState>,
    request: Request<Body>,
    next: Next,
) -> Response
Expand description

Axum middleware that enforces API key authentication.

Skipped entirely when auth.enabled = false (dev mode). Returns 401 with a JSON body if the key is missing or invalid.