Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+23
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { normalizeGdprExportSseCKey, requireGdprExportSseCKey } from "./gdpr-export-storage.js";
|
||||
|
||||
const KEY = "BwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwc=";
|
||||
|
||||
describe("GDPR export SSE-C key", () => {
|
||||
it("accepts only canonical base64 encoding of exactly 32 bytes", () => {
|
||||
expect(normalizeGdprExportSseCKey(` ${KEY} `)).toBe(KEY);
|
||||
expect(normalizeGdprExportSseCKey(Buffer.alloc(31, 7).toString("base64"))).toBeUndefined();
|
||||
expect(normalizeGdprExportSseCKey("not-base64")).toBeUndefined();
|
||||
});
|
||||
|
||||
it("never echoes an invalid key", () => {
|
||||
const invalid = "secret-that-must-not-appear";
|
||||
expect(() => requireGdprExportSseCKey(invalid)).toThrow(/GDPR_EXPORT_SSE_C_KEY_BASE64/u);
|
||||
try {
|
||||
requireGdprExportSseCKey(invalid);
|
||||
} catch (error) {
|
||||
expect(String(error)).not.toContain(invalid);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user