Skip to content

Check if another file has been uploaded with the same blake2 digest#2928

Closed
alanbato wants to merge 1 commit intopypi:masterfrom
alanbato:unique_blake2
Closed

Check if another file has been uploaded with the same blake2 digest#2928
alanbato wants to merge 1 commit intopypi:masterfrom
alanbato:unique_blake2

Conversation

@alanbato
Copy link
Copy Markdown
Contributor

This tries to resolve #2490

I'm not sure if the uniqueness of the blake2 digest should be validated on file uploading or before, or if hijacking on the same "File already exists" message is helpful enough.

Also, I'm getting a weird error on my test, making it fail. Something about the request object missing a 'user' attribute.

Thanks for your feedback y'all.
🐍

@di
Copy link
Copy Markdown
Member

di commented Feb 12, 2018

The error is because your test is getting to this line:

            request.db.add(
                JournalEntry(
                    name=release.project.name,
                    version=release.version,
                    action="add {python_version} file {filename}".format(
                        python_version=file_.python_version,
                        filename=file_.filename,
                    ),
>                   submitted_by=request.user,
                    submitted_from=request.remote_addr,
                ),
            )

Which means it's trying to add the file being uploaded, so it seems like either something is wrong with your test, or with the new logic you added.

@di
Copy link
Copy Markdown
Member

di commented Feb 23, 2018

Hey @alanbato, need any help or more direction here?

@brainwane
Copy link
Copy Markdown
Contributor

I think @alanbato is having computer problems.

@alanbato
Copy link
Copy Markdown
Contributor Author

Yes I am 😢
If anyone wants to continue and build on this PR, please do so. I'll ping this thread when my computer gets better 😓

@brainwane
Copy link
Copy Markdown
Contributor

Thanks for all your work on this @alanbato which @yeraydiazdiaz was able to build on. Hope your computer heals soon!

@alanbato alanbato deleted the unique_blake2 branch March 20, 2018 22:23
@alanbato
Copy link
Copy Markdown
Contributor Author

@brainwane I'm glad it was of help :) And my computer lives to see another, so I'm ready to start contributing again! 😎

@brainwane
Copy link
Copy Markdown
Contributor

@alanbato I'd love your help with #3151.

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

3 participants