mirror of
https://github.com/morluto/rea.git
synced 2026-10-31 11:56:12 +00:00
17 lines
538 B
TypeScript
17 lines
538 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { redactSensitiveText } from "./SensitiveTextCapture.js";
|
|
|
|
describe("sensitive console text", () => {
|
|
it("redacts assignments, bearer credentials, and JWT-shaped values", () => {
|
|
const jwt = "eyJabcdefghijk.abcdefghijkl.abcdefghijk";
|
|
expect(
|
|
redactSensitiveText(
|
|
`authorization=Bearer abc.def password='hunter2' api_key=key ${jwt}`,
|
|
),
|
|
).toBe(
|
|
"authorization=[REDACTED] password=[REDACTED] api_key=[REDACTED] [REDACTED_JWT]",
|
|
);
|
|
});
|
|
});
|