UNPKG

mira-consciousness

Version:

Memory & Intelligence Retention Archive - Preserving The Spark

51 lines 1.57 kB
/** * Input Validation and Sanitization Utilities * ========================================== * * Provides comprehensive input validation to prevent injection attacks * and ensure data integrity throughout the MIRA system. */ /** * Validates and sanitizes file paths to prevent directory traversal attacks */ export declare function validateFilePath(filePath: string, allowedRoot?: string): string; /** * Validates command arguments to prevent command injection */ export declare function validateCommandArgs(args: string[]): string[]; /** * Sanitizes user input for safe display (prevents XSS in terminal output) */ export declare function sanitizeForDisplay(input: string): string; /** * Validates environment variable names */ export declare function validateEnvVarName(name: string): boolean; /** * Validates and sanitizes JSON input */ export declare function validateJSON(input: string): any; /** * Validates Git branch/tag names */ export declare function validateGitRef(ref: string): string; /** * Rate limiting helper to prevent DoS attacks */ export declare class RateLimiter { private maxRequests; private windowMs; private requests; constructor(maxRequests?: number, windowMs?: number); isAllowed(identifier: string): boolean; private cleanup; } /** * Validates memory content before storage */ export declare function validateMemoryContent(content: string): string; /** * Validates search queries */ export declare function validateSearchQuery(query: string): string; //# sourceMappingURL=inputValidation.d.ts.map