elif_auth/lib.rs
1//! # elif-auth: Authentication and Authorization for elif.rs
2//!
3//! This crate provides comprehensive authentication and authorization capabilities
4//! for the elif.rs web framework, including JWT tokens, sessions, RBAC, and MFA.
5
6pub mod config;
7pub mod error;
8pub mod middleware;
9pub mod providers;
10pub mod rbac;
11pub mod traits;
12pub mod utils;
13
14// Prelude-style re-exports for core functionality
15// Only export what actually exists to avoid conflicts
16
17// Error handling
18pub use error::AuthError;
19
20// Core authentication traits
21pub use traits::{AuthProvider, Authenticatable, UserContext};
22
23// Configuration (only existing types)
24pub use config::{
25 AuthConfig, AuthRateLimitConfig, JwtConfig, MfaConfig, PasswordConfig, SessionConfig,
26};
27
28// Providers (minimal specific exports)
29pub use providers::jwt::JwtProvider;
30pub use providers::session::SessionProvider;
31
32// RBAC system (only existing types)
33pub use rbac::{Permission, Role, UserRole};
34
35// Note: utils module contains implementation details, not exported
36/// Authentication result type alias
37pub type AuthResult<T> = Result<T, AuthError>;
38
39/// Authentication system version
40pub const VERSION: &str = env!("CARGO_PKG_VERSION");