/** * Secret pattern detection for outgoing requests. * Ported from scurl's SecretDefender. */ export interface SecretPattern { name: string; pattern: RegExp; description: string; } export const SECRET_PATTERNS: SecretPattern[] = [ // AWS { name: "AWS Access Key ID", pattern: /AKIA[0-9A-Z]{16}/, description: "AWS Access Key ID", }, { name: "AWS Secret Key", pattern: /(?): SecretScanResult { for (const [name, value] of Object.entries(headers)) { if (name.toLowerCase() === "authorization") continue; const m = scanForSecrets(value); if (m) return { found: true, pattern: m, location: `header '${name}'` }; } return { found: false }; }