From 85d2df02b91aebdcc1436f6aa7e0fe857e216061 Mon Sep 17 00:00:00 2001 From: Aditya Manthramurthy Date: Thu, 9 Dec 2021 15:55:28 -0800 Subject: [PATCH] fix: user listing with LDAP (#13872) Users listing was showing just a weird policy mapping output which does not make sense here. --- cmd/iam-store.go | 9 --------- cmd/sts-handlers_test.go | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/iam-store.go b/cmd/iam-store.go index 6698b7f03..454b64cda 100644 --- a/cmd/iam-store.go +++ b/cmd/iam-store.go @@ -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 } diff --git a/cmd/sts-handlers_test.go b/cmd/sts-handlers_test.go index bd2cdc73d..79243c9d2 100644 --- a/cmd/sts-handlers_test.go +++ b/cmd/sts-handlers_test.go @@ -297,6 +297,15 @@ func (s *TestSuiteIAM) TestLDAPSTS(c *check) { 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. c.mustListObjects(ctx, minioClient, bucket)