Skip to content

Commit 79ad93d

Browse files
authored
Merge pull request #20297 from mozilla/fxa-9666
chore(settings): replace fxa-common-password-list npm package with vendor version
2 parents 0c4ae55 + 554afda commit 79ad93d

7 files changed

Lines changed: 20 additions & 28 deletions

File tree

packages/fxa-content-server/app/scripts/models/password_strength/password_strength_balloon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default class PasswordStrengthBalloonModel extends Model {
5959

6060
_getCommonPasswordList() {
6161
return import(
62-
/* webpackChunkName: "fxa-common-password-list" */ 'fxa-common-password-list'
62+
/* webpackChunkName: "common-password-list" */ '@fxa/vendored/common-password-list'
6363
);
6464
}
6565

packages/fxa-content-server/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"fast-text-encoding": "^1.0.4",
5858
"fxa-auth-client": "workspace:*",
5959
"fxa-auth-server": "workspace:*",
60-
"fxa-common-password-list": "0.0.4",
6160
"fxa-geodb": "workspace:*",
6261
"fxa-mustache-loader": "0.0.2",
6362
"fxa-pairing-channel": "1.0.2",

packages/fxa-content-server/webpack.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ const webpackConfig = {
8282
uuid: require.resolve('node-uuid/uuid'),
8383
vat: require.resolve('node-vat/vat'),
8484
'fxa-auth-client/browser': require.resolve('fxa-auth-client/browser'),
85+
'@fxa/vendored/common-password-list': path.resolve(
86+
__dirname,
87+
'../../libs/vendored/common-password-list/src/index.ts'
88+
),
89+
'@fxa/vendored/incremental-encoder': path.resolve(
90+
__dirname,
91+
'../../libs/vendored/incremental-encoder/src/index.ts'
92+
),
8593
},
8694
},
8795

packages/fxa-settings/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@
8181
"@fxa/shared/metrics/glean": "<rootDir>/../../libs/shared/metrics/glean/src/index.ts",
8282
"^@fxa/shared/assets(.*)$": "<rootDir>/../../libs/shared/assets/src$1",
8383
"@fxa/accounts/errors": "<rootDir>/../../libs/accounts/errors/src/index.ts",
84-
"@fxa/accounts/oauth": "<rootDir>/../../libs/accounts/oauth/src/index.ts"
84+
"@fxa/accounts/oauth": "<rootDir>/../../libs/accounts/oauth/src/index.ts",
85+
"@fxa/vendored/common-password-list": "<rootDir>/../../libs/vendored/common-password-list/src/index.ts",
86+
"@fxa/vendored/incremental-encoder": "<rootDir>/../../libs/vendored/incremental-encoder/src/index.ts"
8587
},
8688
"moduleFileExtensions": [
8789
"web.js",
@@ -155,7 +157,6 @@
155157
"file-saver": "^2.0.5",
156158
"fs-extra": "^11.2.0",
157159
"fxa-auth-client": "workspace:*",
158-
"fxa-common-password-list": "^0.0.4",
159160
"fxa-react": "workspace:*",
160161
"html-webpack-plugin": "^5.6.0",
161162
"identity-obj-proxy": "^3.0.0",

packages/fxa-settings/src/components/FormPassword/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,12 @@ export const FormPassword = ({
195195
return !passwordValidator.isSameAsEmail(value.toLowerCase());
196196
},
197197
uncommon: async (value: string) => {
198-
// @ts-ignore
199-
const list = await import('fxa-common-password-list');
198+
const { test: isCommon } = await import(
199+
'@fxa/vendored/common-password-list'
200+
);
200201
const input = value.toLowerCase();
201202
return (
202-
!list.test(input) && !passwordValidator.isBanned(input)
203+
!isCommon(input) && !passwordValidator.isBanned(input)
203204
);
204205
},
205206
},

packages/fxa-settings/src/components/FormPasswordWithInlineCriteria/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,12 @@ export const FormPasswordWithInlineCriteria = ({
289289
);
290290
},
291291
uncommon: async (value: string) => {
292-
// @ts-ignore
293-
const list = await import('fxa-common-password-list');
292+
const { test: isCommon } = await import(
293+
'@fxa/vendored/common-password-list'
294+
);
294295
const input = value.toLowerCase();
295296
return (
296-
!list.test(input) && !passwordValidator.isBanned(input)
297+
!isCommon(input) && !passwordValidator.isBanned(input)
297298
);
298299
},
299300
},

yarn.lock

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32060,15 +32060,6 @@ __metadata:
3206032060
languageName: unknown
3206132061
linkType: soft
3206232062

32063-
"fxa-common-password-list@npm:0.0.4, fxa-common-password-list@npm:^0.0.4":
32064-
version: 0.0.4
32065-
resolution: "fxa-common-password-list@npm:0.0.4"
32066-
dependencies:
32067-
incremental-encoder: "npm:0.0.1"
32068-
checksum: 10c0/ec639effd2d14e5394fbaee29ccec032eab2bf43b15cea33732a0b158ea49733288c26a6dcaa9b7d028ff2c8cf17f48baa4e35e0a77dbf8d27551f0ec7c8b348
32069-
languageName: node
32070-
linkType: hard
32071-
3207232063
"fxa-content-server@workspace:*, fxa-content-server@workspace:packages/fxa-content-server":
3207332064
version: 0.0.0-use.local
3207432065
resolution: "fxa-content-server@workspace:packages/fxa-content-server"
@@ -32113,7 +32104,6 @@ __metadata:
3211332104
firefox-profile: "npm:4.7.0"
3211432105
fxa-auth-client: "workspace:*"
3211532106
fxa-auth-server: "workspace:*"
32116-
fxa-common-password-list: "npm:0.0.4"
3211732107
fxa-geodb: "workspace:*"
3211832108
fxa-mustache-loader: "npm:0.0.2"
3211932109
fxa-pairing-channel: "npm:1.0.2"
@@ -32604,7 +32594,6 @@ __metadata:
3260432594
file-saver: "npm:^2.0.5"
3260532595
fs-extra: "npm:^11.2.0"
3260632596
fxa-auth-client: "workspace:*"
32607-
fxa-common-password-list: "npm:^0.0.4"
3260832597
fxa-react: "workspace:*"
3260932598
fxa-shared: "workspace:*"
3261032599
grunt: "npm:^1.6.1"
@@ -35507,13 +35496,6 @@ __metadata:
3550735496
languageName: node
3550835497
linkType: hard
3550935498

35510-
"incremental-encoder@npm:0.0.1":
35511-
version: 0.0.1
35512-
resolution: "incremental-encoder@npm:0.0.1"
35513-
checksum: 10c0/646032c1ff35ee8556e55d6fbf817fcb172147f4442f5ed786f6b8845cb05e7cc0633ef3c22e57cbf758ac328aac69215d4126f093118e206047ef2a98a4fc66
35514-
languageName: node
35515-
linkType: hard
35516-
3551735499
"indent-string@npm:^4.0.0":
3551835500
version: 4.0.0
3551935501
resolution: "indent-string@npm:4.0.0"

0 commit comments

Comments
 (0)