Skip to content

Commit

Permalink
rename the config type
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar committed Sep 15, 2023
1 parent 83ad5b3 commit 189b717
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions services/frontend/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type Config struct {
AutoAcceptShares bool `yaml:"auto_accept_shares" env:"FRONTEND_AUTO_ACCEPT_SHARES" desc:"Defines if shares should be auto accepted by default. Users can change this setting individually in their profile."`
ServiceAccount ServiceAccount `yaml:"service_account"`

PasswordPolicies PasswordPolicies `yaml:"password_policies"`
PasswordPolicy PasswordPolicy `yaml:"password_policy"`

Supervised bool `yaml:"-"`
Context context.Context `yaml:"-"`
Expand Down Expand Up @@ -174,8 +174,8 @@ type ServiceAccount struct {
ServiceAccountSecret string `yaml:"service_account_secret" env:"OCIS_SERVICE_ACCOUNT_SECRET;FRONTEND_SERVICE_ACCOUNT_SECRET" desc:"The service account secret."`
}

// PasswordPolicies configures reva password policies
type PasswordPolicies struct {
// PasswordPolicy configures reva password policy
type PasswordPolicy struct {
MinCharacters int `yaml:"min_characters,omitempty" env:"FRONTEND_PASSWORD_POLICIES_MIN_CHARACTERS" desc:"Define the minimum password length. Defaults to 0 if not set."`
MinLowerCaseCharacters int `yaml:"min_lowercase_characters" env:"FRONTEND_PASSWORD_POLICIES_MIN_LOWERCASE_CHARACTERS" desc:"Define the minimum number of uppercase letters. Defaults to 0 if not set."`
MinUpperCaseCharacters int `yaml:"min_uppercase_characters" env:"FRONTEND_PASSWORD_POLICIES_MIN_UPPERCASE_CHARACTERS" desc:"Define the minimum number of lowercase letters. Defaults to 0 if not set."`
Expand Down
10 changes: 5 additions & 5 deletions services/frontend/pkg/revaconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,11 @@ func FrontendConfigFromStruct(cfg *config.Config) (map[string]interface{}, error
},
"password_policy": map[string]interface{}{
"max_characters": 72,
"min_characters": cfg.PasswordPolicies.MinCharacters,
"min_lowercase_characters": cfg.PasswordPolicies.MinLowerCaseCharacters,
"min_uppercase_characters": cfg.PasswordPolicies.MinUpperCaseCharacters,
"min_digits": cfg.PasswordPolicies.MinDigits,
"min_special_characters": cfg.PasswordPolicies.MinSpecialCharacters,
"min_characters": cfg.PasswordPolicy.MinCharacters,
"min_lowercase_characters": cfg.PasswordPolicy.MinLowerCaseCharacters,
"min_uppercase_characters": cfg.PasswordPolicy.MinUpperCaseCharacters,
"min_digits": cfg.PasswordPolicy.MinDigits,
"min_special_characters": cfg.PasswordPolicy.MinSpecialCharacters,
},
"notifications": map[string]interface{}{
"endpoints": []string{"list", "get", "delete"},
Expand Down

0 comments on commit 189b717

Please sign in to comment.