-
Notifications
You must be signed in to change notification settings - Fork 49
Add checksum validation for non-chunked non-composite downloads #31
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
Conversation
dhermes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mfschwartz I am happy to maintainer-ify this PR if you are OK with it? I think it may be easier than a nit-picky review.
| server-computed checksum. | ||
| """ | ||
| md5_hash = hashlib.md5() | ||
| # TODO: Add support for validating CRC32C for composite objects. Note |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| # make getting google-cloud-python working well more difficult). | ||
| expected_md5_hash = None | ||
| if ('X-Goog-Hash' in response.headers | ||
| and response.headers['X-Goog-Hash']): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| if name == 'md5': | ||
| expected_md5_hash = value | ||
| if not expected_md5_hash: | ||
| logging.getLogger().info( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
setup.py
Outdated
| setuptools.setup( | ||
| name='google-resumable-media', | ||
| version='0.2.3', | ||
| version='0.2.4', |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| .rstrip('\n')) | ||
| else: | ||
| actual_md5_hash = (base64.encodebytes(bytes(md5_hash.digest(), | ||
| 'UTF-8')).rstrip('\n')) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Hi - I'd appreciate if we could draw this review to a close soon because the lack of checksumming support in this library is causing customer problems. Thanks. |
Yes please. |
|
@mfschwartz I'm closing this PR in favor of #32 (which uses your 3 commits as a diffbase). Usually GitHub allows maintainers to push into a PR branch, but I couldn't for some reason (possibly because you used the As for not being able to install Python 3 on your machine, if you are on Mac OS X or Linux, I highly recommend |
If you are referring to googleapis/google-cloud-python#4129, it seems that the checksumming is a theory for that breakage (or rather, something that could pinpoint the breakage), but we have not been able to reproduce the customer's report. |
|
Thanks for the commits Danny. The problem I was referring to was not googleapis/google-cloud-python#4129, but rather a customer who reached out to the GCS team directly. |
|
Can you please tell me when you have the two libraries in a state where it's possible to build new releases (at a min I think that means updated version #s and dependencies)? Thanks! |
|
Yes. I'm worried that |
|
@mfschwartz Am I correct in assuming you are OK with a release with the partial support implemented? |
|
Yes, a release with partial support would be good. |
|
Yes, they are all passing: https://circleci.com/gh/GoogleCloudPlatform/google-resumable-media-python/198 My primary dev machine is Ubuntu and I use If you want to just type |
|
Ah, thanks, that was quite easy! |
This partially addresses #22
Note current limitations:
I ran the unit and system tests only against Python 2.7, because my current OS doesn't support Python 3.6.