Skip to content

[codex] Add AWS Bedrock provider authentication#289

Open
HAYDEN-OAI wants to merge 3 commits into
mainfrom
dev/hayden/sdk-78-aws-credentials-file
Open

[codex] Add AWS Bedrock provider authentication#289
HAYDEN-OAI wants to merge 3 commits into
mainfrom
dev/hayden/sdk-78-aws-credentials-file

Conversation

@HAYDEN-OAI

Copy link
Copy Markdown

Summary

  • add an OpenAI::Providers.bedrock provider for Amazon Bedrock's OpenAI-compatible API
  • support bearer credentials, static AWS credentials, refreshable credential providers, named profiles, and the standard AWS credential chain, including ~/.aws/credentials
  • sign each request attempt with SigV4 and prevent signed requests from following redirects or authenticating a different origin
  • isolate provider routing and authentication from ambient OpenAI client configuration
  • add RBI/RBS types, setup documentation, a runnable example, a shared SigV4 fixture, and focused regression tests

Why

The Ruby SDK did not have a supported provider-authentication path for AWS Bedrock, so applications could not use their normal AWS credentials file or runtime credential chain with the standard OpenAI client. This brings Ruby in line with the provider architecture used by the Node and Python SDKs.

Linear: SDK-78

User impact

Ruby users can now construct the normal client with OpenAI::Providers.bedrock(...) and use AWS environment credentials, shared credentials/config files, named profiles, SSO or assume-role profiles, workload identities, explicit static credentials, or refreshable providers. AWS authentication loads aws-sdk-core as an optional dependency; bearer authentication does not require it.

Provider authentication is applied immediately before every transport attempt, so retries receive fresh credentials and a fresh signature over the exact serialized body and retry headers.

Validation

  • focused Bedrock, client, and workload-identity suites: 60 runs, 226 assertions, 0 failures, 0 errors
  • Bedrock implementation coverage: 98.7% lines, 96.5% branches, 100% methods
  • provider registry coverage: 100% lines, branches, and methods
  • RuboCop and type checks pass
  • git diff --check passes
  • gem package isolation check passes

The full generated resource suite requires the local Prism mock server on localhost:4010; without it, those tests stop on expected connection errors. CI provisions that dependency.

@HAYDEN-OAI HAYDEN-OAI marked this pull request as ready for review June 22, 2026 18:27
@HAYDEN-OAI HAYDEN-OAI requested a review from a team as a code owner June 22, 2026 18:27

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

Copy link
Copy Markdown

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: 4af7fdf180

ℹ️ 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 lib/openai/providers/bedrock.rb Outdated

@jliccini jliccini left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inline review of the default Bedrock endpoint.

Comment thread lib/openai/providers/bedrock.rb Outdated

@jliccini jliccini left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approving but noting that the URL thing Codex found might be important. I am not a Bedrock expert but the Ruby lgtm

@jliccini jliccini left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ruby truthiness and optional-value validation review.

Comment thread lib/openai/client.rb Outdated
Comment thread lib/openai/providers/bedrock.rb Outdated

@jliccini jliccini left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ruby exception-boundary review.

Comment thread lib/openai/providers/bedrock.rb

@jliccini jliccini left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ruby public-type and exception-contract review.

Comment thread lib/openai/client.rb Outdated
Comment thread lib/openai/providers/bedrock.rb Outdated
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.

2 participants