Repository navigation
Conversation
deriveRegistryID dropped a port by cutting the host at the first ':'. For an IPv6 literal URL such as https://[2606:4700:4700::1111]/ that left only the first group, so the id became "2606" and a second registry in the same /16 was refused as a duplicate id. Pass u.Hostname(), which already strips the port and brackets, and drop the cut.
rudycelekli
force-pushed
the
fix/registry-id-ipv6-host-20261024-01
branch
from
October 24, 2026 22:18
c7573cf to
ffc5042
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Dumbris
approved these changes
Oct 26, 2026
Dumbris
left a comment
Member
There was a problem hiding this comment.
Verified: the PR test fails on main for the reason described and passes on this branch merged with main; race tests for the touched packages and CI lint (bare and server tags) are clean. Also built and tested together with the rest of this batch, independently reviewed, and cross-reviewed with a second model.
Member
|
Merged. Thank you, @rudycelekli! IPv6 registry sources derive a full, unique id instead of |
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.
Problem
When
registry add-sourceis called without--id,buildRegistrySourceEntryderives the id fromu.Host.deriveRegistryIDdrops a port by cutting at the first:. For an IPv6 literal source (https://[2606:4700:4700::1111]/), the SSRF check allows a public address, but the cut leaves only[2606. That slugifies to2606, so every IPv6 registry in the same first group derives the same id, andvalidateNewRegistrySourcerefuses the second one as a duplicate.Fix
Pass
u.Hostname(), which already strips the port and the IPv6 brackets, and remove the colon cut fromderiveRegistryID. Hostname-based ids are unchanged.Test
TestBuildRegistrySourceEntry_IPv6HostIDcovers two IPv6 hosts (one with a port) and two hostnames. On main both IPv6 cases derive2606; with this change they derive2606-4700-4700--1111and2606-4700--64. The hostname cases are unchanged.TestBuildRegistrySourceEntry*and the registry-source tests pass. A full local./internal/serverrun had only theTestBinary*/TestMCPProtocol*tests that need a prebuilt binary, plus one order-dependentTestSearchServers_CatalogOrderMatchesTheRESTGoldenfailure that passes when run alone with this change.Made with Cursor