add missing STS accounts loading (#20279)

PR #20268 missed loading STS accounts map properly
This commit is contained in:
Harshavardhana
2024-08-16 18:24:54 -07:00
committed by GitHub
parent a5702f978e
commit 72cff79c8a
4 changed files with 28 additions and 2 deletions

View File

@@ -802,7 +802,11 @@ func (iamOS *IAMObjectStore) loadAllFromObjStore(ctx context.Context, cache *iam
// Store the newly populated map in the iam cache. This takes care of
// removing stale entries from the existing map.
cache.iamSTSAccountsMap = stsAccountsFromStore
cache.iamSTSPolicyMap = stsAccPoliciesFromStore
stsAccPoliciesFromStore.Range(func(k string, v MappedPolicy) bool {
cache.iamSTSPolicyMap.Store(k, v)
return true
})
return nil
}

View File

@@ -2865,6 +2865,10 @@ func (store *IAMStoreSys) LoadUser(ctx context.Context, accessKey string) error
cache.iamUsersMap[k] = v
}
for k, v := range newCache.iamSTSAccountsMap {
cache.iamSTSAccountsMap[k] = v
}
newCache.iamSTSPolicyMap.Range(func(k string, v MappedPolicy) bool {
cache.iamSTSPolicyMap.Store(k, v)
return true

View File

@@ -179,7 +179,7 @@ func (sys *IAMSys) initStore(objAPI ObjectLayer, etcdClient *etcd.Client) {
if etcdClient == nil {
var group *singleflight.Group
if env.Get("_MINIO_IAM_SINGLE_FLIGHT", config.EnableOff) == config.EnableOn {
if env.Get("_MINIO_IAM_SINGLE_FLIGHT", config.EnableOn) == config.EnableOn {
group = &singleflight.Group{}
}
sys.store = &IAMStoreSys{