Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { redactDiagnosticJsonString, redactDiagnosticText } from "./redaction";
|
||||
|
||||
describe("diagnostic redaction", () => {
|
||||
it("redacts sensitive scalar diagnostics", () => {
|
||||
expect(redactDiagnosticText("token=secret Authorization=Bearer abc123")).toBe("token=[REDACTED] Authorization=Bearer [REDACTED]");
|
||||
});
|
||||
|
||||
it("redacts sensitive JSON keys before UI display or copy", () => {
|
||||
expect(redactDiagnosticJsonString(JSON.stringify({ token: "secret", nested: { authorization: "Bearer abc123", kept: "value" } }))).toBe(
|
||||
'{\n "token": "[REDACTED]",\n "nested": {\n "authorization": "[REDACTED]",\n "kept": "value"\n }\n}',
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user