2022-04-02 22:32:57 +00:00
package schema
2023-01-26 02:23:47 +00:00
// PasswordPolicy represents the configuration related to password policy.
type PasswordPolicy struct {
Standard PasswordPolicyStandard ` koanf:"standard" json:"standard" jsonschema:"title=Standard" jsonschema_description:"The standard password policy engine" `
ZXCVBN PasswordPolicyZXCVBN ` koanf:"zxcvbn" json:"zxcvbn" jsonschema:"title=ZXCVBN" jsonschema_description:"The ZXCVBN password policy engine" `
2022-04-02 22:32:57 +00:00
}
2023-01-26 02:23:47 +00:00
// PasswordPolicyStandard represents the configuration related to standard parameters of password policy.
type PasswordPolicyStandard struct {
Enabled bool ` koanf:"enabled" json:"enabled" jsonschema:"default=false,title=Enabled" jsonschema_description:"Enables the standard password policy engine" `
MinLength int ` koanf:"min_length" json:"min_length" jsonschema:"title=Minimum Length" jsonschema_description:"Minimum password length" `
MaxLength int ` koanf:"max_length" json:"max_length" jsonschema:"default=8,title=Maximum Length" jsonschema_description:"Maximum password length" `
RequireUppercase bool ` koanf:"require_uppercase" json:"require_uppercase" jsonschema:"default=false,title=Require Uppercase" jsonschema_description:"Require uppercase characters" `
RequireLowercase bool ` koanf:"require_lowercase" json:"require_lowercase" jsonschema:"default=false,title=Require Lowercase" jsonschema_description:"Require lowercase characters" `
RequireNumber bool ` koanf:"require_number" json:"require_number" jsonschema:"default=false,title=Require Number" jsonschema_description:"Require numeric characters" `
RequireSpecial bool ` koanf:"require_special" json:"require_special" jsonschema:"default=false,title=Require Special" jsonschema_description:"Require symbolic characters" `
2022-04-02 22:32:57 +00:00
}
2023-01-26 02:23:47 +00:00
// PasswordPolicyZXCVBN represents the configuration related to ZXCVBN parameters of password policy.
type PasswordPolicyZXCVBN struct {
Enabled bool ` koanf:"enabled" json:"enabled" jsonschema:"default=false,title=Enabled" jsonschema_description:"Enables the ZXCVBN password policy engine" `
MinScore int ` koanf:"min_score" json:"min_score" jsonschema:"default=3,title=Minimum Score" jsonschema_description:"The minimum ZXCVBN score allowed" `
2022-04-02 22:32:57 +00:00
}
// DefaultPasswordPolicyConfiguration is the default password policy configuration.
2023-01-26 02:23:47 +00:00
var DefaultPasswordPolicyConfiguration = PasswordPolicy {
Standard : PasswordPolicyStandard {
2022-04-03 11:58:27 +00:00
MinLength : 8 ,
MaxLength : 0 ,
2022-04-02 22:32:57 +00:00
} ,
2023-01-26 02:23:47 +00:00
ZXCVBN : PasswordPolicyZXCVBN {
2022-04-15 09:30:51 +00:00
MinScore : 3 ,
2022-04-02 22:32:57 +00:00
} ,
}