Skip to content

Commit

Permalink
Merge pull request #72 from bakedonion/feature/sort-alphabetically-in…
Browse files Browse the repository at this point in the history
…-proxy-mode

Sort actions in `--mode proxy` alphabetically if the flag is set
  • Loading branch information
iann0036 authored Nov 19, 2023
2 parents d2fc5e7 + 9daffa1 commit e4e8579
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion iamlivecore/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,13 @@ func aggregatePolicy(policy IAMPolicy) IAMPolicy {
}
}

policy.Statement[i].Action = uniqueSlice(policy.Statement[i].Action)
actions := uniqueSlice(policy.Statement[i].Action)

if *sortAlphabeticalFlag {
sort.Strings(actions)
}

policy.Statement[i].Action = actions
policy.Statement[i].Resource = uniqueSlice(policy.Statement[i].Resource.([]string))
}

Expand Down

0 comments on commit e4e8579

Please sign in to comment.