Repository navigation
Check mirrored files against their own SHA-256 - #592
Merged
Merged
Conversation
Mirroring a PyPI version passed each file's sha256 as the integrity GetOrFetchArtifactFromURLWithIntegrity records with the version. Wheels of one version share the name and version they are cached under, so the last file's checksum replaced the others', and serving the other wheels from the cache failed the integrity check. The mirror now passes the sha256 as a digest, which is checked against that file's content hash alone.
This was referenced Oct 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug from #591, which isn't in a release yet.
The PyPI mirror passed each file's sha256 as the integrity that
GetOrFetchArtifactFromURLWithIntegrityrecords with the version. All wheels of a version are cached under the same name and version, so the last file's checksum replaced the others'. Serving the other wheels from the cache then failed the integrity check: the proxy aborted the response.The mirror now passes the sha256 as a digest (
GetOrFetchArtifactFromURLWithDigest), which is checked against that file's content hash alone.TestMirrorPyPIFetchesEveryFilenow has two wheels of one version; it fails without the change.