Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry committed Aug 10, 2016
1 parent 8dae060 commit a70f269
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions pubsub/iam.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// https://googlecloudplatform.github.io/gcloud-node/#/docs/guides/authentication
var gcloud = require('gcloud');

// Get a reference to the pubsub component
// Instantiate a pubsub client
var pubsub = gcloud.pubsub();
// [END auth]

Expand All @@ -45,7 +45,7 @@ function getTopicPolicy (topicName, callback) {
return callback(err);
}

console.log('Got policy:', policy); // { etag: 'ACAB' }
console.log('Got policy:', policy);
return callback(null, policy);
});
}
Expand All @@ -72,7 +72,7 @@ function getSubscriptionPolicy (subscriptionName, callback) {
return callback(err);
}

console.log('Got policy:', policy); // { etag: 'ACAB' }
console.log('Got policy:', policy);
return callback(null, policy);
});
}
Expand All @@ -94,7 +94,7 @@ function setTopicPolicy (topicName, callback) {
var topic = pubsub.topic(topicName);

// Policy update
var myPolicy = {
var newPolicy = {
bindings: [
{
role: 'roles/pubsub.publisher',
Expand All @@ -104,7 +104,7 @@ function setTopicPolicy (topicName, callback) {
};

// Set the IAM policy for the specified topic
topic.iam.setPolicy(myPolicy, function (err, policy) {
topic.iam.setPolicy(newPolicy, function (err, policy) {
if (err) {
return callback(err);
}
Expand All @@ -130,7 +130,7 @@ function setSubscriptionPolicy (subscriptionName, callback) {
var subscription = pubsub.subscription(subscriptionName);

// Policy update
var myPolicy = {
var newPolicy = {
bindings: [
{
role: 'roles/pubsub.subscriber',
Expand All @@ -140,7 +140,7 @@ function setSubscriptionPolicy (subscriptionName, callback) {
};

// Set the IAM policy for the specified subscription
subscription.iam.setPolicy(myPolicy, function (err, policy) {
subscription.iam.setPolicy(newPolicy, function (err, policy) {
if (err) {
return callback(err);
}
Expand All @@ -166,14 +166,14 @@ function testTopicPermissions (topicName, callback) {
// Grab a reference to an existing topic
var topic = pubsub.topic(topicName);

var tests = [
var permissionsToTest = [
'pubsub.topics.attachSubscription',
'pubsub.topics.publish',
'pubsub.topics.update'
];

// Test the IAM policy for the specified topic
topic.iam.testPermissions(tests, function (err, permissions) {
topic.iam.testPermissions(permissionsToTest, function (err, permissions) {
if (err) {
return callback(err);
}
Expand All @@ -199,13 +199,13 @@ function testSubscriptionPermissions (subscriptionName, callback) {
// Grab a reference to an existing subscription
var subscription = pubsub.subscription(subscriptionName);

var tests = [
var permissionsToTest = [
'pubsub.subscriptions.consume',
'pubsub.subscriptions.update'
];

// Test the IAM policy for the specified subscription
subscription.iam.testPermissions(tests, function (err, permissions) {
subscription.iam.testPermissions(permissionsToTest, function (err, permissions) {
if (err) {
return callback(err);
}
Expand Down
2 changes: 1 addition & 1 deletion pubsub/subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// https://googlecloudplatform.github.io/gcloud-node/#/docs/guides/authentication
var gcloud = require('gcloud');

// Get a reference to the pubsub component
// Instantiate a pubsub client
var pubsub = gcloud.pubsub();
// [END auth]

Expand Down
2 changes: 1 addition & 1 deletion pubsub/topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// https://googlecloudplatform.github.io/gcloud-node/#/docs/guides/authentication
var gcloud = require('gcloud');

// Get a reference to the pubsub component
// Instantiate a pubsub client
var pubsub = gcloud.pubsub();
// [END auth]

Expand Down

0 comments on commit a70f269

Please sign in to comment.