2022-04-02 22:32:57 +00:00
|
|
|
package schema
|
|
|
|
|
|
|
|
// PasswordPolicyStandardParams represents the configuration related to standard parameters of password policy.
|
|
|
|
type PasswordPolicyStandardParams struct {
|
2022-04-03 11:58:27 +00:00
|
|
|
Enabled bool `koanf:"enabled"`
|
2022-04-02 22:32:57 +00:00
|
|
|
MinLength int `koanf:"min_length"`
|
|
|
|
MaxLength int `koanf:"max_length"`
|
|
|
|
RequireUppercase bool `koanf:"require_uppercase"`
|
|
|
|
RequireLowercase bool `koanf:"require_lowercase"`
|
|
|
|
RequireNumber bool `koanf:"require_number"`
|
|
|
|
RequireSpecial bool `koanf:"require_special"`
|
|
|
|
}
|
|
|
|
|
2022-04-08 23:21:49 +00:00
|
|
|
// PasswordPolicyZXCVBNParams represents the configuration related to ZXCVBN parameters of password policy.
|
|
|
|
type PasswordPolicyZXCVBNParams struct {
|
2022-04-15 09:30:51 +00:00
|
|
|
Enabled bool `koanf:"enabled"`
|
|
|
|
MinScore int `koanf:"min_score"`
|
2022-04-02 22:32:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// PasswordPolicyConfiguration represents the configuration related to password policy.
|
|
|
|
type PasswordPolicyConfiguration struct {
|
|
|
|
Standard PasswordPolicyStandardParams `koanf:"standard"`
|
2022-04-08 23:21:49 +00:00
|
|
|
ZXCVBN PasswordPolicyZXCVBNParams `koanf:"zxcvbn"`
|
2022-04-02 22:32:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// DefaultPasswordPolicyConfiguration is the default password policy configuration.
|
|
|
|
var DefaultPasswordPolicyConfiguration = PasswordPolicyConfiguration{
|
|
|
|
Standard: PasswordPolicyStandardParams{
|
2022-04-03 11:58:27 +00:00
|
|
|
Enabled: false,
|
|
|
|
MinLength: 8,
|
|
|
|
MaxLength: 0,
|
2022-04-02 22:32:57 +00:00
|
|
|
},
|
2022-04-08 23:21:49 +00:00
|
|
|
ZXCVBN: PasswordPolicyZXCVBNParams{
|
2022-04-15 09:30:51 +00:00
|
|
|
Enabled: false,
|
|
|
|
MinScore: 3,
|
2022-04-02 22:32:57 +00:00
|
|
|
},
|
|
|
|
}
|