Skip to main content

Module auth

Module auth 

Source
Expand description

JWT authentication middleware for Haima.

Reuses lago_auth::jwt for token validation. Haima does not need Lago session mapping — it only validates that the caller holds a valid JWT signed with the shared secret.

Behaviour:

  • If no JWT secret is configured, auth is disabled (local dev mode) and a warning is logged on startup.
  • If a secret IS configured, all protected routes require a valid Authorization: Bearer <token> header.

Structs§

AuthConfig
Auth configuration injected as axum state.

Functions§

require_auth
Axum middleware that validates JWT bearer tokens on protected routes.