Skip to content

fix(bedrock): preserve bearer token env compatibility - #6167

Merged
cdoern merged 1 commit into
ogx-ai:mainfrom
skamenan7:fix/bedrock-env-compat
Jun 23, 2026
Merged

fix(bedrock): preserve bearer token env compatibility#6167
cdoern merged 1 commit into
ogx-ai:mainfrom
skamenan7:fix/bedrock-env-compat

Conversation

@skamenan7

@skamenan7 skamenan7 commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • preserve compatibility after the intentional Bedrock bearer-token rename to AWS_BEDROCK_BEARER_TOKEN
  • keep AWS_BEDROCK_BEARER_TOKEN as the canonical documented Bedrock bearer token env var
  • add fallback support for the legacy AWS_BEARER_TOKEN_BEDROCK env/config name where older callers, CI secrets, or local scripts may still provide it
  • pass both bearer-token names through integration and record workflows so existing secrets continue to work during the transition
  • add an optional Bedrock recording path for the STS web identity auth introduced in feat(bedrock): add AWS SigV4 and STS web identity authentication #5388, gated by an AWS_BEDROCK_ROLE_ARN GitHub secret
  • pass standard AWS credential-chain env vars through Docker integration test runs

Context

This compatibility gap came up while looking at #6106-related CI/re-recording follow-up, but #6106 is not the cause of the rename. The Bedrock env var rename was intentional and documented as part of the AWS-native auth naming work.

The failed re-record job showed AWS_BEDROCK_BEARER_TOKEN was set but Bedrock rejected that credential, so the immediate failure still looks like a stale/invalid bearer token. Separately, #5388 already added SigV4 + STS web identity support in the provider, but the record workflow had not prepared AWS_ROLE_ARN/AWS_WEB_IDENTITY_TOKEN_FILE for Bedrock. This PR wires that optional workflow path without removing the current bearer-token fallback.

Test Plan

  • uv run pytest tests/unit/providers/inference/test_bedrock_config.py tests/unit/providers/inference/bedrock/test_sigv4_auth.py -q
  • uv run pre-commit run check-yaml --files .github/workflows/record-integration-tests.yml
  • uv run pre-commit run actionlint --files .github/workflows/record-integration-tests.yml
  • pre-commit via git commit hooks

Signed-off-by: Sumanth Kamenani <skamenan@redhat.com>
@cdoern

cdoern commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

I wonder, is this why the bedrock re-recording failed?

@skamenan7

skamenan7 commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator Author

I wonder, is this why the bedrock re-recording failed?

@cdoern I don’t think the failed re-record is caused directly by the env var rename. The job env showed
AWS_BEDROCK_BEARER_TOKEN was set, and the error looks like Bedrock rejected the provided credential value.

I opened this PR as a small compatibility follow-up anyway: it keeps AWS_BEDROCK_BEARER_TOKEN as the canonical documented name, but also accepts/passes through the legacy AWS_BEARER_TOKEN_BEDROCK name so older CI/local paths don’t silently fall back to SigV4/no-token behavior during the transition.

@skamenan7
skamenan7 marked this pull request as ready for review June 23, 2026 13:11
@cdoern
cdoern enabled auto-merge June 23, 2026 13:18
@cdoern
cdoern added this pull request to the merge queue Jun 23, 2026
Merged via the queue into ogx-ai:main with commit 78328a1 Jun 23, 2026
47 checks passed
skamenan7 added a commit to skamenan7/llama-stack that referenced this pull request Jun 30, 2026
## Summary
- add an optional Bedrock recording path for the STS web identity auth
introduced in ogx-ai#5388
- when AWS_BEDROCK_ROLE_ARN is configured, request a GitHub OIDC token
for sts.amazonaws.com and expose
AWS_ROLE_ARN/AWS_WEB_IDENTITY_TOKEN_FILE to the Bedrock provider
- keep the current bearer-token path as fallback when
AWS_BEDROCK_ROLE_ARN is not configured
- pass standard AWS credential-chain env vars through Docker integration
test runs

## Context
ogx-ai#6167 preserved compatibility between AWS_BEDROCK_BEARER_TOKEN and the
legacy AWS_BEARER_TOKEN_BEDROCK name. That PR is now merged.

The remaining question from the failed Bedrock re-record is whether CI
ever moved onto the STS/OIDC auth path from ogx-ai#5388. The provider already
supports SigV4 + web identity, but the record workflow did not prepare
AWS_ROLE_ARN/AWS_WEB_IDENTITY_TOKEN_FILE for Bedrock. This PR wires that
optional path without removing the bearer-token fallback.

To use it, configure an AWS_BEDROCK_ROLE_ARN repository secret for the
role trusted by GitHub Actions OIDC.

## Test Plan
- uv run pytest tests/unit/providers/inference/test_bedrock_config.py
tests/unit/providers/inference/bedrock/test_sigv4_auth.py -q
- uv run pre-commit run check-yaml --files
.github/workflows/record-integration-tests.yml
- uv run pre-commit run actionlint --files
.github/workflows/record-integration-tests.yml
- pre-commit via git commit hooks from original commit

Signed-off-by: Sumanth Kamenani <skamenan@redhat.com>
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