Skip to main content

doido_auth/
lib.rs

1//! Unified authentication for Doido — Devise + OmniAuth + JWT analogue.
2
3pub mod config;
4pub mod confirmable;
5pub mod controllers;
6pub mod error;
7pub mod extractors;
8pub mod framework_views;
9pub mod handlers;
10pub mod identity;
11pub mod jwt;
12pub mod layer;
13pub mod lockable;
14pub mod oauth;
15pub mod recoverable;
16pub mod registry;
17pub mod rememberable;
18pub mod route_mount;
19pub mod session;
20pub mod state;
21pub mod strategy;
22pub mod user;
23
24pub mod testing;
25pub mod trackable;
26pub mod validations;
27
28#[cfg(feature = "auth-2fa")]
29pub mod two_factor;
30
31#[cfg(feature = "auth-2fa")]
32pub use controllers::AuthTwoFactor;
33
34pub use config::{
35    load as load_config, AuthConfig, AuthModule, AuthRoutesConfig, JwtConfig, YamlConfig,
36};
37pub use controllers::{AuthOauth, AuthPasswords, AuthRegistrations, AuthSessions};
38pub use doido_auth_macros::{__auth_routes_decl, auth_controller, auth_routes, routes};
39pub use error::AuthError;
40pub use extractors::{AuthToken, CurrentUser, MaybeUser, RequireAuth};
41pub use framework_views::register_views;
42pub use handlers::{authenticate, register_user, sign_in, sign_in_with_session, sign_out};
43pub use identity::AuthIdentity;
44pub use jwt::{JwtClaims, JwtStrategy, TokenPair};
45pub use layer::{auth_layer, current_identity, current_user};
46pub use oauth::{OAuth2Provider, OAuthProvider, OAuthTokenResponse};
47pub use registry::{register_strategy, registered_strategies};
48pub use route_mount::mount;
49pub use session::{
50    SessionStrategy, SessionStrategy as CookieStrategy, SESSION_COOKIE, USER_ID_KEY,
51};
52pub use state::{global, init, set_state, try_global, AuthState};
53pub use strategy::AuthStrategy;
54pub use user::{authenticate_password, AuthUser, RegisterableAuthUser};
55
56#[cfg(feature = "auth-2fa")]
57pub use two_factor::{
58    enroll as enroll_two_factor, verify_code as verify_two_factor_code, TwoFactorEnrollment,
59};
60
61#[cfg(feature = "generators")]
62pub mod generators;