Module auth

Module auth 

Source
Expand description

API Key authentication middleware for the Kroki-rs server.

When server.auth.enabled = true, extracts any API key or admin credentials and validates them. When disabled (the default), all requests pass through — enabling fast local development.

Functions§

admin_auth_middleware
Axum middleware that enforces admin authentication via Basic Auth.
auth_middleware
Axum middleware that enforces API key authentication.
find_api_key_entry
Looks up the ApiKeyEntry for a given key string. Returns None if the key is not found or auth is disabled.