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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//! Authentication integration test fixtures
//!
//! This module provides rstest fixtures for authentication integration tests,
//! including pre-configured session backends, mock users, and test data.
use *;
// Re-exports for convenience
pub use MFAAuthentication as MfaManager;
pub use ;
// =============================================================================
// MFA Fixtures
// =============================================================================
/// MFA authentication fixture
///
/// Provides a pre-configured MFA authentication backend for testing.
///
/// # Examples
///
/// ```rust,no_run
/// use reinhardt_test::fixtures::auth::mfa_authentication;
/// use rstest::*;
///
/// #[rstest]
/// fn test_with_mfa(mfa_authentication: MfaManager) {
/// mfa_authentication.register_user("alice", "JBSWY3DPEHPK3PXP");
/// }
/// ```
// =============================================================================
// JWT Fixtures
// =============================================================================
/// JWT authentication fixture with default secret
///
/// Provides a pre-configured JWT authentication backend for testing.
///
/// # Examples
///
/// ```rust,no_run
/// use reinhardt_test::fixtures::auth::jwt_auth;
/// use rstest::*;
///
/// #[rstest]
/// fn test_with_jwt(jwt_auth: JwtAuth) {
/// let token = jwt_auth.generate_token("user123".to_string(), "alice".to_string(), false, false).unwrap();
/// assert!(!token.is_empty());
/// }
/// ```
/// JWT authentication fixture with custom secret
///
/// Provides a JWT authentication backend with a specified secret.
// =============================================================================
// Password Hasher Fixtures
// =============================================================================
/// Argon2 password hasher fixture
///
/// Provides a pre-configured Argon2 password hasher for testing.
///
/// # Examples
///
/// ```rust,no_run
/// use reinhardt_test::fixtures::auth::argon2_hasher;
/// use rstest::*;
///
/// #[rstest]
/// fn test_with_hasher(argon2_hasher: Argon2Hasher) {
/// let hash = argon2_hasher.hash("password123").unwrap();
/// assert!(argon2_hasher.verify("password123", &hash).unwrap());
/// }
/// ```
// =============================================================================
// Token Storage Fixtures
// =============================================================================
/// In-memory token storage fixture
///
/// Provides a pre-configured in-memory token storage for testing.
///
/// # Examples
///
/// ```rust,no_run
/// use reinhardt_test::fixtures::auth::in_memory_token_storage;
/// use rstest::*;
///
/// #[rstest]
/// #[tokio::test]
/// async fn test_with_storage(in_memory_token_storage: InMemoryTokenStorage) {
/// assert!(in_memory_token_storage.is_empty());
/// }
/// ```
/// Token storage with test data fixture
///
/// Provides an in-memory token storage pre-populated with test tokens.