-
Notifications
You must be signed in to change notification settings - Fork 566
feat(storage): setting default checksum #30878
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
Changes from all commits
eb4c130
a5bb385
9000bdb
fae8845
0147623
13275c4
a89ca60
cbcbe63
6158a74
ea8d7dc
ff9d55e
6c4fb51
b65c4bf
5d6252a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1639,11 +1639,11 @@ def file path, | |
| # * `md5` - Calculate and provide a checksum using the MD5 hash. | ||
| # * `crc32c` - Calculate and provide a checksum using the CRC32c hash. | ||
| # * `all` - Calculate and provide checksums for all available verifications. | ||
| # | ||
| # Optional. The default is `nil`. Do not provide if also providing a | ||
| # Optional. The default is `crc32c`. Do not provide if also providing a | ||
| # corresponding `crc32c` or `md5` argument. See | ||
| # [Validation](https://cloud.google.com/storage/docs/hashes-etags) | ||
| # for more information. | ||
| # | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert this. |
||
| # @param [String] crc32c The CRC32c checksum of the file data, as | ||
| # described in [RFC 4960, Appendix | ||
| # B](http://tools.ietf.org/html/rfc4960#appendix-B). | ||
|
|
@@ -1805,6 +1805,8 @@ def create_file file, | |
| path ||= file.path if file.respond_to? :path | ||
| path ||= file if file.is_a? String | ||
| raise ArgumentError, "must provide path" if path.nil? | ||
| # setting crc32c as default checksum algorithm if none provided for integrity check | ||
| checksum = :crc32c if checksum.nil? && crc32c.nil? && md5.nil? | ||
shubhangi-google marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how can a customer disable checksumming all together, earlier the option was do not send anything and we will consider it nil but now if the customer doesn't send anything or sends nil, we will overwrite with crc32c right? I dont think this is ideal. Main concern: There's no way to distinguish between customer not sending anything and sending nil explicitly.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if customer is not sending anything the default will be nil There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, and that is the problem, we are not providing the user with the option to disable all kinds of checksumming. |
||
| crc32c = crc32c_for file, checksum, crc32c | ||
| md5 = md5_for file, checksum, md5 | ||
|
|
||
|
|
||
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.
Why are we removing this?
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.
updates the doc again