fix(hubclient): remove dead GetWSTicket client code - #1435
Closed
ptone wants to merge 2 commits into
Closed
Conversation
The GetWSTicket() method on AuthService posts to POST /api/v1/auth/ws-ticket, but no such route is registered on the hub server. No production code calls GetWSTicket(), and WebSocket connections (e.g. the PTY terminal) authenticate via session cookies on the same origin — no ticket exchange is needed. Remove the dead interface method, its implementation, the WSTicketResponse type, and the corresponding mock stubs in test files.
Owner
Author
Code Review: APPROVE ✅Risk: LOW — Pure dead-code removal (0 additions, 24 deletions). (Posted as comment because the token cannot self-approve.) Verified
Notes
Clean change. No findings. |
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.
Summary
GetWSTicket()method from theAuthServiceinterface and its implementation inpkg/hubclient/auth.goWSTicketResponsetypepkg/hub/auth/device_flow_test.goandcmd/hub_auth_test.goDecision Rationale
Decision: Remove the dead code (rather than implement the missing server route).
Investigation findings:
GetWSTicket()is only referenced in its own definition (interface + implementation) and two mock stubs in test files. No production code invokes it.web/src/components/pages/terminal.ts) connects vianew WebSocket(url)using same-origin session cookies. No ticket-based auth exchange is needed.POST /api/v1/auth/ws-ticketis not registered on the hub server, so the client method would always fail if called.Keeping a client method that posts to a non-existent endpoint is misleading and adds unnecessary surface area to the
AuthServiceinterface.Test plan
go build ./...passesgo vet ./...passesgo test ./pkg/hubclient/... ./pkg/hub/auth/... ./cmd/...— all pass