import { describe, expect, it } from 'vitest';
import { redactSecrets } from '../../security/redact.js';
describe('redactSecrets', () => {
    it('redacts OpenAI keys', () => {
        expect(redactSecrets('use sk-abcdefghijklmnopqrstuv0123 for now')).toBe('use [REDACTED] for now');
    });
    it('redacts Anthropic keys', () => {
        expect(redactSecrets('sk-ant-api03-AbCdEfGhIjKlMnOpQrStUvWxYz123456 secret')).toBe('[REDACTED] secret');
    });
    it('redacts Actuate API keys', () => {
        expect(redactSecrets('act_sk_abcdef0123456789ABCDEF0123456789 leaked')).toBe('[REDACTED] leaked');
    });
    it('redacts GitHub tokens', () => {
        expect(redactSecrets('ghp_abcdefghijklmnopqrstuvwxyz0123456789')).toBe('[REDACTED]');
    });
    it('redacts AWS access keys', () => {
        expect(redactSecrets('AKIAIOSFODNN7EXAMPLE is mine')).toBe('[REDACTED] is mine');
    });
    it('redacts JWTs', () => {
        const jwt = 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NSJ9.dQw4w9WgXcQabcdef1234';
        expect(redactSecrets(`bearer ${jwt}`)).toBe('bearer [REDACTED]');
    });
    it('redacts password assignments', () => {
        expect(redactSecrets('password: "hunter2x9"')).toBe('[REDACTED]');
    });
    it('preserves non-secret content', () => {
        expect(redactSecrets('hello world')).toBe('hello world');
        expect(redactSecrets('')).toBe('');
    });
});
//# sourceMappingURL=redact.test.js.map