Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit 9b80c07

Browse files
authored
use correct auth scopes (#211)
* We no longer need cloud-platform scope. * The API has consolidated to cloud_debugger as the single scope. cloud_debugletcontroller doesn't seem to be a valid scope anymore. * Simplify readme.
1 parent e5d9eb9 commit 9b80c07

File tree

2 files changed

+5
-25
lines changed

2 files changed

+5
-25
lines changed

README.md

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ npm install --save @google-cloud/debug
2626
// Require and start in the startup of your application:
2727
var debug = require('@google-cloud/debug')();
2828
debug.startAgent();
29-
// No config necessary if your code is running on Google Cloud Platform.
29+
// No auth necessary if your code is running on Google Cloud Platform.
3030

3131
// ... or, if you are running elsewhere, you can manually provide credentials:
3232
var debug = require('@google-cloud/debug')({
@@ -41,23 +41,7 @@ the [Google Cloud Console][dev-console]. You can start adding snapshots and log-
4141

4242
## Running on Google Cloud Platform
4343

44-
There are three different services that can host Node.js application to Google Cloud Platform.
45-
46-
### Google App Engine Flexible Environment
47-
48-
If you are using [Google App Engine Flexible Environment ](https://cloud.google.com/appengine/docs/flexible/), you do not have to do any additional configuration.
49-
50-
### Google Compute Engine
51-
52-
Your VM instances need to be created with `cloud-platform` scope if created via [gcloud](https://cloud.google.com/sdk) or the 'Allow API access' checkbox selected if created via the [console](https://console.cloud.google.com) (see screenshot).
53-
54-
![GCE API](doc/images/gce.png?raw=true)
55-
56-
If you already have VMs that were created without API access and do not wish to recreate it, you can follow the instructions for using a service account under [running elsewhere](#running-elsewhere).
57-
58-
### Google Container Engine
59-
60-
Container Engine nodes need to also be created with the `cloud-platform` scope, which is configurable during cluster creation. Alternatively, you can follow the instructions for using a service account under [running elsewhere](#running-elsewhere). It's recommended that you store the service account credentials as [Kubernetes Secret](http://kubernetes.io/v1.1/docs/user-guide/secrets.html).
44+
Stackdriver debugger agent should work out of the box if your code is running on Google Cloud Platform, just make sure that the [Stackdriver Debugger API][debugger-api] is enabled on your project (this is the default).
6145

6246
## Running elsewhere
6347

@@ -104,7 +88,7 @@ If your application is running outside of Google Cloud Platform, such as locally
10488

10589
gcloud beta debug source gen-repo-info-file
10690

107-
## Debug Agent Settings
91+
## Debugger Agent Settings
10892

10993
You can customize the behaviour of the automatic debugger agent. See [the agent configuration][config-js] for a list of possible configuration options. These options can be passed to the agent through the object argument to the startAgent method as shown below:
11094

@@ -160,6 +144,7 @@ As soon as that line of code is reached in any of the running instances of your
160144
[david-url]: https://david-dm.org/GoogleCloudPlatform/cloud-debug-nodejs
161145
[david-dev-image]: https://david-dm.org/GoogleCloudPlatform/cloud-debug-nodejs/dev-status.svg
162146
[david-dev-url]: https://david-dm.org/GoogleCloudPlatform/cloud-debug-nodejs?type=dev
147+
[debugger-api]: https://console.cloud.google.com/apis/api/clouddebugger.googleapis.com/overview
163148
[snyk-image]: https://snyk.io/test/github/GoogleCloudPlatform/cloud-debug-nodejs/badge.svg
164149
[snyk-url]: https://snyk.io/test/github/GoogleCloudPlatform/cloud-debug-nodejs
165150
[config-js]: https://github.com/GoogleCloudPlatform/cloud-debug-nodejs/blob/master/src/agent/config.js

src/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,7 @@ function Debug(options) {
5151
var config = {
5252
projectIdRequired: false,
5353
baseUrl: 'https://clouddebugger.googleapis.com/v2',
54-
scopes: [
55-
// TODO: do we still need cloud-platform scope?
56-
'https://www.googleapis.com/auth/cloud-platform',
57-
'https://www.googleapis.com/auth/cloud_debugletcontroller'
58-
// TODO: the client library probably wants cloud_debugger scope as well.
59-
],
54+
scopes: ['https://www.googleapis.com/auth/cloud_debugger'],
6055
packageJson: require('../package.json')
6156
};
6257

0 commit comments

Comments
 (0)