/** * Readable text of a matching message for the traffic log, with sign-in secrets masked * (the client masks the same fields in its own log: aces.exe 2.61.0.37 0x44e77c0). */ import type { MatchingMessage } from './matching-message.ts'; const SECRET_KEYS = new Set(['auth_jwt', 'auth_jwt_enc', 'session_key_evp', 'chard_token', 'login']); export function messageLogText(message: MatchingMessage): string { return JSON.stringify(message.json, (key, value: unknown) => (SECRET_KEYS.has(key) && typeof value === 'string' ? '' : value), 2); }