-
Notifications
You must be signed in to change notification settings - Fork 460
feat(storage): Migrate async client to unified checksum options #16261
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
Merged
v-pratap
merged 13 commits into
googleapis:main
from
v-pratap:unified-checksum-options-pr2
Jul 20, 2026
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2ea6ec7
feat(storage): migrate async client to unified checksum options
v-pratap a5ea188
fix(storage): address reviewer comments and fix format
v-pratap 2473a8c
fix: resolve review comments and unit tests failures
v-pratap 5228545
fix(storage): clang-format style issues in connection_impl.cc
v-pratap 1424528
fix: address PR review comments for read hash tests and upload checks…
v-pratap b76b819
fix(storage): resolve read hash tests failing due to incorrect checks…
v-pratap 39c4a25
fix(storage): resolve clang-format style issues
v-pratap c0cf77b
fix(storage): resolve reviewer comments for read hash tests and uploa…
v-pratap 23bb221
fix(storage): resolve clang format
v-pratap e6d1487
fix(storage): add missing TODO username and disable deprecation warni…
v-pratap e2c354a
fix(storage): fix alphabetical order in google_cloud_cpp_storage_grpc…
v-pratap 228b083
test(storage): retain legacy checksum option test cases
v-pratap c419f36
Merge branch 'main' into unified-checksum-options-pr2
v-pratap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| // Copyright 2024 Google LLC | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // https://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ASYNC_CHECKSUM_HELPERS_H | ||
| #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ASYNC_CHECKSUM_HELPERS_H | ||
|
|
||
| #include "google/cloud/internal/disable_deprecation_warnings.inc" | ||
| #include "google/cloud/storage/async/options.h" | ||
| #include "google/cloud/storage/options.h" | ||
| #include "google/cloud/options.h" | ||
|
|
||
| namespace google { | ||
| namespace cloud { | ||
| namespace storage_internal { | ||
| GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN | ||
|
|
||
| struct ChecksumSettings { | ||
| bool enable_crc32c; | ||
| bool enable_md5; | ||
| }; | ||
|
|
||
| inline ChecksumSettings GetDownloadChecksumSettings(Options const& options) { | ||
| if (options.has<storage::DownloadChecksumValidationOption>()) { | ||
| auto const algo = options.get<storage::DownloadChecksumValidationOption>(); | ||
| return {algo == storage::ChecksumAlgorithm::kCrc32c, | ||
| algo == storage::ChecksumAlgorithm::kMD5}; | ||
| } | ||
| return {options.get<storage::EnableCrc32cValidationOption>(), | ||
| options.get<storage::EnableMD5ValidationOption>()}; | ||
| } | ||
|
|
||
| inline ChecksumSettings GetUploadChecksumSettings(Options const& options) { | ||
| if (options.has<storage::UploadChecksumValidationOption>()) { | ||
| auto const algo = options.get<storage::UploadChecksumValidationOption>(); | ||
| return {algo == storage::ChecksumAlgorithm::kCrc32c, | ||
| algo == storage::ChecksumAlgorithm::kMD5}; | ||
| } | ||
| return {options.get<storage::EnableCrc32cValidationOption>(), | ||
| options.get<storage::EnableMD5ValidationOption>()}; | ||
| } | ||
|
|
||
| GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END | ||
| } // namespace storage_internal | ||
| } // namespace cloud | ||
| } // namespace google | ||
|
|
||
| #include "google/cloud/internal/diagnostics_pop.inc" | ||
| #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ASYNC_CHECKSUM_HELPERS_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.