Skip to content

fix(host-service): authorize remote heartbeat pings - #145

Merged
wolfiesch merged 1 commit into
LycaonLLC:mainfrom
brainage04:fix/remote-heartbeat-authorization
Jul 22, 2026
Merged

fix(host-service): authorize remote heartbeat pings#145
wolfiesch merged 1 commit into
LycaonLLC:mainfrom
brainage04:fix/remote-heartbeat-authorization

Conversation

@brainage04

Copy link
Copy Markdown
Contributor

What this changes

Allows protocol-level ping frames after remote connection policy state has been established.

Every post-hello remote frame passes through TailscaleRemotePolicy.authorize(), but heartbeat pings intentionally have no device capability. The generic missing-capability check therefore rejected the first ping and the server closed the socket with remote policy denied. The client starts heartbeats in both pairing and ready states, so the exception belongs immediately after the policy-state check rather than after principal authentication.

Commands, confirmations, terminal frames, leases, features, and capabilities retain their existing authorization paths. A ping only produces a pong containing the request nonce and server timestamp.

Adds a regression test covering all three boundaries:

  • ping before policy state is denied
  • ping while pairing is allowed
  • ping after device authentication is allowed

How you verified it

  • bun test packages/host-service/test/policy.test.ts — 12 passed, 0 failed
  • pnpm check — release consistency, provenance, lint, Flutter analysis, and all workspace typechecks passed
  • umask 022 && pnpm test — all workspace tests passed
  • Live paired Linux client check — connection returned connected, remained paired and connected for 22 seconds across the 15-second first-heartbeat boundary, and reported no remote runtime errors

Checklist

  • pnpm check passes (release contract, provenance, lint, typecheck)
  • pnpm test passes; new behavior has a test that fails without this change
  • Any pasted logs or screenshots are redacted: no secrets, tokens, pairing codes, or private paths
  • Ported code (T3 Code / OMP) follows the provenance rules in THIRD_PARTY_NOTICES.md — not applicable; this is a T4-owned policy correction

@wolfiesch
wolfiesch force-pushed the fix/remote-heartbeat-authorization branch from d57f248 to af8ddb7 Compare July 22, 2026 05:47
@wolfiesch
wolfiesch merged commit 0eb0749 into LycaonLLC:main Jul 22, 2026
11 checks passed
@brainage04
brainage04 deleted the fix/remote-heartbeat-authorization branch July 23, 2026 14:27
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.

2 participants