{"action":"created","comment":{"url":"https://api.github.com/repos/googleapis/nodejs-storage/pulls/comments/183451209","pull_request_review_id":114452017,"id":183451209,"diff_hunk":"@@ -1778,6 +1778,290 @@ describe('storage', function() {\n       });\n     });\n \n+    describe('kms keys', function() {\n+      var FILE_CONTENTS = 'secret data';\n+\n+      var keyRingId = generateName();\n+      var cryptoKeyId = generateName();\n+      var kmsKeyName;\n+\n+      var keyRingsBaseUrl = `https://cloudkms.googleapis.com/v1/projects/${\n+        storage.projectId\n+      }/locations/global/keyRings`;\n+\n+      function generateKmsKeyName(cryptoKeyId) {\n+        return `projects/${\n+          storage.projectId\n+        }/locations/global/keyRings/${keyRingId}/cryptoKeys/${cryptoKeyId}`;\n+      }\n+\n+      function createCryptoKey(cryptoKeyId, callback) {\n+        storage.request(\n+          {\n+            method: 'POST',\n+            uri: `${keyRingsBaseUrl}/${keyRingId}/cryptoKeys`,\n+            qs: {cryptoKeyId},\n+            json: {purpose: 'ENCRYPT_DECRYPT'},\n+          },\n+          function(err) {\n+            if (err) {\n+              callback(err);\n+              return;\n+            }\n+\n+            storage.request(\n+              {\n+                method: 'POST',\n+                uri: `${keyRingsBaseUrl}/${keyRingId}/cryptoKeys/${cryptoKeyId}:setIamPolicy`,\n+                json: {\n+                  policy: {\n+                    bindings: [\n+                      {\n+                        role: 'roles/cloudkms.cryptoKeyEncrypterDecrypter',\n+                        members: `serviceAccount:${","path":"system-test/storage.js","position":44,"original_position":44,"commit_id":"25dcaa144cee31d4f44fabf97d7b2aff7e341c54","original_commit_id":"1458d825fc700214aa6dbaf51dc3031d9fcfe4b1","user":{"login":"frankyn","id":1907648,"avatar_url":"https://avatars1.githubusercontent.com/u/1907648?v=4","gravatar_id":"","url":"https://api.github.com/users/frankyn","html_url":"https://github.com/frankyn","followers_url":"https://api.github.com/users/frankyn/followers","following_url":"https://api.github.com/users/frankyn/following{/other_user}","gists_url":"https://api.github.com/users/frankyn/gists{/gist_id}","starred_url":"https://api.github.com/users/frankyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankyn/subscriptions","organizations_url":"https://api.github.com/users/frankyn/orgs","repos_url":"https://api.github.com/users/frankyn/repos","events_url":"https://api.github.com/users/frankyn/events{/privacy}","received_events_url":"https://api.github.com/users/frankyn/received_events","type":"User","site_admin":false},"body":"The robot service account will be updated for GCS later this quarter and will be available using the serviceAccount.get request. My recommendation is to use the serviceAccount.get request to get the robot service account which will provide the correct format. You can ignore the new format for now.","created_at":"2018-04-23T16:07:59Z","updated_at":"2018-04-23T16:07:59Z","html_url":"https://github.com/googleapis/nodejs-storage/pull/179#discussion_r183451209","pull_request_url":"https://api.github.com/repos/googleapis/nodejs-storage/pulls/179","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/googleapis/nodejs-storage/pulls/comments/183451209"},"html":{"href":"https://github.com/googleapis/nodejs-storage/pull/179#discussion_r183451209"},"pull_request":{"href":"https://api.github.com/repos/googleapis/nodejs-storage/pulls/179"}},"in_reply_to_id":183255243},"pull_request":{"url":"https://api.github.com/repos/googleapis/nodejs-storage/pulls/179","id":182510583,"html_url":"https://github.com/googleapis/nodejs-storage/pull/179","diff_url":"https://github.com/googleapis/nodejs-storage/pull/179.diff","patch_url":"https://github.com/googleapis/nodejs-storage/pull/179.patch","issue_url":"https://api.github.com/repos/googleapis/nodejs-storage/issues/179","number":179,"state":"open","locked":false,"title":"Introduce KMS","user":{"login":"stephenplusplus","id":723048,"avatar_url":"https://avatars0.githubusercontent.com/u/723048?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenplusplus","html_url":"https://github.com/stephenplusplus","followers_url":"https://api.github.com/users/stephenplusplus/followers","following_url":"https://api.github.com/users/stephenplusplus/following{/other_user}","gists_url":"https://api.github.com/users/stephenplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenplusplus/subscriptions","organizations_url":"https://api.github.com/users/stephenplusplus/orgs","repos_url":"https://api.github.com/users/stephenplusplus/repos","events_url":"https://api.github.com/users/stephenplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/stephenplusplus/received_events","type":"User","site_admin":false},"body":"This adds support for KMS.\r\n\r\n#### To Dos\r\n\r\n- [x] [Merge & Release support in gcs-resumable-upload](https://github.com/stephenplusplus/gcs-resumable-upload/pull/54)\r\n- [x] System tests\r\n- Unit tests\r\n  - [x] bucket.js\r\n  - [x] file.js\r\n","created_at":"2018-04-18T15:05:22Z","updated_at":"2018-04-23T16:07:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db51642716383ca117fcfa41202ccde5c0a8e32e","assignee":{"login":"stephenplusplus","id":723048,"avatar_url":"https://avatars0.githubusercontent.com/u/723048?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenplusplus","html_url":"https://github.com/stephenplusplus","followers_url":"https://api.github.com/users/stephenplusplus/followers","following_url":"https://api.github.com/users/stephenplusplus/following{/other_user}","gists_url":"https://api.github.com/users/stephenplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenplusplus/subscriptions","organizations_url":"https://api.github.com/users/stephenplusplus/orgs","repos_url":"https://api.github.com/users/stephenplusplus/repos","events_url":"https://api.github.com/users/stephenplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/stephenplusplus/received_events","type":"User","site_admin":false},"assignees":[{"login":"stephenplusplus","id":723048,"avatar_url":"https://avatars0.githubusercontent.com/u/723048?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenplusplus","html_url":"https://github.com/stephenplusplus","followers_url":"https://api.github.com/users/stephenplusplus/followers","following_url":"https://api.github.com/users/stephenplusplus/following{/other_user}","gists_url":"https://api.github.com/users/stephenplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenplusplus/subscriptions","organizations_url":"https://api.github.com/users/stephenplusplus/orgs","repos_url":"https://api.github.com/users/stephenplusplus/repos","events_url":"https://api.github.com/users/stephenplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/stephenplusplus/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":699304914,"url":"https://api.github.com/repos/googleapis/nodejs-storage/labels/cla:%20yes","name":"cla: yes","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/googleapis/nodejs-storage/pulls/179/commits","review_comments_url":"https://api.github.com/repos/googleapis/nodejs-storage/pulls/179/comments","review_comment_url":"https://api.github.com/repos/googleapis/nodejs-storage/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/nodejs-storage/issues/179/comments","statuses_url":"https://api.github.com/repos/googleapis/nodejs-storage/statuses/25dcaa144cee31d4f44fabf97d7b2aff7e341c54","head":{"label":"stephenplusplus:spp--kms","ref":"spp--kms","sha":"25dcaa144cee31d4f44fabf97d7b2aff7e341c54","user":{"login":"stephenplusplus","id":723048,"avatar_url":"https://avatars0.githubusercontent.com/u/723048?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenplusplus","html_url":"https://github.com/stephenplusplus","followers_url":"https://api.github.com/users/stephenplusplus/followers","following_url":"https://api.github.com/users/stephenplusplus/following{/other_user}","gists_url":"https://api.github.com/users/stephenplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenplusplus/subscriptions","organizations_url":"https://api.github.com/users/stephenplusplus/orgs","repos_url":"https://api.github.com/users/stephenplusplus/repos","events_url":"https://api.github.com/users/stephenplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/stephenplusplus/received_events","type":"User","site_admin":false},"repo":{"id":104504292,"name":"nodejs-storage","full_name":"stephenplusplus/nodejs-storage","owner":{"login":"stephenplusplus","id":723048,"avatar_url":"https://avatars0.githubusercontent.com/u/723048?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenplusplus","html_url":"https://github.com/stephenplusplus","followers_url":"https://api.github.com/users/stephenplusplus/followers","following_url":"https://api.github.com/users/stephenplusplus/following{/other_user}","gists_url":"https://api.github.com/users/stephenplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenplusplus/subscriptions","organizations_url":"https://api.github.com/users/stephenplusplus/orgs","repos_url":"https://api.github.com/users/stephenplusplus/repos","events_url":"https://api.github.com/users/stephenplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/stephenplusplus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stephenplusplus/nodejs-storage","description":null,"fork":true,"url":"https://api.github.com/repos/stephenplusplus/nodejs-storage","forks_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/forks","keys_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/teams","hooks_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/hooks","issue_events_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/issues/events{/number}","events_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/events","assignees_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/assignees{/user}","branches_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/branches{/branch}","tags_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/tags","blobs_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/git/refs{/sha}","trees_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/statuses/{sha}","languages_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/languages","stargazers_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/stargazers","contributors_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/contributors","subscribers_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/subscribers","subscription_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/subscription","commits_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/commits{/sha}","git_commits_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/git/commits{/sha}","comments_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/comments{/number}","issue_comment_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/issues/comments{/number}","contents_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/contents/{+path}","compare_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/merges","archive_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/downloads","issues_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/issues{/number}","pulls_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/pulls{/number}","milestones_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/milestones{/number}","notifications_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/labels{/name}","releases_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/releases{/id}","deployments_url":"https://api.github.com/repos/stephenplusplus/nodejs-storage/deployments","created_at":"2017-09-22T18:06:43Z","updated_at":"2017-09-22T18:06:45Z","pushed_at":"2018-04-23T16:02:25Z","git_url":"git://github.com/stephenplusplus/nodejs-storage.git","ssh_url":"git@github.com:stephenplusplus/nodejs-storage.git","clone_url":"https://github.com/stephenplusplus/nodejs-storage.git","svn_url":"https://github.com/stephenplusplus/nodejs-storage","homepage":null,"size":4272,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"googleapis:master","ref":"master","sha":"fb6a7fd779061da9d885b7ac89992acde1191b54","user":{"login":"googleapis","id":16785467,"avatar_url":"https://avatars3.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":98465010,"name":"nodejs-storage","full_name":"googleapis/nodejs-storage","owner":{"login":"googleapis","id":16785467,"avatar_url":"https://avatars3.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/googleapis/nodejs-storage","description":"Node.js client for Google Cloud Storage: unified object storage for developers and enterprises, from live data serving to data analytics/ML to data archiving.","fork":false,"url":"https://api.github.com/repos/googleapis/nodejs-storage","forks_url":"https://api.github.com/repos/googleapis/nodejs-storage/forks","keys_url":"https://api.github.com/repos/googleapis/nodejs-storage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/nodejs-storage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/nodejs-storage/teams","hooks_url":"https://api.github.com/repos/googleapis/nodejs-storage/hooks","issue_events_url":"https://api.github.com/repos/googleapis/nodejs-storage/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/nodejs-storage/events","assignees_url":"https://api.github.com/repos/googleapis/nodejs-storage/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/nodejs-storage/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/nodejs-storage/tags","blobs_url":"https://api.github.com/repos/googleapis/nodejs-storage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/nodejs-storage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/nodejs-storage/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/nodejs-storage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/nodejs-storage/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/nodejs-storage/languages","stargazers_url":"https://api.github.com/repos/googleapis/nodejs-storage/stargazers","contributors_url":"https://api.github.com/repos/googleapis/nodejs-storage/contributors","subscribers_url":"https://api.github.com/repos/googleapis/nodejs-storage/subscribers","subscription_url":"https://api.github.com/repos/googleapis/nodejs-storage/subscription","commits_url":"https://api.github.com/repos/googleapis/nodejs-storage/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/nodejs-storage/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/nodejs-storage/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/nodejs-storage/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/nodejs-storage/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/nodejs-storage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/nodejs-storage/merges","archive_url":"https://api.github.com/repos/googleapis/nodejs-storage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/nodejs-storage/downloads","issues_url":"https://api.github.com/repos/googleapis/nodejs-storage/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/nodejs-storage/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/nodejs-storage/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/nodejs-storage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/nodejs-storage/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/nodejs-storage/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/nodejs-storage/deployments","created_at":"2017-07-26T20:53:32Z","updated_at":"2018-04-23T14:18:42Z","pushed_at":"2018-04-23T16:02:27Z","git_url":"git://github.com/googleapis/nodejs-storage.git","ssh_url":"git@github.com:googleapis/nodejs-storage.git","clone_url":"https://github.com/googleapis/nodejs-storage.git","svn_url":"https://github.com/googleapis/nodejs-storage","homepage":"https://cloud.google.com/storage/","size":3836,"stargazers_count":82,"watchers_count":82,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":46,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":46,"open_issues":8,"watchers":82,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/nodejs-storage/pulls/179"},"html":{"href":"https://github.com/googleapis/nodejs-storage/pull/179"},"issue":{"href":"https://api.github.com/repos/googleapis/nodejs-storage/issues/179"},"comments":{"href":"https://api.github.com/repos/googleapis/nodejs-storage/issues/179/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/nodejs-storage/pulls/179/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/nodejs-storage/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/nodejs-storage/pulls/179/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/nodejs-storage/statuses/25dcaa144cee31d4f44fabf97d7b2aff7e341c54"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"frankyn"}}