2022-04-03 05:32:57 +07:00
|
|
|
package schema
|
|
|
|
|
|
|
|
// PasswordPolicyStandardParams represents the configuration related to standard parameters of password policy.
|
|
|
|
type PasswordPolicyStandardParams struct {
|
2022-04-03 18:58:27 +07:00
|
|
|
Enabled bool `koanf:"enabled"`
|
2022-04-03 05:32:57 +07: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-09 06:21:49 +07:00
|
|
|
// PasswordPolicyZXCVBNParams represents the configuration related to ZXCVBN parameters of password policy.
|
|
|
|
type PasswordPolicyZXCVBNParams struct {
|
2022-04-15 16:30:51 +07:00
|
|
|
Enabled bool `koanf:"enabled"`
|
|
|
|
MinScore int `koanf:"min_score"`
|
2022-04-03 05:32:57 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
// PasswordPolicyConfiguration represents the configuration related to password policy.
|
|
|
|
type PasswordPolicyConfiguration struct {
|
|
|
|
Standard PasswordPolicyStandardParams `koanf:"standard"`
|
2022-04-09 06:21:49 +07:00
|
|
|
ZXCVBN PasswordPolicyZXCVBNParams `koanf:"zxcvbn"`
|
2022-04-03 05:32:57 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
// DefaultPasswordPolicyConfiguration is the default password policy configuration.
|
|
|
|
var DefaultPasswordPolicyConfiguration = PasswordPolicyConfiguration{
|
|
|
|
Standard: PasswordPolicyStandardParams{
|
2022-04-03 18:58:27 +07:00
|
|
|
Enabled: false,
|
|
|
|
MinLength: 8,
|
|
|
|
MaxLength: 0,
|
2022-04-03 05:32:57 +07:00
|
|
|
},
|
2022-04-09 06:21:49 +07:00
|
|
|
ZXCVBN: PasswordPolicyZXCVBNParams{
|
2022-04-15 16:30:51 +07:00
|
|
|
Enabled: false,
|
|
|
|
MinScore: 3,
|
2022-04-03 05:32:57 +07:00
|
|
|
},
|
|
|
|
}
|