Skip to content

feat: add Bedrock API key as a managed auth mode#27443

Merged
celia-oai merged 4 commits into
mainfrom
dev/cc/auth-manager-aws
Jun 11, 2026
Merged

feat: add Bedrock API key as a managed auth mode#27443
celia-oai merged 4 commits into
mainfrom
dev/cc/auth-manager-aws

Conversation

@celia-oai

@celia-oai celia-oai commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Why

Codex needs to manage Amazon Bedrock API key credentials through the existing auth lifecycle instead of introducing a separate auth manager or provider-specific credential file. Treating Bedrock API key login as a primary auth mode gives it the same persistence, keyring, reload, and logout behavior as the existing OpenAI API key and ChatGPT modes.

The credential is valid only for the amazon-bedrock model provider. OpenAI-compatible providers must reject this auth mode rather than treating the Bedrock key as an OpenAI bearer token.

What changed

  • Added bedrockApiKey as an app-server AuthMode and CodexAuth::BedrockApiKey as a primary AuthManager mode.
  • Added BedrockApiKeyAuth, containing the API key and AWS region, to the existing AuthDotJson payload stored in $CODEX_HOME/auth.json or the configured keyring backend.
  • Added login_with_bedrock_api_key(...), parallel to login_with_api_key(...), which replaces the current stored login with Bedrock credentials.
  • Reused generic auth reload and logout behavior instead of adding a Bedrock-specific auth manager or logout path.
  • Updated login restrictions, status reporting, diagnostics, telemetry classification, generated app-server schemas, and auth fixtures for the new mode.
  • Added explicit errors when Bedrock API key auth is selected with an OpenAI-compatible model provider.

This PR establishes managed storage and auth-mode behavior. Routing the managed key and region into Amazon Bedrock requests will be in follow-up PRs.

@celia-oai celia-oai changed the title changes Add managed Bedrock API key storage to AuthManager Jun 10, 2026
@celia-oai celia-oai changed the title Add managed Bedrock API key storage to AuthManager feat: add managed Bedrock API key storage to AuthManager Jun 10, 2026
@celia-oai celia-oai force-pushed the dev/cc/auth-manager-aws branch from 06792c5 to d846d16 Compare June 10, 2026 20:23
@celia-oai celia-oai force-pushed the dev/cc/auth-manager-aws branch 5 times, most recently from e0a2bf5 to a40c887 Compare June 10, 2026 23:07
@celia-oai celia-oai force-pushed the dev/cc/auth-manager-aws branch 2 times, most recently from 671a0f6 to 2a3b2b2 Compare June 10, 2026 23:20
@celia-oai celia-oai force-pushed the dev/cc/auth-manager-aws branch 3 times, most recently from 4994485 to c3e95a0 Compare June 10, 2026 23:59
@celia-oai celia-oai changed the title feat: add managed Bedrock API key storage to AuthManager feat: add Bedrock API key as a managed auth mode Jun 11, 2026
@celia-oai celia-oai requested a review from pakrym-oai June 11, 2026 00:11
@celia-oai celia-oai marked this pull request as ready for review June 11, 2026 00:11
@celia-oai celia-oai requested a review from a team as a code owner June 11, 2026 00:11
@celia-oai celia-oai force-pushed the dev/cc/auth-manager-aws branch from c3e95a0 to 1cd7a69 Compare June 11, 2026 00:13
@celia-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1cd7a69b77

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/login/src/auth/bedrock_api_key.rs
Comment thread codex-rs/model-provider/src/auth.rs
@celia-oai celia-oai merged commit 06afd63 into main Jun 11, 2026
31 checks passed
@celia-oai celia-oai deleted the dev/cc/auth-manager-aws branch June 11, 2026 03:42
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants