Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a hash based file paths on *new* uploads #1079

Merged
merged 1 commit into from
Apr 19, 2016

Conversation

dstufft
Copy link
Member

@dstufft dstufft commented Apr 19, 2016

Instead of using a file path like {pyver}/{name[0]}/{name}/{filename}, we will instead use one that looks like {hash[:2]}/{hash[2:4]}/{hash[4:]}{filename}, where hash is the blake2b(digest_size=32) hex digest (lowercased) of the actual file contents. This will ensure that the contents referred to by a specific file URL cannot change without also changing the URL.

This also adds File.blake2_256_digest to hold this new hash.

Instead of using a file path like {pyver}/{name[0]}/{name}/{filename}, we will
instead use one that looks like {hash[:2]}/{hash[2:4]}/{hash[4:]}{filename},
where `hash` is the blake2b(digest_size=32) hex digest (lowercased) of the
actual file contents. This will ensure that the contents referred to by a
specific file URL cannot change without also changing the URL.

This also adds File.blake2_256_digest to hold this new hash.
@dstufft dstufft merged commit a7d8ec1 into pypi:master Apr 19, 2016
@dstufft dstufft deleted the hashed-paths-part-1 branch April 19, 2016 01:01
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants