Expand description
Auth middleware + API-key helpers.
AuthMode, JwtConfig, and JwksCache are defined in
crate::auth_mode (no crate-internal deps) and re-exported here so
the public path assay_workflow::api::auth::AuthMode keeps working.
Re-exports§
pub use crate::auth_mode::AuthMode;pub use crate::auth_mode::JwksCache;pub use crate::auth_mode::JwtConfig;
Functions§
- auth_
middleware - Axum middleware that enforces authentication based on the configured mode.
- generate_
api_ key - Generate a new random API key (32 bytes, hex-encoded).
- hash_
api_ key - Hash an API key with SHA-256 for storage/lookup.
- key_
prefix - Extract the prefix (first 8 chars after “assay_”) for display.