Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove all whitespace when stringifying a webhook event payload object to a JSON string for verifycation #595

Merged
merged 2 commits into from
Jun 21, 2021

Conversation

wolfy1339
Copy link
Member

@wolfy1339 wolfy1339 commented Jun 21, 2021

This was introduced in 1127c91
Fixes #593

@wolfy1339 wolfy1339 added the Type: Bug Something isn't working as documented, or is being fixed label Jun 21, 2021
@wolfy1339
Copy link
Member Author

Something is up with the tests.
The signature isn't hard-coded anywhere, and is calculated before every test. Yet the tests fail because of a mismatch.
This causes the tests to never quit (on GH Actions) and go on forever until they are cancelled

@wolfy1339 wolfy1339 requested a review from gr2m June 21, 2021 16:41
@gr2m gr2m force-pushed the fix-remove-json-stringify-pretty-print branch from d98a2e6 to 234c7b4 Compare June 21, 2021 22:43
@gr2m gr2m self-assigned this Jun 21, 2021
@gr2m gr2m changed the title 🚧 fix: remove indentation and new lines from toNormalizedJsonString() fix: remove indentation and new lines from toNormalizedJsonString() Jun 21, 2021
@gr2m
Copy link
Contributor

gr2m commented Jun 21, 2021

Something is up with the tests.

I didn't fix the hanging tests in case of a signature mismatch, but I fixed the cause of the mismatch itself. I'd say lets get this out asap, we can worry about tests later

@gr2m gr2m changed the title fix: remove indentation and new lines from toNormalizedJsonString() fix: remove all whitespace when stringifying a webhook event payload object to a JSON string for verifycation Jun 21, 2021
@gr2m gr2m merged commit 3e0f2a0 into master Jun 21, 2021
@gr2m gr2m deleted the fix-remove-json-stringify-pretty-print branch June 21, 2021 22:51
@gr2m
Copy link
Contributor

gr2m commented Jun 21, 2021

As this is a hotfix, I went ahead and merged it @wolfy1339. Please feel free to add any review comments anyway, I'll create follow up issues if needed

@github-actions
Copy link
Contributor

🎉 This PR is included in version 9.8.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented, or is being fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

signature does not match event payload and secret when receiving JSON body
2 participants