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

Split webhook payload validation logic into separate ValidatePayload* functions #656

Merged
merged 2 commits into from
Aug 10, 2018
Merged

Split webhook payload validation logic into separate ValidatePayload* functions #656

merged 2 commits into from
Aug 10, 2018

Conversation

jfheller
Copy link
Contributor

ConstructEvent and related functions now use the new validatePayload functionality.

This allows consumers of the library to not have to Unmarshal the json
payload in order to validate it. This way a library user can choose to only
validate a signature of a message and pass it to downstream systems as
trusted without being concerned with the actual structure of the events
yet. This is useful because the Event structure is tied to the user's
Stripe-account-wide API version which must be upgraded in an all-or-nothing
fashion. With this commit a library user may choose to write the webhook
event validation portion of their code in a way that will not be broken by
forwards or backwards- incompatible event structure changes

… functions

ConstructEvent and related functions now use the new validatePayload functionality.

This allows consumers of the library to not have to Unmarshal the json
payload in order to validate it. This way a library user can choose to only
validate a signature of a message and pass it to downstream systems as
trusted without being concerned with the actual structure of the events
yet. This is useful because the Event structure is tied to the user's
Stripe-account-wide API version which must be upgraded in an all-or-nothing
fashion. With this commit a library user may choose to write the webhook
event validation portion of their code in a way that will not be broken by
forwards or backwards- incompatible event structure changes
@brandur-stripe
Copy link
Contributor

Thanks!

@brandur-stripe brandur-stripe merged commit 4405d4b into stripe:master Aug 10, 2018
@brandur-stripe
Copy link
Contributor

Released as 40.1.0.

nadaismail-stripe pushed a commit that referenced this pull request Oct 18, 2024
* More docs todo

* Refactor order amendment logic

* Some price exception improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants