oxide_framework_core/auth/mod.rs
1//! JWT authentication and role guards.
2//!
3//! 1. Configure [`AuthConfig`] and register with [`crate::App::auth`].
4//! 2. Use [`Authenticated`], [`OptionalAuth`], or [`RequireRole`] in handlers.
5//!
6//! See [`crate::auth::token::encode_token`] to mint JWTs in login handlers or tests.
7
8mod claims;
9mod config;
10mod extract;
11mod layer;
12pub mod token;
13
14pub use claims::AuthClaims;
15pub use config::AuthConfig;
16pub use extract::{AuthRejection, Authenticated, OptionalAuth, RequireRole, RoleName};
17pub use layer::AuthLayer;
18pub use token::encode_token;
19