Uh oh!
There was an error while loading. Please reload this page.
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds signed-index verification for runtime feed JSONs, aiming to detect tampering of the python.org index while keeping the feature configurable for other sources (Fixes #308).
Changes:
- Introduces a Windows native
_native.verify_trustimplementation to validate a JSON file against a signed catalog (.cat) using OS trust. - Extends
IndexDownloaderto fetch and validate{index_url}.catbefore processing indexes, with configurable per-source requirements (source_settings). - Updates CI pipelines to generate/sign catalog files for partitioned indexes and upload the resulting
.json.catartifacts; adds tests and test fixtures.
Reviewed changes
Copilot reviewed 18 out of 22 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_verify.py | Adds end-to-end tests covering successful verification and failure/bypass paths. |
| tests/data/self-signed.cat | Adds an untrusted (self-signed) catalog fixture for negative tests. |
| tests/data/psf-signed.cat | Adds a trusted/signed catalog fixture for positive tests. |
| tests/data/index-windows.json | Adds a test index fixture used by verification tests. |
| src/pymanager.json | Adds default source_settings for python.org index URLs. |
| src/manage/urlutils.py | Implements signature download/verification flow in IndexDownloader. |
| src/manage/list_command.py | Updates call sites for new IndexDownloader(cmd, ...) signature. |
| src/manage/install_command.py | Updates call sites for new IndexDownloader(cmd, ...) signature. |
| src/manage/indexutils.py | Extends index schema with signature-related fields. |
| src/manage/exceptions.py | Adds an exit code to InvalidFeedError for CLI handling. |
| src/manage/commands.py | Adds source_settings to config schema and command attributes. |
| src/manage/init.py | Treats InvalidFeedError as a user-facing error with an exit code. |
| src/_native/verify_trust.cpp | Adds native Windows verification logic for signed catalog + file hash membership. |
| scripts/repartition-index.py | Updates for new IndexDownloader constructor signature. |
| ci/upload.py | Uploads .json.cat alongside .json for index publishing. |
| ci/sign-files.yml | Adds reusable signing template used by pipelines. |
| ci/repartition-index.yml | Generates catalogs for index JSONs, signs them, and handles publish vs pretend-publish paths. |
| ci/release.yml | Refactors signing parameters and uses sign-files.yml; restructures post-test and publish stages. |
| _msbuild_test.py | Links wintrust.lib and exports verify_trust for test builds. |
| _msbuild.py | Links wintrust.lib and exports verify_trust for production builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Fixes#308