mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
fix: IAM reload should only list at config/iam/ precisely (#14753)
This commit is contained in:
parent
53ca589c11
commit
e69c42956b
@ -407,15 +407,15 @@ func (iamOS *IAMObjectStore) loadMappedPolicies(ctx context.Context, userType IA
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
usersListKey = "/users/"
|
usersListKey = "users/"
|
||||||
svcAccListKey = "/service-accounts/"
|
svcAccListKey = "service-accounts/"
|
||||||
groupsListKey = "/groups/"
|
groupsListKey = "groups/"
|
||||||
policiesListKey = "/policies/"
|
policiesListKey = "policies/"
|
||||||
stsListKey = "/sts/"
|
stsListKey = "sts/"
|
||||||
policyDBUsersListKey = "/policydb/users/"
|
policyDBUsersListKey = "policydb/users/"
|
||||||
policyDBSTSUsersListKey = "/policydb/sts-users/"
|
policyDBSTSUsersListKey = "policydb/sts-users/"
|
||||||
policyDBServiceAccountsListKey = "/policydb/service-accounts/"
|
policyDBServiceAccountsListKey = "policydb/service-accounts/"
|
||||||
policyDBGroupsListKey = "/policydb/groups/"
|
policyDBGroupsListKey = "policydb/groups/"
|
||||||
|
|
||||||
allListKeys = []string{
|
allListKeys = []string{
|
||||||
usersListKey,
|
usersListKey,
|
||||||
@ -433,7 +433,7 @@ var (
|
|||||||
func (iamOS *IAMObjectStore) listAllIAMConfigItems(ctx context.Context) (map[string][]string, error) {
|
func (iamOS *IAMObjectStore) listAllIAMConfigItems(ctx context.Context) (map[string][]string, error) {
|
||||||
res := make(map[string][]string)
|
res := make(map[string][]string)
|
||||||
|
|
||||||
for item := range listIAMConfigItems(ctx, iamOS.objAPI, iamConfigPrefix) {
|
for item := range listIAMConfigItems(ctx, iamOS.objAPI, iamConfigPrefix+SlashSeparator) {
|
||||||
if item.Err != nil {
|
if item.Err != nil {
|
||||||
return nil, item.Err
|
return nil, item.Err
|
||||||
}
|
}
|
||||||
@ -448,7 +448,7 @@ func (iamOS *IAMObjectStore) listAllIAMConfigItems(ctx context.Context) (map[str
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !found && !(item.Item == "config/config.json" || item.Item == "/format.json" || strings.Contains(item.Item, "config/history/")) {
|
if !found && (item.Item != "format.json") {
|
||||||
logger.LogIf(ctx, fmt.Errorf("unknown type of IAM file listed: %v", item.Item))
|
logger.LogIf(ctx, fmt.Errorf("unknown type of IAM file listed: %v", item.Item))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user