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

Create gcloud-node client that uses metadata service auth #511

Closed
drewbryant opened this issue Apr 27, 2015 · 3 comments
Closed

Create gcloud-node client that uses metadata service auth #511

drewbryant opened this issue Apr 27, 2015 · 3 comments
Assignees
Labels
core type: question Request for information or clarification. Not an issue.

Comments

@drewbryant
Copy link

How can I force the gcloud-node client to attempt to use the compute engine environment, which relies upon the "metadata service" for getting auth tokens?

I see this chunk of code in lib/storage/index.js, and I don't see where/how it is checking for the compute engine environment:

function Storage(config) {
  if (!(this instanceof Storage)) {
    return new Storage(config);
  }

  this.makeAuthorizedRequest_ = util.makeAuthorizedRequest({
    credentials: config.credentials,
    keyFile: config.keyFilename,
    scopes: SCOPES
  });

  this.projectId = config.projectId;
}

Basically I'm attempting to create my client like this:

var gcloud = require('gcloud');
var storage = gcloud.storage();

And I'm hitting an error because I haven't passed a config object with credentials. The docs here made it seem like this was the expected syntax on compute engine however (i.e., gcloud.storage()).

Is this auth approach supported currently?

@stephenplusplus
Copy link
Contributor

Can you try with master? We recently went through an overhaul of how we authenticate, but it hasn't had a release yet.

@drewbryant
Copy link
Author

Thanks Stephen, it looks like the version in master is working on GCE with the metadata auth approach.

Follow-up question:
How have you been testing the GCE support locally (i.e., outside of GCE)? Do you simulate the GCE metadata service?

@stephenplusplus
Copy link
Contributor

For my testing, I actually pushed to a GCE endpoint. But fortunately, with our upcoming release, we have removed most of our auth code and instead use the google-auth-library. They have many unit tests that make sure the right requests are made for auth tokens and such.

I'm glad to hear master solves the problem, and sorry for the confusion with the current release. We should be getting a new release out soon.

@jgeewax jgeewax added type: question Request for information or clarification. Not an issue. auth core labels May 14, 2015
chingor13 pushed a commit that referenced this issue Aug 22, 2022
… and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies (#511)

* feat: add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies

PiperOrigin-RevId: 381145907

Source-Link: googleapis/googleapis@5d301f9

Source-Link: googleapis/googleapis-gen@9b332fd

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
Co-authored-by: Jeffrey Rennie <rennie@google.com>
chingor13 pushed a commit that referenced this issue Aug 22, 2022
🤖 I have created a release \*beep\* \*boop\*
---
## [3.15.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.14.1...v3.15.0) (2021-06-30)


### Features

* add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies ([#511](https://www.github.com/googleapis/nodejs-asset/issues/511)) ([1dfb0e9](https://www.github.com/googleapis/nodejs-asset/commit/1dfb0e95c58fdfbca2807744ea22c52d3c6e7651))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
chingor13 pushed a commit that referenced this issue Aug 22, 2022
… and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies (#511)

* feat: add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies

PiperOrigin-RevId: 381145907

Source-Link: googleapis/googleapis@5d301f9

Source-Link: googleapis/googleapis-gen@9b332fd

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
Co-authored-by: Jeffrey Rennie <rennie@google.com>
chingor13 pushed a commit that referenced this issue Aug 22, 2022
🤖 I have created a release \*beep\* \*boop\*
---
## [3.15.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.14.1...v3.15.0) (2021-06-30)


### Features

* add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies ([#511](https://www.github.com/googleapis/nodejs-asset/issues/511)) ([1dfb0e9](https://www.github.com/googleapis/nodejs-asset/commit/1dfb0e95c58fdfbca2807744ea22c52d3c6e7651))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
chingor13 pushed a commit that referenced this issue Aug 22, 2022
… and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies (#511)

* feat: add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies

PiperOrigin-RevId: 381145907

Source-Link: googleapis/googleapis@5d301f9

Source-Link: googleapis/googleapis-gen@9b332fd

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
Co-authored-by: Jeffrey Rennie <rennie@google.com>
chingor13 pushed a commit that referenced this issue Aug 22, 2022
🤖 I have created a release \*beep\* \*boop\*
---
## [3.15.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.14.1...v3.15.0) (2021-06-30)


### Features

* add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies ([#511](https://www.github.com/googleapis/nodejs-asset/issues/511)) ([1dfb0e9](https://www.github.com/googleapis/nodejs-asset/commit/1dfb0e95c58fdfbca2807744ea22c52d3c6e7651))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
sofisl pushed a commit that referenced this issue Sep 15, 2022
sofisl pushed a commit that referenced this issue Sep 16, 2022
…andwritten libraries (#511)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 429395631

Source-Link: googleapis/googleapis@84594b3

Source-Link: googleapis/googleapis-gen@ed74f97
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9
sofisl pushed a commit that referenced this issue Sep 27, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/959b7829-922a-41dc-a5a7-1178c3a8f0e7/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@363fe30
sofisl pushed a commit that referenced this issue Oct 5, 2022
…andwritten libraries (#511)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 429395631

Source-Link: googleapis/googleapis@84594b3

Source-Link: googleapis/googleapis-gen@ed74f97
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9
sofisl pushed a commit that referenced this issue Oct 5, 2022
…andwritten libraries (#511)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 429395631

Source-Link: googleapis/googleapis@84594b3

Source-Link: googleapis/googleapis-gen@ed74f97
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9
sofisl pushed a commit that referenced this issue Oct 8, 2022
…andwritten libraries (#511)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 429395631

Source-Link: googleapis/googleapis@84594b3

Source-Link: googleapis/googleapis-gen@ed74f97
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9
sofisl pushed a commit that referenced this issue Oct 11, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/fca23fa0-3627-48c1-abed-db8e850d5a5a/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@079dcce
sofisl pushed a commit that referenced this issue Nov 9, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/959b7829-922a-41dc-a5a7-1178c3a8f0e7/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@363fe30
sofisl pushed a commit that referenced this issue Nov 10, 2022
sofisl pushed a commit that referenced this issue Nov 10, 2022
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@types/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^9.0.0` -> `^10.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/9.0.11/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/compatibility-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/confidence-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

:date: **Schedule**: "after 9am and before 3pm" (UTC).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-tasks).
sofisl pushed a commit that referenced this issue Nov 11, 2022
…ript generator. (#511)

PiperOrigin-RevId: 385101839
sofisl pushed a commit that referenced this issue Nov 11, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this issue Nov 11, 2022
* docs: add instructions for authenticating for system tests

* docs: add instructions for authenticating for system tests

* docs: add phrasing change to README

Source-Author: sofisl <55454395+sofisl@users.noreply.github.com>
Source-Date: Mon Dec 21 13:21:29 2020 -0800
Source-Repo: googleapis/synthtool
Source-Sha: 363fe305e9ce34a6cd53951c6ee5f997094b54ee
Source-Link: googleapis/synthtool@363fe30
sofisl pushed a commit that referenced this issue Nov 11, 2022
… and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies (#511)

* feat: add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies

PiperOrigin-RevId: 381145907

Source-Link: googleapis/googleapis@5d301f9

Source-Link: googleapis/googleapis-gen@9b332fd

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
Co-authored-by: Jeffrey Rennie <rennie@google.com>
sofisl pushed a commit that referenced this issue Nov 11, 2022
🤖 I have created a release \*beep\* \*boop\*
---
## [3.15.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.14.1...v3.15.0) (2021-06-30)


### Features

* add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies ([#511](https://www.github.com/googleapis/nodejs-asset/issues/511)) ([1dfb0e9](https://www.github.com/googleapis/nodejs-asset/commit/1dfb0e95c58fdfbca2807744ea22c52d3c6e7651))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
sofisl pushed a commit that referenced this issue Nov 11, 2022
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^14.0.0` -> `^16.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/14.17.32/16.11.6) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/compatibility-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/confidence-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: "after 9am and before 3pm" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-kms).
sofisl pushed a commit that referenced this issue Nov 17, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/e0137a63-bb5b-4789-864f-390ba4ea7d6a/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@901ddd4
Source-Link: googleapis/synthtool@f96d3b4
sofisl pushed a commit that referenced this issue Nov 18, 2022
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 474338479

Source-Link: googleapis/googleapis@d5d35e0

Source-Link: googleapis/googleapis-gen@efcd3f9
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9

feat: Added parent display name i.e. source display name for a finding as one of the finding attributes
PiperOrigin-RevId: 474319054

Source-Link: googleapis/googleapis@862f99f

Source-Link: googleapis/googleapis-gen@bfc3497
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmZjMzQ5NzFlMWQxNmIxNzlmZmFiOGNiNjc3OWJjNjRmNzM3OGMwOSJ9
sofisl pushed a commit that referenced this issue Jan 10, 2023
…lates (#511)

This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/5e903fff-57bb-4395-bb94-8b4d1909dbf6/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@21f1470
Source-Link: googleapis/synthtool@388e10f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants