Anthropic workload identity federation#551
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7e1f36bd7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
| headers["anthropic-version"] = "2023-06-01"; | ||
| headers["host"] = fullURL.host; | ||
| headers["x-api-key"] = secret.secret; | ||
| Object.assign(headers, anthropicAuthHeaders(secret)); |
There was a problem hiding this comment.
Drop stale x-api-key before setting Anthropic bearer auth
In the /chat/completions Anthropic path, this line only merges authorization for WIF secrets, but the mutable headers object can already contain the caller's proxy auth x-api-key. When clients authenticate to this proxy with x-api-key, that token is forwarded upstream together with the new bearer token, which can break Anthropic auth and leaks the proxy credential to the model provider. Clear x-api-key before applying bearer auth for this flow.
Useful? React with 👍 / 👎.
When it's used, we need to send a Bearer token