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

adds KMS quickstart #296

Merged
merged 6 commits into from
Jan 11, 2017
Merged

adds KMS quickstart #296

merged 6 commits into from
Jan 11, 2017

Conversation

bshaffer
Copy link
Contributor

No description provided.

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2016 Google Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

small nit: it's 2017

// Set the required scopes to access the Key Management Service API
$client->setScopes(array(
'https://www.googleapis.com/auth/cloudkms',
'https://www.googleapis.com/auth/cloud-platform'
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you really need both?

Copy link
Member

Choose a reason for hiding this comment

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

Nope, remove https://www.googleapis.com/auth/cloudkms

$projectId = 'YOUR_PROJECT_ID';

# The "global" zone will list all keys, can be a specific zone if desired
$zone = 'global';
Copy link
Member

Choose a reason for hiding this comment

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

Change variable name throughout from $zone to $location, per GoogleCloudPlatform/python-docs-samples#754

# Your Google Cloud Platform project ID
$projectId = 'YOUR_PROJECT_ID';

# The "global" zone will list all keys, can be a specific zone if desired
Copy link
Member

Choose a reason for hiding this comment

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

Change comment to Lists keys in the "global" location., per GoogleCloudPlatform/python-docs-samples#754

$kms = new Google_Service_CloudKMS($client);

// list all key rings for your project
$keyRings = $kms->projects_locations_keyRings->listProjectsLocationsKeyRings(
Copy link
Member

Choose a reason for hiding this comment

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

Last question, does this work? The published discovery doc required that I change the Node.js and Python samples to pass in a full, manually constructed path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to add the $parent parameter - should work now

@bshaffer bshaffer merged commit a47f94b into master Jan 11, 2017
@bshaffer bshaffer deleted the kms branch January 11, 2017 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants