fix: add URI validation to webhook connectors #1629
Closed
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.
Description
Check that webhook ID contains only valid URI characters as outlined in RFC 3986 for the following:
Before:
After:
Webhook ID's form part of a URL. As such, the ID needs to be a valid URI in order to prevent obviously malformed URL's. See #1238 for more details.
More Details
Allowing "/"
There was discussion in #1238 to disallow the forward slash "/" as this could be misconstrued as a path delimiter.
I personally feel we should still allow "/" because it is still syntactically correct. I don't want to enforce semantics, as it's possible there are some use cases where a Webhook ID could have a "/".
Test Cases
Checked the following for all connectors in Desktop Modeller:
Should show error message:
Should not show error message:
Next Steps
webhook-connector-boundary
)I wanted to wait to get feedback on my first implementation before expanding this approach to many other connectors.
Related issues
#1238