fix: user listing with LDAP (#13872)

Users listing was showing just a weird policy 
mapping output which does not make sense here.
This commit is contained in:
Aditya Manthramurthy 2021-12-09 15:55:28 -08:00 committed by GitHub
parent 2f1e8ba612
commit 85d2df02b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -1099,15 +1099,6 @@ func (store *IAMStoreSys) GetUsers() map[string]madmin.UserInfo {
} }
} }
if store.getUsersSysType() == LDAPUsersSysType {
for k, v := range cache.iamUserPolicyMap {
result[k] = madmin.UserInfo{
PolicyName: v.Policies,
Status: madmin.AccountEnabled,
}
}
}
return result return result
} }

View File

@ -297,6 +297,15 @@ func (s *TestSuiteIAM) TestLDAPSTS(c *check) {
c.Fatalf("Error initializing client: %v", err) c.Fatalf("Error initializing client: %v", err)
} }
// Validate that user listing does not return any entries
usersList, err := s.adm.ListUsers(ctx)
if err != nil {
c.Fatalf("list users should not fail: %v", err)
}
if len(usersList) > 0 {
c.Fatalf("expected listing to be empty: %v", usersList)
}
// Validate that the client from sts creds can access the bucket. // Validate that the client from sts creds can access the bucket.
c.mustListObjects(ctx, minioClient, bucket) c.mustListObjects(ctx, minioClient, bucket)