-
Notifications
You must be signed in to change notification settings - Fork 103
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
Only support signed webhooks #95
Comments
Instead, favor Stripe's new wehook signatures Ref #95 [skip ci]
I'm in favor of this proposal. Some things to consider.
|
See PR #96 for the initial deprecation of |
I now also have a work-in-progress branch for only supporting signed webhooks. This branch removes The branch is green, and should be in working order. I still need to update the README and sleep on it before submitting a pull request, but it's ready for some testing (if anyone is brave enough). I should have a formal pull-request ready tomorrow. |
For those following this proposal, please review PR #97. The goal is to merge it in by end of week and then get a v2.0.0 release out soon after. |
My plan is to merge #97 in later today and close this issue out, but I think we need to address Issue #98 before releasing a v2.0.0 release. @invisiblefunnel Any objections to this plan of attack? |
@rmm5t sgtm. Exciting to be approaching 2.0 🎉 |
Stripe supports signed webhooks as a way to verify that the events have been sent by Stripe and not spoofed by a third-party. Ideally, StripeEvent would support only signed webhooks. Doing so would encourage best practices, plus would simplify the event-retrieving code because the events can be safely constructed from the POST data.
This eliminates the need for an additional API call to Stripe to fetch the same event data. Not only is that extra API call wasteful, but it becomes complex when handling both normal Stripe and Stripe Connect events.
This should work for all event types (including Connect events), and will verify the signature:
StripeEvent could safely construct the event, which makes the
event_retriever
unnecessary. Or, it could be renamed toevent_preprocessor
and passed the constructedStripe::Event
. I think this would greatly simplify things, and would require developers to secure their endpoints — which is never a bad thing to encourage.(Original discussion: #85 (comment))
The text was updated successfully, but these errors were encountered: