Expand description
Input validation and sanitization utilities.
This module provides functions for validating and sanitizing user input before processing. These functions are used by import parsers and storage backends to ensure data integrity and security.
§Security
Input validation prevents:
- SQL injection via malicious table/column names
- Path traversal via malicious file paths
- Buffer overflows via excessively long inputs
- Unicode normalization attacks
Enums§
- Validation
Error - Errors that can occur during input validation.
Constants§
- MAX_
BPMN_ DMN_ FILE_ SIZE - Maximum file size for BPMN/DMN models (10MB)
- MAX_
COLUMN_ NAME_ LENGTH - Maximum length for column names
- MAX_
DESCRIPTION_ LENGTH - Maximum length for descriptions
- MAX_
IDENTIFIER_ LENGTH - Maximum length for identifiers in general
- MAX_
MODEL_ NAME_ LENGTH - Maximum length for model names (filenames)
- MAX_
OPENAPI_ FILE_ SIZE - Maximum file size for OpenAPI specifications (5MB)
- MAX_
PATH_ LENGTH - Maximum path length (platform-dependent, using conservative limit)
- MAX_
TABLE_ NAME_ LENGTH - Maximum length for table names
Functions§
- sanitize_
description - Sanitize a string for safe use in descriptions and comments.
- sanitize_
model_ name - Sanitize a model name for use as a filename.
- sanitize_
path - Sanitize a file path by removing dangerous components.
- sanitize_
sql_ identifier - Sanitize a SQL identifier by quoting it.
- validate_
bpmn_ dmn_ file_ size - Validate file size for BPMN/DMN models.
- validate_
column_ name - Validate a column name.
- validate_
data_ type - Validate a data type string.
- validate_
description - Validate a description string.
- validate_
glob_ pattern - Validate a glob pattern for security.
- validate_
openapi_ file_ size - Validate file size for OpenAPI specifications.
- validate_
path - Validate a file path for security.
- validate_
table_ name - Validate a table name.
- validate_
url - Validate a URL for security.
- validate_
uuid - Validate a UUID string.
Type Aliases§
- Validation
Result - Result type for validation operations.