Skip to main content

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//! | SQLite | `sqlite-storage` | [`sqlite`] |
13//! | AES-256-GCM encrypted wrapper | *(always available)* | [`encryption`] |
14//!
15//! All backends implement [`AuthStorage`], so they can be used
16//! interchangeably via `dyn AuthStorage` or generics.
17
18pub mod core;
19pub mod dashmap_memory; // DashMap-based storage proof-of-concept
20pub mod encryption; // AES-256-GCM encryption for storage at rest
21pub(crate) mod factory;
22pub(crate) mod key_names; // one-way key names for credentials
23pub mod memory;
24#[cfg(feature = "postgres-storage")]
25pub mod postgres;
26#[cfg(feature = "redis")]
27pub mod redis;
28#[cfg(feature = "sqlite-storage")]
29pub mod sqlite;
30
31// Performance optimized unified storage
32#[cfg(feature = "performance-optimization")]
33pub mod unified;
34
35// Re-export the main storage traits and types
36pub use core::*;
37pub use encryption::{EncryptedStorage, StorageEncryption};
38
39// Re-export unified storage when feature is enabled
40#[cfg(feature = "performance-optimization")]
41pub use unified::{StorageStats, UnifiedStorage, UnifiedStorageConfig};
42
43// Convenience re-export for common trait
44pub use crate::storage::core::AuthStorage;