chore: remove dead routes/components + fix redact/env cleanup

This commit is contained in:
Gabriel Brown
2026-07-11 18:11:22 -04:00
parent f89dfce3b8
commit 1fbb2dd0a1
11 changed files with 48 additions and 137 deletions
@@ -0,0 +1,38 @@
import { describe, expect, test } from 'vitest';
import { createRedactor } from '../../src/redact';
describe('createRedactor', () => {
test('redacts group-less token patterns without emitting a literal $1', () => {
const redact = createRedactor([]);
const output = redact('token ghs_ABC123 and sk-xyz789 here');
expect(output).toContain('[redacted]');
expect(output).not.toContain('$1');
expect(output).not.toContain('ghs_ABC123');
expect(output).not.toContain('sk-xyz789');
});
test('redacts github_pat_ tokens to [redacted]', () => {
const redact = createRedactor([]);
const output = redact('github_pat_ABCDEF123456');
expect(output).toBe('[redacted]');
expect(output).not.toContain('$1');
});
test('keeps the key= prefix for key=value secrets', () => {
const redact = createRedactor([]);
expect(redact('api_key=secret')).toBe('api_key=[redacted]');
expect(redact('password=hunter2')).toBe('password=[redacted]');
});
test('redacts caller-supplied secret values verbatim', () => {
const redact = createRedactor(['super-secret-value']);
expect(redact('the value is super-secret-value')).toBe(
'the value is [redacted]',
);
});
});