Skip to content

feat: prefer managed Bedrock auth in model provider#27689

Merged
celia-oai merged 1 commit into
mainfrom
dev/cc/provider-auth-managed-2
Jun 11, 2026
Merged

feat: prefer managed Bedrock auth in model provider#27689
celia-oai merged 1 commit into
mainfrom
dev/cc/provider-auth-managed-2

Conversation

@celia-oai

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

Copy link
Copy Markdown
Contributor

Why

The Amazon Bedrock model provider currently discards the shared AuthManager, so a Codex-managed Bedrock API key cannot reach request-time provider auth. Bedrock instead falls through to AWS environment or SDK credentials, and the request endpoint can be resolved from a different region than the managed credential.

Managed Bedrock login should control both the bearer credential and Mantle region. Unrelated OpenAI or ChatGPT credentials must remain isolated from Bedrock.

What changed

  • Pass the shared AuthManager into AmazonBedrockModelProvider.
  • Select CodexAuth::BedrockApiKey before the existing AWS_BEARER_TOKEN_BEDROCK and AWS SDK/SigV4 paths.
  • Use the managed Bedrock auth region when resolving the Mantle endpoint.
  • Filter other CodexAuth variants so OpenAI and ChatGPT auth are not exposed to Bedrock request auth or unauthorized recovery.
  • Add focused coverage for provider construction, managed-auth precedence, bearer headers, endpoint selection, and OpenAI-auth isolation.

@celia-oai celia-oai changed the title [codex] Prefer managed Bedrock auth in model provider feat: prefer managed Bedrock auth in model provider Jun 11, 2026
@celia-oai
celia-oai marked this pull request as ready for review June 11, 2026 22:28
@celia-oai
celia-oai requested a review from pakrym-oai June 11, 2026 22:29
@celia-oai
celia-oai merged commit b7a5d81 into main Jun 11, 2026
31 checks passed
@celia-oai
celia-oai deleted the dev/cc/provider-auth-managed-2 branch June 11, 2026 22:33
@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.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants