Skip to content

Commit 15dc309

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 80f998a commit 15dc309

9 files changed

Lines changed: 23 additions & 17 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: 13 additions & 4 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';
@@ -3502,7 +3502,10 @@ export class StripeHelper extends StripeHelperBase {
35023502
return;
35033503
}
35043504

3505-
return this.stripeFirestore.fetchAndInsertCustomer(customerId, event.created);
3505+
return this.stripeFirestore.fetchAndInsertCustomer(
3506+
customerId,
3507+
event.created
3508+
);
35063509
}
35073510

35083511
/**
@@ -3525,7 +3528,10 @@ export class StripeHelper extends StripeHelperBase {
35253528
CUSTOMER_RESOURCE
35263529
);
35273530
if (!customer.deleted && !customer.currency) {
3528-
await this.stripeFirestore.fetchAndInsertCustomer(customerId, event.created);
3531+
await this.stripeFirestore.fetchAndInsertCustomer(
3532+
customerId,
3533+
event.created
3534+
);
35293535
const subscription =
35303536
await this.stripe.subscriptions.retrieve(subscriptionId);
35313537
return subscription;
@@ -3566,7 +3572,10 @@ export class StripeHelper extends StripeHelperBase {
35663572
);
35673573
} catch (err) {
35683574
if (err.name === FirestoreStripeError.FIRESTORE_CUSTOMER_NOT_FOUND) {
3569-
await this.stripeFirestore.fetchAndInsertCustomer(customerId, event.created);
3575+
await this.stripeFirestore.fetchAndInsertCustomer(
3576+
customerId,
3577+
event.created
3578+
);
35703579
await this.stripeFirestore.fetchAndInsertInvoice(
35713580
invoiceId,
35723581
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
@@ -12,7 +12,7 @@ const { ignoreErrors } = require('@fxa/accounts/errors');
1212
const {
1313
formatMetadataValidationErrorMessage,
1414
reportValidationError,
15-
} = require('fxa-shared/sentry/report-validation-error');
15+
} = require('@fxa/shared/sentry-node');
1616

1717
function reportSentryMessage(message, captureContext) {
1818
Sentry.withScope((scope) => {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ const { configureSentry } = require('./sentry');
2020
const { swaggerOptions } = require('../docs/swagger/swagger-options');
2121
const { Account } = require('fxa-shared/db/models/auth');
2222
const { determineLocale } = require('../../../libs/shared/l10n/src');
23-
const {
24-
reportValidationError,
25-
} = require('fxa-shared/sentry/report-validation-error');
23+
const { reportValidationError } = require('@fxa/shared/sentry-node');
2624
const { logErrorWithGlean } = require('./metrics/glean');
2725
const mfa = require('./routes/auth-schemes/mfa');
2826
const verifiedSessionToken = require('./routes/auth-schemes/verified-session-token');

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

Lines changed: 3 additions & 4 deletions
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();
@@ -62,9 +62,8 @@ export async function init() {
6262
const lockDuration =
6363
parseInt(`${program.lockDuration}`) || DEFAULT_LOCK_DURATION_MS;
6464

65-
const { log, database, senders } = await setupProcessingTaskObjects(
66-
'paypal-processor'
67-
);
65+
const { log, database, senders } =
66+
await setupProcessingTaskObjects('paypal-processor');
6867

6968
initSentry(
7069
{

packages/fxa-auth-server/test/local/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const customs = mocks.mockCustoms();
2020
const sandbox = sinon.createSandbox();
2121
const mockReportValidationError = sandbox.stub();
2222
const server = proxyquire(`${ROOT_DIR}/lib/server`, {
23-
'fxa-shared/sentry/report-validation-error': {
23+
'@fxa/shared/sentry-node': {
2424
reportValidationError: mockReportValidationError,
2525
},
2626
});

0 commit comments

Comments
 (0)