symfonic.kernel.contracts.archive_limits¶
archive_limits ¶
Private, dependency-free inspection of zip container declarations.
ArchiveLimitExceeded ¶
Bases: ValueError
A zip is malformed or one of its declared resource bounds is exceeded.
inspect_zip_limits ¶
inspect_zip_limits(payload: bytes, *, max_uncompressed_bytes: int, max_expansion_ratio: float, max_members: int, max_nesting_depth: int) -> None
Reject a zip whose central-directory declarations exceed a ceiling.
Source code in src/symfonic/kernel/contracts/archive_limits.py
is_zip_container ¶
Return whether bytes should be treated as a zip-backed container.