UNPKG

context-optimizer-mcp-server

Version:

Context optimization tools MCP server for AI coding assistants - compatible with GitHub Copilot, Cursor AI, and other MCP-supporting assistants

44 lines 1.42 kB
/** * Path security validation utilities * * Prevents path traversal attacks and unauthorized file access */ export declare class PathValidator { /** * Validates a file path against security boundaries * * @param requestedPath - Path to validate * @returns Validation result with resolved path or error */ static validateFilePath(requestedPath: string): Promise<{ valid: boolean; resolvedPath?: string; error?: string; }>; /** * Validates a working directory path against security boundaries * * @param requestedPath - Directory path to validate * @returns Validation result with resolved path or error */ static validateWorkingDirectory(requestedPath: string): Promise<{ valid: boolean; resolvedPath?: string; error?: string; }>; /** * Helper method to check if a path is within allowed boundaries (without file system checks) * * @param requestedPath - Path to check * @returns Whether the path is within allowed boundaries */ static isPathAllowed(requestedPath: string): boolean; /** * Normalize and sanitize a path for logging purposes * * @param filePath - Path to sanitize * @returns Sanitized path safe for logging */ static sanitizePathForLogging(filePath: string): string; } //# sourceMappingURL=pathValidator.d.ts.map