-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Description
The current destination type webhook's URL validation regex is slightly too strict. While it works great for standard domains, it currently fails to validate URLs that include embedded Basic Auth credentials (e.g., username:password@)
Since these are standard URL formats (especially for webhooks and API endpoints), the validation should ideally be relaxed to allow them.
Current Regex
Code snippet
^https?:\\/\\/[\\w\\-]+(?:\\.[\\w\\-]+)*(?::\\d{1,5})?(?:\\/[\\w\\-\\/\\.~:%?#\\[\\]@!$&'\\(\\)*+,;=]*)?$
Failing Examples (Valid URLs that are currently blocked)
Basic Auth: https://username:password@api.example.com
Proposed Solution
I suggest relaxing the regex to explicitly allow the optional auth segment before the domain
Handles auth and safely captures any complex token in the query/path:
Code snippet
^https?:\\/\\/(?:[^@\\/\\s]+@)?[\\w\\-]+(?:\\.[\\w\\-]+)*(?::\\d{1,5})?(?:\\/\\S*)?\$
Question for the Maintainers
Is there a specific reason for the strict regex? I wanted to make sure loosening the query/auth parameters doesn't introduce any unintended side effects for the Outpost. Also, from the documentation, it seems like adding DESTINATIONS_METADATA_PATH should override the destination definition but I tried it locally and it doesn't change it. My intention was to make it simple for my use case and create custom image.
Let me know what you think!
Metadata
Metadata
Assignees
Labels
Type
Projects
Status