-
Notifications
You must be signed in to change notification settings - Fork 210
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
feat(auth): set up App Store modules #12374
Conversation
@bbangert I'm particularly interested in feedback on any parts that I can descope (e.g. if they are or can be covered by separate tickets) in order to land this sooner rather than later and unblock the other tickets. |
2b25ada
to
f0449be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bbangert : Here is the finished patch without tests and some questions for you. It'd be great if you can review this while I am working on fixing/adding tests. I'll ping you in Slack about this as well as we discussed.
Thank you in advance; I know this is a very large patch.
packages/fxa-auth-server/lib/payments/apple-app-store/purchase-manager.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/apple-app-store/subscription-purchase.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/apple-app-store/subscription-purchase.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/apple-app-store/apple-iap.ts
Outdated
Show resolved
Hide resolved
7bca437
to
e0a25f0
Compare
packages/fxa-auth-server/lib/payments/iap/apple-app-store/types/api-client.ts
Outdated
Show resolved
Hide resolved
e0a25f0
to
111deb2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost done with tests. I fixed (or attempted to in a couple of cases; see inline comments) the issues we discussed earlier today.
packages/fxa-auth-server/lib/payments/iap/apple-app-store/types/api-client.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/apple-iap.ts
Outdated
Show resolved
Hide resolved
1c5c1e3
to
713b82e
Compare
I think we disabled squash and merge, but I can do an interactive rebase and roll these commits into one commit before merging. I will file a follow-up ticket to set the App Store credentials/sandbox env vars in stage and prod and open a cloudops PR. Edit: CloudOps ticket is https://mozilla-hub.atlassian.net/browse/FXA-4941 (#12594 ). |
packages/fxa-auth-server/lib/payments/iap/apple-app-store/apple-iap.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/apple-iap.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/apple-iap.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/errors.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/apple-iap.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/subscription-purchase.ts
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/purchase-manager.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/apple-iap.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/purchase-manager.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/purchase-manager.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/purchase-manager.ts
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/types/api-client.ts
Outdated
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/app-store-helper.ts
Show resolved
Hide resolved
packages/fxa-auth-server/lib/payments/iap/apple-app-store/purchase-manager.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Minor nit about the error, I'd imagine we'd figure it out quick if we did hit it since Apple purchase registration wouldn't work.
Because: * We want SubPlat to know about Apple IAP subscriptions for our RPs. This commit: * Sets up the needed Apple IAP modules in lib/payments/iap/apple-app-store including classes, their methods and types, largely modeled after the Google Play IAP modules. * Adds App Store config (under config.subscriptions.appStore) including a sandbox flag and App Store credentials by app bundleId. * Moves lib/payments/google-play to lib/payments/iap/google-play. * Moves IAPConfig class to the new shared lib/payments/iap dir. * Adds two new libraries to the auth server: app-store-server-api (App Store Server API client) and type-fest (for helpful TS types, such as RequireAtLeastOne used here). Closes #10313, closes #12579
c81b0d4
to
c4b55cc
Compare
Because:
This commit:
Closes #10313, closes #12579
Checklist
Put an
x
in the boxes that applyScreenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
Here are the analogs I modeled the different modules on from the Google Play Store integration: