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
//! MySQL user/role option specifications
//!
//! This module provides type-safe representations of MySQL user and role options
//! used in CREATE ROLE, ALTER ROLE, CREATE USER, and ALTER USER statements.
//!
//! # Examples
//!
//! ```
//! use reinhardt_query::dcl::UserOption;
//!
//! // Set user password
//! let pass_opt = UserOption::Password("secret".to_string());
//!
//! // Lock user account
//! let lock_opt = UserOption::AccountLock;
//!
//! // Set password expiration
//! let expire_opt = UserOption::PasswordExpireInterval(90);
//! ```
/// MySQL user/role option specifications
///
/// These options control authentication, account locking, password policies,
/// and metadata for MySQL users and roles.
///
/// # Authentication Options
///
/// - `` `Password` `` - Set user password (IDENTIFIED BY)
/// - `` `AuthPlugin` `` - Use authentication plugin (IDENTIFIED WITH)
///
/// # Account Locking Options
///
/// - `` `AccountLock` `` - Lock the account (prevent login)
/// - `` `AccountUnlock` `` - Unlock the account
///
/// # Password Expiration Options
///
/// - `` `PasswordExpire` `` - Expire password immediately
/// - `` `PasswordExpireDefault` `` - Use default expiration policy
/// - `` `PasswordExpireNever` `` - Password never expires
/// - `` `PasswordExpireInterval` `` - Expire after N days
///
/// # Password History Options
///
/// - `` `PasswordHistory` `` - Prevent reuse of last N passwords
/// - `` `PasswordHistoryDefault` `` - Use default history policy
///
/// # Password Reuse Options
///
/// - `` `PasswordReuseInterval` `` - Allow reuse after N days
/// - `` `PasswordReuseIntervalDefault` `` - Use default reuse policy
///
/// # Password Requirement Options
///
/// - `` `PasswordRequireCurrent` `` - Require current password to change
/// - `` `PasswordRequireCurrentOptional` `` - Current password optional
/// - `` `PasswordRequireCurrentDefault` `` - Use default requirement policy
///
/// # Failed Login Handling Options
///
/// - `` `FailedLoginAttempts` `` - Lock after N failed attempts
/// - `` `PasswordLockTime` `` - Lock for N days after failed attempts
/// - `` `PasswordLockTimeUnbounded` `` - Lock indefinitely
///
/// # Metadata Options
///
/// - `` `Comment` `` - User comment/description
/// - `` `Attribute` `` - User attribute (JSON format)