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

Better CryptoProvider error #1828

Merged
merged 3 commits into from
Jun 27, 2023

Conversation

richardm-stripe
Copy link
Contributor

In response to #1827.

  • I could have made a smaller change to just add the string to SubtleCryptoProvider.computeHMACSignature itself, but it felt wrong to me for .computeHMACSignature to make assumptions about how it was called, so instead I introduced a specialized error class for constructEvent can produce the message. Open to reversing this upon feedback.
  • I didn't change the default implementation of .computeHMACSignature to throw this error. That means we're asking hypothetical implementors of additional async-only CryptoProviders will have to explicitly override .computeHMACSignature to throw this error instead of just only implementing .computeHMACSignatureAsync. This kind of is a bummer but I think it prevents misleading error messages in the hypothetical case where the implementer implements neither method. This almost certainly doesn't matter, but figured I'd mention.

@richardm-stripe richardm-stripe requested review from anniel-stripe and a team and removed request for anniel-stripe and a team June 26, 2023 23:00
richardm-stripe and others added 2 commits June 26, 2023 16:57
@richardm-stripe richardm-stripe merged commit e303221 into master Jun 27, 2023
@richardm-stripe richardm-stripe deleted the richardm-improve-subtlecryptoprovider-error branch June 27, 2023 00:15
gurus00 pushed a commit to gurus00/stripe-node that referenced this pull request Feb 11, 2025
…ptoprovider-error

Better CryptoProvider error
gurus00 pushed a commit to gurus00/stripe-node that referenced this pull request Feb 11, 2025
…ptoprovider-error

Better CryptoProvider error
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