diff --git a/packages/functional-tests/tests/settings/misc.spec.ts b/packages/functional-tests/tests/settings/misc.spec.ts index bdfb753892..ae5a658fd7 100644 --- a/packages/functional-tests/tests/settings/misc.spec.ts +++ b/packages/functional-tests/tests/settings/misc.spec.ts @@ -120,7 +120,7 @@ test.describe('severity-3 #smoke', () => { await recoveryKey.submit(); const dl = await recoveryKey.dataTrio.clickDownload(); expect(dl.suggestedFilename()).toBe( - `${credentials.email} Firefox recovery key.txt` + `${credentials.email} Firefox account recovery key.txt` ); const clipboard = await recoveryKey.dataTrio.clickCopy(); expect(clipboard).toEqual(await recoveryKey.getKey()); diff --git a/packages/functional-tests/tests/settings/password.spec.ts b/packages/functional-tests/tests/settings/password.spec.ts index 201d3fa218..04d7210939 100644 --- a/packages/functional-tests/tests/settings/password.spec.ts +++ b/packages/functional-tests/tests/settings/password.spec.ts @@ -47,7 +47,7 @@ test.describe('severity-1 #smoke', () => { }); // https://testrail.stage.mozaws.net/index.php?/cases/view/1293431 - test('forgot password has recovery key but skip using it #1293431', async ({ + test('forgot password has account recovery key but skip using it #1293431', async ({ target, credentials, page, diff --git a/packages/functional-tests/tests/settings/recoveryKey.spec.ts b/packages/functional-tests/tests/settings/recoveryKey.spec.ts index 4da09ac3a0..827a35ad34 100644 --- a/packages/functional-tests/tests/settings/recoveryKey.spec.ts +++ b/packages/functional-tests/tests/settings/recoveryKey.spec.ts @@ -4,7 +4,7 @@ import { EmailHeader, EmailType } from '../../lib/email'; test.describe('severity-1 #smoke', () => { // https://testrail.stage.mozaws.net/index.php?/cases/view/1293421 // https://testrail.stage.mozaws.net/index.php?/cases/view/1293429 - test('add and remove recovery key #1293421 #1293429', async ({ + test('add and remove account recovery key #1293421 #1293429', async ({ credentials, pages: { settings, recoveryKey }, }) => { @@ -26,7 +26,7 @@ test.describe('severity-1 #smoke', () => { // https://testrail.stage.mozaws.net/index.php?/cases/view/1293432 // https://testrail.stage.mozaws.net/index.php?/cases/view/1293433 - test('use recovery key #1293432 #1293433', async ({ + test('use account recovery key #1293432 #1293433', async ({ credentials, target, pages: { page, login, recoveryKey, settings }, diff --git a/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.test.tsx b/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.test.tsx index 4f267242fa..9cdf22c80d 100644 --- a/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.test.tsx +++ b/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.test.tsx @@ -274,7 +274,7 @@ it('displays the totp status', async () => { expect(getByTestId('totp-enabled')).toBeInTheDocument(); }); -it('displays the recovery key status', async () => { +it('displays the account recovery key status', async () => { const { getByTestId } = render( diff --git a/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.tsx b/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.tsx index bf1bb2e081..ebc68daad9 100644 --- a/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.tsx +++ b/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.tsx @@ -486,7 +486,7 @@ export const Account = ({ )}
  • -

    Recovery Key

    +

    Account Recovery Key

  • {recoveryKeys && recoveryKeys.length > 0 ? ( <> @@ -499,7 +499,7 @@ export const Account = ({ ) : (
  • - This account doesn't have a recovery key enabled. + This account doesn't have an account recovery key enabled.
  • )} @@ -806,13 +806,13 @@ const RecoveryKeys = ({ verifiedAt, createdAt, enabled }: RecoveryKeysType) => {
    • - Recovery Key Created At:{' '} + Account Recovery Key Created At:{' '} {recoveryKeyCreatedDate}
    • - Recovery Key Confirmed At:{' '} + Account Recovery Key Confirmed At:{' '} {
    • - Recovery Key Enabled:{' '} + Account Recovery Key Enabled:{' '} { code: 400, error: 'Bad Request', errno: ERRNO.RECOVERY_KEY_NOT_FOUND, - message: 'Recovery key not found.', + message: 'Account recovery key not found.', }); }; @@ -1074,7 +1074,7 @@ AppError.recoveryKeyInvalid = () => { code: 400, error: 'Bad Request', errno: ERRNO.RECOVERY_KEY_INVALID, - message: 'Recovery key is not valid.', + message: 'Account recovery key is not valid.', }); }; @@ -1093,7 +1093,7 @@ AppError.recoveryKeyExists = () => { code: 400, error: 'Bad Request', errno: ERRNO.RECOVERY_KEY_EXISTS, - message: 'Recovery key already exists.', + message: 'Account recovery key already exists.', }); }; diff --git a/packages/fxa-auth-server/lib/routes/account.ts b/packages/fxa-auth-server/lib/routes/account.ts index ef36e3c034..445e426b2a 100644 --- a/packages/fxa-auth-server/lib/routes/account.ts +++ b/packages/fxa-auth-server/lib/routes/account.ts @@ -1318,8 +1318,8 @@ export class AccountHandler { }; const recoveryKeyDeleteAndEmailNotification = async () => { - // If the password was reset with a recovery key, then we explicitly delete the - // recovery key and send an email that the account was reset with it. + // If the password was reset with an account recovery key, then we explicitly delete the + // account recovery key and send an email that the account was reset with it. if (recoveryKeyId) { await this.db.deleteRecoveryKey(account.uid); diff --git a/packages/fxa-auth-server/lib/routes/recovery-key.js b/packages/fxa-auth-server/lib/routes/recovery-key.js index f6fc2fa96d..43ec99d9f4 100644 --- a/packages/fxa-auth-server/lib/routes/recovery-key.js +++ b/packages/fxa-auth-server/lib/routes/recovery-key.js @@ -47,8 +47,8 @@ module.exports = (log, db, Password, verifierVersion, customs, mailer) => { const { uid } = sessionToken; const { recoveryKeyId, recoveryData, enabled } = request.payload; - // Users that already have an enabled recovery key can not - // create a second recovery key + // Users that already have an enabled account recovery key can not + // create a second account recovery key try { await db.createRecoveryKey(uid, recoveryKeyId, recoveryData, enabled); } catch (err) { @@ -130,7 +130,7 @@ module.exports = (log, db, Password, verifierVersion, customs, mailer) => { const { recoveryKeyId } = request.payload; - // Attempt to retrieve a recovery key, if it exists and is not already enabled, + // Attempt to retrieve an account recovery key, if it exists and is not already enabled, // then we enable it. const recoveryKeyData = await db.getRecoveryKey(uid, recoveryKeyId); @@ -223,7 +223,7 @@ module.exports = (log, db, Password, verifierVersion, customs, mailer) => { if (!uid) { // If not using a sessionToken, an email is required to check - // for a recovery key. This occurs when checking from the + // for an account recovery key. This occurs when checking from the // password reset page and allows us to redirect the user to either // the regular password reset or account recovery password reset. if (!email) { diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/en.ftl b/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/en.ftl index 1f5d6bb7ed..ac25446e0d 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/en.ftl +++ b/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/en.ftl @@ -1,7 +1,7 @@ -passwordResetAccountRecovery-subject = Password updated using recovery key -passwordResetAccountRecovery-title = Your account password was reset with a recovery key -passwordResetAccountRecovery-description = You have successfully reset your password using a recovery key from the following device: -passwordResetAccountRecovery-action = Create new recovery key -passwordResetAccountRecovery-regen-required = You will need to generate a new recovery key. +passwordResetAccountRecovery-subject = Password updated using account recovery key +passwordResetAccountRecovery-title = Your account password was reset with an account recovery key +passwordResetAccountRecovery-description = You have successfully reset your password using an account recovery key from the following device: +passwordResetAccountRecovery-action = Create new account recovery key +passwordResetAccountRecovery-regen-required = You will need to generate a new account recovery key. # After the colon, there's a link to https://accounts.firefox.com/settings/account_recovery -passwordResetAccountRecovery-create-key = Create new recovery key: +passwordResetAccountRecovery-create-key = Create new account recovery key: diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/includes.json b/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/includes.json index 699058dbf0..ef413de650 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/includes.json +++ b/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/includes.json @@ -1,10 +1,10 @@ { "subject": { "id": "passwordResetAccountRecovery-subject", - "message": "Password updated using recovery key" + "message": "Password updated using account recovery key" }, "action": { "id": "passwordResetAccountRecovery-action", - "message": "Create new recovery key" + "message": "Create new account recovery key" } } diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/index.mjml b/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/index.mjml index f7427e6227..c93fa4daf7 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/index.mjml +++ b/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/index.mjml @@ -5,11 +5,11 @@ - Your account password was reset with a recovery key + Your account password was reset with an account recovery key - You have successfully reset your password using a recovery key from the following device: + You have successfully reset your password using an account recovery key from the following device: @@ -19,14 +19,14 @@ - You will need to generate a new recovery key. + You will need to generate a new account recovery key. <%- include('/partials/button/index.mjml', { buttonL10nId: "passwordResetAccountRecovery-action", - buttonText: "Create new recovery key" + buttonText: "Create new account recovery key" }) %> <%- include('/partials/automatedEmailChangePassword/index.mjml') %> diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/index.stories.ts b/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/index.stories.ts index 26c2c18078..5a2d9d9561 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/index.stories.ts +++ b/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/index.stories.ts @@ -12,7 +12,7 @@ export default { const createStory = storyWithProps( 'passwordResetAccountRecovery', - 'Sent when recovery key is used', + 'Sent when account recovery key is used', { ...MOCK_USER_INFO, link: 'http://localhost:3030/settings/account_recovery', diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/index.txt b/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/index.txt index f21afc0c78..fb94624534 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/index.txt +++ b/packages/fxa-auth-server/lib/senders/emails/templates/passwordResetAccountRecovery/index.txt @@ -1,12 +1,12 @@ -passwordResetAccountRecovery-title = "Your account password was reset with a recovery key" +passwordResetAccountRecovery-title = "Your account password was reset with an account recovery key" -passwordResetAccountRecovery-description = "You have successfully reset your password using a recovery key from the following device:" +passwordResetAccountRecovery-description = "You have successfully reset your password using an account recovery key from the following device:" <%- include('/partials/userInfo/index.txt') %> -passwordResetAccountRecovery-regen-required = "You will need to generate a new recovery key." +passwordResetAccountRecovery-regen-required = "You will need to generate a new account recovery key." -passwordResetAccountRecovery-create-key = "Create new recovery key:" +passwordResetAccountRecovery-create-key = "Create new account recovery key:" <%- link %> <%- include('/partials/changePassword/index.txt') %> diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/postAddAccountRecovery/index.stories.ts b/packages/fxa-auth-server/lib/senders/emails/templates/postAddAccountRecovery/index.stories.ts index 5542ada8c0..718b3bac7b 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/postAddAccountRecovery/index.stories.ts +++ b/packages/fxa-auth-server/lib/senders/emails/templates/postAddAccountRecovery/index.stories.ts @@ -12,7 +12,7 @@ export default { const createStory = storyWithProps( 'postAddAccountRecovery', - 'Sent when new recovery key is generated', + 'Sent when new account recovery key is generated', { ...MOCK_USER_INFO, link: 'http://localhost:3030/settings', diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/postRemoveAccountRecovery/en.ftl b/packages/fxa-auth-server/lib/senders/emails/templates/postRemoveAccountRecovery/en.ftl index f67b40363f..dacce413f3 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/postRemoveAccountRecovery/en.ftl +++ b/packages/fxa-auth-server/lib/senders/emails/templates/postRemoveAccountRecovery/en.ftl @@ -2,4 +2,4 @@ postRemoveAccountRecovery-subject = Account recovery key removed postRemoveAccountRecovery-title = Account recovery key removed postRemoveAccountRecovery-description = You have successfully removed an account recovery key for your { -product-firefox-account } using the following device: postRemoveAccountRecovery-action = Manage account -postRemoveAccountRecovery-invalid = This recovery key can no longer be used to recover your account. +postRemoveAccountRecovery-invalid = This account recovery key can no longer be used to recover your account. diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/postRemoveAccountRecovery/index.mjml b/packages/fxa-auth-server/lib/senders/emails/templates/postRemoveAccountRecovery/index.mjml index e130495fef..5a451db4f4 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/postRemoveAccountRecovery/index.mjml +++ b/packages/fxa-auth-server/lib/senders/emails/templates/postRemoveAccountRecovery/index.mjml @@ -19,7 +19,7 @@ - This recovery key can no longer be used to recover your account. + This account recovery key can no longer be used to recover your account. diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/postRemoveAccountRecovery/index.txt b/packages/fxa-auth-server/lib/senders/emails/templates/postRemoveAccountRecovery/index.txt index a036efe967..006f813cd5 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/postRemoveAccountRecovery/index.txt +++ b/packages/fxa-auth-server/lib/senders/emails/templates/postRemoveAccountRecovery/index.txt @@ -4,7 +4,7 @@ postRemoveAccountRecovery-description = "You have successfully removed an accoun <%- include('/partials/userInfo/index.txt') %> -postRemoveAccountRecovery-invalid = "This recovery key can no longer be used to recover your account." +postRemoveAccountRecovery-invalid = "This account recovery key can no longer be used to recover your account." <%- include('/partials/manageAccount/index.txt') %> diff --git a/packages/fxa-auth-server/test/local/routes/account.js b/packages/fxa-auth-server/test/local/routes/account.js index 21eccc34af..98ea50ca97 100644 --- a/packages/fxa-auth-server/test/local/routes/account.js +++ b/packages/fxa-auth-server/test/local/routes/account.js @@ -198,7 +198,7 @@ describe('/account/reset', () => { clientAddress = mockRequest.app.clientAddress; }); - describe('reset account with recovery key', () => { + describe('reset account with account recovery key', () => { let res; beforeEach(() => { mockRequest.payload.wrapKb = hexString(32); @@ -211,7 +211,7 @@ describe('/account/reset', () => { assert.ok(res.keyFetchToken, 'return keyFetchToken'); }); - it('should have checked for recovery key', () => { + it('should have checked for account recovery key', () => { assert.equal(mockDB.getRecoveryKey.callCount, 1); const args = mockDB.getRecoveryKey.args[0]; assert.equal( @@ -223,11 +223,11 @@ describe('/account/reset', () => { assert.equal( args[1], mockRequest.payload.recoveryKeyId, - 'recovery key id passed' + 'account recovery key id passed' ); }); - it('should have reset account with recovery key', () => { + it('should have reset account with account recovery key', () => { assert.equal(mockDB.resetAccount.callCount, 1); assert.equal(mockDB.resetAccountTokens.callCount, 1); assert.equal(mockDB.createKeyFetchToken.callCount, 1); @@ -241,7 +241,7 @@ describe('/account/reset', () => { assert.equal(args[0].wrapKb, mockRequest.payload.wrapKb, 'wrapKb passed'); }); - it('should have deleted recovery key', () => { + it('should have deleted account recovery key', () => { assert.equal(mockDB.deleteRecoveryKey.callCount, 1); const args = mockDB.deleteRecoveryKey.args[0]; assert.equal( diff --git a/packages/fxa-auth-server/test/local/routes/recovery-keys.js b/packages/fxa-auth-server/test/local/routes/recovery-keys.js index 3db1f4fb48..8fce93c40d 100644 --- a/packages/fxa-auth-server/test/local/routes/recovery-keys.js +++ b/packages/fxa-auth-server/test/local/routes/recovery-keys.js @@ -17,7 +17,7 @@ const recoveryData = '11111111111'; const uid = '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'; describe('POST /recoveryKey', () => { - describe('should create recovery key', () => { + describe('should create account recovery key', () => { beforeEach(() => { const requestOptions = { credentials: { uid, email }, @@ -85,7 +85,7 @@ describe('POST /recoveryKey', () => { }); }); - describe('should create disabled recovery key', () => { + describe('should create disabled account recovery key', () => { beforeEach(() => { const requestOptions = { credentials: { uid, email }, @@ -112,7 +112,7 @@ describe('POST /recoveryKey', () => { }); }); - describe('should verify recovery key', () => { + describe('should verify account recovery key', () => { beforeEach(() => { const requestOptions = { credentials: { uid, email }, @@ -196,7 +196,7 @@ describe('POST /recoveryKey', () => { }); describe('GET /recoveryKey/{recoveryKeyId}', () => { - describe('should get recovery key', () => { + describe('should get account recovery key', () => { beforeEach(() => { const requestOptions = { credentials: { uid, email }, @@ -264,14 +264,14 @@ describe('GET /recoveryKey/{recoveryKeyId}', () => { assert.deepEqual( response.errno, errors.ERRNO.RECOVERY_KEY_INVALID, - 'correct invalid recovery key errno' + 'correct invalid account recovery key errno' ); }); }); }); describe('POST /recoveryKey/exists', () => { - describe('should check if recovery key exists using sessionToken', () => { + describe('should check if account recovery key exists using sessionToken', () => { beforeEach(() => { const requestOptions = { credentials: { uid, email }, @@ -305,7 +305,7 @@ describe('POST /recoveryKey/exists', () => { }); }); - describe('should check if recovery key exists using email', () => { + describe('should check if account recovery key exists using email', () => { beforeEach(() => { const requestOptions = { payload: { email }, @@ -349,7 +349,7 @@ describe('POST /recoveryKey/exists', () => { }); describe('DELETE /recoveryKey', () => { - describe('should delete recovery key', () => { + describe('should delete account recovery key', () => { beforeEach(() => { const requestOptions = { method: 'DELETE', diff --git a/packages/fxa-auth-server/test/local/senders/emails.ts b/packages/fxa-auth-server/test/local/senders/emails.ts index b5146ddb4c..3897c60900 100644 --- a/packages/fxa-auth-server/test/local/senders/emails.ts +++ b/packages/fxa-auth-server/test/local/senders/emails.ts @@ -900,7 +900,7 @@ const TESTS: [string, any, Record?][] = [ ])], ['passwordResetAccountRecoveryEmail', new Map([ - ['subject', { test: 'equal', expected: 'Password updated using recovery key' }], + ['subject', { test: 'equal', expected: 'Password updated using account recovery key' }], ['headers', new Map([ ['X-Link', { test: 'equal', expected: configUrl('createAccountRecoveryUrl', 'password-reset-account-recovery-success', 'create-recovery-key', 'email', 'uid') }], ['X-SES-MESSAGE-TAGS', { test: 'equal', expected: sesMessageTagsHeaderValue('passwordResetAccountRecovery') }], @@ -908,7 +908,7 @@ const TESTS: [string, any, Record?][] = [ ['X-Template-Version', { test: 'equal', expected: TEMPLATE_VERSIONS.passwordResetAccountRecovery }], ])], ['html', [ - { test: 'include', expected: 'Your account password was reset with a recovery key' }, + { test: 'include', expected: 'Your account password was reset with an account recovery key' }, { test: 'include', expected: decodeUrl(configHref('createAccountRecoveryUrl', 'password-reset-account-recovery-success', 'create-recovery-key', 'email', 'uid')) }, { test: 'include', expected: decodeUrl(configHref('initiatePasswordChangeUrl', 'password-reset-account-recovery-success', 'change-password', 'email')) }, { test: 'include', expected: decodeUrl(configHref('privacyUrl', 'password-reset-account-recovery-success', 'privacy')) }, @@ -921,7 +921,7 @@ const TESTS: [string, any, Record?][] = [ { test: 'notInclude', expected: 'utm_source=email' }, ]], ['text', [ - { test: 'include', expected: 'Your account password was reset with a recovery key' }, + { test: 'include', expected: 'Your account password was reset with an account recovery key' }, { test: 'include', expected: configUrl('createAccountRecoveryUrl', 'password-reset-account-recovery-success', 'create-recovery-key', 'email', 'uid') }, { test: 'include', expected: `please change your password.\n${configUrl('initiatePasswordChangeUrl', 'password-reset-account-recovery-success', 'change-password', 'email')}` }, { test: 'include', expected: `Mozilla Privacy Policy\n${configUrl('privacyUrl', 'password-reset-account-recovery-success', 'privacy')}` }, diff --git a/packages/fxa-auth-server/test/remote/recovery_key_tests.js b/packages/fxa-auth-server/test/remote/recovery_key_tests.js index 93497a7c93..e293b6b08c 100644 --- a/packages/fxa-auth-server/test/remote/recovery_key_tests.js +++ b/packages/fxa-auth-server/test/remote/recovery_key_tests.js @@ -64,7 +64,7 @@ describe('remote recovery keys', function () { return createMockRecoveryKey(client.uid, keys.kB).then((result) => { recoveryKeyId = result.recoveryKeyId; recoveryData = result.recoveryData; - // Should create recovery key + // Should create account recovery key return client .createRecoveryKey(result.recoveryKeyId, result.recoveryData) .then((res) => assert.ok(res, 'empty response')) @@ -79,7 +79,7 @@ describe('remote recovery keys', function () { }); }); - it('should get recovery key', () => { + it('should get account recovery key', () => { return getAccountResetToken(client, server, email) .then(() => client.getRecoveryKey(recoveryKeyId)) .then((res) => { @@ -87,11 +87,11 @@ describe('remote recovery keys', function () { }); }); - it('should fail to get unknown recovery key', () => { + it('should fail to get unknown account recovery key', () => { return getAccountResetToken(client, server, email) .then(() => client.getRecoveryKey('abce1234567890')) .then(assert.fail, (err) => { - assert.equal(err.errno, 159, 'recovery key is not valid'); + assert.equal(err.errno, 159, 'account recovery key is not valid'); }); }); @@ -143,12 +143,12 @@ describe('remote recovery keys', function () { const duration = 1000 * 60 * 60 * 24; // 24 hours const publicKey = { algorithm: 'RS', - n: - '4759385967235610503571494339196749614544606692567785790953934768202714280652973091341316862993582789079872007974809511698859885077002492642203267408776123', + n: '4759385967235610503571494339196749614544606692567785790953934768202714280652973091341316862993582789079872007974809511698859885077002492642203267408776123', e: '65537', }; - const cert1 = jwtool.unverify(await client.sign(publicKey, duration)) - .payload; + const cert1 = jwtool.unverify( + await client.sign(publicKey, duration) + ).payload; res = await client.resetAccountWithRecoveryKey( 'newpass', @@ -187,13 +187,13 @@ describe('remote recovery keys', function () { assert.equal(cert1['fxa-keysChangedAt'], cert2['fxa-keysChangedAt']); }); - it('should delete recovery key', () => { + it('should delete account recovery key', () => { return client.deleteRecoveryKey().then((res) => { assert.ok(res, 'empty response'); return client .getRecoveryKeyExists() .then((result) => { - assert.equal(result.exists, false, 'recovery key deleted'); + assert.equal(result.exists, false, 'account recovery key deleted'); }) .then(() => server.mailbox.waitForEmail(email)) .then((emailData) => { @@ -205,7 +205,7 @@ describe('remote recovery keys', function () { }); }); - it('should fail to create recovery key when one already exists', () => { + it('should fail to create account recovery key when one already exists', () => { return createMockRecoveryKey(client.uid, keys.kB).then((result) => { recoveryKeyId = result.recoveryKeyId; recoveryData = result.recoveryData; @@ -217,15 +217,15 @@ describe('remote recovery keys', function () { }); }); - describe('check recovery key status', () => { + describe('check account recovery key status', () => { describe('with sessionToken', () => { - it('should return true if recovery key exists and enabled', () => { + it('should return true if account recovery key exists and enabled', () => { return client.getRecoveryKeyExists().then((res) => { - assert.equal(res.exists, true, 'recovery key exists'); + assert.equal(res.exists, true, 'account recovery key exists'); }); }); - it("should return false if recovery key doesn't exist", () => { + it("should return false if account recovery key doesn't exist", () => { email = server.uniqueEmail(); return Client.createAndVerify( config.publicUrl, @@ -239,11 +239,15 @@ describe('remote recovery keys', function () { return client.getRecoveryKeyExists(); }) .then((res) => { - assert.equal(res.exists, false, 'recovery key doesnt exists'); + assert.equal( + res.exists, + false, + 'account recovery key doesnt exists' + ); }); }); - it('should return false if recovery key exist but not enabled', async () => { + it('should return false if account recovery key exist but not enabled', async () => { const email2 = server.uniqueEmail(); const client2 = await Client.createAndVerify( config.publicUrl, @@ -264,18 +268,18 @@ describe('remote recovery keys', function () { assert.deepEqual(res, {}); res = await client2.getRecoveryKeyExists(); - assert.equal(res.exists, false, 'recovery key doesnt exists'); + assert.equal(res.exists, false, 'account recovery key doesnt exists'); }); }); describe('with email', () => { - it('should return true if recovery key exists', () => { + it('should return true if account recovery key exists', () => { return client.getRecoveryKeyExists(email).then((res) => { - assert.equal(res.exists, true, 'recovery key exists'); + assert.equal(res.exists, true, 'account recovery key exists'); }); }); - it("should return false if recovery key doesn't exist", () => { + it("should return false if account recovery key doesn't exist", () => { email = server.uniqueEmail(); return Client.createAndVerify( config.publicUrl, @@ -289,7 +293,11 @@ describe('remote recovery keys', function () { return client.getRecoveryKeyExists(email); }) .then((res) => { - assert.equal(res.exists, false, "recovery key doesn't exist"); + assert.equal( + res.exists, + false, + "account recovery key doesn't exist" + ); }); }); }); diff --git a/packages/fxa-content-server/CHANGELOG.md b/packages/fxa-content-server/CHANGELOG.md index 6e7ac3ce03..982a7d95b9 100644 --- a/packages/fxa-content-server/CHANGELOG.md +++ b/packages/fxa-content-server/CHANGELOG.md @@ -8,7 +8,6 @@ Changes are now documented at https://github.com/mozilla/fxa/releases - pair: Show Fx View when version >= 106 Because: ([7f1bccf601](https://github.com/mozilla/fxa/commit/7f1bccf601)) - ## 1.236.0 ### New features @@ -987,7 +986,7 @@ No changes. - tests: some testing updates ([d13f9fc5e](https://github.com/mozilla/fxa/commit/d13f9fc5e)) - settings: clear local storage on account delete ([382795556](https://github.com/mozilla/fxa/commit/382795556)) - settings: ensure the object returned from useSession is stable ([045902b45](https://github.com/mozilla/fxa/commit/045902b45)) -- tests: Fixes recovery key flaky test and updates functional settings test ([37858955f](https://github.com/mozilla/fxa/commit/37858955f)) +- tests: Fixes account recovery key flaky test and updates functional settings test ([37858955f](https://github.com/mozilla/fxa/commit/37858955f)) - tests: Enabled the disabled smoke tests ([7f948a394](https://github.com/mozilla/fxa/commit/7f948a394)) ### Other changes diff --git a/packages/fxa-content-server/app/scripts/lib/auth-errors.js b/packages/fxa-content-server/app/scripts/lib/auth-errors.js index 52f00bf1ac..86010a2ea8 100644 --- a/packages/fxa-content-server/app/scripts/lib/auth-errors.js +++ b/packages/fxa-content-server/app/scripts/lib/auth-errors.js @@ -239,11 +239,11 @@ var ERRORS = { }, RECOVERY_KEY_NOT_FOUND: { errno: 158, - message: t('Recovery key not found'), + message: t('Account recovery key not found'), }, INVALID_RECOVERY_KEY: { errno: 159, - message: t('Invalid recovery key'), + message: t('Invalid account recovery key'), }, TOTP_REQUIRED: { errno: 160, @@ -586,7 +586,7 @@ var ERRORS = { }, RECOVERY_KEY_REQUIRED: { errno: 1059, - message: t('Recovery key required'), + message: t('Account recovery key required'), }, OTP_CODE_REQUIRED: { errno: 1060, diff --git a/packages/fxa-content-server/app/scripts/lib/constants.js b/packages/fxa-content-server/app/scripts/lib/constants.js index 1e870c80a8..be94155f5f 100644 --- a/packages/fxa-content-server/app/scripts/lib/constants.js +++ b/packages/fxa-content-server/app/scripts/lib/constants.js @@ -139,9 +139,9 @@ module.exports = { UTM_SOURCE_EMAIL: 'email', - // Recovery keys are base32 encoded, length 32 gives 155 bits of entropy + // Account recovery keys are base32 encoded, length 32 gives 155 bits of entropy // Ex. (32 char - 1 version char) * 5 bits = 155 bits. This gives us a - // 1 in 2^155 chance of clashing recovery keys. + // 1 in 2^155 chance of clashing account recovery keys. RECOVERY_KEY_LENGTH: 32, DEVICE_PAIRING_AUTHORITY_CONTEXT: 'device_pairing_authority', diff --git a/packages/fxa-content-server/app/scripts/lib/crypto/recovery-keys.js b/packages/fxa-content-server/app/scripts/lib/crypto/recovery-keys.js index 19773d515d..7b57bceefa 100644 --- a/packages/fxa-content-server/app/scripts/lib/crypto/recovery-keys.js +++ b/packages/fxa-content-server/app/scripts/lib/crypto/recovery-keys.js @@ -4,7 +4,7 @@ /** * This file contains utilities to help create, bundle and unbundle encrypted - * recovery key data. + * account recovery key data. * * For more encryption details, check out * https://github.com/mozilla/fxa/blob/main/packages/fxa-auth-server/docs/recovery_keys.md @@ -22,16 +22,16 @@ function getRecoveryKeyVersion() { export default { /** - * Generate a random base32 recovery key. The recovery key + * Generate a random base32 account recovery key. The account recovery key * string is prepended with version information. * * @param {Integer} length Length of string to generate (default 32 length) - * @returns {Promise} recovery key + * @returns {Promise} account recovery key */ generateRecoveryKey: function (length = 32) { return Promise.resolve().then(() => { if (length < 27) { - throw new Error('Recovery key length must be at least 27'); + throw new Error('Account recovery key length must be at least 27'); } return Base32.generate(length - 1).then((key) => { return getRecoveryKeyVersion() + key; @@ -42,18 +42,18 @@ export default { /** * Get the current version of the recovery keys. * - * @returns {string} current recovery key version + * @returns {string} current account recovery key version */ getCurrentRecoveryKeyVersion: function () { return getRecoveryKeyVersion(); }, /** - * Generates the recovery JWK from the uid and recovery key. The + * Generates the recovery JWK from the uid and account recovery key. The * recoveryJwk can be used to encrypt and decrypt data. * * @param {String} uid Uid of user - * @param {String} recoveryKey Recovery key + * @param {String} recoveryKey Account recovery key * @returns {Promise} A promise that will be fulfilled with JWK */ getRecoveryJwk: function (uid, recoveryKey) { diff --git a/packages/fxa-content-server/app/scripts/lib/fxa-client.js b/packages/fxa-content-server/app/scripts/lib/fxa-client.js index 15a5e482d1..a29fb41a0b 100644 --- a/packages/fxa-content-server/app/scripts/lib/fxa-client.js +++ b/packages/fxa-content-server/app/scripts/lib/fxa-client.js @@ -291,13 +291,13 @@ FxaClientWrapper.prototype = { accountData.verificationMethod = VerificationMethods.EMAIL; } } - + // The `originalLoginEmail` is a users current primary email, ensure // the account model uses this email and updates local storage with it if (signInOptions.originalLoginEmail) { - email = signInOptions.originalLoginEmail + email = signInOptions.originalLoginEmail; } - + return getUpdatedSessionData(email, relier, accountData, options); }); } @@ -1071,8 +1071,8 @@ FxaClientWrapper.prototype = { replaceRecoveryCodes: createClientDelegate('replaceRecoveryCodes'), /** - * Creates a new recovery key bundle for the current user. To - * create a recovery key first a session re-auth is performed, + * Creates a new account recovery key bundle for the current user. To + * create an account recovery key first a session re-auth is performed, * then the account keys are fetched and finally the recovery * bundle stores an encrypted copy of the original user's `kB` * @@ -1120,14 +1120,14 @@ FxaClientWrapper.prototype = { ), /** - * Deletes the recovery key associated with this user. + * Deletes the account recovery key associated with this user. * * @param sessionToken */ deleteRecoveryKey: createClientDelegate('deleteRecoveryKey'), /** - * Verify the recovery key associated with this user. + * Verify the account recovery key associated with this user. * * @param sessionToken * @param recoveryKeyId @@ -1135,7 +1135,7 @@ FxaClientWrapper.prototype = { verifyRecoveryKey: createClientDelegate('verifyRecoveryKey'), /** - * This checks to see if a recovery key exists for a user. + * This checks to see if an account recovery key exists for a user. * * @param sessionToken * @param {String} email User's email @@ -1149,7 +1149,7 @@ FxaClientWrapper.prototype = { * @param {String} passwordForgotCode - password forgot code * @param {String} passwordForgotToken - password forgot token * @param {Object} [options={}] Options - * @param {String} [options.accountResetWithRecoveryKey] - perform account reset with recovery key + * @param {String} [options.accountResetWithRecoveryKey] - perform account reset with account recovery key * @returns {Promise} resolves with response when complete. */ passwordForgotVerifyCode: withClient( @@ -1163,11 +1163,11 @@ FxaClientWrapper.prototype = { ), /** - * Gets recovery key bundle for the current user. + * Gets account recovery key bundle for the current user. * * @param {String} accountResetToken * @param {String} uid - Uid of user - * @param {String} recoveryKey - User's recovery key + * @param {String} recoveryKey - User's account recovery key * @returns {Promise} resolves with response when complete. */ getRecoveryBundle: withClient( @@ -1191,12 +1191,12 @@ FxaClientWrapper.prototype = { ), /** - * Reset an account using a recovery key. This maintains a user's original encryption keys. + * Reset an account using an account recovery key. This maintains a user's original encryption keys. * * @param {String} accountResetToken * @param {String} email - Email of user * @param {String} newPassword - New password for user - * @param {String} recoveryKeyId - The recoveryKeyId that mapped to original recovery key + * @param {String} recoveryKeyId - The recoveryKeyId that mapped to original account recovery key * @param {String} kB - Wrap new password with this kB * @param {String} relier - Relier to sign-in * @returns {Promise} resolves with response when complete. diff --git a/packages/fxa-content-server/app/scripts/lib/metrics.js b/packages/fxa-content-server/app/scripts/lib/metrics.js index 1ce7b58e8f..796f9dbeec 100644 --- a/packages/fxa-content-server/app/scripts/lib/metrics.js +++ b/packages/fxa-content-server/app/scripts/lib/metrics.js @@ -738,7 +738,7 @@ _.extend(Metrics.prototype, Backbone.Events, { /** * Log when a user preference is updated. Example, two step authentication, - * adding recovery email or recovery key. + * adding recovery email or account recovery key. * * @param {String} prefName - name of preference, typically view name * @param {Boolean} value - value of preference diff --git a/packages/fxa-content-server/app/scripts/models/account.js b/packages/fxa-content-server/app/scripts/models/account.js index 5c3732a341..2f43ac1d00 100644 --- a/packages/fxa-content-server/app/scripts/models/account.js +++ b/packages/fxa-content-server/app/scripts/models/account.js @@ -1533,10 +1533,10 @@ const Account = Backbone.Model.extend( }, /** - * Creates a new recovery key bundle for the current user. + * Creates a new account recovery key bundle for the current user. * * @param {String} password The current password for the user - * @param {String} enable Enable to recovery key + * @param {String} enable Enable to account recovery key * @returns {Promise} */ createRecoveryBundle(password, enabled) { @@ -1550,7 +1550,7 @@ const Account = Backbone.Model.extend( }, /** - * Deletes the recovery key associated with this user. + * Deletes the account recovery key associated with this user. * * @returns {Promise} resolves when complete. */ @@ -1559,7 +1559,7 @@ const Account = Backbone.Model.extend( }, /** - * Verify the recovery key associated with this user. + * Verify the account recovery key associated with this user. * * @returns {Promise} resolves when complete. */ @@ -1571,7 +1571,7 @@ const Account = Backbone.Model.extend( }, /** - * This checks to see if a recovery key exists for a user. + * This checks to see if an account recovery key exists for a user. * * @returns {Promise} resolves with response when complete. * @@ -1584,7 +1584,7 @@ const Account = Backbone.Model.extend( }, /** - * This checks to see if a recovery key exists for a given + * This checks to see if an account recovery key exists for a given * email. * * Response: { @@ -1602,7 +1602,7 @@ const Account = Backbone.Model.extend( * @param {String} code * @param {String} token * @param {Object} [options={}] Options - * @param {String} [options.accountResetWithRecoveryKey] - perform account reset with recovery key + * @param {String} [options.accountResetWithRecoveryKey] - perform account reset with account recovery key * @returns {Promise} resolves with response when complete. */ passwordForgotVerifyCode(code, token, options) { @@ -1613,7 +1613,7 @@ const Account = Backbone.Model.extend( * Get this user's recovery bundle, which contains their `kB`. * * @param {String} uid - Uid of user - * @param {String} recoveryKey - Recovery key for user + * @param {String} recoveryKey - Account recovery key for user * @returns {Promise} resolves with response when complete. */ getRecoveryBundle(uid, recoveryKey) { @@ -1629,7 +1629,7 @@ const Account = Backbone.Model.extend( * * @param {String} accountResetToken * @param {String} password - new password - * @param {String} recoveryKeyId - recoveryKeyId that maps to recovery key + * @param {String} recoveryKeyId - recoveryKeyId that maps to account recovery key * @param {String} kB - original kB * @param {Object} relier - relier being signed in to. * @param {String} emailToHashWith - has password with this email address diff --git a/packages/fxa-content-server/app/scripts/models/user.js b/packages/fxa-content-server/app/scripts/models/user.js index ab9f3b8aae..5eb46b133a 100644 --- a/packages/fxa-content-server/app/scripts/models/user.js +++ b/packages/fxa-content-server/app/scripts/models/user.js @@ -616,7 +616,7 @@ var User = Backbone.Model.extend({ }, /** - * Complete a password reset for the account using a recovery key. Notifies other tabs + * Complete a password reset for the account using an account recovery key. Notifies other tabs * of signin on success. * * @param {Object} account - account to sign up diff --git a/packages/fxa-content-server/app/scripts/templates/account_recovery_confirm_key.mustache b/packages/fxa-content-server/app/scripts/templates/account_recovery_confirm_key.mustache index cccf9e846a..ad7dba7124 100644 --- a/packages/fxa-content-server/app/scripts/templates/account_recovery_confirm_key.mustache +++ b/packages/fxa-content-server/app/scripts/templates/account_recovery_confirm_key.mustache @@ -22,7 +22,7 @@

      - {{#t}}Reset password with recovery key{{/t}} {{#t}}Continue to %(serviceName)s{{/t}} + {{#t}}Reset password with account recovery key{{/t}} {{#t}}Continue to %(serviceName)s{{/t}}

      @@ -31,20 +31,20 @@

      - {{#t}}Please enter the one time use recovery key you stored in a safe place to regain access to your Firefox Account.{{/t}} + {{#t}}Please enter the one time use account recovery key you stored in a safe place to regain access to your Firefox Account.{{/t}}

      {{#unsafeTranslate}}NOTE: If you reset your password and don't have account recovery key saved, some of your data will be erased (including synced server data like history and bookmarks).{{/unsafeTranslate}}

      - +
      - +
      diff --git a/packages/fxa-content-server/app/scripts/templates/complete_reset_password.mustache b/packages/fxa-content-server/app/scripts/templates/complete_reset_password.mustache index 2afd2bbade..084cac2c85 100644 --- a/packages/fxa-content-server/app/scripts/templates/complete_reset_password.mustache +++ b/packages/fxa-content-server/app/scripts/templates/complete_reset_password.mustache @@ -47,7 +47,7 @@ {{#showAccountRecoveryInfo}}

      - {{#t}}You have successfully restored your account using your recovery key. Create a new password to secure your data, and store it in a safe location.{{/t}} + {{#t}}You have successfully restored your account using your account recovery key. Create a new password to secure your data, and store it in a safe location.{{/t}}

      {{/showAccountRecoveryInfo}} diff --git a/packages/fxa-content-server/app/scripts/templates/post_verify/account_recovery/add_recovery_key.mustache b/packages/fxa-content-server/app/scripts/templates/post_verify/account_recovery/add_recovery_key.mustache index 2847596835..ff86bfabdd 100644 --- a/packages/fxa-content-server/app/scripts/templates/post_verify/account_recovery/add_recovery_key.mustache +++ b/packages/fxa-content-server/app/scripts/templates/post_verify/account_recovery/add_recovery_key.mustache @@ -3,10 +3,10 @@

      {{#serviceName}} - {{#t}}Protect your data with a recovery key{{/t}} {{#t}}Continue to %(serviceName)s{{/t}} + {{#t}}Protect your data with an account recovery key{{/t}} {{#t}}Continue to %(serviceName)s{{/t}} {{/serviceName}} {{^serviceName}} - {{#t}}Protect your data with a recovery key{{/t}} + {{#t}}Protect your data with an account recovery key{{/t}} {{/serviceName}}

      @@ -21,7 +21,7 @@

      {{#t}}Because this information is critical to your security, Firefox deletes it to protect you when your password is reset to prevent other people from accessing it.{{/t}}

      - +