chore(deps): collapse duplicated majors and move off unmaintained lines - #6861
Merged
Conversation
v1 is unmaintained and stuck on the pre-modules layout. The v3 API we use (NewVersion, MustParse, LessThan, GreaterThan, Original, String) is unchanged, so the move is an import path rewrite in the agent and server modules.
The server already signed web-terminal tokens with v5 while jwttoken and LoadKeys stayed on v4, so both majors were linked into the same binary. v5 keeps RegisteredClaims, NewNumericDate and ParseWithClaims as we use them, so this is an import path rewrite that leaves one JWT library.
go-redis/redis v8 is archived; the maintained line moved to redis/go-redis/v9, which asynq already pulled in, so the binary carried two clients. The cache wrapper only uses ParseURL, NewClient, SetNX and go-redis/cache's Item, all unchanged in v9.
The integration test module reaches golang-jwt through the root module, so pinning v5.3.1 there moves its indirect requirement too.
Both modules redirect gliderlabs/ssh to the same fork, so the stale v0.3.5 requirement in the agent was inert — but it decides the version the moment the replace goes away, and it should not disagree with the server's v0.3.8.
The agent pins the 28.x backport commit for CVE-2026-34040 while the integration test module stayed on v28.5.2, so the two disagreed on the same client library. Both now build against the patched commit.
|
Claude finished @otavio's task in 2m 4s —— View job Code Review CompleteReviewed 20 files across code quality, security, testing, language patterns, and architecture — no new issues found. The code looks good as-is. This is a clean, mechanical dependency consolidation. I verified each migration against the actual call sites rather than only the diff:
One operational note for the deploy (not a code defect, no change requested): go-redis v9 negotiates RESP3 by default, whereas v8 spoke RESP2. This is transparent for Redis ≥ 6.0 but worth keeping in mind if any target environment still runs Redis 5.x. To request another review round, comment |
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
Collapsed four dependencies that were linked into the binaries at two majors
at once, and moved two unmaintained ones to their current line: golang-jwt to
v5, go-redis to v9, Masterminds/semver to v3, plus alignment of the agent's
gliderlabs/ssh and docker requirements with the rest of the workspace.
Why
Each of these had the same shape: the codebase already depended on the newer
major somewhere, so both were compiled in. The server signed web-terminal
tokens with golang-jwt v5 while
pkg/api/jwttokenandLoadKeysstayed onv4; asynq pulled in
redis/go-redis/v9while the cache wrapper still used thearchived
go-redis/redis/v8. Two copies of a JWT or Redis client in one binaryis a latent source of type mismatches and duplicated connection pools, and the
v8/v1 lines no longer receive fixes.
Changes
pkg/api/jwttokenandserver/api/services/utils.go(
LoadKeys).RegisteredClaims,NewNumericDateandParseWithClaimsbehave the same in v5, so this is an import path rewrite; v5 is now the only
JWT library in the tree.
pkg/cache/cache_redis.goandgo-redis/cache/v8→/v9. The wrapper only usesParseURL,NewClient,SetNXand cache'sItem, all unchanged.unmaintained; the API we use (
NewVersion,MustParse,LessThan,GreaterThan,Original,String) is identical.gliderlabs/sshv0.3.5 againstthe server's v0.3.8. The shared
replacemade the requirement inert today,but it decides the resolved version the moment that replace goes away.
CVE-2026-34040 backport (the test module was still on v28.5.2), and retidied
after the JWT bump.
Testing
The JWT change is the one worth probing: tokens minted before this branch must
still parse, so check login and web-terminal auth against an existing session
rather than only a fresh one. The Redis change is exercised by the cache tests,
which run against a real Redis via testcontainers.
The matching cloud change is shellhub-io/cloud#2475 — cloud's
replacepoints at this branch, so CI there resolves against it.