Skip to content
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
DaedalusG merged 1 commit into
5.1from
backport-55084-to-5.1
Jul 24, 2023
Merged

[Backport 5.1] batchchanges: Load custom certs into the http client used to create GitHub Apps#55238
DaedalusG merged 1 commit into
5.1from
backport-55084-to-5.1

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

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 (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

…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)
@sourcegraph-bot

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@DaedalusG DaedalusG merged commit 8098a7a into 5.1 Jul 24, 2023
@DaedalusG DaedalusG deleted the backport-55084-to-5.1 branch July 24, 2023 20:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants