From 30a64b0dd3ecbffa2aa4034bd01d10845005eb0e Mon Sep 17 00:00:00 2001 From: "R.D." Date: Sat, 28 Mar 2026 19:56:06 -0400 Subject: [PATCH] test: align security hardening log helper checks --- tests/integration/security-hardening.test.mjs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/integration/security-hardening.test.mjs b/tests/integration/security-hardening.test.mjs index dd49da6ad5..5a1febb037 100644 --- a/tests/integration/security-hardening.test.mjs +++ b/tests/integration/security-hardening.test.mjs @@ -161,7 +161,17 @@ test("callLogs.ts wires no-log and PII sanitization before persistence", () => { ); assert.ok(content.includes('from "../piiSanitizer"'), "callLogs.ts should import piiSanitizer"); assert.ok(content.includes("isNoLog("), "callLogs.ts should check no-log policy"); - assert.ok(content.includes("sanitizePayloadPII"), "callLogs.ts should sanitize PII recursively"); + + const payloadHelperContent = readIfExists("src/lib/logPayloads.ts"); + assert.ok(payloadHelperContent, "src/lib/logPayloads.ts should exist"); + assert.ok( + content.includes("protectPayloadForLog") && content.includes('from "../logPayloads"'), + "callLogs.ts should route payload protection through shared log helpers" + ); + assert.ok( + payloadHelperContent.includes("export function sanitizePayloadPII"), + "logPayloads.ts should keep recursive PII sanitization logic" + ); }); test("API key update route and DB layer wire persisted no-log controls", () => {