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 16:52:39 +00:00
committed by GitHub
parent 4de9fe60ae
commit 047e8e8a9c
15 changed files with 93 additions and 93 deletions
@@ -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
@@ -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());
@@ -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"
@@ -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"