Repository navigation
docs: Add transport options and authentication to v5-to-v6 guide - #12
Open
JonathanYuan23 wants to merge 1 commit into
Open
JonathanYuan23 wants to merge 1 commit into
JonathanYuan23 wants to merge 1 commit into
Conversation
v6 replaced Auth, InsecureSkipTLS, CABundle, ProxyOptions and client.InstallProtocol with ClientOptions []client.Option. Add a mapping table and before/after examples, and note that WithCABundle now trusts only the given CAs. Signed-off-by: Jonathan Yuan <jy90023@gmail.com> Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
pjbgf
requested changes
Nov 18, 2026
pjbgf
left a comment
Member
There was a problem hiding this comment.
@JonathanYuan23 thanks for looking into this. Here's some feedback:
The mapping table, the CABundle behaviour-change callout and the WithHTTPClient caveat all match what's on main. Some suggestions, checked against 9decb13c:
Correction
- "The authentication types themselves are unchanged" is only true for code that constructs them. The types themselves changed:
- SSH auth types (
PublicKeys,Password,KeyboardInteractive,PasswordCallback,PublicKeysCallback) lost theHostKeyAlgorithmsfield and theName()/String()methods, andClientConfig()becameClientConfig(ctx, *transport.Request). http.BasicAuth/TokenAuthlostSetAuth,NameandString, and gainedAuthorizer.
- SSH auth types (
Let's add: "Constructing the auth types is unchanged … custom auth implementations and code that set HostKeyAlgorithms need updating."
Missing migrations
- mTLS. v5's
ClientCert/ClientKeyaren't in the checklist or the table, and there's noclient.With…equivalent. The current workaround isclient.WithHTTPClient(c)withTLSClientConfig.Certificatesset, orclient.WithTransport("https", http.NewTransport(http.Options{TLS: …})). Worth a row and a short example.
Small improvements
- The "build the option slice once and reuse it" tip: each operation still builds a new client and HTTP connection pool. If connection reuse matters, users should pass their own
*http.ClientwithWithHTTPClient. Worth one line. WithHTTPClientapplies to bothhttpandhttps, while v5'sInstallProtocol("https", …)covered onlyhttps. A minor difference, but users who installed different clients per scheme will notice.
Elsewhere in the guide
These are outside this PR, but the new note in section 14 draws attention to them.
- Section 14 says only the client side has merged. The server side is on
maintoo:plumbing/transport/serveris gone, replaced bytransport.UploadPack/ReceivePack/UploadArchiveand the newbackendpackage.transport/client,transport/testandserverinfowere removed as well. - Section 12 (SHA-256) is listed as Planned, but it is on
main. Points to cover:plumbing.Hashis now an alias of the structObjectID, so code that indexes, slices or converts hashes to[20]byteno longer compiles.== plumbing.ZeroHashstill compiles but is wrong for SHA-256 ids;IsZero()is the safe check.
This branch has not been deployed
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.
v6 replaced:
AuthInsecureSkipTLSCABundleProxyOptionsclient.InstallProtocolwith
ClientOptions []client.Option.This PR adds a mapping table and before/after examples.
Assisted-by: Claude Opus 5.5 noreply@anthropic.com