Add option to configure http/s managed transport #870
Open
darkowlzz wants to merge 2 commits from
darkowlzz/http-go-transport-fix-2
into main
pull from: darkowlzz/http-go-transport-fix-2
merge into: jcarr:main
jcarr:main
jcarr:devel
jcarr:cherry-pick-3186582408-release-1.1
jcarr:cherry-pick-3186582408-release-0.27
jcarr:cherry-pick-3186582408-release-0.28
jcarr:cherry-pick-3186582408-release-1.2
jcarr:cherry-pick-3186582408-release-1.0
jcarr:cherry-pick-2663196279-release-1.1
jcarr:cherry-pick-2663196279-release-0.27
jcarr:cherry-pick-2663196279-release-1.0
jcarr:cherry-pick-2663196279-release-1.2
jcarr:cherry-pick-2663196279-release-0.28
jcarr:release-0.28
jcarr:release-1.2
jcarr:release-1.1
jcarr:release-1.0
jcarr:release-0.27
jcarr:release-0.99
jcarr:release-0.24
jcarr:release-0.23
jcarr:release-0.22
jcarr:v28
jcarr:v27
jcarr:release-0.26
jcarr:v26
jcarr:cmn/tree-parse-go
jcarr:cmn/go-http
jcarr:cmn/tls-stream
jcarr:release-0.25
jcarr:v25
jcarr:next
jcarr:v24
jcarr:v23
jcarr:winfix
jcarr:v22
jcarr:cmn/pointer-indirection
jcarr:cmn/config-snapshot
jcarr:cmn/remotes-ng
jcarr:cmn/remote-callbacks
jcarr:cmn/oid-copies
jcarr:remotes
jcarr:revwalk
2 Commits
Author | SHA1 | Message | Date |
---|---|---|---|
|
5bd7c33e5d |
Update SmartServiceActionReceivepack request path
Similar to SmartServiceActionUploadpack, SmartServiceActionReceivepack is not an info endpoint. Fix the path for git-receive-pack. |
|
|
3d4b9b97d1
|
Add option to configure http/s managed transport
This change introduces NewRegisterSmartTransportWithOptions() to help configure the smart transport with SmartSubtransportOptions. If the default smart subtransport client needs to be configured, a newly configured smart transport can be registered and used. The SmartSubtransportOptions includes CABundle only for now. This enables creating and using new transport with secrets that can be deleted and not shared with subsequent operations. The http client from httpSmartSubtransport is now shared with the underlying httpSmartSubtransportStream, reusing the client and its configurations. It also fixes the error during cloning: ``` unable to clone: Post "http://test-user:***@127.0.0.1:40463/bar/test-reponame/git-upload-pack": io: read/write on closed pipe ``` by using credentials if available and avoiding failure due to unauthorized request. A user of the smart transport who needs to add a CA bundle in the http client can do the following to setup the smart transport before cloning: ``` stOpts := &git2go.SmartSubtransportOptions{CABundle: opts.CAFile} rst, err := git2go.NewRegisterSmartTransportWithOptions("https", stOpts) if err != nil { return err } if rst != nil { defer rst.Free() } ``` |