Skip to content

feat: enable AWS login credentials for Bedrock auth#21623

Merged
celia-oai merged 3 commits intomainfrom
dev/cc/console-login
May 8, 2026
Merged

feat: enable AWS login credentials for Bedrock auth#21623
celia-oai merged 3 commits intomainfrom
dev/cc/console-login

Conversation

@celia-oai
Copy link
Copy Markdown
Collaborator

@celia-oai celia-oai commented May 8, 2026

Summary

Codex's Amazon Bedrock provider signs Mantle requests with SigV4 using credentials resolved by the AWS SDK. That worked for standard AWS profiles and environment credentials, but AWS CLI console-login profiles created by aws login require the SDK's credentials-login feature to resolve login_session credentials.

This change enables that credential provider so Bedrock can use AWS console-login credentials through the existing provider-owned AWS auth path.

While testing the console-login path, we also hit a Mantle-specific SigV4 regression from the new split between session_id and thread_id. Mantle does not preserve legacy OpenAI compatibility headers that use snake_case before SigV4 verification, so signing those headers can make the server reconstruct a different canonical request. The Bedrock auth path now removes that header class before signing, keeping preserved hyphenated Codex/AWS headers such as x-codex-turn-metadata signed normally.

Changes

  • Enable aws-config's credentials-login feature in codex-rs/aws-auth.
  • Add a compile-time regression test for aws_config::login::LoginCredentialsProvider.
  • Strip snake_case compatibility headers from Bedrock Mantle SigV4 requests before signing.
  • Expand the Bedrock auth regression test to cover session_id, thread_id, and future headers of the same shape.
  • Refresh Cargo and Bazel lockfiles for the added aws-sdk-signin dependency.

Tests

  • tested with aws login locally and verified that it works as intended.

@celia-oai celia-oai force-pushed the dev/cc/console-login branch 2 times, most recently from 02550ee to 03eab36 Compare May 8, 2026 01:46
@celia-oai celia-oai marked this pull request as ready for review May 8, 2026 01:46
@celia-oai celia-oai requested a review from pakrym-oai May 8, 2026 01:47
@celia-oai celia-oai force-pushed the dev/cc/console-login branch from 03eab36 to 4cf4aa8 Compare May 8, 2026 01:51
// richer Codex agent requests fail even though raw Responses requests work.
let headers_to_remove = headers
.keys()
.filter(|name| name.as_str().contains('_'))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the right filter? should we have an allowlist instead?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately non-standard headers just won't be accepted by aws anyways. I think it's a fine tradeoff for now, we can revisit it if we need to achieve header parity with out responses api down the road

Comment thread codex-rs/aws-auth/src/lib.rs Outdated
@celia-oai celia-oai enabled auto-merge (squash) May 8, 2026 03:25
@celia-oai celia-oai merged commit 9cbd4c0 into main May 8, 2026
40 of 41 checks passed
@celia-oai celia-oai deleted the dev/cc/console-login branch May 8, 2026 04:08
@github-actions github-actions Bot locked and limited conversation to collaborators May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants