Skip to content

fix(ingress): route the whole /api surface through the Bearer-token ingress#429

Merged
imran31415 merged 1 commit into
mainfrom
kc/issue-428-bearer-ingress
Jul 23, 2026
Merged

fix(ingress): route the whole /api surface through the Bearer-token ingress#429
imran31415 merged 1 commit into
mainfrom
kc/issue-428-bearer-ingress

Conversation

@umi-appcoder

@umi-appcoder umi-appcoder Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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 makes check_claude_auth require the Bearer token and distrust upstream identity headers (#161) — and an audit of all /api handlers confirms each one calls check_claude_auth server-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. /health stays intentionally open as a liveness probe.

Testing

  • New tests/bearer_api_ingress_test.yaml pins the broadened path regex, the /bearer-api/$1 rewrite marker, and absence outside oauth2 mode — so neither the coverage nor the auth marker can regress silently.
  • helm lint clean; helm unittest: 107 passed (3 new).
  • Rendered with oauth2 values and verified the emitted path is /(api/.*|metrics|health).

🤖 Generated with Claude Code

…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>
@imran31415
imran31415 merged commit c23657a into main Jul 23, 2026
9 checks passed
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.

audit(ingress): Bearer-token API ingress whitelist is missing most post-#174 APIs (hypervisor, files, skills, gateway, webhooks)

1 participant