Validating Payload Data #197
Unanswered
BootsThunderclap
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm curious about how I could approach validating actual payload data and returning a conditional response based on that. As I understand it, when a webhook request is received, it'll first get routed through our custom signature validator, and that works exactly as expected.
It's the next part that I'm interested in, where the
WebhookProfile
runsshouldProcess()
. I have a custom class that implementsWebhookProfile
, and I want to perform some data validation logic in there. Very simple stuff like "on the request, were these 3 fields included?" The important thing though, is I want to send a Bad Request response so the sending application knows that the request was rejected. The way I understand it isshouldProcess()
is simply a filtering mechanism for whether or not to store (and ultimately process) the webhook request.Looking at the
WebhookProcessor
code, it callsrespondToValidWebhook()
. IfshouldProcess()
returnsfalse
, is there any way to have some otherrespondToInvalidWebhook()
method that can actually notify the sending application? Or am I just thinking about this the wrong way?Beta Was this translation helpful? Give feedback.
All reactions