auth_framework/storage/mod.rs
1//! Storage backends for the authentication framework.
2//!
3//! This module provides the [`AuthStorage`] trait and multiple backend
4//! implementations:
5//!
6//! | Backend | Feature flag | Module |
7//! |---------|-------------|--------|
8//! | In-memory (HashMap) | *(always available)* | [`memory`] |
9//! | In-memory (DashMap) | *(always available)* | [`dashmap_memory`] |
10//! | Redis | `redis-storage` | [`redis`] |
11//! | PostgreSQL | `postgres-storage` | [`postgres`] |
12//! | MySQL | `mysql-storage` | [`mysql`] |
13//! | SQLite | `sqlite-storage` | [`sqlite`] |
14//! | AES-256-GCM encrypted wrapper | *(always available)* | [`encryption`] |
15//!
16//! All backends implement [`AuthStorage`], so they can be used
17//! interchangeably via `dyn AuthStorage` or generics.
18
19pub mod core;
20pub mod dashmap_memory; // DashMap-based storage proof-of-concept
21pub mod encryption; // AES-256-GCM encryption for storage at rest
22pub(crate) mod factory;
23pub mod memory;
24#[cfg(feature = "mysql-storage")]
25pub mod mysql;
26#[cfg(feature = "postgres-storage")]
27pub mod postgres;
28#[cfg(feature = "redis")]
29pub mod redis;
30#[cfg(feature = "sqlite-storage")]
31pub mod sqlite;
32
33// Performance optimized unified storage
34#[cfg(feature = "performance-optimization")]
35pub mod unified;
36
37// Re-export the main storage traits and types
38pub use core::*;
39pub use encryption::{EncryptedStorage, StorageEncryption};
40
41// Re-export unified storage when feature is enabled
42#[cfg(feature = "performance-optimization")]
43pub use unified::{StorageStats, UnifiedStorage, UnifiedStorageConfig};
44
45// Convenience re-export for common trait
46pub use crate::storage::core::AuthStorage;