Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Implemented reading keyFile/credentials field from config object#315

Merged
kjin merged 6 commits intogoogleapis:masterfrom
kjin:auto-auth
Oct 31, 2016
Merged

Implemented reading keyFile/credentials field from config object#315
kjin merged 6 commits intogoogleapis:masterfrom
kjin:auto-auth

Conversation

@kjin
Copy link
Copy Markdown
Contributor

@kjin kjin commented Oct 27, 2016

Clients may use config.keyFilename and config.credentialsto supply a key file or its contents in lieu of GCLOUD_APPLICATION_CREDENTIALS.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 27, 2016
@kjin
Copy link
Copy Markdown
Contributor Author

kjin commented Oct 27, 2016

@GoogleCloudPlatform/node-team PTAL

README.md Outdated
@@ -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.

This comment was marked as spam.

This comment was marked as spam.


// 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.


process.env.GCLOUD_PROJECT = 0;

describe('test-config-credentials', function() {

This comment was marked as spam.

This comment was marked as spam.

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.

README.md Outdated
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.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

README.md Outdated
@@ -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.

@kjin
Copy link
Copy Markdown
Contributor Author

kjin commented Oct 31, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants