This repository was archived by the owner on Sep 30, 2024. It is now read-only.
[Backport 5.1] batchchanges: Load custom certs into the http client used to create GitHub Apps#55238
Merged
Conversation
…itHub Apps (#55084) Previously, we were using Go's default HTTP Client (`http.DefaultClient`) to invoke GitHub to create GitHub apps. This client does not work with custom certificates that may need to be used if calling an on-prem GitHub instance. ### Changes * Updated to use our `httpcli.UncachedExternalClientFactory` instead of `http.DefaultClient` * This gives us access to logging, tracing, etc... out of the box * Loading certs that are configured in `experimentalFeatures.tls.external.certificates` into the HTTP client * This happpens automagically with `httpcli.UncachedExternalClientFactory`. It has an option called `ExternalTransportOpt` that loads the certs from `tls.external` (see recording to see this in action) ## Test plan Added new tests and tested manually. (cherry picked from commit 97fad93)
Contributor
Piszmog
approved these changes
Jul 24, 2023
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Previously, we were using Go's default HTTP Client (
http.DefaultClient) to invoke GitHub to create GitHub apps. This client does not work with custom certificates that may need to be used if calling an on-prem GitHub instance.Changes
httpcli.UncachedExternalClientFactoryinstead ofhttp.DefaultClientexperimentalFeatures.tls.external.certificatesinto the HTTP clienthttpcli.UncachedExternalClientFactory. It has an option calledExternalTransportOptthat loads the certs fromtls.external(see recording to see this in action)Test plan
Added new tests and tested manually (see below for recordings)
Creating an app
Screen.Recording.2023-07-18.at.14.02.22.mov
Validation of custom certs being loaded
Screen.Recording.2023-07-19.at.10.34.45.mov
Backport 97fad93 from #55084