mirror of https://github.com/minio/minio.git
avoid frivolous logs for expired credentials (#18767)
This commit is contained in:
parent
a89e0bab7d
commit
f02d282754
11
cmd/iam.go
11
cmd/iam.go
|
@ -1358,9 +1358,15 @@ func (sys *IAMSys) updateGroupMembershipsForLDAP(ctx context.Context) {
|
|||
// DN to ldap username mapping for each LDAP user
|
||||
parentUserToLDAPUsernameMap := make(map[string]string)
|
||||
for _, cred := range allCreds {
|
||||
// Expired credentials don't need parent user updates.
|
||||
if cred.IsExpired() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !sys.LDAPConfig.IsLDAPUserDN(cred.ParentUser) {
|
||||
continue
|
||||
}
|
||||
|
||||
// Check if this is the first time we are
|
||||
// encountering this LDAP user.
|
||||
if _, ok := parentUserToCredsMap[cred.ParentUser]; !ok {
|
||||
|
@ -1425,6 +1431,11 @@ func (sys *IAMSys) updateGroupMembershipsForLDAP(ctx context.Context) {
|
|||
continue
|
||||
}
|
||||
|
||||
// Expired credentials don't need group membership updates.
|
||||
if cred.IsExpired() {
|
||||
continue
|
||||
}
|
||||
|
||||
cred.Groups = currGroups
|
||||
if err := sys.store.UpdateUserIdentity(ctx, cred); err != nil {
|
||||
// Log and continue error - perhaps it'll work the next time.
|
||||
|
|
Loading…
Reference in New Issue