I’m working with an external API that utilizes webhooks. The third-party documentation specifies that webhook signature validation is required. I’ve written a function stack where the first step retrieves all raw input to capture the data, followed by signature validation, and finally, the function returns a boolean value.
However, I’m unsure how to implement this function within middleware. Specifically, I’m unclear about the exact data format that middleware variables receive. My expectation is to place this function in the middleware and use a precondition like result = true. If the middleware receives the correct data, the webhook endpoint should proceed with executing the remaining code. If the precondition fails, it should return an "access denied" response.