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

Provide hash in the link for local packages #53

Closed
Ivoz opened this issue Jun 3, 2014 · 9 comments
Closed

Provide hash in the link for local packages #53

Ivoz opened this issue Jun 3, 2014 · 9 comments

Comments

@Ivoz
Copy link

Ivoz commented Jun 3, 2014

pip 1.5 and greater would like secure links by default, which by implementation means the link provides a hash of the package in the url. This provides some form of verification of correct file download at least.

You can see some of the api docs at warehouse how this is done.

It would be great for pypiserver's links to provide this for pip; I believe this would mean you no longer have to pass --allow-insecure.

@Ivoz Ivoz changed the title Provide md5 hash in the link for local packages Provide hash in the link for local packages Jun 3, 2014
@schmir
Copy link
Contributor

schmir commented Jul 11, 2014

Thanks for your bug report and sorry for the late answer.

pypiserver doesn't have a good way to "remember" those package checksums since it doesn't use a database and doesn't store anything in the filesystem.

Please have a look at devpi. I assume it does provide package checksums.

@ror6ax
Copy link
Contributor

ror6ax commented Oct 28, 2014

Since check-sums are a upcoming standard for pip, I suggest we use redis as a storage for the hashes. It's fast and light.

@schmir
Copy link
Contributor

schmir commented Oct 29, 2014

I would vote for a sqlite based solution. redis as a dependency makes it much harder to install (especially on windows). @ror6ax: but it's your choice now, you should be able push to pypiserver now.

@ror6ax ror6ax modified the milestone: Feature Oct 30, 2014
@ror6ax ror6ax self-assigned this Oct 31, 2014
@ror6ax
Copy link
Contributor

ror6ax commented Oct 31, 2014

I will test the ability to use redis on windows, last time I was doing it - it was pretty straightforward.

@ankostis
Copy link
Member

I may have gotten this wrong, but why is a DB needed for pip's secure-links?
Isn't it enough for pypiserver to check that the requested hash matches the hosted or fail-through package's hash?

@ror6ax
Copy link
Contributor

ror6ax commented Feb 5, 2015

Well, remaking hash every time it's requested is a bit overhead, right?
I'll finish this in nearest future.

@ankostis
Copy link
Member

ankostis commented Feb 6, 2015

My feeling is that current CPUs have more than enough juice for such numerical tasks.
Of course this may not apply for embedded ones.

@ror6ax ror6ax removed their assignment Feb 15, 2015
@ankostis ankostis added this to the M1.1.8 milestone Mar 8, 2015
@ankostis ankostis modified the milestones: M1.1.9, M1.1.8 Sep 11, 2015
ankostis added a commit to ankostis/pypiserver that referenced this issue Dec 19, 2015
@ankostis
Copy link
Member

Note that the hashes contained on the link-fragments served by PyPI are NOT used by pip: https://pip.pypa.io/en/latest/reference/pip_install/#hashes-from-pypi

ankostis added a commit to ankostis/pypiserver that referenced this issue Dec 20, 2015
ankostis added a commit to ankostis/pypiserver that referenced this issue Dec 21, 2015
ankostis added a commit to ankostis/pypiserver that referenced this issue Dec 21, 2015
ankostis added a commit to ankostis/pypiserver that referenced this issue Dec 21, 2015
@Ivoz
Copy link
Author

Ivoz commented Dec 25, 2015

👍 nice work ankostis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants