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

Do not allow setting API Version directly #1941

Merged
merged 5 commits into from
Oct 25, 2024
Merged

Conversation

ramya-stripe
Copy link
Contributor

@ramya-stripe ramya-stripe commented Oct 25, 2024

Why?

When we introduced beta SDKs, we allowed users to directly update the global configuration for API Version since they needed to pass beta headers in #1529. We soon realized that was not safe and was error prone if users didnt pass in the right format and so introduced a helper method in #1819 and advertised that as the right way of doing things in the README

Proper deserialization of classes from Events can be guaranteed only when the Webhook API version matches the API version used to generate the SDKs. Therefore, in this PR we are dropping the ability to directly update the API version.

What?

  • Resolving merge conflicts coming from running the auto merge tool after Update webhook API version validation #1940
  • Rename the public variable APIVersion to a private variable apiVersionWithBetaHeaders and add a new constant for APIVersion
  • Updated tests

Changelog

  • stripe.APIVersion is no longer settable. If you were using this to set the beta headers, use the helper method stripe.AddBetaVersion() instead.

jar-stripe and others added 5 commits October 22, 2024 17:19
replaced api version check in webhook/client with isCompatibleApiVersion, which will test if the release identifier of the webhook event matches the pinned version, or return false for any event api version that does not have a release identifier
Copy link
Contributor

@jar-stripe jar-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ramya-stripe ramya-stripe merged commit 453392e into beta Oct 25, 2024
12 checks passed
@ramya-stripe ramya-stripe deleted the ramya/merge-go-beta branch October 25, 2024 16:06
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