/** * StrictDB Input Sanitization — Backend-specific * * MongoDB: Already handled internally by core/db/mongo.ts (whitelist-based) * SQL: Column name validation against schema + parameterized values * Elasticsearch: Field name validation + script injection prevention */ import type { Backend, SanitizeRule } from './types.js'; /** * Register known fields for a collection. Used by the filter translator * to validate field names in filters and prevent identifier injection. */ export declare function registerFields(collection: string, fields: string[]): void; export declare function getRegisteredFields(collection: string): Set | undefined; export declare function clearFieldRegistry(): void; /** * Validate that all field names in a filter exist in the registered schema. * Only validates if schema is registered for the collection. * If no schema registered, allows all field names through (runtime introspection fallback). */ export declare function validateFilterFields(collection: string, filter: Record, backend: Backend): void; /** * Validate field names for Elasticsearch queries. * Blocks access to internal ES fields and validates against schema. */ export declare function validateElasticFields(collection: string, filter: Record): void; /** * Validate an Elasticsearch index name to prevent cross-index access. */ export declare function validateIndexName(name: string): void; /** * Validate regex patterns for catastrophic backtracking. * Rejects patterns with nested quantifiers that could cause exponential matching. */ export declare function validateRegexComplexity(pattern: string): void; /** * Run backend-specific sanitization on a filter. * MongoDB: No-op (handled internally by core/db/mongo.ts) * SQL: Validates field names against registered schema * Elasticsearch: Validates field names + blocks internal fields */ export declare function sanitizeFilter(collection: string, filter: Record, backend: Backend): void; /** * Apply user-defined sanitize rules to a data object. * Returns a new object (never mutates input). Short-circuits if rules is empty. */ export declare function applySanitizeRules(data: Record, collection: string, rules: SanitizeRule[]): Record; //# sourceMappingURL=sanitize.d.ts.map