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

Fix concurrent assertions #4426

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

davidme-stripe
Copy link
Contributor

@davidme-stripe davidme-stripe commented Dec 23, 2024

Summary

The server enforces that the counter attached to the assertion increases with each assertion. This means if one client happens to attempt to send multiple assertions at once, and the network requests arrive out of order, we'll fail the assertion.

To work around this, we'll change the API so that the StripeAttest returns an AssertionHandle. It's required to call complete() with this handle, or no future assertions will proceed.

I'm also going to make stripeAttest a parameter of an STPAPIClient — now that there's more state involved, it makes more sense for an STPAPIClient to own this instead of creating one each time.

Testing

CI, added a new test, tested attestation on device.

@davidme-stripe davidme-stripe marked this pull request as ready for review December 24, 2024 04:40
@davidme-stripe davidme-stripe requested review from a team as code owners December 24, 2024 04:40
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.

1 participant