MM-28882:ignore guest ldap sync (#15936)

* add ignoreGuestsLdapSync to config, update interface

* update interface

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
Scott Bishel
2020-10-21 20:12:12 -06:00
committed by GitHub
parent efc3304fe1
commit f46661d7a9
3 changed files with 7 additions and 1 deletions

View File

@@ -20,7 +20,7 @@ type LdapInterface interface {
MigrateIDAttribute(toAttribute string) error
GetGroup(groupUID string) (*model.Group, *model.AppError)
GetAllGroupsPage(page int, perPage int, opts model.LdapGroupSearchOpts) ([]*model.Group, int, *model.AppError)
FirstLoginSync(userID, userAuthService, userAuthData, email string) *model.AppError
FirstLoginSync(user *model.User, userAuthService, userAuthData, email string) *model.AppError
UpdateProfilePictureIfNecessary(model.User, *model.Session)
GetADLdapIdFromSAMLId(authData string) string
}

View File

@@ -2194,6 +2194,7 @@ type SamlSettings struct {
Enable *bool `access:"authentication"`
EnableSyncWithLdap *bool `access:"authentication"`
EnableSyncWithLdapIncludeAuth *bool `access:"authentication"`
IgnoreGuestsLdapSync *bool `access:"authentication"`
Verify *bool `access:"authentication"`
Encrypt *bool `access:"authentication"`
@@ -2248,6 +2249,10 @@ func (s *SamlSettings) SetDefaults() {
s.EnableSyncWithLdapIncludeAuth = NewBool(false)
}
if s.IgnoreGuestsLdapSync == nil {
s.IgnoreGuestsLdapSync = NewBool(false)
}
if s.EnableAdminAttribute == nil {
s.EnableAdminAttribute = NewBool(false)
}

View File

@@ -649,6 +649,7 @@ func (ts *TelemetryService) trackConfig() {
"enable": *cfg.SamlSettings.Enable,
"enable_sync_with_ldap": *cfg.SamlSettings.EnableSyncWithLdap,
"enable_sync_with_ldap_include_auth": *cfg.SamlSettings.EnableSyncWithLdapIncludeAuth,
"ignore_guests_ldap_sync": *cfg.SamlSettings.IgnoreGuestsLdapSync,
"enable_admin_attribute": *cfg.SamlSettings.EnableAdminAttribute,
"verify": *cfg.SamlSettings.Verify,
"encrypt": *cfg.SamlSettings.Encrypt,