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

fix: KMS Bad Key error when using existing Blob context to overwrite object #507

Merged
merged 7 commits into from Sep 17, 2020

Conversation

athakor
Copy link
Contributor

@athakor athakor commented Sep 14, 2020

Fixes #502

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 14, 2020
@codecov
Copy link

codecov bot commented Sep 14, 2020

Codecov Report

Merging #507 into master will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #507      +/-   ##
============================================
- Coverage     64.69%   64.68%   -0.02%     
+ Complexity      629      620       -9     
============================================
  Files            32       32              
  Lines          5249     5255       +6     
  Branches        509      511       +2     
============================================
+ Hits           3396     3399       +3     
- Misses         1694     1697       +3     
  Partials        159      159              
Impacted Files Coverage Δ Complexity Δ
...c/main/java/com/google/cloud/storage/BlobInfo.java 88.34% <ø> (ø) 94.00 <0.00> (ø)
...om/google/cloud/storage/spi/v1/HttpStorageRpc.java 1.59% <0.00%> (-0.01%) 2.00 <0.00> (ø)
...ain/java/com/google/cloud/storage/StorageImpl.java 81.31% <0.00%> (+0.06%) 138.00% <0.00%> (-9.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10cc743...f0e249f. Read the comment docs.

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage API. label Sep 15, 2020
@athakor
Copy link
Contributor Author

athakor commented Sep 17, 2020

@frankyn PTAL

@@ -621,7 +637,8 @@ Builder setCustomerEncryption(CustomerEncryption customerEncryption) {

@Override
Builder setKmsKeyName(String kmsKeyName) {
this.kmsKeyName = kmsKeyName;
this.kmsKeyName =
kmsKeyName != null && kmsKeyName.contains("cryptoKeyVersions") ? "" : kmsKeyName;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should be in the HttpStorageRpc request being sent instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@frankyn frankyn merged commit 4d9c490 into googleapis:master Sep 17, 2020
gcf-merge-on-green bot pushed a commit that referenced this pull request Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KMS Bad Key error when using existing Blob context to overwrite object.
2 participants