Skip to content

Commit b289bfb

Browse files
committed
chore(auth): Update refs to use libs instead of fxa-shared
Because: - Cleaning up code duplication This Commit: - References @fxa/shared/sentry - References @fxa/shared/otel - References @fxa/shared/monitoring
1 parent 0e5bf29 commit b289bfb

8 files changed

Lines changed: 16 additions & 12 deletions

File tree

packages/fxa-auth-server/bin/key_server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const {
2121
ProductConfigurationManager,
2222
StrapiClient,
2323
} = require('@fxa/shared/cms');
24-
const TracingProvider = require('fxa-shared/tracing/node-tracing');
24+
const { TracingProvider } = require('@fxa/shared/otel');
2525

2626
const { AppError: error } = require('@fxa/accounts/errors');
2727
const { JWTool } = require('@fxa/vendored/jwtool');

packages/fxa-auth-server/config/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import convict from 'convict';
55
import fs from 'fs';
66
import { makeRedisConfig } from 'fxa-shared/db/config';
7-
import { tracingConfig } from 'fxa-shared/tracing/config';
7+
import { tracingConfig } from '@fxa/shared/otel';
88
import { CloudTasksConvictConfigFactory } from '@fxa/shared/cloud-tasks';
99
import path from 'path';
1010
import url from 'url';

packages/fxa-auth-server/lib/monitoring.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
const { initMonitoring } = require('fxa-shared/monitoring');
5+
const { initMonitoring } = require('@fxa/shared/monitoring');
66
const Sentry = require('@sentry/node');
77
const { config } = require('../config');
88
const logger = require('./log')(

packages/fxa-auth-server/lib/payments/stripe.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ import { subscriptionProductMetadataValidator } from '../routes/validators';
6868
import {
6969
formatMetadataValidationErrorMessage,
7070
reportValidationError,
71-
} from 'fxa-shared/sentry/report-validation-error';
71+
} from '@fxa/shared/sentry-node';
7272
import { AppConfig, AuthFirestore, AuthLogger, TaxAddress } from '../types';
7373
import { PaymentConfigManager } from './configuration/manager';
7474
import { CurrencyHelper } from './currencies';
@@ -3540,7 +3540,10 @@ export class StripeHelper extends StripeHelperBase {
35403540
CUSTOMER_RESOURCE
35413541
);
35423542
if (!customer.deleted && !customer.currency) {
3543-
await this.stripeFirestore.fetchAndInsertCustomer(customerId, event.created);
3543+
await this.stripeFirestore.fetchAndInsertCustomer(
3544+
customerId,
3545+
event.created
3546+
);
35443547
const subscription =
35453548
await this.stripe.subscriptions.retrieve(subscriptionId);
35463549
return subscription;
@@ -3581,7 +3584,10 @@ export class StripeHelper extends StripeHelperBase {
35813584
);
35823585
} catch (err) {
35833586
if (err.name === FirestoreStripeError.FIRESTORE_CUSTOMER_NOT_FOUND) {
3584-
await this.stripeFirestore.fetchAndInsertCustomer(customerId, event.created);
3587+
await this.stripeFirestore.fetchAndInsertCustomer(
3588+
customerId,
3589+
event.created
3590+
);
35853591
await this.stripeFirestore.fetchAndInsertInvoice(
35863592
invoiceId,
35873593
event.created

packages/fxa-auth-server/lib/routes/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'use strict';
66

77
const url = require('url');
8-
const tracing = require('fxa-shared/tracing/node-tracing');
8+
const tracing = require('@fxa/shared/otel');
99

1010
module.exports = function (
1111
log,

packages/fxa-auth-server/lib/sentry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const Sentry = require('@sentry/node');
99
const {
1010
formatMetadataValidationErrorMessage,
1111
reportValidationError,
12-
} = require('fxa-shared/sentry/report-validation-error');
12+
} = require('@fxa/shared/sentry-node');
1313

1414
// Anything with these keys containing these strings will be redacted.
1515
const SENSITIVE_KEY_TERMS = new Set(['auth', 'pw', 'kb', 'key']);

packages/fxa-auth-server/lib/server.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ const { resolveClientTags } = require('./metrics/client-tags');
2222
const { swaggerOptions } = require('../docs/swagger/swagger-options');
2323
const { Account } = require('fxa-shared/db/models/auth');
2424
const { determineLocale } = require('../../../libs/shared/l10n/src');
25-
const {
26-
reportValidationError,
27-
} = require('fxa-shared/sentry/report-validation-error');
25+
const { reportValidationError } = require('@fxa/shared/sentry-node');
2826
const { logErrorWithGlean } = require('./metrics/glean');
2927
const mfa = require('./routes/auth-schemes/mfa');
3028
const verifiedSessionToken = require('./routes/auth-schemes/verified-session-token');

packages/fxa-auth-server/scripts/paypal-processor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { PayPalHelper } from '../lib/payments/paypal/helper';
1313
import { PayPalClient } from '@fxa/payments/paypal';
1414
import { PaypalProcessor } from '../lib/payments/paypal/processor';
1515
import { setupProcessingTaskObjects } from '../lib/payments/processing-tasks-setup';
16-
import { initSentry } from 'packages/fxa-shared/sentry/node';
16+
import { initSentry } from '@fxa/shared/sentry-node';
1717

1818
const pckg = require('../package.json');
1919
const config = require('../config').default.getProperties();

0 commit comments

Comments
 (0)