Skip to content

Throw for control plane 403s#390

Open
knjiang wants to merge 3 commits intomainfrom
ken/fix-handling-401s
Open

Throw for control plane 403s#390
knjiang wants to merge 3 commits intomainfrom
ken/fix-handling-401s

Conversation

@knjiang
Copy link
Contributor

@knjiang knjiang commented Feb 13, 2026

401s have to be passthrough in order to allow for raw OPENAI_API_KEY auth headers but 403s should be thrown since we know they aren't authorized.

@vercel
Copy link

vercel bot commented Feb 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-proxy Ready Ready Preview, Comment Feb 14, 2026 0:03am

Request Review

Copy link

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

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: aac2ec424f

ℹ️ 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 on lines 253 to 254
if (response.status === 401 || response.status === 403) {
throw new Error(responseText);

Choose a reason for hiding this comment

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

P1 Badge Let control-plane 403 errors escape lookup fallback

Throwing here does not enforce the new 403 behavior because the surrounding try/catch in makeFetchApiSecrets immediately catches this error, marks lookupFailed, and then falls back to the provided auth token. When /api/secret returns 403 (the unauthorized case this commit targets), requests still proceed with fallback credentials instead of failing, which can bypass control-plane authorization decisions.

Useful? React with 👍 / 👎.

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.

1 participant

Comments