Skip to content

Commit e4e8579

Browse files
authored
Merge pull request #72 from bakedonion/feature/sort-alphabetically-in-proxy-mode
Sort actions in `--mode proxy` alphabetically if the flag is set
2 parents d2fc5e7 + 9daffa1 commit e4e8579

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

iamlivecore/logger.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,13 @@ func aggregatePolicy(policy IAMPolicy) IAMPolicy {
293293
}
294294
}
295295

296-
policy.Statement[i].Action = uniqueSlice(policy.Statement[i].Action)
296+
actions := uniqueSlice(policy.Statement[i].Action)
297+
298+
if *sortAlphabeticalFlag {
299+
sort.Strings(actions)
300+
}
301+
302+
policy.Statement[i].Action = actions
297303
policy.Statement[i].Resource = uniqueSlice(policy.Statement[i].Resource.([]string))
298304
}
299305

0 commit comments

Comments
 (0)