@@ -158,6 +158,7 @@ const (
|
||||
LdapSettingsDefaultGroupDisplayNameAttribute = ""
|
||||
LdapSettingsDefaultGroupIdAttribute = ""
|
||||
LdapSettingsDefaultPictureAttribute = ""
|
||||
LdapSettingsDefaultMaximumLoginAttempts = 10
|
||||
|
||||
SamlSettingsDefaultIdAttribute = ""
|
||||
SamlSettingsDefaultGuestAttribute = ""
|
||||
@@ -2415,14 +2416,15 @@ type ClientRequirements struct {
|
||||
|
||||
type LdapSettings struct {
|
||||
// Basic
|
||||
Enable *bool `access:"authentication_ldap"`
|
||||
EnableSync *bool `access:"authentication_ldap"`
|
||||
LdapServer *string `access:"authentication_ldap"` // telemetry: none
|
||||
LdapPort *int `access:"authentication_ldap"` // telemetry: none
|
||||
ConnectionSecurity *string `access:"authentication_ldap"`
|
||||
BaseDN *string `access:"authentication_ldap"` // telemetry: none
|
||||
BindUsername *string `access:"authentication_ldap"` // telemetry: none
|
||||
BindPassword *string `access:"authentication_ldap"` // telemetry: none
|
||||
Enable *bool `access:"authentication_ldap"`
|
||||
EnableSync *bool `access:"authentication_ldap"`
|
||||
LdapServer *string `access:"authentication_ldap"` // telemetry: none
|
||||
LdapPort *int `access:"authentication_ldap"` // telemetry: none
|
||||
ConnectionSecurity *string `access:"authentication_ldap"`
|
||||
BaseDN *string `access:"authentication_ldap"` // telemetry: none
|
||||
BindUsername *string `access:"authentication_ldap"` // telemetry: none
|
||||
BindPassword *string `access:"authentication_ldap"` // telemetry: none
|
||||
MaximumLoginAttempts *int `access:"authentication_ldap"` // telemetry: none
|
||||
|
||||
// Filtering
|
||||
UserFilter *string `access:"authentication_ldap"` // telemetry: none
|
||||
@@ -2510,6 +2512,10 @@ func (s *LdapSettings) SetDefaults() {
|
||||
s.BindPassword = NewPointer("")
|
||||
}
|
||||
|
||||
if s.MaximumLoginAttempts == nil {
|
||||
s.MaximumLoginAttempts = NewPointer(LdapSettingsDefaultMaximumLoginAttempts)
|
||||
}
|
||||
|
||||
if s.UserFilter == nil {
|
||||
s.UserFilter = NewPointer("")
|
||||
}
|
||||
@@ -4100,6 +4106,10 @@ func (s *LdapSettings) isValid() *AppError {
|
||||
return NewAppError("Config.IsValid", "model.config.is_valid.ldap_server", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
if *s.MaximumLoginAttempts <= 0 {
|
||||
return NewAppError("Config.IsValid", "model.config.is_valid.ldap_max_login_attempts.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
if *s.BaseDN == "" {
|
||||
return NewAppError("Config.IsValid", "model.config.is_valid.ldap_basedn", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user