-
Notifications
You must be signed in to change notification settings - Fork 61
refactor(cli): create ProxyAgent in the CLI in preparation of proxy-agent removal from toolkit-lib
#532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0659625 to
fd9a54c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #532 +/- ##
==========================================
- Coverage 78.65% 78.62% -0.04%
==========================================
Files 46 47 +1
Lines 6977 7055 +78
Branches 775 783 +8
==========================================
+ Hits 5488 5547 +59
- Misses 1470 1489 +19
Partials 19 19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…toolkit-lib Updates the CdkToolkit and Notices APIs to take a Node https.Agent instead of options. This gives more flexibility to integrators while retaining proxy support. The CLI changed need to be split out from the toolkit-lib changes, so the latter can be safely marked as breaking without touching CLI files.
fd9a54c to
4fe8dc6
Compare
| * Options for the HTTPS requests made by Notices | ||
| */ | ||
| readonly httpOptions?: SdkHttpOptions; | ||
| readonly httpsOptions?: NoticesHttpsOptions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you call it httpOptions I'll assume it applies to all flavors of HTTP requests.
If you call it httpsOptions I'll wonder where the httpOptions are.
I see how this is strictly correct but is it helpful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will revert back.
Fixes #398 Depends on #532 Previously automatically configured the SDK to pass all requests through an instance of `ProxyAgent` from the third-party `proxy-agent` package. A user could configure its proxy settings, but by default it would act as a pass through. `proxy-agent` is a hefty dependency (primarily due to its support for `pac` files) that not everyone might want to use. This is the standard interface in Node.js and we are aligning on it. Note that with this we are also removing built-in (but not advertised) support for managing proxy configuration through env vars like `HTTP_PROXY` or `HTTPS_PROXY`. This functionality was provided by `proxy-agent` and the easiest way to get it back is by configuring `proxy-agent` again. BREAKING CHANGE: Dependency on `proxy-agent` has been removed, this also removes the support of configuring a proxy through like `HTTPS_PROXY` and `AWS_CA_BUNDLE`. The type of `sdkConfig.httpOptions` has changed to now optionally take a single `agent: https.Agent` property instead of the proxy settings. The restore the previous behavior, pass an instance of `ProxyAgent` to `sdkConfig.httpOptions`: `{ agent: new ProxyAgent({ ca: oldHttpOptions.caBundlePath, getProxyForUrl: () => oldHttpOptions.proxyAddress }) }` --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
Updates the
CdkToolkitandNoticesAPIs to take a Node https.Agent instead of options. This gives more flexibility to integrators while retaining proxy support. We can make the changes toNoticessince it is not a public API.The CLI changed need to be split out from the toolkit-lib changes, so the latter can be safely marked as breaking without touching CLI files. The respective
toolkit-libchanges are in #533Relates to #398
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license