Remove anthropic api token from http auth#564
Open
stuartc wants to merge 2 commits into
Open
Conversation
An inbound api_key is now only ever a client credential, never forwarded to the LLM: - known client -> swap in its stored Anthropic key - known client, NULL key -> 500 (server misconfig, reported to Sentry) - unknown key -> 401 (verified unknown) / 503 (store unreachable) - no api_key -> global ANTHROPIC_API_KEY, else 401 Drops the sk-ant- shape check and the `forward` KeyResolution tag. Also trims unactionable logging (internal-token mismatch and max-staleness eviction no longer warn/report) and tidies comments in instance-auth.ts.
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "apollo": patch | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short Description
Tightens instance auth so an inbound
api_keyis only ever treated as a client credential, never forwarded to Anthropic. Drops the oldsk-ant-bring-your-own-key path.Fixes #
Implementation Details
Previously an unknown
sk-ant--shaped key was forwarded to the LLM as a bring-your-own key. That path is gone. Anapi_keynow resolves one of four ways:NULLstored key → 500 (server misconfig, reported to Sentry)api_key→ globalANTHROPIC_API_KEY, else 401Removed the
forwardKeyResolutiontag and the shape check that went with it. Also trimmed a couple of log lines that were either routine or not actionable: the internal-token mismatch no longer reports to Sentry (it's a config/forgery signal, not a bug), and a max-staleness cache eviction no longer warns (happens whenever the DB lags). Tidied the comments ininstance-auth.tswhile I was in there.AI Usage