feat: Lockout policy feature (#2341)

* feat: add lockoutpolicy feature

* feat: add tests

* fix: err handling
This commit is contained in:
Fabi
2021-09-09 15:42:28 +02:00
committed by GitHub
parent 257bf90f7e
commit 59e393728e
20 changed files with 165 additions and 8 deletions

View File

@@ -32,6 +32,7 @@ type FeaturesView struct {
MetadataUser bool
CustomTextMessage bool
CustomTextLogin bool
LockoutPolicy bool
}
func (f *FeaturesView) FeatureList() []string {
@@ -78,6 +79,9 @@ func (f *FeaturesView) FeatureList() []string {
if f.CustomTextLogin {
list = append(list, domain.FeatureCustomTextLogin)
}
if f.LockoutPolicy {
list = append(list, domain.FeatureLockoutPolicy)
}
return list
}

View File

@@ -46,6 +46,7 @@ type FeaturesView struct {
MetadataUser bool `json:"metadataUser" gorm:"column:metadata_user"`
CustomTextMessage bool `json:"customTextMessage" gorm:"column:custom_text_message"`
CustomTextLogin bool `json:"customTextLogin" gorm:"column:custom_text_login"`
LockoutPolicy bool `json:"lockoutPolicy" gorm:"column:lockout_policy"`
}
func FeaturesToModel(features *FeaturesView) *features_model.FeaturesView {
@@ -74,6 +75,7 @@ func FeaturesToModel(features *FeaturesView) *features_model.FeaturesView {
MetadataUser: features.MetadataUser,
CustomTextMessage: features.CustomTextMessage,
CustomTextLogin: features.CustomTextLogin,
LockoutPolicy: features.LockoutPolicy,
}
}