Skip to content

Fix allowTailscale bypass for token auth in Serve mode#823

Merged
steipete merged 2 commits intoopenclaw:mainfrom
roshanasingh4:fix/820-tailscale-allow-token
Jan 13, 2026
Merged

Fix allowTailscale bypass for token auth in Serve mode#823
steipete merged 2 commits intoopenclaw:mainfrom
roshanasingh4:fix/820-tailscale-allow-token

Conversation

@roshanasingh4
Copy link
Copy Markdown
Contributor

Fixes #820.

Problem: gateway.auth.allowTailscale was computed and logged as true, but authorizeGatewayConnect() enforced token_missing/password_missing before checking Tailscale identity headers. In Tailscale Serve mode this prevents tailnet clients from authenticating via tailscale-user-* headers as documented.

Solution: accept valid Tailscale Serve proxy requests (loopback + required x-forwarded-* headers + tailscale-user-login) as method: tailscale before falling back to token/password checks. Keep the stricter behavior for auth.mode: none (tailscale required unless local-direct).

Adds a regression test covering token-mode + allowTailscale + valid Serve headers.

@steipete steipete self-assigned this Jan 13, 2026
@steipete
Copy link
Copy Markdown
Contributor

Thanks Roshan!

@steipete steipete force-pushed the fix/820-tailscale-allow-token branch from 98ec8e1 to b70298f Compare January 13, 2026 04:39
@steipete steipete merged commit 8a9096c into openclaw:main Jan 13, 2026
17 of 21 checks passed
@steipete
Copy link
Copy Markdown
Contributor

Landed via temp rebase onto main.\n\n- Gate: pnpm lint && pnpm build && pnpm test\n- Land commit: b70298f\n- Merge commit: 8a9096c\n\nThanks @roshanasingh4!

@steipete
Copy link
Copy Markdown
Contributor

Gate note: pnpm lint failed before build/test due to existing lint issues (src/commands/auth-choice.ts unused import MINIMAX_HOSTED_MODEL_REF; src/agents/pi-embedded-helpers.test.ts formatting). Build/test not run.

victorarias pushed a commit to victorarias/clawdbot that referenced this pull request Jan 13, 2026
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…allow-token

Fix allowTailscale bypass for token auth in Serve mode
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…allow-token

Fix allowTailscale bypass for token auth in Serve mode
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.

gateway.auth.allowTailscale: true not working in Serve mode

2 participants