Allow internal webhook call on the HTTP action#2212
Merged
MarceloRGonc merged 5 commits intomainfrom Apr 9, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
validateHostAllowingPublicWebhookUrlfrom@openops/server-shared(and its unit tests). - Added
validateAndRewritePublicWebhookUrlto 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-httppackage.
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,networkUtlsis 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.
ravikiranvm
approved these changes
Apr 9, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes OPS-4101