Skip to content

Allow internal webhook call on the HTTP action#2212

Merged
MarceloRGonc merged 5 commits intomainfrom
mg/fix-http
Apr 9, 2026
Merged

Allow internal webhook call on the HTTP action#2212
MarceloRGonc merged 5 commits intomainfrom
mg/fix-http

Conversation

@MarceloRGonc
Copy link
Copy Markdown
Contributor

Fixes OPS-4101

@linear
Copy link
Copy Markdown

linear Bot commented Apr 9, 2026

Copilot AI review requested due to automatic review settings April 9, 2026 12:04
@MarceloRGonc MarceloRGonc changed the title WIP Allow internal webhook call on the HTTP action Apr 9, 2026
@MarceloRGonc MarceloRGonc requested a review from ravikiranvm April 9, 2026 12:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR (OPS-4101) refactors how the HTTP block handles host validation for OpenOps “system webhook” URLs by removing the special-case validator from server-shared and introducing URL rewrite logic inside the HTTP block.

Changes:

  • Removed validateHostAllowingPublicWebhookUrl from @openops/server-shared (and its unit tests).
  • Added validateAndRewritePublicWebhookUrl to rewrite valid public webhook sync URLs to the internal API URL when host validation fails.
  • Wired the HTTP send-request action to use the rewritten URL and added Jest configuration/target for the blocks-http package.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/server/shared/test/host-validation/index.test.ts Removes tests/imports for the deleted shared webhook-allowing validator.
packages/server/shared/src/lib/host-validation/index.ts Removes validateHostAllowingPublicWebhookUrl, leaving only validateHost.
packages/blocks/http/src/lib/common/webhook-url-validator.ts New helper to validate and rewrite system webhook URLs to internal API.
packages/blocks/http/test/webhook-url-validator.test.ts New unit tests for the rewrite helper.
packages/blocks/http/src/lib/actions/send-http-request-action.ts Uses the new rewrite helper and updates host validation calls accordingly.
packages/blocks/http/jest.config.ts Adds Jest config for the http block package.
packages/blocks/http/tsconfig.spec.json Adds ts-jest tsconfig for tests.
packages/blocks/http/project.json Adds an Nx test target for the http block package.
Comments suppressed due to low confidence (1)

packages/server/shared/src/lib/host-validation/index.ts:66

  • After removing validateHostAllowingPublicWebhookUrl, networkUtls is no longer referenced in this module. Please remove the unused import to avoid lint warnings and keep the dependency surface minimal.
  if (isPrivate) throw new Error('Host must not be an internal address');
}


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/blocks/http/src/lib/common/webhook-url-validator.ts Outdated
Comment thread packages/blocks/http/src/lib/common/webhook-url-validator.ts
Comment thread packages/blocks/http/test/webhook-url-validator.test.ts Outdated
Comment thread packages/blocks/http/test/webhook-url-validator.test.ts Outdated
Comment thread packages/server/shared/test/host-validation/index.test.ts Outdated
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 9, 2026

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@MarceloRGonc MarceloRGonc merged commit 9ccfa42 into main Apr 9, 2026
21 checks passed
@MarceloRGonc MarceloRGonc deleted the mg/fix-http branch April 9, 2026 13:45
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