Rename "security key" into "recovery key" (#29217)

* feat(crypto): rename "security key" into "recovery key" in lang file

* test(crypto): rename "security key" into "recovery key" in test files

* test(e2e crypto): rename "security key" into "recovery key" in test files

* doc(crypto): rename "security key" into "recovery key"
This commit is contained in:
Florian D
2025-02-10 17:52:39 +01:00
committed by GitHub
parent 4de9fe60ae
commit 047e8e8a9c
15 changed files with 93 additions and 93 deletions

View File

@@ -155,7 +155,7 @@ complete re-branding/private labeling, a more personalised experience can be ach
3. `show_once`: Optional. If true then the notice will only be shown once per device.
18. `help_url`: The URL to point users to for help with the app, defaults to `https://element.io/help`.
19. `help_encryption_url`: The URL to point users to for help with encryption, defaults to `https://element.io/help#encryption`.
20. `force_verification`: If true, users must verify new logins (eg. with another device / their security key)
20. `force_verification`: If true, users must verify new logins (eg. with another device / their recovery key)
### `desktop_builds` and `mobile_builds`

View File

@@ -58,8 +58,8 @@ test.describe("Backups", () => {
// Create another
await securityTab.getByRole("button", { name: "Set up", exact: true }).click();
await expect(currentDialogLocator.getByRole("heading", { name: "Security Key" })).toBeVisible();
await currentDialogLocator.getByLabel("Security Key").fill(securityKey);
await expect(currentDialogLocator.getByRole("heading", { name: "Recovery Key" })).toBeVisible();
await currentDialogLocator.getByLabel("Recovery Key").fill(securityKey);
await currentDialogLocator.getByRole("button", { name: "Continue", exact: true }).click();
// Should be successful
@@ -90,8 +90,8 @@ test.describe("Backups", () => {
// Try to create another
await securityTab.getByRole("button", { name: "Set up", exact: true }).click();
await expect(currentDialogLocator.getByRole("heading", { name: "Security Key" })).toBeVisible();
// But cancel the security key dialog, to simulate not having the secret storage passphrase
await expect(currentDialogLocator.getByRole("heading", { name: "Recovery Key" })).toBeVisible();
// But cancel the recovery key dialog, to simulate not having the secret storage passphrase
await currentDialogLocator.getByTestId("dialog-cancel-button").click();
await expect(currentDialogLocator.getByRole("heading", { name: "Starting backup…" })).toBeVisible();

View File

@@ -186,7 +186,7 @@ test.describe("Cryptography", function () {
await page.getByRole("button", { name: "Clear cross-signing keys" }).click();
// Enter the 4S key
await page.getByPlaceholder("Security Key").fill(secretStorageKey);
await page.getByPlaceholder("Recovery Key").fill(secretStorageKey);
await page.getByRole("button", { name: "Continue" }).click();
// Enter the password

View File

@@ -119,7 +119,7 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => {
await logIntoElement(page, credentials);
// Select the security phrase
await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Security Key or Phrase" }).click();
await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Recovery Key or Phrase" }).click();
// Fill the passphrase
const dialog = page.locator(".mx_Dialog");
@@ -136,15 +136,15 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => {
await checkDeviceIsConnectedKeyBackup(app, expectedBackupVersion, true);
});
test("Verify device with Security Key during login", async ({ page, app, credentials, homeserver }) => {
test("Verify device with Recovery Key during login", async ({ page, app, credentials, homeserver }) => {
await logIntoElement(page, credentials);
// Select the security phrase
await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Security Key or Phrase" }).click();
await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Recovery Key or Phrase" }).click();
// Fill the security key
// Fill the recovery key
const dialog = page.locator(".mx_Dialog");
await dialog.getByRole("button", { name: "use your Security Key" }).click();
await dialog.getByRole("button", { name: "use your Recovery Key" }).click();
const aliceRecoveryKey = await aliceBotClient.getRecoveryKey();
await dialog.locator("#mx_securityKey").fill(aliceRecoveryKey.encodedPrivateKey);
await dialog.locator(".mx_Dialog_primary:not([disabled])", { hasText: "Continue" }).click();

View File

@@ -35,7 +35,7 @@ test.describe("Key storage out of sync toast", () => {
await page.getByRole("button", { name: "Enter recovery key" }).click();
await page.getByRole("textbox", { name: "Security key" }).fill(recoveryKey.encodedPrivateKey);
await page.getByRole("textbox", { name: "Recovery Key" }).fill(recoveryKey.encodedPrivateKey);
await page.getByRole("button", { name: "Continue" }).click();
await expect(page.getByRole("button", { name: "Enter recovery key" })).not.toBeVisible();

View File

@@ -216,13 +216,13 @@ export async function logIntoElement(page: Page, credentials: Credentials, secur
// if a securityKey was given, verify the new device
if (securityKey !== undefined) {
await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Security Key" }).click();
await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Recovery Key" }).click();
const useSecurityKey = page.locator(".mx_Dialog").getByRole("button", { name: "use your Security Key" });
const useSecurityKey = page.locator(".mx_Dialog").getByRole("button", { name: "use your Recovery Key" });
if (await useSecurityKey.isVisible()) {
await useSecurityKey.click();
}
// Fill in the security key
// Fill in the recovery key
await page.locator(".mx_Dialog").locator('input[type="password"]').fill(securityKey);
await page.locator(".mx_Dialog_primary:not([disabled])", { hasText: "Continue" }).click();
await page.getByRole("button", { name: "Done" }).click();
@@ -249,15 +249,15 @@ export async function logOutOfElement(page: Page, discardKeys: boolean = false)
}
/**
* Open the encryption settings, and verify the current session using the security key.
* Open the encryption settings, and verify the current session using the recovery key.
*
* @param app - `ElementAppPage` wrapper for the playwright `Page`.
* @param securityKey - The security key (i.e., 4S key), set up during a previous session.
* @param securityKey - The recovery key (i.e., 4S key), set up during a previous session.
*/
export async function verifySession(app: ElementAppPage, securityKey: string) {
const settings = await app.settings.openUserSettings("Encryption");
await settings.getByRole("button", { name: "Verify this device" }).click();
await app.page.getByRole("button", { name: "Verify with Security Key" }).click();
await app.page.getByRole("button", { name: "Verify with Recovery Key" }).click();
await app.page.locator(".mx_Dialog").locator('input[type="password"]').fill(securityKey);
await app.page.getByRole("button", { name: "Continue", disabled: false }).click();
await app.page.getByRole("button", { name: "Done" }).click();
@@ -291,7 +291,7 @@ export async function doTwoWaySasVerification(page: Page, verifier: JSHandle<Ver
*
* Assumes that the current device has been cross-signed (which means that we skip a step where we set it up).
*
* Returns the security key
* Returns the recovery key
*/
export async function enableKeyBackup(app: ElementAppPage): Promise<string> {
await app.settings.openUserSettings("Security & Privacy");
@@ -319,9 +319,9 @@ export async function completeCreateSecretStorageDialog(
const currentDialogLocator = page.locator(".mx_Dialog");
await expect(currentDialogLocator.getByRole("heading", { name: "Set up Secure Backup" })).toBeVisible();
// "Generate a Security Key" is selected by default
// "Generate a Recovery Key" is selected by default
await currentDialogLocator.getByRole("button", { name: "Continue", exact: true }).click();
await expect(currentDialogLocator.getByRole("heading", { name: "Save your Security Key" })).toBeVisible();
await expect(currentDialogLocator.getByRole("heading", { name: "Save your Recovery Key" })).toBeVisible();
await currentDialogLocator.getByRole("button", { name: "Copy", exact: true }).click();
// copy the recovery key to use it later
const recoveryKey = await page.evaluate(() => navigator.clipboard.readText());
@@ -345,7 +345,7 @@ export async function completeCreateSecretStorageDialog(
}
/**
* Click on copy and continue buttons to dismiss the security key dialog
* Click on copy and continue buttons to dismiss the recovery key dialog
*/
export async function copyAndContinue(page: Page) {
await page.getByRole("button", { name: "Copy" }).click();

View File

@@ -43,7 +43,7 @@ class Helpers {
*/
async verifyDevice(recoveryKey: GeneratedSecretStorageKey) {
// Select the security phrase
await this.page.getByRole("button", { name: "Verify with Security Key" }).click();
await this.page.getByRole("button", { name: "Verify with Recovery Key" }).click();
await this.enterRecoveryKey(recoveryKey);
await this.page.getByRole("button", { name: "Done" }).click();
}
@@ -91,7 +91,7 @@ class Helpers {
}
/**
* Get the security key from the clipboard and fill in the input field
* Get the recovery key from the clipboard and fill in the input field
* Then click on the finish button
* @param title - The title of the dialog
* @param confirmButtonLabel - The label of the confirm button

View File

@@ -877,22 +877,22 @@
"empty_room_was_name": "Empty room (was %(oldName)s)",
"encryption": {
"access_secret_storage_dialog": {
"enter_phrase_or_key_prompt": "Enter your Security Phrase or <button>use your Security Key</button> to continue.",
"enter_phrase_or_key_prompt": "Enter your Security Phrase or <button>use your Recovery Key</button> to continue.",
"key_validation_text": {
"invalid_security_key": "Invalid Security Key",
"invalid_security_key": "Invalid Recovery Key",
"recovery_key_is_correct": "Looks good!",
"wrong_file_type": "Wrong file type",
"wrong_security_key": "Wrong Security Key"
"wrong_security_key": "Wrong Recovery Key"
},
"reset_title": "Reset everything",
"reset_warning_1": "Only do this if you have no other device to complete verification with.",
"reset_warning_2": "If you reset everything, you will restart with no trusted sessions, no trusted users, and might not be able to see past messages.",
"restoring": "Restoring keys from backup",
"security_key_title": "Security Key",
"security_key_title": "Recovery Key",
"security_phrase_incorrect_error": "Unable to access secret storage. Please verify that you entered the correct Security Phrase.",
"security_phrase_title": "Security Phrase",
"separator": "%(securityKey)s or %(recoveryFile)s",
"use_security_key_prompt": "Use your Security Key to continue."
"use_security_key_prompt": "Use your Recovery Key to continue."
},
"bootstrap_title": "Setting up keys",
"cancel_entering_passphrase_description": "Are you sure you want to cancel entering passphrase?",
@@ -995,7 +995,7 @@
"incoming_sas_dialog_waiting": "Waiting for partner to confirm…",
"incoming_sas_user_dialog_text_1": "Verify this user to mark them as trusted. Trusting users gives you extra peace of mind when using end-to-end encrypted messages.",
"incoming_sas_user_dialog_text_2": "Verifying this user will mark their session as trusted, and also mark your session as trusted to them.",
"no_key_or_device": "It looks like you don't have a Security Key or any other devices you can verify against. This device will not be able to access old encrypted messages. In order to verify your identity on this device, you'll need to reset your verification keys.",
"no_key_or_device": "It looks like you don't have a Recovery Key or any other devices you can verify against. This device will not be able to access old encrypted messages. In order to verify your identity on this device, you'll need to reset your verification keys.",
"no_support_qr_emoji": "The device you are trying to verify doesn't support scanning a QR code or emoji verification, which is what %(brand)s supports. Try with a different client.",
"other_party_cancelled": "The other party cancelled the verification.",
"prompt_encrypted": "Verify all users in a room to ensure it's secure.",
@@ -1045,10 +1045,10 @@
"verify_emoji_prompt_qr": "If you can't scan the code above, verify by comparing unique emoji.",
"verify_later": "I'll verify later",
"verify_reset_warning_1": "Resetting your verification keys cannot be undone. After resetting, you won't have access to old encrypted messages, and any friends who have previously verified you will see security warnings until you re-verify with them.",
"verify_reset_warning_2": "Please only proceed if you're sure you've lost all of your other devices and your Security Key.",
"verify_reset_warning_2": "Please only proceed if you're sure you've lost all of your other devices and your Recovery Key.",
"verify_using_device": "Verify with another device",
"verify_using_key": "Verify with Security Key",
"verify_using_key_or_phrase": "Verify with Security Key or Phrase",
"verify_using_key": "Verify with Recovery Key",
"verify_using_key_or_phrase": "Verify with Recovery Key or Phrase",
"waiting_for_user_accept": "Waiting for %(displayName)s to accept…",
"waiting_other_device": "Waiting for you to verify on your other device…",
"waiting_other_device_details": "Waiting for you to verify on your other device, %(deviceName)s (%(deviceId)s)…",
@@ -1799,24 +1799,24 @@
"restore_key_backup_dialog": {
"count_of_decryption_failures": "Failed to decrypt %(failedCount)s sessions!",
"count_of_successfully_restored_keys": "Successfully restored %(sessionCount)s keys",
"enter_key_description": "Access your secure message history and set up secure messaging by entering your Security Key.",
"enter_key_title": "Enter Security Key",
"enter_key_description": "Access your secure message history and set up secure messaging by entering your Recovery Key.",
"enter_key_title": "Enter Recovery Key",
"enter_phrase_description": "Access your secure message history and set up secure messaging by entering your Security Phrase.",
"enter_phrase_title": "Enter Security Phrase",
"incorrect_security_phrase_dialog": "Backup could not be decrypted with this Security Phrase: please verify that you entered the correct Security Phrase.",
"incorrect_security_phrase_title": "Incorrect Security Phrase",
"key_backup_warning": "<b>Warning</b>: you should only set up key backup from a trusted computer.",
"key_fetch_in_progress": "Fetching keys from server…",
"key_forgotten_text": "If you've forgotten your Security Key you can <button>set up new recovery options</button>",
"key_is_invalid": "Not a valid Security Key",
"key_is_valid": "This looks like a valid Security Key!",
"key_forgotten_text": "If you've forgotten your Recovery Key you can <button>set up new recovery options</button>",
"key_is_invalid": "Not a valid Recovery Key",
"key_is_valid": "This looks like a valid Recovery Key!",
"keys_restored_title": "Keys restored",
"load_error_content": "Unable to load backup status",
"load_keys_progress": "%(completed)s of %(total)s keys restored",
"no_backup_error": "No backup found!",
"phrase_forgotten_text": "If you've forgotten your Security Phrase you can <button1>use your Security Key</button1> or <button2>set up new recovery options</button2>",
"recovery_key_mismatch_description": "Backup could not be decrypted with this Security Key: please verify that you entered the correct Security Key.",
"recovery_key_mismatch_title": "Security Key mismatch",
"phrase_forgotten_text": "If you've forgotten your Security Phrase you can <button1>use your Recovery Key</button1> or <button2>set up new recovery options</button2>",
"recovery_key_mismatch_description": "Backup could not be decrypted with this Recovery Key: please verify that you entered the correct Recovery Key.",
"recovery_key_mismatch_title": "Recovery Key mismatch",
"restore_failed_error": "Unable to restore backup"
},
"right_panel": {
@@ -2616,21 +2616,21 @@
"enter_phrase_description": "Enter a Security Phrase only you know, as it's used to safeguard your data. To be secure, you shouldn't re-use your account password.",
"enter_phrase_title": "Enter a Security Phrase",
"enter_phrase_to_confirm": "Enter your Security Phrase a second time to confirm it.",
"generate_security_key_description": "We'll generate a Security Key for you to store somewhere safe, like a password manager or a safe.",
"generate_security_key_title": "Generate a Security Key",
"generate_security_key_description": "We'll generate a Recovery Key for you to store somewhere safe, like a password manager or a safe.",
"generate_security_key_title": "Generate a Recovery Key",
"pass_phrase_match_failed": "That doesn't match.",
"pass_phrase_match_success": "That matches!",
"phrase_strong_enough": "Great! This Security Phrase looks strong enough.",
"secret_storage_query_failure": "Unable to query secret storage status",
"security_key_safety_reminder": "Store your Security Key somewhere safe, like a password manager or a safe, as it's used to safeguard your encrypted data.",
"security_key_safety_reminder": "Store your Recovery Key somewhere safe, like a password manager or a safe, as it's used to safeguard your encrypted data.",
"set_phrase_again": "Go back to set it again.",
"settings_reminder": "You can also set up Secure Backup & manage your keys in Settings.",
"title_confirm_phrase": "Confirm Security Phrase",
"title_save_key": "Save your Security Key",
"title_save_key": "Save your Recovery Key",
"title_set_phrase": "Set a Security Phrase",
"unable_to_setup": "Unable to set up secret storage",
"use_different_passphrase": "Use a different passphrase?",
"use_phrase_only_you_know": "Use a secret phrase only you know, and optionally save a Security Key to use for backup."
"use_phrase_only_you_know": "Use a secret phrase only you know, and optionally save a Recovery Key to use for backup."
}
},
"key_export_import": {
@@ -2749,7 +2749,7 @@
"backup_key_stored_status": "Backup key stored:",
"backup_key_unexpected_type": "unexpected type",
"backup_key_well_formed": "well formed",
"backup_keys_description": "Back up your encryption keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Security Key.",
"backup_keys_description": "Back up your encryption keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Recovery Key.",
"bulk_options_accept_all_invites": "Accept all %(invitedRooms)s invites",
"bulk_options_reject_all_invites": "Reject all %(invitedRooms)s invites",
"bulk_options_section": "Bulk options",

View File

@@ -14,7 +14,7 @@ import userEvent from "@testing-library/user-event";
import { mockPlatformPeg, stubClient } from "../../../../test-utils";
import AccessSecretStorageDialog from "../../../../../src/components/views/dialogs/security/AccessSecretStorageDialog";
const securityKey = "EsTc WKmb ivvk jLS7 Y1NH 5CcQ mP1E JJwj B3Fd pFWm t4Dp dbyu";
const recoveryKey = "EsTc WKmb ivvk jLS7 Y1NH 5CcQ mP1E JJwj B3Fd pFWm t4Dp dbyu";
describe("AccessSecretStorageDialog", () => {
let mockClient: MatrixClient;
@@ -29,11 +29,11 @@ describe("AccessSecretStorageDialog", () => {
render(<AccessSecretStorageDialog {...defaultProps} {...props} />);
};
const enterSecurityKey = (placeholder = "Security Key"): void => {
const enterRecoveryKey = (placeholder = "Recovery Key"): void => {
act(() => {
fireEvent.change(screen.getByPlaceholderText(placeholder), {
target: {
value: securityKey,
value: recoveryKey,
},
});
// wait for debounce
@@ -67,17 +67,17 @@ describe("AccessSecretStorageDialog", () => {
renderComponent({ onFinished, checkPrivateKey });
// check that the input field is focused
expect(screen.getByPlaceholderText("Security Key")).toHaveFocus();
expect(screen.getByPlaceholderText("Recovery Key")).toHaveFocus();
await enterSecurityKey();
await enterRecoveryKey();
await submitDialog();
expect(screen.getByText("Looks good!")).toBeInTheDocument();
expect(checkPrivateKey).toHaveBeenCalledWith({ recoveryKey: securityKey });
expect(onFinished).toHaveBeenCalledWith({ recoveryKey: securityKey });
expect(checkPrivateKey).toHaveBeenCalledWith({ recoveryKey });
expect(onFinished).toHaveBeenCalledWith({ recoveryKey });
});
it("Notifies the user if they input an invalid Security Key", async () => {
it("Notifies the user if they input an invalid Recovery Key", async () => {
const onFinished = jest.fn();
const checkPrivateKey = jest.fn().mockResolvedValue(true);
renderComponent({ onFinished, checkPrivateKey });
@@ -86,11 +86,11 @@ describe("AccessSecretStorageDialog", () => {
throw new Error("invalid key");
});
await enterSecurityKey();
await enterRecoveryKey();
await submitDialog();
expect(screen.getByText("Continue")).toBeDisabled();
expect(screen.getByText("Invalid Security Key")).toBeInTheDocument();
expect(screen.getByText("Invalid Recovery Key")).toBeInTheDocument();
});
it("Notifies the user if they input an invalid passphrase", async function () {
@@ -110,8 +110,8 @@ describe("AccessSecretStorageDialog", () => {
const checkPrivateKey = jest.fn().mockResolvedValue(false);
renderComponent({ checkPrivateKey, keyInfo });
await enterSecurityKey("Security Phrase");
expect(screen.getByPlaceholderText("Security Phrase")).toHaveValue(securityKey);
await enterRecoveryKey("Security Phrase");
expect(screen.getByPlaceholderText("Security Phrase")).toHaveValue(recoveryKey);
await submitDialog();
await expect(
@@ -141,11 +141,11 @@ describe("AccessSecretStorageDialog", () => {
document.execCommand = jest.fn().mockReturnValue(true);
jest.spyOn(mockClient.getCrypto()!, "createRecoveryKeyFromPassphrase").mockResolvedValue({
privateKey: new Uint8Array(),
encodedPrivateKey: securityKey,
encodedPrivateKey: recoveryKey,
});
screen.getByRole("button", { name: "Continue" }).click();
await screen.findByText(/Save your Security Key/);
await screen.findByText(/Save your Recovery Key/);
screen.getByRole("button", { name: "Copy" }).click();
await screen.findByText("Copied!");
screen.getByRole("button", { name: "Continue" }).click();

View File

@@ -48,7 +48,7 @@ describe("CreateSecretStorageDialog", () => {
expect(result.container).toMatchSnapshot();
await userEvent.click(result.getByRole("button", { name: "Continue" }));
await screen.findByText("Save your Security Key");
await screen.findByText("Save your Recovery Key");
expect(result.container).toMatchSnapshot();
// Copy the key to enable the continue button
await userEvent.click(screen.getByRole("button", { name: "Copy" }));
@@ -66,7 +66,7 @@ describe("CreateSecretStorageDialog", () => {
"Safeguard against losing access to encrypted messages & data by backing up encryption keys on your server.",
);
await userEvent.click(screen.getByRole("button", { name: "Continue" }));
await screen.findByText("Save your Security Key");
await screen.findByText("Save your Recovery Key");
await userEvent.click(screen.getByRole("button", { name: "Copy" }));
await userEvent.click(screen.getByRole("button", { name: "Continue" }));
@@ -108,7 +108,7 @@ describe("CreateSecretStorageDialog", () => {
});
result.getByRole("button", { name: "Continue" }).click();
await result.findByText(/Save your Security Key/);
await result.findByText(/Save your Recovery Key/);
result.getByRole("button", { name: "Copy" }).click();
// Resetting should reset secret storage, cross signing, and key

View File

@@ -32,7 +32,7 @@ describe("<RestoreKeyBackupDialog />", () => {
it("should render", async () => {
const { asFragment } = render(<RestoreKeyBackupDialog onFinished={jest.fn()} />);
await waitFor(() => expect(screen.getByText("Enter Security Key")).toBeInTheDocument());
await waitFor(() => expect(screen.getByText("Enter Recovery Key")).toBeInTheDocument());
expect(asFragment()).toMatchSnapshot();
});
@@ -41,19 +41,19 @@ describe("<RestoreKeyBackupDialog />", () => {
throw new Error("Invalid recovery key");
});
const { asFragment } = render(<RestoreKeyBackupDialog onFinished={jest.fn()} />);
await waitFor(() => expect(screen.getByText("Enter Security Key")).toBeInTheDocument());
await waitFor(() => expect(screen.getByText("Enter Recovery Key")).toBeInTheDocument());
await userEvent.type(screen.getByRole("textbox"), "invalid key");
await waitFor(() => expect(screen.getByText("👎 Not a valid Security Key")).toBeInTheDocument());
await waitFor(() => expect(screen.getByText("👎 Not a valid Recovery Key")).toBeInTheDocument());
expect(asFragment()).toMatchSnapshot();
});
it("should not raise an error when recovery is valid", async () => {
const { asFragment } = render(<RestoreKeyBackupDialog onFinished={jest.fn()} />);
await waitFor(() => expect(screen.getByText("Enter Security Key")).toBeInTheDocument());
await waitFor(() => expect(screen.getByText("Enter Recovery Key")).toBeInTheDocument());
await userEvent.type(screen.getByRole("textbox"), "valid key");
await waitFor(() => expect(screen.getByText("👍 This looks like a valid Security Key!")).toBeInTheDocument());
await waitFor(() => expect(screen.getByText("👍 This looks like a valid Recovery Key!")).toBeInTheDocument());
expect(asFragment()).toMatchSnapshot();
});
@@ -79,7 +79,7 @@ describe("<RestoreKeyBackupDialog />", () => {
expect(asFragment()).toMatchSnapshot();
});
it("should restore key backup when security key is filled by user", async () => {
it("should restore key backup when Recovery key is filled by user", async () => {
jest.spyOn(matrixClient.getCrypto()!, "restoreKeyBackup")
// Reject when trying to restore from cache
.mockRejectedValueOnce(new Error("key backup not found"))
@@ -87,9 +87,9 @@ describe("<RestoreKeyBackupDialog />", () => {
.mockResolvedValue(keyBackupRestoreResult);
const { asFragment } = render(<RestoreKeyBackupDialog onFinished={jest.fn()} />);
await waitFor(() => expect(screen.getByText("Enter Security Key")).toBeInTheDocument());
await waitFor(() => expect(screen.getByText("Enter Recovery Key")).toBeInTheDocument());
await userEvent.type(screen.getByRole("textbox"), "my security key");
await userEvent.type(screen.getByRole("textbox"), "my recovery key");
await userEvent.click(screen.getByRole("button", { name: "Next" }));
await waitFor(() => expect(screen.getByText("Successfully restored 1 keys")).toBeInTheDocument());

View File

@@ -55,10 +55,10 @@ exports[`CreateSecretStorageDialog handles the happy path 1`] = `
<span
class="mx_CreateSecretStorageDialog_optionIcon mx_CreateSecretStorageDialog_optionIcon_secureBackup"
/>
Generate a Security Key
Generate a Recovery Key
</div>
<div>
We'll generate a Security Key for you to store somewhere safe, like a password manager or a safe.
We'll generate a Recovery Key for you to store somewhere safe, like a password manager or a safe.
</div>
</div>
<div
@@ -88,7 +88,7 @@ exports[`CreateSecretStorageDialog handles the happy path 1`] = `
Enter a Security Phrase
</div>
<div>
Use a secret phrase only you know, and optionally save a Security Key to use for backup.
Use a secret phrase only you know, and optionally save a Recovery Key to use for backup.
</div>
</div>
<div
@@ -148,13 +148,13 @@ exports[`CreateSecretStorageDialog handles the happy path 2`] = `
class="mx_Heading_h3 mx_Dialog_title mx_CreateSecretStorageDialog_titleWithIcon mx_CreateSecretStorageDialog_secureBackupTitle"
id="mx_BaseDialog_title"
>
Save your Security Key
Save your Recovery Key
</h1>
</div>
<div>
<div>
<p>
Store your Security Key somewhere safe, like a password manager or a safe, as it's used to safeguard your encrypted data.
Store your Recovery Key somewhere safe, like a password manager or a safe, as it's used to safeguard your encrypted data.
</p>
<div
class="mx_CreateSecretStorageDialog_primaryContainer mx_CreateSecretStorageDialog_recoveryKeyPrimarycontainer"

View File

@@ -20,7 +20,7 @@ exports[`<RestoreKeyBackupDialog /> should display an error when recovery key is
class="mx_Heading_h3 mx_Dialog_title"
id="mx_BaseDialog_title"
>
Enter Security Key
Enter Recovery Key
</h1>
</div>
<div
@@ -36,7 +36,7 @@ exports[`<RestoreKeyBackupDialog /> should display an error when recovery key is
</span>
</p>
<p>
Access your secure message history and set up secure messaging by entering your Security Key.
Access your secure message history and set up secure messaging by entering your Recovery Key.
</p>
<div
class="mx_RestoreKeyBackupDialog_primaryContainer"
@@ -48,7 +48,7 @@ exports[`<RestoreKeyBackupDialog /> should display an error when recovery key is
<div
class="mx_RestoreKeyBackupDialog_keyStatus"
>
👎 Not a valid Security Key
👎 Not a valid Recovery Key
</div>
<div
class="mx_Dialog_buttons"
@@ -74,7 +74,7 @@ exports[`<RestoreKeyBackupDialog /> should display an error when recovery key is
</div>
</div>
<span>
If you've forgotten your Security Key you can
If you've forgotten your Recovery Key you can
<div
class="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_link_inline"
role="button"
@@ -120,7 +120,7 @@ exports[`<RestoreKeyBackupDialog /> should not raise an error when recovery is v
class="mx_Heading_h3 mx_Dialog_title"
id="mx_BaseDialog_title"
>
Enter Security Key
Enter Recovery Key
</h1>
</div>
<div
@@ -136,7 +136,7 @@ exports[`<RestoreKeyBackupDialog /> should not raise an error when recovery is v
</span>
</p>
<p>
Access your secure message history and set up secure messaging by entering your Security Key.
Access your secure message history and set up secure messaging by entering your Recovery Key.
</p>
<div
class="mx_RestoreKeyBackupDialog_primaryContainer"
@@ -148,7 +148,7 @@ exports[`<RestoreKeyBackupDialog /> should not raise an error when recovery is v
<div
class="mx_RestoreKeyBackupDialog_keyStatus"
>
👍 This looks like a valid Security Key!
👍 This looks like a valid Recovery Key!
</div>
<div
class="mx_Dialog_buttons"
@@ -173,7 +173,7 @@ exports[`<RestoreKeyBackupDialog /> should not raise an error when recovery is v
</div>
</div>
<span>
If you've forgotten your Security Key you can
If you've forgotten your Recovery Key you can
<div
class="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_link_inline"
role="button"
@@ -219,7 +219,7 @@ exports[`<RestoreKeyBackupDialog /> should render 1`] = `
class="mx_Heading_h3 mx_Dialog_title"
id="mx_BaseDialog_title"
>
Enter Security Key
Enter Recovery Key
</h1>
</div>
<div
@@ -235,7 +235,7 @@ exports[`<RestoreKeyBackupDialog /> should render 1`] = `
</span>
</p>
<p>
Access your secure message history and set up secure messaging by entering your Security Key.
Access your secure message history and set up secure messaging by entering your Recovery Key.
</p>
<div
class="mx_RestoreKeyBackupDialog_primaryContainer"
@@ -271,7 +271,7 @@ exports[`<RestoreKeyBackupDialog /> should render 1`] = `
</div>
</div>
<span>
If you've forgotten your Security Key you can
If you've forgotten your Recovery Key you can
<div
class="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_link_inline"
role="button"
@@ -297,7 +297,7 @@ exports[`<RestoreKeyBackupDialog /> should render 1`] = `
</DocumentFragment>
`;
exports[`<RestoreKeyBackupDialog /> should restore key backup when passphrase is filled 1`] = `
exports[`<RestoreKeyBackupDialog /> should restore key backup when Recovery key is filled by user 1`] = `
<DocumentFragment>
<div
data-focus-guard="true"
@@ -362,7 +362,7 @@ exports[`<RestoreKeyBackupDialog /> should restore key backup when passphrase is
</DocumentFragment>
`;
exports[`<RestoreKeyBackupDialog /> should restore key backup when security key is filled by user 1`] = `
exports[`<RestoreKeyBackupDialog /> should restore key backup when passphrase is filled 1`] = `
<DocumentFragment>
<div
data-focus-guard="true"

View File

@@ -5,7 +5,7 @@ exports[`<SecureBackupPanel /> handles error fetching backup 1`] = `
<div
class="mx_SettingsSubsection_text"
>
Back up your encryption keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Security Key.
Back up your encryption keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Recovery Key.
</div>
<div
class="mx_SettingsSubsection_text"
@@ -71,7 +71,7 @@ exports[`<SecureBackupPanel /> suggests connecting session to key backup when ba
<div
class="mx_SettingsSubsection_text"
>
Back up your encryption keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Security Key.
Back up your encryption keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Recovery Key.
</div>
<div
class="mx_SettingsSubsection_text"

View File

@@ -89,7 +89,7 @@ exports[`<SecurityUserSettingsTab /> renders security section 1`] = `
<div
class="mx_SettingsSubsection_text"
>
Back up your encryption keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Security Key.
Back up your encryption keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Recovery Key.
</div>
<div
class="mx_Spinner"