feat: add JSON output for AWS accounts - #1534
Open
junland wants to merge 10 commits into
Open
Conversation
Agent-Logs-Url: https://github.com/junland/saml2aws/sessions/3a90e3f2-d211-4de6-a055-16e6518dbeef Co-authored-by: junland <9792545+junland@users.noreply.github.com>
Agent-Logs-Url: https://github.com/junland/saml2aws/sessions/c1ac1444-12b6-4e84-bff3-4c536d302d73 Co-authored-by: junland <9792545+junland@users.noreply.github.com>
Agent-Logs-Url: https://github.com/junland/saml2aws/sessions/c1ac1444-12b6-4e84-bff3-4c536d302d73 Co-authored-by: junland <9792545+junland@users.noreply.github.com>
Agent-Logs-Url: https://github.com/junland/saml2aws/sessions/328815d6-86d2-4b76-b5b7-cca716cfb0b8 Co-authored-by: junland <9792545+junland@users.noreply.github.com>
Agent-Logs-Url: https://github.com/junland/saml2aws/sessions/0ef21ef4-edc7-472d-b9cc-779ea35e1b48 Co-authored-by: junland <9792545+junland@users.noreply.github.com>
Agent-Logs-Url: https://github.com/junland/saml2aws/sessions/6e41333c-2db2-4fdd-a0de-7bd49d0eac67 Co-authored-by: junland <9792545+junland@users.noreply.github.com>
Add --json flag to list-roles command and improve tests
list-roles: add --json-pretty flag and extract AccountNumber/AccountAlias in JSON output
Update list-roles functionality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the AWS roles listing functionality by adding support for JSON output (both compact and pretty-printed), extracting and exposing AWS account numbers and aliases, and introducing comprehensive tests for these changes. The most important changes are summarized below.
Output format enhancements
--jsonand--json-prettyflags to thelist-rolescommand, allowing users to output AWS account and role information in compact or pretty-printed JSON formats. [1] [2] [3] [4]AWS account parsing improvements
AWSAccountstruct to includeAccountNumberandAccountAliasfields, and enhanced parsing logic to extract these values from account names using regular expressions. [1] [2]Testing
list-rolescommand, covering text output, compact JSON, pretty-printed JSON, and error handling when no roles are present.AccountNumberandAccountAliasfields. [1] [2]