import { Logger } from './Logger'; /** * Console logger implementation with automatic sensitive data masking. * * All output is automatically scanned for potential sensitive information * including API tokens, passwords, and other secrets, which are masked * before being written to the console. * * @remarks * **Security Features (Defense in Depth)**: * - Automatically masks strings that look like API tokens (20+ alphanumeric chars) * - Masks object properties with sensitive keys (token, key, password, secret, etc.) * - Recursively masks nested objects with circular reference detection * - Prevents accidental logging of sensitive data in error messages and metadata * - Case-insensitive pattern matching for various formats (key:, key=, "key": ) * * **Usage Guidelines**: * - This provides automatic protection but should be used with other layers * - For errors, consider using sanitizeError() before logging for extra safety * - Never disable masking or bypass the logger for sensitive operations * - Review logs before sharing to ensure no sensitive data leaked through * * @category Logging */ export declare class ConsoleLogger implements Logger { /** * List of property names that should always be masked. * Case-insensitive matching is used. */ private readonly sensitiveKeys; /** * Masks sensitive data in any value (string, object, or other). * * @param data - Data to mask * @param visited - WeakSet to track visited objects and prevent infinite recursion * @returns Masked copy of the data */ private maskSensitiveData; /** * Masks potential tokens and secrets in strings. * * Looks for patterns that resemble API tokens or other secrets: * - Sequences of 20+ alphanumeric characters (typical token length) * - Patterns like "token: value" or "key=value" * * @param str - String to mask * @returns String with sensitive data replaced with '****' */ private maskString; /** * Recursively masks sensitive properties in an object. * Uses a WeakSet to track visited objects and prevent infinite recursion. */ private maskObject; info(message: string, meta?: Record): void; warn(message: string, meta?: Record): void; error(message: string | Error, meta?: Record): void; debug(message: string, meta?: Record): void; table(data: unknown): void; } //# sourceMappingURL=ConsoleLogger.d.ts.map