You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: api-proxy auth chain — trim keys, align placeholder format, add diagnostics (#1528)
* fix: api-proxy auth chain — trim keys, align placeholder format, add diagnostics
Three fixes for the Anthropic API proxy auth chain failure (#1527):
1. Trim API keys read from env vars in api-proxy (server.js)
CI secrets and docker-compose YAML may include trailing whitespace
or newlines. Untrimmed keys produce malformed HTTP headers (the
newline terminates the header prematurely), causing silent auth
failures with error_status: null.
2. Align ANTHROPIC_AUTH_TOKEN placeholder with sk-ant- key format
Claude Code validates key format before making API calls. The old
placeholder 'placeholder-token-for-credential-isolation' lacks the
sk-ant- prefix and may fail format validation. Now uses the same
value as apiKeyHelper: 'sk-ant-placeholder-key-for-credential-isolation'.
3. Add auth header injection + upstream error logging in api-proxy
- 'auth_inject' debug log confirms key injection (length, preview)
- 'upstream_auth_error' warning on 401/403 from upstream API
Closes#1527
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: update health check to match new ANTHROPIC_AUTH_TOKEN placeholder
The api-proxy-health-check.sh validates that ANTHROPIC_AUTH_TOKEN
contains a placeholder value. Update the expected value to match
the new sk-ant- prefixed placeholder set in docker-manager.ts.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments