workos/workos-ruby

Allow for verifying the web hook header signature without parsing the JSON

bfad opened this issue · 3 comments

bfad commented

Right now, the only public API that's available to verify the header signature of an incoming web hook is Webhooks.construct_event. This method verifies the header and parses the JSON. It returns a Webhook object (the documentation of which says it's only meant to be used internally, but that is another issue.) I would like to keep my responses to the incoming web hook requests as snappy as possible which means I would prefer not to parse the JSON data, just verify it. (I can leave parsing and processing to my background task.)

I have opened up a PR that should solve this issue: #162

Thanks! I noted on your PR, we're actually uncovering all methods in the Webhook class to be public. PR here: #171

It looks like the webhook helper methods were made public in v2.6.0.

@bfad Does this address your issue?

Going to close this one out since it should be addressed.

Feel free to reopen if your need something else!