Skip to content

feat: add JSON output for AWS accounts - #1534

Open
junland wants to merge 10 commits into
Versent:masterfrom
junland:master
Open

feat: add JSON output for AWS accounts#1534
junland wants to merge 10 commits into
Versent:masterfrom
junland:master

Conversation

@junland

@junland junland commented Jul 18, 2026

Copy link
Copy Markdown

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

  • Added --json and --json-pretty flags to the list-roles command, allowing users to output AWS account and role information in compact or pretty-printed JSON formats. [1] [2] [3] [4]

AWS account parsing improvements

  • Updated the AWSAccount struct to include AccountNumber and AccountAlias fields, and enhanced parsing logic to extract these values from account names using regular expressions. [1] [2]

Testing

  • Added a new test suite for the list-roles command, covering text output, compact JSON, pretty-printed JSON, and error handling when no roles are present.
  • Updated existing AWS account extraction tests to validate the new AccountNumber and AccountAlias fields. [1] [2]

Copilot AI and others added 10 commits May 3, 2026 18:44
Agent-Logs-Url: https://github.com/junland/saml2aws/sessions/3a90e3f2-d211-4de6-a055-16e6518dbeef

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants