LDAP: Added reload endpoint for LDAP config (#15470)

* 4843 - Added reload endpoint for LDAP config

closes #4843

* Refactor to make the reload work after master drifted
This commit is contained in:
Samuel
2019-05-03 22:53:07 +10:00
committed by Andrej Ocenas
parent 16d5df1cba
commit 846b9327a5
8 changed files with 90 additions and 37 deletions
+6 -6
View File
@@ -67,18 +67,18 @@ func TestMiddlewareContext(t *testing.T) {
return true
}
readLDAPConfig = func() *ldap.Config {
getLDAPConfig = func() (*ldap.Config, error) {
config := &ldap.Config{
Servers: []*ldap.ServerConfig{
{},
},
}
return config
return config, nil
}
defer func() {
isLDAPEnabled = ldap.IsEnabled
readLDAPConfig = ldap.ReadConfig
getLDAPConfig = ldap.GetConfig
}()
store := remotecache.NewFakeStore(t)
@@ -109,16 +109,16 @@ func TestMiddlewareContext(t *testing.T) {
return true
}
readLDAPConfig = func() *ldap.Config {
getLDAPConfig = func() (*ldap.Config, error) {
config := &ldap.Config{
Servers: []*ldap.ServerConfig{},
}
return config
return config, nil
}
defer func() {
isLDAPEnabled = ldap.IsEnabled
readLDAPConfig = ldap.ReadConfig
getLDAPConfig = ldap.GetConfig
}()
store := remotecache.NewFakeStore(t)