Skip to content

fix: respect command ignores HTTP_PROXY#2805

Open
harshit078 wants to merge 15 commits into
Redocly:mainfrom
harshit078:fix-respect-HTTP-PROXY
Open

fix: respect command ignores HTTP_PROXY#2805
harshit078 wants to merge 15 commits into
Redocly:mainfrom
harshit078:fix-respect-HTTP-PROXY

Conversation

@harshit078
Copy link
Copy Markdown
Contributor

@harshit078 harshit078 commented May 11, 2026

What/Why/How?

  • using withConnectionClient () function in index.ts as a BaseResolver which inreturn should fetch HTTP_PROXY and other related.
  • Fixed the respect command so that loading remote sourceDescriptions and external $refs honors HTTP_PROXY / HTTPS_PROXY / NO_PROXY

Reference

#2668

Testing

Screenshots (optional)

Check yourself

  • This PR follows the contributing guide
  • All new/updated code is covered by tests
  • Core code changed? - Tested with other Redocly products (internal contributions only)
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update has been considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

Note

Medium Risk
Changes network resolution behavior for remote source descriptions and external $refs by wiring a new BaseResolver with a custom fetch; misconfiguration could impact connectivity or proxy bypass (NO_PROXY) behavior. Covered by targeted unit tests asserting proxy/mTLS fetch selection.

Overview
Fixes respect so remote source descriptions and external $ref resolution consistently honor HTTP_PROXY/HTTPS_PROXY/NO_PROXY by passing a dedicated BaseResolver into run that uses the same proxy/mTLS-aware customFetch.

Adds unit tests verifying externalRefResolver is provided and that its customFetch switches between bare undici fetch vs proxy-aware/mTLS-aware implementations based on env vars and --mtls. Includes a patch changeset documenting the fix.

Reviewed by Cursor Bugbot for commit bd37494. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 11, 2026

🦋 Changeset detected

Latest commit: bd37494

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@redocly/cli Patch
@redocly/openapi-core Patch
@redocly/respect-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@harshit078 harshit078 marked this pull request as ready for review May 13, 2026 08:22
@harshit078 harshit078 requested review from a team as code owners May 13, 2026 08:22
Comment thread packages/cli/src/__tests__/commands/respect/create-network-dispatcher.test.ts Outdated
Comment thread packages/cli/src/commands/respect/connection-client.ts Outdated
Comment thread .changeset/upset-chairs-feel.md Outdated
Comment thread packages/cli/src/__tests__/commands/respect/create-network-dispatcher.test.ts Outdated
Comment thread packages/cli/src/commands/respect/index.ts Outdated
Comment thread packages/cli/src/__tests__/commands/respect/create-network-dispatcher.test.ts Outdated
Comment thread packages/cli/src/__tests__/commands/respect/create-network-dispatcher.test.ts Outdated
Comment thread packages/cli/src/__tests__/commands/respect/create-network-dispatcher.test.ts Outdated
harshit078 and others added 3 commits May 18, 2026 16:16
Co-authored-by: Dmytro Anansky <dmytro@redocly.com>
Co-authored-by: Dmytro Anansky <dmytro@redocly.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6443b3c. Configure here.

Comment thread packages/cli/src/commands/respect/index.ts Outdated
@harshit078 harshit078 requested a review from DmitryAnansky May 20, 2026 08:00
@DmitryAnansky
Copy link
Copy Markdown
Contributor

DmitryAnansky commented May 20, 2026

@harshit078 you have some errors with formatting,
Could you please run the formatter from the repository root using npm run format.

"format": "oxfmt .",

This should resolve the failed code style check.

@harshit078
Copy link
Copy Markdown
Contributor Author

Hi @DmitryAnansky, Pushed a Fix for it in the last commit. Thanks !

Comment thread .changeset/upset-chairs-feel.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants