fix(tess): redact sensitive runtime content
This commit is contained in:
14
packages/log/src/redaction.spec.ts
Normal file
14
packages/log/src/redaction.spec.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { redactSensitiveContent } from './redaction.js';
|
||||
|
||||
describe('redactSensitiveContent', (): void => {
|
||||
it('redacts seeded secret and PII canaries before persistence or egress', (): void => {
|
||||
const result = redactSensitiveContent(
|
||||
'email canary@example.test token=sk_CANARY12345678 phone +1 555 555 1212',
|
||||
);
|
||||
expect(result.content).not.toContain('canary@example.test');
|
||||
expect(result.content).not.toContain('sk_CANARY12345678');
|
||||
expect(result.content).not.toContain('+1 555 555 1212');
|
||||
expect(result.classifications).toEqual(['secret', 'pii']);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user