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"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// PasswordPolicyZxcvbnParams represents the configuration related to zxcvbn parameters of password policy.
|
|
|
|
type PasswordPolicyZxcvbnParams struct {
|
2022-04-03 11:58:27 +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"`
|
|
|
|
Zxcvbn PasswordPolicyZxcvbnParams `koanf:"zxcvbn"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
|
|
},
|
|
|
|
Zxcvbn: PasswordPolicyZxcvbnParams{
|
2022-04-03 11:58:27 +00:00
|
|
|
Enabled: false,
|
|
|
|
MinScore: 0,
|
2022-04-02 22:32:57 +00:00
|
|
|
},
|
|
|
|
}
|