matrix-org / matrix-hookshot

A bridge between Matrix and multiple project management services, such as GitHub, GitLab and JIRA.
https://matrix-org.github.io/matrix-hookshot/
Apache License 2.0
283 stars 68 forks source link

Fix GitHub events not verifying #875

Closed Half-Shot closed 9 months ago

Half-Shot commented 9 months ago

At some point the API on the @octokit/webhooks library changed and it started requiring a full raw payload of the JSON data rather than a parsed body. To get around this, we store the raw string value of the body on the request object after verifying that the fields are valid.

Ideally we'd validate in the verification function, but alas the GitHub function is async and the verifier expects a synchronous throw.