Skip to content

fix: list-roles empty for single-role users (#14) - #21

Merged
aspratt merged 3 commits into
masterfrom
fix/14-list-roles-single-role
Oct 20, 2026
Merged

aspratt merged 3 commits into
masterfrom
fix/14-list-roles-single-role

Conversation

@aspratt

@aspratt aspratt commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Record: #14 (bug × functional × S2).

A single-role user is 302ed to the console, so no role chooser renders and list-roles printed nothing with exit 0. When the chooser parse yields no accounts after a redirect, accounts are now built from the assertion's roles, grouped by account id. Multi-role users who get the chooser see no change.

  • Red then green: TestParseAWSAccountsSingleRoleRedirect. The e2e TestListRolesSingleRole is now required.
  • Gate: lint 0, gofmt/vet clean, cross-builds for windows/darwin amd64/arm64.

Questions (conservative choice already in code): the label is Account: <id> because the assertion carries no alias; the fallback also applies to a multi-role redirect that returns zero accounts, which used to fail with "No accounts available".

…14)

A single-role user is 302ed straight to the console, so the role chooser
never renders and ParseAWSAccounts returned no accounts. When the parse
yields nothing after a redirect, build accounts from the assertion's
roles, grouped by account id. TestListRolesSingleRole is now required.
…oops (#14)

Fall back to assertion roles only when the final response is < 400, and
restore Go's 10-redirect cap that the custom CheckRedirect dropped.
list-roles always posts to the real AWS sign-in page, which the offline
moto lane can't reach, so the test skips unless E2E_TARGET=aws and stays
required in e2e-aws.
@aspratt

aspratt commented Oct 20, 2026

Copy link
Copy Markdown
Owner Author

Pushed a419587. TestListRolesSingleRole now skips unless E2E_TARGET=aws, so it stays required in the e2e-aws lane and no longer fails the offline moto lane. make e2e and make e2e-aws are running at a419587; results will follow here and in #12. The Build failures on this head are the known retired Playwright CDN (404 on playwright-1.47.2 driver download in pkg/provider/browser). master fails the same way, and #10 fixes it.

@aspratt

aspratt commented Oct 20, 2026

Copy link
Copy Markdown
Owner Author

e2e PASS and e2e-aws PASS at a419587 (2026-10-20). TestListRolesSingleRole passes against real AWS in e2e-aws and is skipped in the offline lane. Re-review APPROVE. Marked ready for approval in #12.

@aspratt
aspratt merged commit f6e7159 into master Oct 20, 2026
6 of 9 checks passed
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.

1 participant