Expand description
Centralized validation and helper functions.
Enums§
- Validation
Error - Security validation error types
Constants§
- MAX_
CONTIGS - Maximum number of contigs allowed in a single file (DOS protection)
- MAX_
FILENAME_ LENGTH - Security-related constants for input validation
- MIN_
FILE_ CONTENT_ SIZE
Functions§
- check_
contig_ limit - Check if adding another contig would exceed the maximum allowed.
- compute_
signature - Compute a signature hash from a set of MD5 checksums.
- is_
valid_ md5 - Validate that a string is a valid MD5 checksum (32 hex characters).
- normalize_
md5 - Normalize an MD5 string to lowercase. Returns None if the input is not a valid MD5.
- validate_
file_ content - Validate that file content is not malicious or malformed
- validate_
file_ format - Validate file content using magic numbers for known binary formats
- validate_
filename - Secure filename validation to prevent directory traversal and other attacks
- validate_
upload - Comprehensive input validation combining filename and content checks