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
71
72
73
74
75
76
77
78
79
80
//! Repository implementations for account and secret storage.
//!
//! This module provides repository abstractions and implementations for storing
//! user accounts and authentication secrets across different storage backends.
//!
//! # Available Backends
//!
//! - [`memory`] - In-memory storage (development, testing)
//! - `surrealdb` - SurrealDB backend (feature: `storage-surrealdb`)
//! - `sea_orm` - SeaORM backend (feature: `storage-seaorm`)
//!
//! # Usage
//!
//! ## In-Memory (Development)
//! ```rust
//! use axum_gate::repositories::memory::{MemoryAccountRepository, MemorySecretRepository};
//! use axum_gate::prelude::{Role, Group};
//! use std::sync::Arc;
//!
//! let account_repo = Arc::new(MemoryAccountRepository::<Role, Group>::default());
//! let secret_repo = Arc::new(MemorySecretRepository::new_with_argon2_hasher().unwrap());
//! ```
//!
//! ## SurrealDB (Production)
//! ```rust
//! # #[cfg(feature = "storage-surrealdb")]
//! # {
//! use axum_gate::repositories::surrealdb::{SurrealDbRepository, DatabaseScope};
//! use std::sync::Arc;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! # let db = surrealdb::Surreal::new::<surrealdb::engine::local::Mem>(()).await?;
//! let scope = DatabaseScope::default();
//! let repo = Arc::new(SurrealDbRepository::new(db, scope));
//! # Ok(())
//! # }
//! # }
//! ```
//!
//! ## SeaORM (SQL Databases)
//! ```rust
//! # #[cfg(feature = "storage-seaorm")]
//! # {
//! use axum_gate::repositories::sea_orm::SeaOrmRepository;
//! use std::sync::Arc;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! # let db = sea_orm::Database::connect("sqlite::memory:").await?;
//! let repo = Arc::new(SeaOrmRepository::new(&db));
//! # Ok(())
//! # }
//! # }
//! ```
pub use ;
/// Table names used by the storage backends.