Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/fxa-settings/config/paths.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// This file was created by react-scripts' (create-react-app) eject script.
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

'use strict';
// This file was created by react-scripts' (create-react-app) eject script.

const path = require('path');
const fs = require('fs');
Expand Down
5 changes: 4 additions & 1 deletion packages/fxa-settings/config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// This file was created by react-scripts' (create-react-app) eject script.

const fs = require('fs');
Expand Down Expand Up @@ -358,7 +362,6 @@ module.exports = function (webpackEnv) {
'react-dom$': 'react-dom/profiling',
'scheduler/tracing': 'scheduler/tracing-profiling',
}),
fxaCryptoDeriver: require.resolve('@fxa/vendored/crypto-relier/esm'),
...(modules.webpackAliases || {}),
},
plugins: [
Expand Down
1 change: 1 addition & 0 deletions packages/fxa-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"^@fxa/shared/assets(.*)$": "<rootDir>/../../libs/shared/assets/src$1",
"@fxa/accounts/errors": "<rootDir>/../../libs/accounts/errors/src/index.ts",
"@fxa/accounts/oauth": "<rootDir>/../../libs/accounts/oauth/src/index.ts",
"@fxa/vendored/crypto-relier": "<rootDir>/../../libs/vendored/crypto-relier/src/index.ts",
"@fxa/vendored/common-password-list": "<rootDir>/../../libs/vendored/common-password-list/src/index.ts",
"@fxa/vendored/incremental-encoder": "<rootDir>/../../libs/vendored/incremental-encoder/src/index.ts"
},
Expand Down
10 changes: 0 additions & 10 deletions packages/fxa-settings/src/lib/crypto/deriver.ts

This file was deleted.

8 changes: 3 additions & 5 deletions packages/fxa-settings/src/lib/crypto/scoped-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// NOTE: Ported from scoped-keys.js in content server. Minor typescript adaptions applied.

import fxaCryptoDeriver from './deriver';
import * as cryptoRelier from '@fxa/vendored/crypto-relier';

/**
* Derive scoped keys and create an encrypted bundle for key transport
Expand Down Expand Up @@ -45,8 +45,7 @@ export async function createEncryptedBundle(
* @returns {Promise} A promise that will resolve into an encrypted bundle of scoped keys
*/
async function encryptBundle(bundleObject: any, keysJwk: any) {
const cryptoDeriver = await fxaCryptoDeriver();
const fxaDeriverUtils = new cryptoDeriver.DeriverUtils();
const fxaDeriverUtils = new cryptoRelier.DeriverUtils();
return fxaDeriverUtils.encryptBundle(keysJwk, JSON.stringify(bundleObject));
}

Expand All @@ -64,8 +63,7 @@ async function deriveScopedKeys(inputKey: any, uid: string, keyData: any) {
required(uid, 'uid');
required(keyData, 'key data');

const cryptoDeriver = await fxaCryptoDeriver();
const scopedKeys = new cryptoDeriver.ScopedKeys();
const scopedKeys = new cryptoRelier.ScopedKeys();

return scopedKeys.deriveScopedKey({
identifier: keyData.identifier,
Expand Down
4 changes: 4 additions & 0 deletions packages/fxa-settings/src/lib/glean/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,10 @@ describe('lib/glean', () => {

describe('thirdPartyAuth', () => {
it('submits a ping with the third_party_auth_google_reg_start event name', async () => {
GleanMetrics.initialize(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes flaky test?

{ ...mockConfig, enabled: true },
mockMetricsContext
);
const spy = sandbox.spy(thirdPartyAuth.googleRegStart, 'record');
GleanMetrics.thirdPartyAuth.startGoogleAuthFromReg();
await GleanMetrics.isDone();
Expand Down
Loading