fix(ingress): route the whole /api surface through the Bearer-token ingress#429
Merged
Conversation
…ngress (#428) The enumerated whitelist was last extended at #174, silently 404ing every API added since (hypervisor, files, skills, gateway, webhooks, crons, provider-keys, mcp-servers, workspace) for Bearer-token clients on oauth2 deployments. Auth was never enforced by the list: the /bearer-api marker + check_claude_auth gate every endpoint server-side (#161), and the one intentionally unauthenticated /api endpoint (the WhatsApp webhook verify) is provider-signature-gated and already public via its own ingress. Broaden to api/.* and pin the posture with helm unittests so the regex and marker can't regress unnoticed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What & why
Fixes #428. The Bearer-token API ingress enumerated allowed prefixes (last extended at #174), so every API shipped since —
api/hypervisor/*,api/files/*,api/skills,api/gateway/*(mobile Walkie),api/webhooks,api/crons,api/provider-keys,api/mcp-servers,api/workspace/*— 404'd at nginx for Bearer-token clients (the mobile app) on oauth2 deployments.Why broadening to
api/.*is safe (audited): the whitelist never was the auth boundary. Every request through this ingress is rewritten to/bearer-api/$1, which makescheck_claude_authrequire the Bearer token and distrust upstream identity headers (#161) — and an audit of all/apihandlers confirms each one callscheck_claude_authserver-side. The single exception, the WhatsApp webhook verify, is provider-signature-gated and already exposed publicly via its own dedicated ingress, so this adds no new surface./healthstays intentionally open as a liveness probe.Testing
tests/bearer_api_ingress_test.yamlpins the broadened path regex, the/bearer-api/$1rewrite marker, and absence outside oauth2 mode — so neither the coverage nor the auth marker can regress silently.helm lintclean;helm unittest: 107 passed (3 new)./(api/.*|metrics|health).🤖 Generated with Claude Code