Repository navigation
fix(ui): decide auth key expiry on the server - #704
Open
decky-grande wants to merge 1 commit into
Open
decky-grande wants to merge 1 commit into
decky-grande wants to merge 1 commit into
Conversation
Headscale stamps an expired key with its own clock, and the auth keys page compared that against the browser's clock. A browser even a second behind kept listing a key it had just expired as active, with its Expire button, until the next reload some time later. The loader now marks each key expired using the server's clock, and the status filter and row use that flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
ℹ️ No blocking issues — one non-blocking note below.
Approach: sound — expiry is now decided in the loader, where the clock that stamps the timestamp lives, and it matches how mapNodes already computes node expiry server-side.
Reviewed changes
Reviewed the full diff (4 files, 1 commit): the auth-keys loader annotates each key with expired from the server clock, the row and status filter read that flag, a regression test covers an expired key, and the changelog has a ## Fixes line.
- Server-side expiry flag.
overview.tsxsnapshotsDate.now()and marks every listed keyexpiredbefore returning it, so a browser clock behind the server no longer keeps a just-expired key active. - Row and filter read the flag.
auth-key-row.tsxand the status filter usekey.expired; the client-sidenew Date()comparison is gone. - Regression test. Expires a key through the action and asserts the loader lists it as
expired, which fails without the new field.
Non-blocking
- A key that expires while the page is open stays listed as active until the loader revalidates.
expiredis a loader-time snapshot, so once a key's expiry passes with the page open, its row keeps the Expire button and the Active filter keeps it; before this change, changing the status filter recomputednowand corrected both. overview.tsx
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
This branch has not been deployed
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.

Fixes #703.
Headscale stamps an expired key's
expirationwith its own clock, and the auth keys page compared that against the browser's clock. With the browser a second or two behind, a key that was just expired stayed listed as active, with its Expire button.The loader now marks each key
expiredusing the server's clock, and the status filter and the row read that flag instead of callingnew Date()in the browser.tests/integration/headplane/auth-keys.test.ts: expire a key, then check the loader lists it as expired. It fails before the change.# Next→## Fixes.pnpm test:unit,pnpm run typecheck,pnpm run lintand the auth keys integration tests pass locally against Headscale 0.29.5.🤖 Generated with Claude Code