Repository navigation
feat(socket-auth): add socket.token() to mint realtime socket tokens - #45
Merged
Merged
Conversation
Adds a Socket helper on the client (fleetbase.socket.token()) that calls
POST socket/token and resolves to { token, expires_in, expires_at }.
Documents the server-side mint / browser authenticate flow.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/v2.1.0 #45 +/- ##
================================================
Coverage 100.00% 100.00%
================================================
Files 17 18 +1
Lines 855 860 +5
Branches 143 143
================================================
+ Hits 855 860 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Oct 6, 2026
feat(socket-auth): show channel authorization failures in the sockets viewer
fleetbase/dev-engine#51
Merged
Merged
3 tasks done
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.
What
Sockethelper exposed asfleetbase.socket;fleetbase.socket.token(options?)callsPOST socket/tokenand resolves to{ token, expires_in, expires_at }(exported typeSocketTokenResponse).setAdapter()also moves the socket helper to the new adapter.socketcluster-clientusing an in-memoryauthEngine/socket.authenticate(token)and refreshing ~60 s before expiry.Why
Fleetbase realtime channels are moving to authenticated subscriptions. API customers need a supported way to exchange their secret key for a short-lived socket token on their own server, so the browser only ever sees the token.
Test plan
tests/core.test.tscover the request path/body/options, adapter replacement and error propagation (100% coverage gate).Related PRs
Part of the authenticated realtime channels rollout (socket auth), one PR per repo:
fleetbase/core-api ^1.6.69)fleetbase/fleetbase-socketserver, compose/helm/installer, console socket test page