1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! # Authen Authentication Crate
//!
//! `authen` is a robust and secure authentication library for Rust, designed to provide all the essential building blocks for modern authentication systems.
//!
//! ## Features
//! - **User Management**: Create, update, and manage user accounts with flexible persistence options.
//! - **Password Hashing**: Secure password storage using industry-standard algorithms (e.g., Argon2).
//! - **Token Management**: JWT-based access and refresh token generation, validation, and rotation.
//! - **Session Handling**: Tools for managing user sessions securely.
//! - **Policy Enforcement**: Password and authentication policy enforcement.
//! - **Pluggable Backends**: Support for in-memory and PostgreSQL backends (enable with `postgres` feature).
//! - **Web Integration**: Axum-based web server integration (enable with `web` feature).
//!
//! ## Optional Features
//! - `postgres`: Enables PostgreSQL-backed persistence.
//! - `web`: Enables Axum web server integration for HTTP APIs.
//!
//! ## Example
//! ```rust
//! use authen::{AuthService, AuthenUser};
//! // ...
//! ```
//!
//! ## Modules
//! - [`auth_service`]: High-level authentication service API.
//! - [`core`]: Core primitives (users, credentials, hashing, tokens, etc.).
//! - [`error`]: Error types for authentication operations.
//! - [`postgres`]: PostgreSQL backend (requires `postgres` feature).
//! - [`web_axum`]: Axum web integration (requires `web` feature).
//!
//! ## Re-exports
//! - [`AuthService`]: Main authentication service.
//! - [`AuthenUser`]: User type.
//! - [`AuthError`]: Error type.
//! - [`get_authen_axum_router`], [`start_server`]: Web server utilities (with `web` feature).
//!
//! ## License
//! See [LICENCE](../LICENCE) for details.
//!
//! ---
//!
//! _For more details, see the individual module documentation._
/// High-level authentication service API.
/// Core primitives: users, credentials, hashing, tokens, etc.
/// Error types for authentication operations.
/// PostgreSQL backend (requires `postgres` feature).
/// Axum web integration (requires `axum` feature).
/// Main authentication service.
pub use AuthService;
/// Authentication method enums for unified login and signup.
pub use ;
/// User type.
pub use User as AuthenUser;
/// Error type for authentication operations.
pub use AuthError;
/// Returns an Axum router with authentication endpoints (with `axum` feature).
pub use get_authen_axum_router;
/// Starts the Axum web server (with `axum` feature).
pub use start_server;