Skip to content

feat(cli): resolve Bedrock credentials from AWS SSO - #68

Merged
johnnyhuy merged 1 commit into
mainfrom
ao/hoist-backlog-5/agent/issue-67-cli-bedrock-sso
Dec 1, 2026
Merged

johnnyhuy merged 1 commit into
mainfrom
ao/hoist-backlog-5/agent/issue-67-cli-bedrock-sso

Conversation

@johnnyhuy

@johnnyhuy johnnyhuy commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

The CLI Bedrock probe now uses the selected AWS IAM Identity Center profile when explicit, environment and static shared-file credentials are unavailable. It signs with temporary role credentials and gives a sign-in hint when the SSO exchange fails.

Closes #67. Part of #15.

Verification

  • mise run ci:cli passed. Typecheck, 61 tests, 0 failures, 329 assertions and a Linux x64 binary build.
  • mise exec -- bun build cli/src/index.ts --compile --target=bun-darwin-arm64 --outfile=<fixture>/hoist passed. The native fixture run with HOIST_TEST_CLI_BINARY=<fixture>/hoist passed all five tests.
  • git diff --cached --check passed before commit.

Behaviour proof

(pass) Bedrock signs with temporary credentials from a named SSO session
(pass) Bedrock signs with temporary credentials from a legacy SSO profile
(pass) static shared credentials take precedence over a configured SSO session
(pass) keys probe bedrock prompts for SSO login when the session is missing
(pass) a rejected SSO exchange avoids Bedrock and hides the AWS response body

The positive fixture checks that the SSO endpoint receives the portal token and the Bedrock endpoint receives the temporary session token and the profile's Bedrock region in the SigV4 credential scope.

Built macOS CLI transcript for a configured AWS profile with no cached login, with spinner control codes removed:

$ hoist keys probe bedrock
◇  ✗ error · AWS error: Could not resolve AWS IAM Identity Center credentials. Check the selected AWS profile and run `aws sso login` for that profile
exit 1

A second native run reached the local SSO fixture, received a 401 and printed the same sign-in hint. Both native runs verified that the Bedrock endpoint received zero requests.

Reviewer notes

The SDK's SSO provider handles direct profiles with an sso_session or legacy inline SSO settings. The tests use isolated AWS files, fake tokens and local HTTP endpoints. App parity, role chaining and live provider acceptance remain on #15.

Co-authored-by: OpenAI Codex <noreply@openai.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​aws-sdk/​credential-provider-sso@​3.973.301001007697100

View full report

@johnnyhuy
johnnyhuy merged commit 0d91dde into main Dec 1, 2026
7 checks passed
@johnnyhuy
johnnyhuy deleted the ao/hoist-backlog-5/agent/issue-67-cli-bedrock-sso branch December 1, 2026 23:44
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.

CLI: resolve Bedrock credentials from AWS SSO profiles

1 participant