Repository navigation
Conversation
Persist per-token revocations in the node datastore and cancel active authenticated requests, including WebSocket sessions. Add admin RPC and CLI revocation with regression coverage.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5364 +/- ##
==========================================
+ Coverage 40.06% 40.50% +0.44%
==========================================
Files 323 324 +1
Lines 22484 22572 +88
==========================================
+ Hits 9008 9143 +135
+ Misses 12412 12358 -54
- Partials 1064 1071 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
[High impact] No identified issues block merging.
|
chatton
left a comment
There was a problem hiding this comment.
Sorry for the late review! Looks good overall, left a few small suggestions
Reuse parsed JWTs for permission checks and revocation keys. Combine verification and session registration while preserving the revocation lock, invalid-token checks, and active request cancellation. Keep the README usage example and remove CHANGELOG_PENDING.md as requested in review. The feature commit records persistent revocation; the Go API adds node.AuthRevoke and changes rpc.NewServer to accept *authtoken.Verifier.
Issued JWTs cannot currently be invalidated individually. This adds admin-only
node.AuthRevoke(token)andcelestia node revoke-token, backed by the existing node datastore. Revoked tokens stop authenticating, their active WebSocket sessions and subscriptions disconnect, and unrelated tokens remain valid.Closes #4816.
Approach
/auth/revoked/. This supports existing tokens, including legacy tokens without nonces, and prevents alternate signature encodings from bypassing revocation.node.AuthVerify. Parse and verify each token once, then reuse it for permission and revocation checks. Datastore read failures reject authentication.This follows up on the discussion in #5132 using the existing datastore and request lifecycle, without a separate revocation file or connection tracker.
Usage and scope
A local operator can instead supply
--node.store <path>. The node must be running with RPC authentication enabled. Revocation records persist across restarts and are retained indefinitely. Offline revocation, issued-token listing, and refresh flows are outside this change. Revocation cannot undo operations already performed by an in-flight request.Breaking Go API change:
rpc.NewServernow accepts*authtoken.Verifierinstead ofjwt.Verifier;node.ModulegainsAuthRevoke. The JWT format and existing RPC methods remain unchanged.Validation
make test-unitpassed. Coverage packages run serially to prevent port collisions between test processes that allocate from the same deterministic port range.go test -short -p 1 ./...passed. The initial parallel run encountered a port collision inTestEstimatorService; the isolated retry and serial suite passed.go test -race ./libs/authtoken ./api/rpc ./nodebuilder/node ./nodebuilder/rpc ./nodebuilder/node/cmdpassed.Coverage includes single-pass token parsing, persistent storage reopening, legacy/expired/foreign tokens, alternate signature encodings, storage errors, concurrent registration/revocation, session cleanup, admin authorization, HTTP rejection, active WebSocket termination, reconnect rejection, self-revocation, and CLI routing.
Changed-package
go vet, formatting/import checks, andgolangci-lint v2.10.1 run --new-from-rev=origin/main ./...passed.CLI build/help and OpenRPC generation passed; the generated schema includes admin-only
node.AuthRevoke.Repository-wide
go vet ./...still reports the existing discarded timeout cancellation atcmd/rpc.go:88, unchanged fromorigin/main.