Revert 1 claude/webhooks form validation 8xlbql#180
Merged
mikewheeleer merged 3 commits intoJun 26, 2026
Merged
Conversation
…bmit The webhook registration form accepted any type="url" string and a free-text comma-separated events field with no validation, so http(s) URLs, javascript: schemes, and empty/duplicate event lists could be posted as-is. Validate the URL is https:// and normalise the events CSV (trim, drop empties, de-duplicate) before calling apiPost, with field-level errors surfaced through TextField. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Qm9y5cUE6ZMGicMztgekh
…xlbql feat(webhooks): validate https url and normalise event list before submit
Contributor
|
solid — in it goes 👍 |
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.
Closes #12
Summary
src/app/webhooks/page.tsxpreviously accepted anytype="url"string and afree-text comma-separated events field, then posted it directly — no scheme
check, no de-duplication, no guard against an empty event list. This PR adds
client-side validation before the
apiPostcall and clearer field-levelfeedback using the shared
TextFieldcomponent.https://URLs are accepted.http://,javascript:, and other malformed values are rejected with a field-levelerror shown via
TextField'serrorprop (aria-invalid="true", messagelinked through
aria-describedby). Nativetype="url"/requiredattributes are kept — this validation augments them, not replaces them.
and trailing-comma artifacts), and de-duplicates while preserving order.
Submit is blocked with a field error if the normalised list ends up empty.
TextFieldfor consistentlabel/description/error/aria wiring.
README.md.Test plan
npm run lintnpm run typechecknpm test— 15/15 passing, 96.2% statement coverage on the changed pagenpm run buildaria-invalid/aria-describedbywiring throughTextField