Merge branch 'phase/029-handbuch'
# Conflicts: # src/worker/index.ts
This commit is contained in:
@@ -48,6 +48,7 @@ test("neuen Host einrichten", async ({ page }) => {
|
||||
await expect(page.getByRole("button", { name: "Fingerprint stimmt – vertrauen" })).toBeVisible({
|
||||
timeout: 30_000,
|
||||
});
|
||||
await page.screenshot({ path: "docs/anleitung/bilder/hostkey-bestaetigen-desktop.png", fullPage: true });
|
||||
await page.getByRole("button", { name: "Fingerprint stimmt – vertrauen" }).click();
|
||||
await expect(page.getByText("Einmalig per Passwort")).toBeVisible({ timeout: 15_000 });
|
||||
await expect(page.getByLabel("Bootstrap-Befehl", { exact: true })).toContainText("SSHKV_BOOTSTRAP");
|
||||
|
||||
@@ -73,3 +73,22 @@ describe("Deployment-Key", () => {
|
||||
expect(dump).not.toContain(kern.slice(0, 40));
|
||||
});
|
||||
});
|
||||
|
||||
describe("Master-Key-Pruefung beim Start (#029)", () => {
|
||||
it("meldet einen falschen Master-Key verstaendlich", async () => {
|
||||
const { masterKeyPruefen } = await import("@/worker/geheimnisse");
|
||||
const id = await deploymentKeySicherstellen();
|
||||
await expect(masterKeyPruefen(id)).resolves.toBeUndefined();
|
||||
const falsch = path.join(verzeichnis, "falsch.key");
|
||||
writeFileSync(falsch, randomBytes(32), { mode: 0o600 });
|
||||
const richtig = process.env["SSHKV_MASTER_KEY_FILE"];
|
||||
process.env["SSHKV_MASTER_KEY_FILE"] = falsch;
|
||||
masterKeyVergessen();
|
||||
try {
|
||||
await expect(masterKeyPruefen(id)).rejects.toThrow(/passt nicht zur Datenbank/);
|
||||
} finally {
|
||||
process.env["SSHKV_MASTER_KEY_FILE"] = richtig;
|
||||
masterKeyVergessen();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user