-
Notifications
You must be signed in to change notification settings - Fork 782
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
Event Webhook only works for a single event payload #1238
Comments
Thanks for taking the time to report this @Abr3u! Could you please provide your support ticket number so I can dig in and try to reproduce? With best regards, Elmer |
Hey,
Of course: https://support.sendgrid.com/hc/en-us/requests/5540009
Thanks in advance
Elmer Thomas <notifications@github.com> escreveu no dia quinta, 7/01/2021
à(s) 01:11:
… Thanks for taking the time to report this @Abr3u
<https://github.com/Abr3u>!
Could you please provide your support ticket number so I can dig in and
try to reproduce?
With best regards,
Elmer
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1238 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACDAL7ONA4WF7PA3ENSJIU3SYUC3HANCNFSM4VVGOIVA>
.
|
Hi @Abr3u |
Hi @JenniferMah @thinkingserious , I'm having exactly the same problem. It's not returning any exception and return false. Do you have any expected resolution time for this? |
@edsrodrigues We do not yet have an expected resolution time for this. That said, +1s and PRs will definitely help it move up our backlog. |
Yes, I realized that before but didn't know it was a bug. Thanks |
We're also running into this problem. +1 |
I've hit this problem too |
+1 I'm having the same issue |
+1 Happen to me already |
+1 already had the same issue |
+1 Same issue here |
+1 Same issue here |
+1 |
+1 same issue here. It is also happening on Csharp side as well. |
@mayureshs if you're still needing a fix and anyone else who finds this issue while searching (like I did): The test code has the correct way to stringify your payload from the incoming webhook
You may have to tweak it for your C# issues but this format should be consistent across the board. Hope that helps! |
Issue Summary
The helper library to validate the webhook signature only works when the payload has a single event. when the payload is an array of multiple JSON objects the signature always returns false. as seen here: https://github.com/sendgrid/sendgrid-nodejs/blob/main/packages/eventwebhook/src/eventwebhook.spec.js there is only 1 test and this tests uses a payload with a single event. I've opened a ticket with the sendgrid support team who told me to open an issue here stating the problem.
Steps to Reproduce
Code Snippet
Basically the same as here: https://github.com/sendgrid/sendgrid-nodejs/blob/main/packages/eventwebhook/src/eventwebhook.spec.js with the payload being a 2 object array.
Exception/Log
No exception, just returns false
Technical details:
I have an example payload, signature and timestamp received that I shared with the support team when creating the ticket but since the payload contains sensitive information I'm not pasting that here. I'll be glad to do so via a private chat or something similar.
To quote the answer that I got from the technical support: "I have looked into this further and would agree this could be a library specific issue with the configuration since a single event works. I also reviewed the payload and do not see anything that is wrong. "
I'm running this code in a aws lambda running Node.js 12.x. To be able to use the webhook helper lib I copied this file into my lambda env https://github.com/sendgrid/sendgrid-nodejs/blob/main/packages/eventwebhook/src/eventwebhook.js and used it as shown in its respective tests (as linked above)
The text was updated successfully, but these errors were encountered: