-
Notifications
You must be signed in to change notification settings - Fork 98
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
Implemented reading keyFile/credentials field from config object #315
Conversation
@GoogleCloudPlatform/node-team PTAL |
@@ -84,7 +84,9 @@ If your application is running outside of Google Cloud Platform, such as locally | |||
2. Copy the key somewhere your application can access it. Be sure not to expose the key publicly. | |||
3. Set the environment variable `GOOGLE_APPLICATION_CREDENTIALS` to the full path to the key. The debug agent will automatically look for this environment variable. |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
// An alias for keyFile. If both keyFile and keyFilename are set, the value | ||
// of keyFilename will be ignored. | ||
keyFilename: null, |
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.
|
||
process.env.GCLOUD_PROJECT = 0; | ||
|
||
describe('test-config-credentials', function() { |
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.request_ = utils.authorizedRequestFactory(SCOPES); | ||
this.request_ = utils.authorizedRequestFactory(SCOPES, { | ||
credentials: config.credentials, | ||
keyFile: config.keyFile || config.keyFilename |
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.
3. Alternatively, if you are running your application on a development machine or test environment where you are using the [`gcloud` command line tools][gcloud-sdk], and are logged using `gcloud beta auth application-default login`, you already have sufficient credentials, and a service account key is not required. | ||
If you are running your application on a development machine or test environment where you are using the [`gcloud` command line tools][gcloud-sdk], and are logged using `gcloud beta auth application-default login`, you already have sufficient credentials, and a service account key is not required. | ||
|
||
Alternatively, you may set the `keyFilename` or `credentials` configuration field to the full path or contents to the key file, respectively. Setting either of these fields will override both of the above options. (See the [default configuration](config.js) for more details.) |
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.
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.
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.
@@ -84,7 +84,9 @@ If your application is running outside of Google Cloud Platform, such as locally | |||
2. Copy the key somewhere your application can access it. Be sure not to expose the key publicly. | |||
3. Set the environment variable `GOOGLE_APPLICATION_CREDENTIALS` to the full path to the key. The debug agent will automatically look for this environment variable. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Appveyor failure seems to be due to an unrelated issue (gRPC 1.0.1 compilation on Windows). |
// The contents of a key file. If this field is set, its contents will be | ||
// used for authentication instead of your application default credentials. | ||
// If keyFilename is also set, the value of credentials will be ignored. | ||
credentials: null |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Clients may use
config.keyFilename
andconfig.credentials
to supply a key file or its contents in lieu ofGCLOUD_APPLICATION_CREDENTIALS
.