mirror of
https://github.com/tailscale/tailscale.git
synced 2026-12-03 07:02:33 -08:00
Add end-to-end gate tests driving serveWebHandler with a Funnel context: unauthenticated bounce to control, valid-session admission with identity passthrough, allowlist 403, expired-session re-auth, reserved callback/ logout interception, redirect-loop guard, and an unauthenticated-funnel regression that asserts today's behavior is unchanged. Document the manual browser round-trip steps that need a live dev control plane. Writing the tests surfaced a gate-bypass: the reserved-path interceptor was keyed on the matched handler's Auth, so an app route registered directly under /.well-known/tailscale/funnel-auth/ (whose own handler had no Auth) fell through to the backend. Intercept the reserved prefix before mount matching whenever the funnel host has any Auth-configured handler, so the node owns the entire prefix; keep the gate itself per matched mount point (Auth is per-mount). Factor the host/config resolution out of getServeHandler into webServerConfigForRequest for reuse. Updates tailscale/corp#38806 Change-Id: I39f77a6f4d2ca20101f4c7b041c24065edf13c63 Signed-off-by: Kabir Sikand <[email protected]>