diff --git a/pkg/api/admin_ldap.go b/pkg/api/admin_ldap.go index 6e1b40bfa3e..8aca63c5394 100644 --- a/pkg/api/admin_ldap.go +++ b/pkg/api/admin_ldap.go @@ -4,7 +4,7 @@ import ( "github.com/grafana/grafana/pkg/services/ldap" ) -func (server *HTTPServer) ReloadLdapCfg() Response { +func (server *HTTPServer) ReloadLDAPCfg() Response { if !ldap.IsEnabled() { return Error(400, "LDAP is not enabled", nil) } @@ -13,5 +13,5 @@ func (server *HTTPServer) ReloadLdapCfg() Response { if err != nil { return Error(500, "Failed to reload ldap config.", err) } - return Success("Ldap config reloaded") + return Success("LDAP config reloaded") } diff --git a/pkg/api/api.go b/pkg/api/api.go index 2facbf9351c..70f6263686a 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -395,7 +395,7 @@ func (hs *HTTPServer) registerRoutes() { adminRoute.Post("/provisioning/dashboards/reload", Wrap(hs.AdminProvisioningReloadDasboards)) adminRoute.Post("/provisioning/datasources/reload", Wrap(hs.AdminProvisioningReloadDatasources)) adminRoute.Post("/provisioning/notifications/reload", Wrap(hs.AdminProvisioningReloadNotifications)) - adminRoute.Post("/ldap/reload", Wrap(hs.ReloadLdapCfg)) + adminRoute.Post("/ldap/reload", Wrap(hs.ReloadLDAPCfg)) }, reqGrafanaAdmin) // rendering diff --git a/pkg/api/frontendsettings.go b/pkg/api/frontendsettings.go index e881fc1539d..643a53d18fb 100644 --- a/pkg/api/frontendsettings.go +++ b/pkg/api/frontendsettings.go @@ -176,7 +176,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf "appSubUrl": setting.AppSubUrl, "allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin, "authProxyEnabled": setting.AuthProxyEnabled, - "ldapEnabled": setting.LdapEnabled, + "ldapEnabled": setting.LDAPEnabled, "alertingEnabled": setting.AlertingEnabled, "alertingErrorOrTimeout": setting.AlertingErrorOrTimeout, "alertingNoDataOrNullValues": setting.AlertingNoDataOrNullValues, diff --git a/pkg/api/password.go b/pkg/api/password.go index 4776c6a3064..278408ee9af 100644 --- a/pkg/api/password.go +++ b/pkg/api/password.go @@ -9,7 +9,7 @@ import ( ) func SendResetPasswordEmail(c *m.ReqContext, form dtos.SendResetPasswordEmailForm) Response { - if setting.LdapEnabled || setting.AuthProxyEnabled { + if setting.LDAPEnabled || setting.AuthProxyEnabled { return Error(401, "Not allowed to reset password when LDAP or Auth Proxy is enabled", nil) } if setting.DisableLoginForm { diff --git a/pkg/api/team_members.go b/pkg/api/team_members.go index 54a4d8220e5..bc622f8662a 100644 --- a/pkg/api/team_members.go +++ b/pkg/api/team_members.go @@ -21,7 +21,7 @@ func GetTeamMembers(c *m.ReqContext) Response { member.AvatarUrl = dtos.GetGravatarUrl(member.Email) member.Labels = []string{} - if setting.IsEnterprise && setting.LdapEnabled && member.External { + if setting.IsEnterprise && setting.LDAPEnabled && member.External { member.Labels = append(member.Labels, "LDAP") } } diff --git a/pkg/api/user.go b/pkg/api/user.go index 9eb7e75eab0..cde5b7b92fd 100644 --- a/pkg/api/user.go +++ b/pkg/api/user.go @@ -202,7 +202,7 @@ func (hs *HTTPServer) ChangeActiveOrgAndRedirectToHome(c *m.ReqContext) { } func ChangeUserPassword(c *m.ReqContext, cmd m.ChangeUserPasswordCommand) Response { - if setting.LdapEnabled || setting.AuthProxyEnabled { + if setting.LDAPEnabled || setting.AuthProxyEnabled { return Error(400, "Not allowed to change password when LDAP or Auth Proxy is enabled", nil) } diff --git a/pkg/infra/usagestats/usage_stats.go b/pkg/infra/usagestats/usage_stats.go index 8b20391cbb4..e5b9e8fd8cb 100644 --- a/pkg/infra/usagestats/usage_stats.go +++ b/pkg/infra/usagestats/usage_stats.go @@ -132,7 +132,7 @@ func (uss *UsageStatsService) sendUsageStats(oauthProviders map[string]bool) { authTypes := map[string]bool{} authTypes["anonymous"] = setting.AnonymousEnabled authTypes["basic_auth"] = setting.BasicAuthEnabled - authTypes["ldap"] = setting.LdapEnabled + authTypes["ldap"] = setting.LDAPEnabled authTypes["auth_proxy"] = setting.AuthProxyEnabled for provider, enabled := range oauthProviders { diff --git a/pkg/infra/usagestats/usage_stats_test.go b/pkg/infra/usagestats/usage_stats_test.go index ea5b95d6ef0..07f2df22192 100644 --- a/pkg/infra/usagestats/usage_stats_test.go +++ b/pkg/infra/usagestats/usage_stats_test.go @@ -182,7 +182,7 @@ func TestMetrics(t *testing.T) { setting.BuildVersion = "5.0.0" setting.AnonymousEnabled = true setting.BasicAuthEnabled = true - setting.LdapEnabled = true + setting.LDAPEnabled = true setting.AuthProxyEnabled = true setting.Packaging = "deb" diff --git a/pkg/login/auth.go b/pkg/login/auth.go index 6d822c3244d..ca5b572deb8 100644 --- a/pkg/login/auth.go +++ b/pkg/login/auth.go @@ -41,7 +41,7 @@ func AuthenticateUser(query *models.LoginUserQuery) error { return err } - ldapEnabled, ldapErr := loginUsingLdap(query) + ldapEnabled, ldapErr := loginUsingLDAP(query) if ldapEnabled { if ldapErr == nil || ldapErr != ldap.ErrInvalidCredentials { return ldapErr diff --git a/pkg/login/auth_test.go b/pkg/login/auth_test.go index 76e33ef4706..06a78cc6d5d 100644 --- a/pkg/login/auth_test.go +++ b/pkg/login/auth_test.go @@ -15,7 +15,7 @@ func TestAuthenticateUser(t *testing.T) { authScenario("When a user authenticates without setting a password", func(sc *authScenarioContext) { mockLoginAttemptValidation(nil, sc) mockLoginUsingGrafanaDB(nil, sc) - mockLoginUsingLdap(false, nil, sc) + mockLoginUsingLDAP(false, nil, sc) loginQuery := models.LoginUserQuery{ Username: "user", @@ -33,7 +33,7 @@ func TestAuthenticateUser(t *testing.T) { authScenario("When a user authenticates having too many login attempts", func(sc *authScenarioContext) { mockLoginAttemptValidation(ErrTooManyLoginAttempts, sc) mockLoginUsingGrafanaDB(nil, sc) - mockLoginUsingLdap(true, nil, sc) + mockLoginUsingLDAP(true, nil, sc) mockSaveInvalidLoginAttempt(sc) err := AuthenticateUser(sc.loginUserQuery) @@ -50,7 +50,7 @@ func TestAuthenticateUser(t *testing.T) { authScenario("When grafana user authenticate with valid credentials", func(sc *authScenarioContext) { mockLoginAttemptValidation(nil, sc) mockLoginUsingGrafanaDB(nil, sc) - mockLoginUsingLdap(true, ErrInvalidCredentials, sc) + mockLoginUsingLDAP(true, ErrInvalidCredentials, sc) mockSaveInvalidLoginAttempt(sc) err := AuthenticateUser(sc.loginUserQuery) @@ -68,7 +68,7 @@ func TestAuthenticateUser(t *testing.T) { customErr := errors.New("custom") mockLoginAttemptValidation(nil, sc) mockLoginUsingGrafanaDB(customErr, sc) - mockLoginUsingLdap(true, ErrInvalidCredentials, sc) + mockLoginUsingLDAP(true, ErrInvalidCredentials, sc) mockSaveInvalidLoginAttempt(sc) err := AuthenticateUser(sc.loginUserQuery) @@ -85,7 +85,7 @@ func TestAuthenticateUser(t *testing.T) { authScenario("When a non-existing grafana user authenticate and ldap disabled", func(sc *authScenarioContext) { mockLoginAttemptValidation(nil, sc) mockLoginUsingGrafanaDB(models.ErrUserNotFound, sc) - mockLoginUsingLdap(false, nil, sc) + mockLoginUsingLDAP(false, nil, sc) mockSaveInvalidLoginAttempt(sc) err := AuthenticateUser(sc.loginUserQuery) @@ -102,7 +102,7 @@ func TestAuthenticateUser(t *testing.T) { authScenario("When a non-existing grafana user authenticate and invalid ldap credentials", func(sc *authScenarioContext) { mockLoginAttemptValidation(nil, sc) mockLoginUsingGrafanaDB(models.ErrUserNotFound, sc) - mockLoginUsingLdap(true, ldap.ErrInvalidCredentials, sc) + mockLoginUsingLDAP(true, ldap.ErrInvalidCredentials, sc) mockSaveInvalidLoginAttempt(sc) err := AuthenticateUser(sc.loginUserQuery) @@ -119,7 +119,7 @@ func TestAuthenticateUser(t *testing.T) { authScenario("When a non-existing grafana user authenticate and valid ldap credentials", func(sc *authScenarioContext) { mockLoginAttemptValidation(nil, sc) mockLoginUsingGrafanaDB(models.ErrUserNotFound, sc) - mockLoginUsingLdap(true, nil, sc) + mockLoginUsingLDAP(true, nil, sc) mockSaveInvalidLoginAttempt(sc) err := AuthenticateUser(sc.loginUserQuery) @@ -137,7 +137,7 @@ func TestAuthenticateUser(t *testing.T) { customErr := errors.New("custom") mockLoginAttemptValidation(nil, sc) mockLoginUsingGrafanaDB(models.ErrUserNotFound, sc) - mockLoginUsingLdap(true, customErr, sc) + mockLoginUsingLDAP(true, customErr, sc) mockSaveInvalidLoginAttempt(sc) err := AuthenticateUser(sc.loginUserQuery) @@ -154,7 +154,7 @@ func TestAuthenticateUser(t *testing.T) { authScenario("When grafana user authenticate with invalid credentials and invalid ldap credentials", func(sc *authScenarioContext) { mockLoginAttemptValidation(nil, sc) mockLoginUsingGrafanaDB(ErrInvalidCredentials, sc) - mockLoginUsingLdap(true, ldap.ErrInvalidCredentials, sc) + mockLoginUsingLDAP(true, ldap.ErrInvalidCredentials, sc) mockSaveInvalidLoginAttempt(sc) err := AuthenticateUser(sc.loginUserQuery) @@ -187,8 +187,8 @@ func mockLoginUsingGrafanaDB(err error, sc *authScenarioContext) { } } -func mockLoginUsingLdap(enabled bool, err error, sc *authScenarioContext) { - loginUsingLdap = func(query *models.LoginUserQuery) (bool, error) { +func mockLoginUsingLDAP(enabled bool, err error, sc *authScenarioContext) { + loginUsingLDAP = func(query *models.LoginUserQuery) (bool, error) { sc.ldapLoginWasCalled = true return enabled, err } @@ -210,7 +210,7 @@ func mockSaveInvalidLoginAttempt(sc *authScenarioContext) { func authScenario(desc string, fn authScenarioFunc) { Convey(desc, func() { origLoginUsingGrafanaDB := loginUsingGrafanaDB - origLoginUsingLdap := loginUsingLdap + origLoginUsingLDAP := loginUsingLDAP origValidateLoginAttempts := validateLoginAttempts origSaveInvalidLoginAttempt := saveInvalidLoginAttempt @@ -224,7 +224,7 @@ func authScenario(desc string, fn authScenarioFunc) { defer func() { loginUsingGrafanaDB = origLoginUsingGrafanaDB - loginUsingLdap = origLoginUsingLdap + loginUsingLDAP = origLoginUsingLDAP validateLoginAttempts = origValidateLoginAttempts saveInvalidLoginAttempt = origSaveInvalidLoginAttempt }() diff --git a/pkg/login/ldap_login.go b/pkg/login/ldap_login.go index 0b41e612a2e..33693212ac7 100644 --- a/pkg/login/ldap_login.go +++ b/pkg/login/ldap_login.go @@ -17,9 +17,9 @@ var isLDAPEnabled = multildap.IsEnabled // newLDAP creates multiple LDAP instance var newLDAP = multildap.New -// loginUsingLdap logs in user using LDAP. It returns whether LDAP is enabled and optional error and query arg will be +// loginUsingLDAP logs in user using LDAP. It returns whether LDAP is enabled and optional error and query arg will be // populated with the logged in user if successful. -var loginUsingLdap = func(query *models.LoginUserQuery) (bool, error) { +var loginUsingLDAP = func(query *models.LoginUserQuery) (bool, error) { enabled := isLDAPEnabled() if !enabled { @@ -38,7 +38,7 @@ var loginUsingLdap = func(query *models.LoginUserQuery) (bool, error) { login, err := user.Upsert(&user.UpsertArgs{ ExternalUser: externalUser, - SignupAllowed: setting.LdapAllowSignup, + SignupAllowed: setting.LDAPAllowSignup, }) if err != nil { return true, err diff --git a/pkg/login/ldap_login_test.go b/pkg/login/ldap_login_test.go index b93a4890bc3..ac5ba49e2f1 100644 --- a/pkg/login/ldap_login_test.go +++ b/pkg/login/ldap_login_test.go @@ -14,10 +14,10 @@ import ( var errTest = errors.New("Test error") -func TestLdapLogin(t *testing.T) { +func TestLDAPLogin(t *testing.T) { Convey("Login using ldap", t, func() { Convey("Given ldap enabled and no server configured", func() { - setting.LdapEnabled = true + setting.LDAPEnabled = true LDAPLoginScenario("When login", func(sc *LDAPLoginScenarioContext) { sc.withLoginResult(false) @@ -29,7 +29,7 @@ func TestLdapLogin(t *testing.T) { return config, nil } - enabled, err := loginUsingLdap(sc.loginUserQuery) + enabled, err := loginUsingLDAP(sc.loginUserQuery) Convey("it should return true", func() { So(enabled, ShouldBeTrue) @@ -46,11 +46,11 @@ func TestLdapLogin(t *testing.T) { }) Convey("Given ldap disabled", func() { - setting.LdapEnabled = false + setting.LDAPEnabled = false LDAPLoginScenario("When login", func(sc *LDAPLoginScenarioContext) { sc.withLoginResult(false) - enabled, err := loginUsingLdap(&models.LoginUserQuery{ + enabled, err := loginUsingLDAP(&models.LoginUserQuery{ Username: "user", Password: "pwd", }) diff --git a/pkg/middleware/auth_proxy/auth_proxy.go b/pkg/middleware/auth_proxy/auth_proxy.go index 2e1e72b82f6..e078aaf8425 100644 --- a/pkg/middleware/auth_proxy/auth_proxy.go +++ b/pkg/middleware/auth_proxy/auth_proxy.go @@ -40,7 +40,7 @@ type AuthProxy struct { header string enabled bool - LdapAllowSignup bool + LDAPAllowSignup bool AuthProxyAutoSignUp bool whitelistIP string headerType string @@ -88,8 +88,8 @@ func New(options *Options) *AuthProxy { headerType: setting.AuthProxyHeaderProperty, headers: setting.AuthProxyHeaders, whitelistIP: setting.AuthProxyWhitelist, - cacheTTL: setting.AuthProxyLdapSyncTtl, - LdapAllowSignup: setting.LdapAllowSignup, + cacheTTL: setting.AuthProxyLDAPSyncTtl, + LDAPAllowSignup: setting.LDAPAllowSignup, AuthProxyAutoSignUp: setting.AuthProxyAutoSignUp, } } @@ -213,7 +213,7 @@ func (auth *AuthProxy) LoginViaLDAP() (int64, *Error) { // Have to sync grafana and LDAP user during log in user, err := user.Upsert(&user.UpsertArgs{ ReqContext: auth.ctx, - SignupAllowed: auth.LdapAllowSignup, + SignupAllowed: auth.LDAPAllowSignup, ExternalUser: extUser, }) if err != nil { diff --git a/pkg/middleware/middleware_test.go b/pkg/middleware/middleware_test.go index 694ecef14f4..c50960569b6 100644 --- a/pkg/middleware/middleware_test.go +++ b/pkg/middleware/middleware_test.go @@ -300,7 +300,7 @@ func TestMiddlewareContext(t *testing.T) { setting.AuthProxyEnabled = true setting.AuthProxyWhitelist = "" setting.AuthProxyAutoSignUp = true - setting.LdapEnabled = true + setting.LDAPEnabled = true setting.AuthProxyHeaderName = "X-WEBAUTH-USER" setting.AuthProxyHeaderProperty = "username" name := "markelog" @@ -326,7 +326,7 @@ func TestMiddlewareContext(t *testing.T) { }) middlewareScenario(t, "should create an user from a header", func(sc *scenarioContext) { - setting.LdapEnabled = false + setting.LDAPEnabled = false setting.AuthProxyAutoSignUp = true bus.AddHandler("test", func(query *m.GetSignedInUserQuery) error { @@ -354,7 +354,7 @@ func TestMiddlewareContext(t *testing.T) { }) middlewareScenario(t, "should get an existing user from header", func(sc *scenarioContext) { - setting.LdapEnabled = false + setting.LDAPEnabled = false bus.AddHandler("test", func(query *m.GetSignedInUserQuery) error { query.Result = &m.SignedInUser{OrgId: 2, UserId: 12} @@ -379,7 +379,7 @@ func TestMiddlewareContext(t *testing.T) { middlewareScenario(t, "should allow the request from whitelist IP", func(sc *scenarioContext) { setting.AuthProxyWhitelist = "192.168.1.0/24, 2001::0/120" - setting.LdapEnabled = false + setting.LDAPEnabled = false bus.AddHandler("test", func(query *m.GetSignedInUserQuery) error { query.Result = &m.SignedInUser{OrgId: 4, UserId: 33} @@ -405,7 +405,7 @@ func TestMiddlewareContext(t *testing.T) { middlewareScenario(t, "should not allow the request from whitelist IP", func(sc *scenarioContext) { setting.AuthProxyWhitelist = "8.8.8.8" - setting.LdapEnabled = false + setting.LDAPEnabled = false bus.AddHandler("test", func(query *m.GetSignedInUserQuery) error { query.Result = &m.SignedInUser{OrgId: 4, UserId: 33} diff --git a/pkg/services/ldap/ldap.go b/pkg/services/ldap/ldap.go index 446a712477b..9fa680d1e19 100644 --- a/pkg/services/ldap/ldap.go +++ b/pkg/services/ldap/ldap.go @@ -454,9 +454,9 @@ func (server *Server) requestMemberOf(searchResult *ldap.SearchResult) ([]string for _, groupSearchBase := range server.config.GroupSearchBaseDNs { var filterReplace string if server.config.GroupSearchFilterUserAttribute == "" { - filterReplace = getLdapAttr(server.config.Attr.Username, searchResult) + filterReplace = getLDAPAttr(server.config.Attr.Username, searchResult) } else { - filterReplace = getLdapAttr(server.config.GroupSearchFilterUserAttribute, searchResult) + filterReplace = getLDAPAttr(server.config.GroupSearchFilterUserAttribute, searchResult) } filter := strings.Replace( @@ -489,7 +489,7 @@ func (server *Server) requestMemberOf(searchResult *ldap.SearchResult) ([]string if len(groupSearchResult.Entries) > 0 { for i := range groupSearchResult.Entries { - memberOf = append(memberOf, getLdapAttrN(groupIDAttribute, groupSearchResult, i)) + memberOf = append(memberOf, getLDAPAttrN(groupIDAttribute, groupSearchResult, i)) } break } @@ -512,27 +512,27 @@ func (server *Server) serializeUsers( } userInfo := &UserInfo{ - DN: getLdapAttrN( + DN: getLDAPAttrN( "dn", users, index, ), - LastName: getLdapAttrN( + LastName: getLDAPAttrN( server.config.Attr.Surname, users, index, ), - FirstName: getLdapAttrN( + FirstName: getLDAPAttrN( server.config.Attr.Name, users, index, ), - Username: getLdapAttrN( + Username: getLDAPAttrN( server.config.Attr.Username, users, index, ), - Email: getLdapAttrN( + Email: getLDAPAttrN( server.config.Attr.Email, users, index, @@ -554,7 +554,7 @@ func (server *Server) getMemberOf(search *ldap.SearchResult) ( []string, error, ) { if server.config.GroupSearchFilter == "" { - memberOf := getLdapAttrArray(server.config.Attr.MemberOf, search) + memberOf := getLDAPAttrArray(server.config.Attr.MemberOf, search) return memberOf, nil } @@ -576,11 +576,11 @@ func appendIfNotEmpty(slice []string, values ...string) []string { return slice } -func getLdapAttr(name string, result *ldap.SearchResult) string { - return getLdapAttrN(name, result, 0) +func getLDAPAttr(name string, result *ldap.SearchResult) string { + return getLDAPAttrN(name, result, 0) } -func getLdapAttrN(name string, result *ldap.SearchResult, n int) string { +func getLDAPAttrN(name string, result *ldap.SearchResult, n int) string { if strings.ToLower(name) == "dn" { return result.Entries[n].DN } @@ -594,11 +594,11 @@ func getLdapAttrN(name string, result *ldap.SearchResult, n int) string { return "" } -func getLdapAttrArray(name string, result *ldap.SearchResult) []string { - return getLdapAttrArrayN(name, result, 0) +func getLDAPAttrArray(name string, result *ldap.SearchResult) []string { + return getLDAPAttrArrayN(name, result, 0) } -func getLdapAttrArrayN(name string, result *ldap.SearchResult, n int) []string { +func getLDAPAttrArrayN(name string, result *ldap.SearchResult, n int) []string { for _, attr := range result.Entries[n].Attributes { if attr.Name == name { return attr.Values diff --git a/pkg/services/ldap/settings.go b/pkg/services/ldap/settings.go index 15f1583fea7..df63f10a6fa 100644 --- a/pkg/services/ldap/settings.go +++ b/pkg/services/ldap/settings.go @@ -65,7 +65,7 @@ var loadingMutex = &sync.Mutex{} // IsEnabled checks if ldap is enabled func IsEnabled() bool { - return setting.LdapEnabled + return setting.LDAPEnabled } // ReloadConfig reads the config from the disc and caches it. @@ -78,7 +78,7 @@ func ReloadConfig() error { defer loadingMutex.Unlock() var err error - config, err = readConfig(setting.LdapConfigFile) + config, err = readConfig(setting.LDAPConfigFile) return err } @@ -98,7 +98,7 @@ func GetConfig() (*Config, error) { defer loadingMutex.Unlock() var err error - config, err = readConfig(setting.LdapConfigFile) + config, err = readConfig(setting.LDAPConfigFile) return config, err } @@ -106,7 +106,7 @@ func GetConfig() (*Config, error) { func readConfig(configFile string) (*Config, error) { result := &Config{} - logger.Info("Ldap enabled, reading config file", "file", configFile) + logger.Info("LDAP enabled, reading config file", "file", configFile) _, err := toml.DecodeFile(configFile, result) if err != nil { diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index 194617f3bcb..65e4e0e2502 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -138,7 +138,7 @@ var ( AuthProxyHeaderName string AuthProxyHeaderProperty string AuthProxyAutoSignUp bool - AuthProxyLdapSyncTtl int + AuthProxyLDAPSyncTtl int AuthProxyWhitelist string AuthProxyHeaders map[string]string @@ -165,11 +165,11 @@ var ( GoogleTagManagerId string // LDAP - LdapEnabled bool - LdapConfigFile string - LdapSyncCron string - LdapAllowSignup bool - LdapActiveSyncEnabled bool + LDAPEnabled bool + LDAPConfigFile string + LDAPSyncCron string + LDAPAllowSignup bool + LDAPActiveSyncEnabled bool // QUOTA Quota QuotaSettings @@ -815,7 +815,7 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error { return err } AuthProxyAutoSignUp = authProxy.Key("auto_sign_up").MustBool(true) - AuthProxyLdapSyncTtl = authProxy.Key("ldap_sync_ttl").MustInt() + AuthProxyLDAPSyncTtl = authProxy.Key("ldap_sync_ttl").MustInt() AuthProxyWhitelist, err = valueAsString(authProxy, "whitelist", "") if err != nil { return err @@ -978,11 +978,11 @@ type RemoteCacheOptions struct { func (cfg *Cfg) readLDAPConfig() { ldapSec := cfg.Raw.Section("auth.ldap") - LdapConfigFile = ldapSec.Key("config_file").String() - LdapSyncCron = ldapSec.Key("sync_cron").String() - LdapEnabled = ldapSec.Key("enabled").MustBool(false) - LdapActiveSyncEnabled = ldapSec.Key("active_sync_enabled").MustBool(false) - LdapAllowSignup = ldapSec.Key("allow_sign_up").MustBool(true) + LDAPConfigFile = ldapSec.Key("config_file").String() + LDAPSyncCron = ldapSec.Key("sync_cron").String() + LDAPEnabled = ldapSec.Key("enabled").MustBool(false) + LDAPActiveSyncEnabled = ldapSec.Key("active_sync_enabled").MustBool(false) + LDAPAllowSignup = ldapSec.Key("allow_sign_up").MustBool(true) } func (cfg *Cfg) readSessionConfig() {