Split __init__.py into focused modules #30
No reviewers
Labels
No labels
bug
contribution welcome
duplicate
enhancement
good first issue
help wanted
invalid
question
upstream
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
marvin8/zaojun!30
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/30/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Splits the 1320-line
__init__.pyinto six focused single-responsibility modules with no behaviour changes.Modules created
models.pyVulnAdvisory,PyPIPackageData,DependencyResult)pypi.pyversion.pyvulns.py_norm_pkgrender.pychecker.py__init__.pyis reduced to ~190 lines of thin CLI glue.Notes
zaojun.checker.*)models←pypi/version/vulns/render←checker←__init__Closes #29
src/zaojun/pypi.pyline 93🔴 Declining —
package_namealways reaches this function viaparse_dependency()inchecker.py, which parses the raw string throughpackaging.requirements.Requirement(). A PEP 508 package name cannot contain../,/, or\, so a path-traversal payload would raiseInvalidRequirementand never reachget_latest_pypi_version. No sanitisation is needed at this layer; the validation happens at the boundary.src/zaojun/pypi.pyline 93🔴 Declining —
--index-urlis intentionally user-controlled by design. zaojun explicitly supports private and corporate PyPI mirrors (e.g. Artifactory, Nexus, devpi) via this flag. This is a local developer CLI tool, not a web service; the person running it is also the person controlling--index-url. An allowlist would break legitimate use cases and add no security value in this threat model.