Repository navigation
Conversation
serveBase starts a second Server over the notes and token file an earlier one used, which is what a restarted process has and nothing more. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…231) A session was a random id in the daemon's memory, so every restart, upgrade and reboot logged every device out. It is now a signed value: v1.<issued-at>.<random id>.<HMAC-SHA256>, the MAC over the fields and the tailnet name, keyed by a key derived from the token (token.Store.Derive). Nothing about sessions is held in memory or on disk, so: - a daemon started over the same token file derives the same key and accepts the cookie the browser kept; - mdn token --rotate, or a token file replaced while stopped, changes the key, and every older cookie fails its MAC on the next request; - no secret is at rest beyond the token file. A session a day old or more is reissued on a request the guard serves, with Max-Age equal to the idle limit (session.Idle, 30 days pending the operator's answer on the checkpoint), and refused once unused for that long. The token's generation counter is replaced by the derived key; AuthenticateDerive keeps the one-read guarantee the login needs. The throttle, loopback, the bearer token's exemption and the cookie's attributes are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chromium logs in through a local TLS proxy that stands in for tailscale serve; the daemon is stopped and started and the same cookie is still a session; a rotation while running, and one while stopped, end it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The introduction's browser-on-the-tailnet section and the running guide: a login survives restarts and upgrades, ends on rotation or after 30 days unused, and every device logs in once more at the upgrade to v0.3.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review nit 3 on PR #232: removing the id-length check went unnoticed. Three re-signed cases, a byte short, a byte long and empty, now fail against that mutation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#231) Review nits 2 and 4 on PR #232: the introduction's rotation bullet says that writing an earlier token back makes its sessions good again, up to the idle limit; docs/running.md no longer says an upgrade never logs a device out, and is rewrapped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…me (#231) The operator chose a 30-day idle limit on the checkpoint; the page now says idle, as the introduction does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Closing: opened from a fresh branch name ( |
This was referenced Sep 30, 2026
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.
Closes #231
Replaces #233 and #232, which GitHub never linked to #231. The review rounds are on #232: #232 (comment)
A tailnet login now survives daemon restarts, upgrades and reboots, and ends when the token is rotated. Milestone M12 (#230); this adopts capture #229, which
task finishcloses.What changed
internal/session: the in-memory store is replaced by a stateless signed value:v1.<issued-at>.<random id>.<HMAC-SHA256>. The MAC covers the fields and the tailnet host name, and its key is derived from the token. The check is strict about shape, compares withhmac.Equal, and refuses an issued-at from the future or one past the idle limit.internal/token: the generation counter is replaced byDerive(purpose)andAuthenticateDerive(presented, purpose), which keep the one-read guarantee the login relies on.internal/server: the guard checks the cookie against the key of the token in force now. It reissues a session a day old or more, but only on a response it serves. Every cookie, whether from a login or a reissue, gets the same attributes from one function.docs/running.mdandcontrib/mdn.1say how long a login lasts, what ends it, and that every device logs in once more at the upgrade to v0.3.1.Requirements
TestTailnetSessionSurvivesARestart, andui/e2e/tailnet-session.test.mjsin Chromium behind TLS. The upgrade and newer-build legs were measured with a scratch rig; the table is in the Decision linked below.TestTailnetRotationEndsTheSession(existing),TestTailnetRotationWhileStoppedEndsTheSession,TestTailnetRotationEndsTheSessionAcrossARestart,TestTailnetCookieFromAnotherTokenIsRefused,TestTailnetCookieIsBoundToItsHostName,TestTailnetRejectsAForgedCookie(existing), and the session package's tamper, truncation and other-key tests. The e2e suite covers rotation while running and while stopped.TestTailnetSessionIsRefreshedOnUse,TestTailnetUnusedSessionLapsesandTestTailnetRefusedRequestIsNotReissued. The idle limit is 30 days, chosen by the operator on the checkpoint (option A, Tailnet sessions that survive restarts and end on rotation #231 (comment)). It lives insession.Idle(internal/session/session.go:48) and in the docs atdocs/introduction.md:431(Max-Age=2592000in theSet-Cookieexample),:448,:451-452, andcontrib/mdn.1:59-60. Each says the limit counts idle time, not a fixed lifetime.Decisions and deviations
TestTailnetSessionExpiresbecameTestTailnetUnusedSessionLapses, andTestLoggingInAgainEndsTheOldSessionbecameTestLoggingInAgainIssuesAFreshSession. The Decision above records the trade-off.Checks
make checkandmake e2epass locally (Chromium 153). Run against the v0.3.0 tree's binary, the new e2e suite fails on the restart leg, as it should.No
featcommit: nothing user-facing is added. The commits arefix,test, and onedocsfor the prose.🤖 Generated with Claude Code