Storage: add support for KMS keys#5259
Conversation
| :param kms_key_name: | ||
| Optional resource name of Cloud KMS key used to encrypt the blob's | ||
| contents. | ||
| See https://cloud.google.com/storage/docs/encryption#kms. |
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.
| # We can't verify it, but ideally we would check that the following | ||
| # URL was resolvable with our credentals | ||
| # KEY_URL = 'https://cloudkms.googleapis.com/v1/{}'.format( | ||
| # kms_key_name) |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| download_url = blob._get_download_url() | ||
| expected_url = ( | ||
| 'https://www.googleapis.com/download/storage/v1/b/' | ||
| 'buhkit/o/bzzz-fly.txt?alt=media') # kmsKeyName *not* expected |
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.
| key_name, | ||
| ) | ||
|
|
||
| def test_blob_w_explicit_kms_key_name(self): |
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.
|
@frankyn PTAL. |
frankyn
left a comment
There was a problem hiding this comment.
LGTM, but do not merge and still pending switching to regional keys.
|
@frankyn FYI I just ran the KMS system tests without changing to regional keys, and they passed. When I switch to regional keys, they fail. |
|
Thanks @tseaver, what is the error you're seeing? |
|
@frankyn |
|
Synced with @tseaver and will look into reproducing error and syncing with GCS team. |
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
|
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) |
|
I made commits and caused the CLA issue. I'm okay with my contributions being added to the repo. |
|
@frankyn We are good to merge this branch today, right? |
|
I saw the failures in tests were related to logging, and tests for storage weren't ran. I ran tests locally and they passed, but I want to make sure they're not broken for repo system tests. |
|
@frankyn The logging system tests shouldn't even run against this branch. I've run them locally using the same credentials we use on CircleCI, and they pass. I will try rebuilding them. |
Backed by '_properties'.
* Plumb 'kms_key_name' param through to 'Bucket.blob'.
Don't highlight absence of 'kmsKeyName' in expected GET request URL.
200df7c to
d7843d1
Compare
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
|
I've rebased the branch against current |
|
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) |
|
Same state as before, but CLA: yes was removed again.. |
Merge is blocked for public beta of the KMS support. We will need to adjust the system tests at that time to switch from using keys in the
globallocation to keys in the same location as the bucket.