iam: include policy in role show output - #903
Conversation
|
[SC-196302] |
|
Can you add example of the output table with full featured policy? |
Updated the PR description accordingly with output from a live full-featured policy, including allow and deny rules with expressions. |
|
Thanks @natalie-o-perret . IMO it feels cluttered, rule expression can also be very long which will extend policy table even more. Probably why policy was factored out in the first place. |
Yea, agreed. I updated the PR to keep the default table unchanged and include the nested policy only in JSON output. |
Description
Show an IAM role policy alongside the normal role details. The policy is rendered as a separate table with a
Policy:heading. Keep--policyas the existing policy-only output for scripts.JSON output includes the policy under
policy.Checklist
(For exoscale contributors)
CHANGELOG.md)Testing
Live before/after check using a temporary role with a denied service and three policy rules. The role was deleted after capturing the output.
Before, using the installed binary:
After, using the patched binary:
A live read-only check against the existing
DBaaSrole confirms the final blank-line and heading layout.JSON output contains the complete policy under
policy.--policycontinues to print only the policy table.A focused fake API test covers the reported deny-by-default policy with
computeandnetworkingallowed.go test ./cmd/iampasses.The full
make test-verbosesuite passes.make buildsucceeds.golangci-lint run --timeout 4mreports0 issues.Note
AI assistance: PR description, test scaffolding.