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:
1 parent
16d5df1cba
commit
846b9327a5
8 files changed
+90
-37
No files matched your search
@@ -22,8 +22,8 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
readLDAPConfig = ldap.ReadConfig
|
||||
isLDAPEnabled = ldap.IsEnabled
|
||||
getLDAPConfig = ldap.GetConfig
|
||||
isLDAPEnabled = ldap.IsEnabled
|
||||
)
|
||||
|
||||
// AuthProxy struct
|
||||
@@ -219,7 +219,10 @@ func (auth *AuthProxy) GetUserIDViaLDAP() (int64, *Error) {
|
||||
Username: auth.header,
|
||||
}
|
||||
|
||||
config := readLDAPConfig()
|
||||
config, err := getLDAPConfig()
|
||||
if err != nil {
|
||||
return 0, newError("Failed to get LDAP config", nil)
|
||||
}
|
||||
if len(config.Servers) == 0 {
|
||||
return 0, newError("No LDAP servers available", nil)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user