mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
feat: handle multiple attributes (#3052)
Enhance LDAP user group retrieval to handle multiple attributes Signed-off-by: 周游 <hi@zhouyou.info>
This commit is contained in:
+3
-2
@@ -223,8 +223,9 @@ func (lc *LDAPClient) Authenticate(username, password string) (bool, map[string]
|
||||
var userGroups []string
|
||||
|
||||
if lc.UserGroupAttribute != "" && len(search.Entries[0].Attributes) > 0 {
|
||||
userAttributes := search.Entries[0].Attributes[0]
|
||||
userGroups = userAttributes.Values
|
||||
for _, attr := range search.Entries[0].Attributes {
|
||||
userGroups = append(userGroups, attr.Values...)
|
||||
}
|
||||
}
|
||||
|
||||
user := map[string]string{}
|
||||
|
||||
Reference in New Issue
Block a user