Skip to content

fix: add Anthropic WIF beta headers - #6890

Merged
lpcox merged 2 commits into
update-auth-proxy-docsfrom
lpcox-fix-anthropic-wif-headers
Aug 3, 2026
Merged

fix: add Anthropic WIF beta headers#6890
lpcox merged 2 commits into
update-auth-proxy-docsfrom
lpcox-fix-anthropic-wif-headers

Conversation

@lpcox

@lpcox lpcox commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add Anthropic SDK-compatible beta headers to JWT-bearer exchanges and bearer API requests
  • preserve and deduplicate client and auto-cache beta values without affecting static-key or refresh-token flows
  • cover exchange, request, validation, models, static-key, and merging behavior and document the supported contract

Validation

  • API proxy: 76 suites, 1,523 tests
  • repository unit tests: 287 suites, 4,972 passed, 1 skipped
  • lint, type-check, TypeScript build
  • Markdown lint and Astro documentation build

Stack

Targets update-auth-proxy-docs and should be merged after that base PR.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1bc91d4c-0fdf-40ff-94e6-250d18f08563
Copilot AI review requested due to automatic review settings August 3, 2026 16:26
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation build failed for this PR. View logs.

Built from commit 8c68c46

Copilot AI 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.

Pull request overview

Adds Anthropic WIF beta headers to JWT exchanges and bearer-authenticated requests.

Changes:

  • Adds and merges required Anthropic beta headers.
  • Enables OIDC validation and model discovery.
  • Expands tests and authentication documentation.
Show a summary per file
File Description
docs/authentication-architecture.md Documents beta-header routing.
docs/auth-matrix.md Updates WIF behavior matrix.
docs/api-proxy-sidecar.md Documents sidecar header contract.
containers/api-proxy/server.custom-auth-header.test.js Updates custom-header expectations.
containers/api-proxy/providers/anthropic.js Merges bearer, client, and cache betas.
containers/api-proxy/anthropic-oidc-token-provider.test.js Tests exchange headers.
containers/api-proxy/anthropic-oidc-token-provider.js Adds federation exchange headers.
containers/api-proxy/anthropic-adapter-auth.test.js Covers request-header behavior.
containers/api-proxy/adapter-factory.js Supports non-key credentials for startup operations.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +89 to +91
if (new URL(this._tokenEndpoint).pathname === '/v1/oauth/token') {
headers['anthropic-beta'] = `${OAUTH_API_BETA},${OIDC_FEDERATION_BETA}`;
}
@lpcox

lpcox commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@lpcox Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Done in fix: apply WIF beta headers unconditionally in _exchangeForAnthropicToken. Removed the /v1/oauth/token path guard and now set anthropic-beta unconditionally in the headers object for every _exchangeForAnthropicToken() call. Updated the "unrelated token paths" test to instead assert the headers are present for custom-path endpoints. All 12 tests pass.

@lpcox
lpcox merged commit 31b2cee into update-auth-proxy-docs Aug 3, 2026
3 checks passed
@lpcox
lpcox deleted the lpcox-fix-anthropic-wif-headers branch August 3, 2026 16:44
lpcox added a commit that referenced this pull request Aug 3, 2026
* docs: update authentication and API proxy guidance

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 01b67b6c-fcd9-4c60-8409-827495c49557

* fix: add Anthropic WIF beta headers (#6890)

* fix: add Anthropic WIF beta headers

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1bc91d4c-0fdf-40ff-94e6-250d18f08563

* fix: apply WIF beta headers unconditionally in _exchangeForAnthropicToken

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copilot-Session: 1bc91d4c-0fdf-40ff-94e6-250d18f08563

* feat: sign AWS Bedrock requests with SigV4 (#6891)

* feat: sign AWS Bedrock requests with SigV4

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 60f8a12a-5b5b-41d6-8cce-35c71f8c2ac5

* fix: reframe rewritten fallback requests

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 60f8a12a-5b5b-41d6-8cce-35c71f8c2ac5

---------

Copilot-Session: 60f8a12a-5b5b-41d6-8cce-35c71f8c2ac5

* docs: correct authentication trust boundaries

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 01b67b6c-fcd9-4c60-8409-827495c49557

* fix: isolate Actions OIDC from agent container (#6894)

* fix: isolate Actions OIDC from agent

Keep GitHub Actions OIDC request credentials in the API proxy sidecar.
Prevent default, env-all, env-file, and explicit environment paths from
exposing them to untrusted agent code.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 01b67b6c-fcd9-4c60-8409-827495c49557

* docs: clarify OIDC agent credential boundary

* docs: align OIDC isolation with MCP gateway

Describe the runner-owned gateway flow generated by gh-aw and add direct
regression coverage for env-file credential exclusion.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 01b67b6c-fcd9-4c60-8409-827495c49557

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copilot-Session: 01b67b6c-fcd9-4c60-8409-827495c49557

* fix: update brace-expansion to 5.0.9

Resolve GHSA-rgw5-rvv9-x895 in the main package dependency tree.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 01b67b6c-fcd9-4c60-8409-827495c49557

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copilot-Session: 01b67b6c-fcd9-4c60-8409-827495c49557
Copilot-Session: 1bc91d4c-0fdf-40ff-94e6-250d18f08563
Copilot-Session: 60f8a12a-5b5b-41d6-8cce-35c71f8c2ac5
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.

3 participants