return error on invalid action in PutUserPolicy (#6482)

This commit is contained in:
Tom Crasset
2025-01-28 14:42:03 +01:00
committed by GitHub
parent be5f6b3565
commit 7c3a0ed874
2 changed files with 26 additions and 0 deletions

View File

@@ -343,6 +343,11 @@ func GetActions(policy *PolicyDocument) ([]string, error) {
continue
}
statementAction := MapToStatementAction(act[1])
if statementAction == "" {
return nil, fmt.Errorf("not a valid action: '%s'", act[1])
}
path := res[5]
if path == "*" {
actions = append(actions, statementAction)