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

Validate if a file with the same blake2 digest already exists (#2490) #3310

Merged
merged 3 commits into from
Mar 20, 2018

Conversation

yeraydiazdiaz
Copy link
Contributor

@yeraydiazdiaz yeraydiazdiaz commented Mar 18, 2018

Finishing off @alanbato's PR to fix #2490. Closes #2928.

Introduces a subtle shift in how we consider a file to exist in the database to be either the filename or the blake2 hash, which I believe should be safe enough.

Thanks for starting work on this one @alanbato 👍

@ewdurbin
Copy link
Member

ewdurbin commented Mar 19, 2018

@yeraydiazdiaz thanks for picking this up!

Can we update the error message at https://github.com/yeraydiazdiaz/warehouse/blob/be94c82324c18c9e7c12a0c79d83cacac1a2cd58/warehouse/forklift/legacy.py#L1083-L1088 and help-text at https://github.com/yeraydiazdiaz/warehouse/blob/be94c82324c18c9e7c12a0c79d83cacac1a2cd58/warehouse/templates/pages/help.html#L225-L238 to note the new possible reasons for the error?

Copy link
Member

@di di left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree with @ewdurbin, either we need to make this a separate error that is explicit about the file being rejected b/c the hash matches, or we need to update the existing help text (this happens rarely enough that the latter should suffice).

@yeraydiazdiaz yeraydiazdiaz force-pushed the upload-diff-filename-same-blake2 branch from 0e79690 to c1a4e72 Compare March 20, 2018 09:40
@di di merged commit 89efaa7 into pypi:master Mar 20, 2018
@di
Copy link
Member

di commented Mar 20, 2018

Thanks @yeraydiazdiaz!

@alanbato
Copy link
Contributor

Hooray @yeraydiazdiaz! Thanks for finishing it up right and proper :)

@yeraydiazdiaz yeraydiazdiaz deleted the upload-diff-filename-same-blake2 branch March 21, 2018 09:17
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.

Validate Blake2 Uniqueness prior to saving
4 participants