Skip to content

feat(toolkit-lib)!: support custom https.Agent for SDK requests #533

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

Merged
merged 3 commits into from
May 27, 2025

Conversation

mrgrain
Copy link
Contributor

@mrgrain mrgrain commented May 26, 2025

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

@github-actions github-actions bot added the p2 label May 26, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team May 26, 2025 10:31
@mrgrain mrgrain force-pushed the mrgrain/refactor/cli/externalize-proxy-agent branch from 0659625 to fd9a54c Compare May 26, 2025 10:31
@mrgrain mrgrain force-pushed the mrgrain/feat/toolkit-lib/https-agents branch from 65a83db to 8c32dd1 Compare May 26, 2025 10:35
@mrgrain mrgrain force-pushed the mrgrain/refactor/cli/externalize-proxy-agent branch from fd9a54c to 4fe8dc6 Compare May 26, 2025 10:44
@mrgrain mrgrain force-pushed the mrgrain/feat/toolkit-lib/https-agents branch from 8c32dd1 to 6aa8b19 Compare May 26, 2025 10:46
@mrgrain mrgrain temporarily deployed to integ-approval May 26, 2025 10:46 — with GitHub Actions Inactive
@mrgrain mrgrain force-pushed the mrgrain/feat/toolkit-lib/https-agents branch from 6aa8b19 to 4d1903c Compare May 26, 2025 11:33
@mrgrain mrgrain temporarily deployed to integ-approval May 26, 2025 11:33 — with GitHub Actions Inactive
Base automatically changed from mrgrain/chore/integ-workflow/update-verdaccio-config to main May 27, 2025 07:02
@mrgrain mrgrain temporarily deployed to integ-approval May 27, 2025 07:55 — with GitHub Actions Inactive
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.88%. Comparing base (70128c0) to head (8c4f26f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #533      +/-   ##
==========================================
- Coverage   79.01%   78.88%   -0.13%     
==========================================
  Files          47       47              
  Lines        7032     7032              
  Branches      786      781       -5     
==========================================
- Hits         5556     5547       -9     
- Misses       1458     1467       +9     
  Partials       18       18              
Flag Coverage Δ
suite.unit 78.88% <ø> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue May 27, 2025
Merged via the queue into main with commit 56b6c4c May 27, 2025
21 checks passed
@aws-cdk-automation aws-cdk-automation deleted the mrgrain/feat/toolkit-lib/https-agents branch May 27, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove ProxyAgent from being included in Toolkit Lib by default
4 participants