We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5093200 commit acb37e2Copy full SHA for acb37e2
1 file changed
internal/service/auth_service.go
@@ -141,9 +141,13 @@ func (auth *AuthService) GetLocalUser(username string) config.User {
141
}
142
143
func (auth *AuthService) GetLdapUser(userDN string) (config.LdapUser, error) {
144
- auth.ldapGroupsMutex.Lock()
+ if auth.ldap == nil {
145
+ return config.LdapUser{}, errors.New("LDAP service not initialized")
146
+ }
147
+
148
+ auth.ldapGroupsMutex.RLock()
149
entry, exists := auth.ldapGroupsCache[userDN]
- auth.ldapGroupsMutex.Unlock()
150
+ auth.ldapGroupsMutex.RUnlock()
151
152
if exists && time.Now().Before(entry.Expires) {
153
return config.LdapUser{
0 commit comments