Граф коммитов

48 Коммитов

Автор SHA1 Сообщение Дата
Vijay Budhram 320a84f436
feat(2fa): Add `backup-code` libs 2024-11-05 12:40:30 -05:00
Dan Schomburg 73b710023e
Merge pull request #17938 from mozilla/FXA-10460-admin-server
task(admin-server): Fix admin server startup times and some refactor
2024-10-31 14:31:54 -07:00
Ben Bangert 904923e113
feat: add recovery-phone library
Because:

* We want a root recovery-phone library for related functionality.

This commit:

* Adds a new recovery-phone library.
2024-10-31 01:19:54 +00:00
Dan Schomburg 14c64e18b7
task(admin-server): Fix startup times and some refactor
Because:
- We want to improve startup performance of admin-server
- We determined using the @sentry/node package in the admin-server was source of slowdown
- Using @sentry/nestjs made a big improvement in startup time.

This Commit:
- Switches to using @sentry/nestjs integration for admin-server
- Refactors libs/sentry into three distinct contexts libs/sentry-nestjs, libs/sentry-node, libs/sentry-browser, and libs/sentry-utils
- Extracts common functions to libs/sentry-utils so they can be reused.
2024-10-30 12:32:46 -07:00
Davey Alvarez c9100171f2
Set up cart status polling 2024-10-11 15:25:45 -07:00
Reino Muhl e23da68baf
feat(payments-next): remaining p1 metrics
Because:

- payments-next should be be recording all P1 metrics.

This commit:

- Renames PaymentsGleanService to PaymentsEmitterService to more
  accurately indicate that this service will be used to handle all
  Emitter events.
- Restructure EmitterService to reuse common functionality.
- Restructure EmitterService to reuse common functionality.
- Renames recordGleanEvents to recordEmitterEvents to more accurately
  indicate that this action should be used to emit Emittery events on
  the server.
- Emit CheckoutView/Engage/Submit/Success/Error events from pages and
  components where necessary.
- Record the appropriate Glean event for each of the Emittery events.

Closes #FXA-10088
2024-10-07 16:22:46 -04:00
Davey Alvarez f946bdf12f
Set up error boundary for cart checkout flow 2024-09-20 16:01:05 -07:00
Reino Muhl 7dd569d383
feat(next): glean emit view event
Because:

- Record SubPlat P1 metric view event using glean

This commit:

- Adds payments-metrics library
- Adds PaymentsGleanManager to format events data and CMS data into the
  required format for Glean events recording.
- Adds PaymentsGleanService to handle metrics events emitted by Next.js
- Adds the manager and service to the NestApp
- Adds new config values to payments-next for Glean reporting
- Emit view event from Checkout start page

Closes #FXA-10087
2024-09-19 15:38:27 -04:00
Reino Muhl 73bd174c9d
Merge pull request #17550 from mozilla/fxa-9998-add-sentry-payments
feat(next): add sentry to payments-next
2024-09-09 17:25:20 -04:00
Reino Muhl 54fefd2872
feat(next): add sentry to payments-next
Because:

- Be able to use Sentry in Next.js on both the client and the server

This commit:

- Add Sentry to payments-next using the installation wizard

Closes #FXA-9998
2024-09-09 13:21:21 -04:00
julianpoyourow ba65ee49d2
chore(payments): split payments-stripe into payments-customer 2024-09-06 23:00:01 +00:00
Reino Muhl 10e00b6456
feat(libs): move profile client to libs
Because:

- Only have one implementation of a profile server client, instead of
  various implementations in the services where its required.

This commit:

- Moves the profile client implementation from auth-server and into a
  dedicated library in libs

Closes #FXA-9274
2024-09-04 15:11:54 -04:00
Reino Muhl e15e7e718b
feat(next): add glean-generate script
Because:

- Have project target to generate glean code.

This commit:

- Adds glean metrics library.
- Adds blank subplat-backend-metrics.yaml
- Add glean-generate target to project.

Closes #FXA-9996
2024-08-09 15:05:16 -04:00
Lisa Chan 66d28d6e16
refactor(libs): Rename Contentful library to generic name 2024-06-28 17:00:27 -04:00
Lisa Chan 18e5d172b0
Merge pull request #17056 from mozilla/FXA-9708
fix(payments-next): Implement a11y improvements
2024-06-05 11:57:22 -04:00
Lisa Chan f9f670fb2e
fix(payments-next): Implement a11y improvements 2024-06-05 10:55:43 -04:00
Ben Bangert 8771178ee3
feat: vendor fxa-crypto-relier as crypto-relier
Because:

* We want to incorporate the fxa-crypto-relier library into the Firefox
  Accounts codebase and deprecated its webextension functionality.

This commit:

* Adds the fxa-crypto-relier library to the Firefox Accounts codebase.

Closes FXA-9741
2024-06-03 14:03:11 -07:00
Ben Bangert fae80ae7e3
chore: vendor typesafe-node-firestore
Because:

* We don't want to maintain small external libs instead of using our
  monorepo.

This commit:

* Vendors in the typesafe-node-firestore typings.
2024-05-20 19:10:19 -07:00
Ben Bangert 9a649c6441
feat: vendor fxa-jwtool
Because:

* We want to reduce the dependencies in fxa-jwtool and bring more
  of the functionality into the monorepo.

This commit:

* Moves and updates the fxa-jwtool code to function the same
  except as TypeScript with classes and no additional dependencies.
2024-05-06 07:52:16 -07:00
Ben Bangert db8e62f7f7
feat: vendor and update pem-jwk library
Because:

* The pem-jwk library wasn't using the latest crypto library
  functionality and included older dependencies.

This commit:

* Pulls in pem-jwk functionality using the crypto library.
2024-05-02 21:49:24 -07:00
Ben Bangert 181d06927f
feat: vendor fxa-common-password-list and incremental-encoder
Because:

* We want to reduce external dependencies on orphaned code and
  consolidate libraries.

This commit:

* Adds the `common-password-list` and `incremental-encoder` libraries
  to the monorepo.
2024-05-02 12:21:52 -07:00
Meghan Sardesai 0ddaf1b4d2
Merge pull request #16630 from mozilla/FXA-8935
feat(payments-paypal): create PaypalService createBillingAgreement method
2024-04-24 15:19:36 -04:00
Meghan Sardesai 5d5b8f05e0
feat(payments-paypal): create PaypalService createBillingAgreement method
Because:

* Part of M3a.
* We want `createBillingAgreement` added to PaypalService.

This commit:

* Adds `createBillingAgreement` in `PaypalService`.
* Adds `CurrencyManager` library.
* Adds `status` to `createBillingAgreement` in `PaypalRepository`.
* Adds/updates all applicable tests.

Closes FXA-8935
2024-04-24 11:07:34 -07:00
Barry Chen d588eb23e8
feat(password): send OTP to start password reset flow
Because:
 - we want to use OTPs to improve the UX of the password reset flow

This commit:
 - adds a lib for generating and validating random numeric OTPs
 - adds a new auth-server endpoint for requesting the OTP in an email
   - this endpoint does not send an email yet; To Be Implemented
2024-04-24 12:11:14 -05:00
dschom 8b9051f881
task(graphql): Send notifications when users opt in/out of metrics collection
Because:
- We want to let RPs know when users opt out of metrics collection
- We want to let RPs know when users opt in to metrics collection

This Commit:
- Ports the notifier code over to nx libs from auth server
- Ports other supporting libraries from fxa-shared to nx libs
  - MozLoggerService
  - Sentry
  - Metrics (ie statsd)
- Updates graphql to emit a 'metricsChange' event when users toggle their 'Help improve Mozilla accounts' option in settings.
- Adds support for the metricsChanged event to the fxa-event-broker
2024-04-24 08:10:14 -07:00
Reino Muhl c595afe4f3
feat(next): create setupCart server action
Because:

* Call CartService.setupCart from payments-next via server action.

This commit:

* Extracts fxa-geodb into libs/* library
* Updates CartService to include GeodbManager
* Call setupCart from payments-next

Closes #FXA-8892
2024-04-15 12:48:35 -04:00
Reino Muhl 652c09ab50
feat(next): add l10n to localizer for next rsc
Because:

* Ensure all localization strings can be localized in React Server
  Components.

This commit:

* Removes LocalizerServer
* Adds LocalizerRSC to serve as a wrapper for ReactLocalization that can
  be used by React Server Components, as well as a few other utility
  methods.
* Adds LocalizerRscFactory that instantiates LocalizerRSC only with
  bundles for a provided acceptLanguage string.
* Adds LocalizerRscFactoryProvider to be used with the NestApp to
  instantiate and then intialize the LocalizerRscFactory. Initalization
  will fetch all messages from disk and populate the bundles.
* Reorganize shared/l10n library to match Node style guide
* Removes demo l10n code
* Update purchase-details, terms-and-service components, and success and
  error pages to use new LocalizerRSC class for localization.
* Adds temporary l10n-convert script to provide translation for existing
  ftl strings.

Closes #FXA-8822
2024-04-08 14:58:17 -04:00
Reino Muhl 695d791b15
feat(l10n): add localizer class for payments next
Because:

* Create a localizer class that can be used by payments next react
  server components.
* Only generate fluent bundles once on startup.

This commit:

* Moves logic from Localizer class, defined in
  `fxa-auth-server/lib/l10n/index.ts`, to a LocalizerBase class.
* Adds LocalizerServer class to be used by payments next.
* Moves nestapp from payments-next app to a library

Closes #FXA-8821
2024-03-22 08:58:53 -04:00
Lisa Chan 25bcf355ed
feat(shared-assets): Create library for shared assets 2024-03-20 18:54:49 -04:00
Ben Bangert c28b061257
chore: update Node to LTS 20, TypeScript, tsconfig
Because:

* We want to update to Node 20 LTS.
* We want to target the JS output of Node 20.
* We want to use the latest TypeScript 5.4

This commit:

* Updates the Node version to 20 LTS.
* Updates the TypeScript version and related TS libs
  to 5.4.
* Updates tsconfig for the new Node 20 target.
2024-03-14 11:54:20 -07:00
dschom aaa625ce15
task(admin-panel): Hookup account delete
Because:
- We want to delete accounts from the admin panel

This Commit:
- Adds cloud task emulator pm2 service
- Creates cloud-task nx lib for interacting with cloud tasks
- Creates PageDeleteAccount in admin panel
- Adds ability to delete accounts to admin server's account resolver
- Fixes broken admin panel configuration
- Fixes broken admin server configuration
2024-03-13 11:26:09 -07:00
Julian Poyourow 573a18be60
feat(auth): type-cacheable firestore and networkfirst adapter 2024-02-14 09:01:30 -08:00
Reino Muhl a9259228ad
fix(auth): add contentful to plans api
Because:

* The GET /plans API is used in multiple places to retrieve the relying
  party configuration data currently configured in Stripe.metadata

This commit:

* Updates the logic used by the GET /plans API to retrieve the relying
  party configuration data from Contentful, with Stripe.metadata as a
  fallback
* Reports a Sentry error when the Contentful configuration data does not
  match the Stripe.metadata

Closes #FXA-8538
2023-11-17 10:26:54 -05:00
Ivo Plamenac 5c5b055f86
feat(sp3): add Stripe Factories
Because:

* we want to employ the factory pattern for mocking testing data

This commit:

* adds factory functions for several stripe objects

Closes #FXA-8311
2023-10-25 10:52:05 -07:00
Reino Muhl 63e5ab95fd
feat(libs): move fxa-shared/l10n to libs/shared/l10n
Because:

* We want to use functions from fxa-shared/l10n in new libs/* libraries
  including libs/shared/contentful.

This commit:

* Moves fxa-shared/l10n to libs/shared/l10n
* Updates all references in packages/*

Closes #FXA-8228
2023-10-04 16:08:01 -04:00
Bianca Danforth 83501ecf83
feat(libs): create EligibilityManager library
Because:

* Plan eligibility depends on a number of factors, including what plans the user is already subscribed to (in Stripe, Google IAP or Apple IAP) and available upgrade paths for those plans per product-specific config (in Stripe metadata currently but soon to live in Contentful).
* We want to break out eligibility checks and types into a separate library from the auth server's `CapabilityService.getPlanEligibility`, since it's not really capability-oriented.

This commit:

* Generates a new nx library in lib/payments/eligibility

Closes #FXA-7582
2023-09-25 16:02:44 -04:00
Lisa Chan 8616a34f6d
feat(libs): Create CapabilityManager library 2023-09-14 09:15:26 -04:00
Reino Muhl 3894a65527
feat(next): payments-next initial work
Because:

* Create the initial work for the Checkout page as a starting point and
  example for the rest of the SP3 components and pages.

This commit:

* Adds the payments/next/ui Next.js library.
* Move Header JSX into layout.tsx and remove ExampleHeader component.
* Add RSC PurchaseDetails, using JSX from SP2.5 PlanDetails component.
* Add RSC TermsAndPrivacy component
* Add various stubs functions for illustration purposes. These will be
  replaced with actual implementations in future tickets.
  * Cart fetch
  * Contentful fetch
  * Translation using @fluent/bundle

Closes FXA-8133
2023-09-12 14:24:39 -04:00
Meghan Sardesai a999afd748
chore(next): add Storybook to NextJS setup
Because:

* We want to include Storybook in 3.0.

This commit:

* Ensures Storybook component loads as expected.
* Ensures shared Tailwind styles can be used in payments-next and works with hot-reloading.
* Ensures the build script executes without any errors.

Closes FXA-7503
2023-09-11 17:26:30 -04:00
Ben Bangert 0be6fd95c5
feat: add account manager class
Because:

* We want to have a single place to manage account related operations in
  the database layer.

This commit:

* Adds a new AccountManager class and account package.

Closes #FXA-6623
2023-08-18 09:06:28 -07:00
Julian Poyourow d65c9f9cc7
feat(shared): contentful client
Because
- We need a reusable client for accessing contentful

This Commit
- Adds a contentful client with automated codegen
- Creates a reusable query system

Closes FXA-7501
2023-08-16 16:27:12 +00:00
Bianca Danforth a9dc3372fe
feat(shared): create error library with initial error classes
Because:

* We want an error library to generalize error handling across all new integrated libraries.

This commit:

* Generates a new JS library with nx called shared-error that exports a few error classes.
* Ports the PayPalClientError to the new library as an example error (renamed to PayPalNVPError with PayPalClientError becoming a MultiError composed of one or more PayPalNVPErrors), refactoring the multiple error handling logic to a new helper.

Closes #FXA-7656
2023-08-02 11:26:54 -04:00
Reino Muhl 868a723be6
feat(payments): add cart library and factories
Because:

* Need a library to handle the cart db table and related functions

This commit:

* Add cart DB model
* Initializes the Cart library and creates factories and types
* Adds CartManager library
* Adds Cart related resolvers with basic Cart DB queries

Closes: #FXA-7508 #FXA-7505
2023-08-01 14:42:42 -04:00
Ben Bangert 9e1670ab30
feat: add foundational db classes
Because:

 * We want to use clean and well tested code for our new integrated
   account database layer.
 * We don't want to use stored procedures for new code.

This commit:

 * Adds a new library that contains core mysql connection functionality.
 * Duplicates core objection classes and setup from fxa-shared without
   stored procedure functionality.

Closes FXA-6622
2023-07-24 14:44:12 -04:00
Lisa Chan d4bf24117c
chore(next): Add Next.js to fxa and initial setup 2023-07-19 14:57:15 -04:00
Julian Poyourow 1faa33a353
feat(payments/paypal): add subs/paypal library
Because:

* Nx gives us the ability to break things up into smaller libraries with
  individual responsibilities.
* Paypal logic can exist in a standalone library for reusability in SP3

This commit:

* Moves PayPalClient and associated utils/typings to a library named
  `subs/paypal`. It can be imported via `@fxa/payments/paypal` in any
  TypeScript code.

Closes FXA-7610
2023-06-07 11:40:10 -07:00
Julian Poyourow d07236bcd8
chore(build): upgrade nx to v16
Because:

* Nx released v16!

This commit:

* Upgrades Nx to v16 using `nx migrate`

Closes FXA-7622
2023-06-01 13:21:44 -07:00
Julian Poyourow 565ebb89c9
chore(build): initial nx implementation
Because:

* We want to introduce nx to the repository

This commit:

* Adds nx with working builds

Closes: FXA-7341

Co-authored-by: dschom <dschomburg@mozilla.com>
2023-05-23 08:37:47 -07:00