GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — streamline auth - normalize `project_id` to `projectId` by nw · Pull Request #1661 · googleapis/google-cloud-node

Conversation

@nw

@nw nw commented Oct 2, 2016

Copy link
Copy Markdown

This patch helps to streamline authentication with google-cloud modules.

Example:

const bq = require('@google-cloud/bigquery')(require('./gcloud_key.json'))

gcloud_key.json is a non modified exported key from IAM service accounts.

This patch normalizes the name of project_id found in the keyfile to projectId to work with google-auto-auth library.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
nw added 2 commits October 2, 2016 15:12
@nw
normalizes project_id from service account key to
e4270c2
@nw
added test
6fb4f2e
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 2, 2016
@nw
fixed linting issues
ce67f70
@coveralls

coveralls commented Oct 2, 2016

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling ce67f70 on nw:nw/fix-normalize-projectId into * on GoogleCloudPlatform:master*.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Oct 3, 2016

Copy link
Copy Markdown
Contributor

Thank you for this! It's very interestingly-timed, because we're working on getting the projectId in a similar way with one of our dependencies: googleapis/google-auth-library-nodejs#98. I think we should wait for that, since it will work for all of the various ways we accept credentials-- keyfile, environment variable, and a credentials object-- and we won't have to special-case this scenario.

const bq = require('@google-cloud/bigquery')(require('./gcloud_key.json'))

This confuses me a bit because when a user provides a parsed key file, we accept it under the credentials key like this:

const bq = require('@google-cloud/bigquery')({
  credentials: require('./keyfile.json')
})

Was your example a typo, or does it work without using the credentials key as well?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus stephenplusplus added the auth label Oct 3, 2016
@nw

nw commented Oct 3, 2016

Copy link
Copy Markdown
Author

@stephenplusplus Yeah I saw the discussion about google-auth just after putting this PR.

The example is correct. The json key files have all the credentials needed with the exception of normalizing the projectId.

Maybe this example is clearer

const creds = require('./keyfile.json')
const bq = require('@google-cloud/bigquery')(creds)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Oct 3, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

When I try that, I get:

var creds = require('/Users/stephen/dev/keyfile.json')
creds.projectId = creds.project_id
var bigquery = require('@google-cloud/bigquery')(creds)
Error: Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information.
    at /Users/stephen/dev/play/gcloud-1475518276/node_modules/google-auth-library/lib/auth/googleauth.js:145:21

To fix:

var creds = require('/Users/stephen/dev/keyfile.json')
var bigquery = require('@google-cloud/bigquery')({
  projectId: creds.project_id,
  credentials: creds
})

I'm going to close since we'll wait out googleapis/google-auth-library-nodejs#98, but still thank you very much for the help. If you find anything else you think can be improved, please let us know!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus stephenplusplus closed this Oct 3, 2016
sofisl pushed a commit that referenced this pull request Feb 25, 2026
@ddelgrosso1
fix: remove bucket preconditions from deleteFiles, it is a file opera…
675d470
…tion not bucket (#1661)
sofisl pushed a commit that referenced this pull request Feb 25, 2026
@release-please
chore: release 5.15.2 (#1662)
09e5c80
🤖 I have created a release \*beep\* \*boop\*
---
### [5.15.2](https://www.github.com/googleapis/nodejs-storage/compare/v5.15.1...v5.15.2) (2021-10-13)


### Bug Fixes

* remove bucket preconditions from deleteFiles, it is a file operation not bucket ([#1661](https://www.github.com/googleapis/nodejs-storage/issues/1661)) ([6b7a06d](https://www.github.com/googleapis/nodejs-storage/commit/6b7a06defe1a3cadc6fad9258ff3fb01a2ecce0a))
---


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 pull request Feb 26, 2026
@renovate-bot
chore(deps): update dependency jsdoc-fresh to v2 (#1661)
facde3d
GautamSharda pushed a commit that referenced this pull request Mar 11, 2026
@renovate-bot
chore(deps): update dependency @types/uuid to v9 (#1661)
7fb4e80
sofisl pushed a commit that referenced this pull request Mar 17, 2026
@leahecole
feat: paging changes for bigquery (#1661)
9544c71
* debug statements

* WIP pagination

* WIP

* WIP - partial pagination work

* WIP - pageResponseType compiles

* WIP

* WIP success pagination maxResults

* partial cleanup

* remove unnecessary step

* WIP - some tempalte changes

* more changes

* lint

* update baselines

* run baselines

* update esm templates

* add bq cjs baseline

* add bigquery esm baselines

* change package.json baseline to symlink

* change esm package.json baseline to symlink

* add bq to ci.yml

* add debug line

* more debugging

* remove debug

* WIP: baselines

* update baselines

* add bq protos

* run baseline job

* run baseline job

* add reviewer suggestion to protos.ts, update baselines

* make the maxResultsParameter undefined for all APIS that aren't BQ

* update samples comments

* fix lint

* remove todo

* remove todo

* address reviewer suggestions

* address reviewer suggestion

* fix lint
thiyaguk09 pushed a commit to thiyaguk09/google-cloud-node-fork that referenced this pull request Mar 18, 2026
@ddelgrosso1
fix: remove bucket preconditions from deleteFiles, it is a file opera…
0094bfb
…tion not bucket (googleapis#1661)
thiyaguk09 pushed a commit to thiyaguk09/google-cloud-node-fork that referenced this pull request Mar 18, 2026
@release-please
chore: release 5.15.2 (googleapis#1662)
3e698fa
🤖 I have created a release \*beep\* \*boop\*
---
### [5.15.2](https://www.github.com/googleapis/nodejs-storage/compare/v5.15.1...v5.15.2) (2021-10-13)


### Bug Fixes

* remove bucket preconditions from deleteFiles, it is a file operation not bucket ([googleapis#1661](https://www.github.com/googleapis/nodejs-storage/issues/1661)) ([0094bfb](https://www.github.com/googleapis/nodejs-storage/commit/0094bfb0f1c4d7af8bb47cd8c7c56dce8cc09012))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
GautamSharda pushed a commit that referenced this pull request Mar 23, 2026
@danieljbruce
feat: Add client side metrics for checkAndMutateRow calls (#1661)
b91c814
## Description

This PR collects client side metrics for checkAndMutateRow calls and collects all the right types of metrics for these unary calls. They leverage the plumbing provided for unary calls to add interceptors to those calls so that we can record metrics for the right zone/cluster/server time.

## Impact

This PR collects client side metrics for checkAndMutateRow calls.

## Testing

For each readRows/mutateRows/mutateRow test we add a corresponding test for checkAndMutateRow.
GautamSharda pushed a commit that referenced this pull request Mar 23, 2026
@release-please
chore(main): release 6.3.0 (#1648)
e515c93
🤖 I have created a release *beep* *boop*
---


## [6.3.0](https://togithub.com/googleapis/nodejs-bigtable/compare/v6.2.0...v6.3.0) (2025-08-11)


### Features

* Add client side metrics for checkAndMutateRow calls ([#1661](https://togithub.com/googleapis/nodejs-bigtable/issues/1661)) ([c258ea1](https://togithub.com/googleapis/nodejs-bigtable/commit/c258ea1b29203aad3eaaf9cfe64ddabb8c1018bf))
* Add client side metrics for readModifyWriteRow calls ([#1656](https://togithub.com/googleapis/nodejs-bigtable/issues/1656)) ([2129312](https://togithub.com/googleapis/nodejs-bigtable/commit/2129312401bf9f5b8e51b13ac576cb765de401df))
* Client side metrics support for mutateRows ([#1638](https://togithub.com/googleapis/nodejs-bigtable/issues/1638)) ([7601e4d](https://togithub.com/googleapis/nodejs-bigtable/commit/7601e4da115ff6a5da411cc857917b579c70ced7))
* Collect client side metrics for sampleRowKeys calls ([#1660](https://togithub.com/googleapis/nodejs-bigtable/issues/1660)) ([6ed98fa](https://togithub.com/googleapis/nodejs-bigtable/commit/6ed98faefe446e67f83fd5394aae30374fd3ec3a))
* For client side metrics, record metrics as MUTATE_ROW for single row mutates ([#1650](https://togithub.com/googleapis/nodejs-bigtable/issues/1650)) ([f190a8c](https://togithub.com/googleapis/nodejs-bigtable/commit/f190a8c322498ddfbe73406759a43a268c16bdc4))
* Record ReadRows application latencies for client side metrics ([#1647](https://togithub.com/googleapis/nodejs-bigtable/issues/1647)) ([8af801b](https://togithub.com/googleapis/nodejs-bigtable/commit/8af801b3ecd7ff5e30e6c8cc67bd4123bdf34ee9))


### Bug Fixes

* FirstResponseLatencies should only be collected for readRows calls ([#1658](https://togithub.com/googleapis/nodejs-bigtable/issues/1658)) ([99cf5a6](https://togithub.com/googleapis/nodejs-bigtable/commit/99cf5a6010249ed0eedd88f23b2d32cacb106c07))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
GautamSharda pushed a commit that referenced this pull request Mar 25, 2026
@danieljbruce @GautamSharda
feat: Add client side metrics for checkAndMutateRow calls (#1661)
97da7b9
## Description

This PR collects client side metrics for checkAndMutateRow calls and collects all the right types of metrics for these unary calls. They leverage the plumbing provided for unary calls to add interceptors to those calls so that we can record metrics for the right zone/cluster/server time.

## Impact

This PR collects client side metrics for checkAndMutateRow calls.

## Testing

For each readRows/mutateRows/mutateRow test we add a corresponding test for checkAndMutateRow.
GautamSharda pushed a commit that referenced this pull request Mar 25, 2026
@release-please @GautamSharda
chore(main): release 6.3.0 (#1648)
a0c2225
🤖 I have created a release *beep* *boop*
---


## [6.3.0](https://togithub.com/googleapis/nodejs-bigtable/compare/v6.2.0...v6.3.0) (2025-08-11)


### Features

* Add client side metrics for checkAndMutateRow calls ([#1661](https://togithub.com/googleapis/nodejs-bigtable/issues/1661)) ([c258ea1](https://togithub.com/googleapis/nodejs-bigtable/commit/c258ea1b29203aad3eaaf9cfe64ddabb8c1018bf))
* Add client side metrics for readModifyWriteRow calls ([#1656](https://togithub.com/googleapis/nodejs-bigtable/issues/1656)) ([2129312](https://togithub.com/googleapis/nodejs-bigtable/commit/2129312401bf9f5b8e51b13ac576cb765de401df))
* Client side metrics support for mutateRows ([#1638](https://togithub.com/googleapis/nodejs-bigtable/issues/1638)) ([7601e4d](https://togithub.com/googleapis/nodejs-bigtable/commit/7601e4da115ff6a5da411cc857917b579c70ced7))
* Collect client side metrics for sampleRowKeys calls ([#1660](https://togithub.com/googleapis/nodejs-bigtable/issues/1660)) ([6ed98fa](https://togithub.com/googleapis/nodejs-bigtable/commit/6ed98faefe446e67f83fd5394aae30374fd3ec3a))
* For client side metrics, record metrics as MUTATE_ROW for single row mutates ([#1650](https://togithub.com/googleapis/nodejs-bigtable/issues/1650)) ([f190a8c](https://togithub.com/googleapis/nodejs-bigtable/commit/f190a8c322498ddfbe73406759a43a268c16bdc4))
* Record ReadRows application latencies for client side metrics ([#1647](https://togithub.com/googleapis/nodejs-bigtable/issues/1647)) ([8af801b](https://togithub.com/googleapis/nodejs-bigtable/commit/8af801b3ecd7ff5e30e6c8cc67bd4123bdf34ee9))


### Bug Fixes

* FirstResponseLatencies should only be collected for readRows calls ([#1658](https://togithub.com/googleapis/nodejs-bigtable/issues/1658)) ([99cf5a6](https://togithub.com/googleapis/nodejs-bigtable/commit/99cf5a6010249ed0eedd88f23b2d32cacb106c07))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
@release-please release-please Bot mentioned this pull request Mar 26, 2026
chore(main): release bigtable 3.2.3 #7899
Closed
shivanee-p pushed a commit that referenced this pull request Mar 27, 2026
@danieljbruce @shivanee-p
feat: Add client side metrics for checkAndMutateRow calls (#1661)
6bf038c
## Description

This PR collects client side metrics for checkAndMutateRow calls and collects all the right types of metrics for these unary calls. They leverage the plumbing provided for unary calls to add interceptors to those calls so that we can record metrics for the right zone/cluster/server time.

## Impact

This PR collects client side metrics for checkAndMutateRow calls.

## Testing

For each readRows/mutateRows/mutateRow test we add a corresponding test for checkAndMutateRow.
shivanee-p pushed a commit that referenced this pull request Mar 27, 2026
@release-please @shivanee-p
chore(main): release 6.3.0 (#1648)
aa05ee4
🤖 I have created a release *beep* *boop*
---


## [6.3.0](https://togithub.com/googleapis/nodejs-bigtable/compare/v6.2.0...v6.3.0) (2025-08-11)


### Features

* Add client side metrics for checkAndMutateRow calls ([#1661](https://togithub.com/googleapis/nodejs-bigtable/issues/1661)) ([c258ea1](https://togithub.com/googleapis/nodejs-bigtable/commit/c258ea1b29203aad3eaaf9cfe64ddabb8c1018bf))
* Add client side metrics for readModifyWriteRow calls ([#1656](https://togithub.com/googleapis/nodejs-bigtable/issues/1656)) ([2129312](https://togithub.com/googleapis/nodejs-bigtable/commit/2129312401bf9f5b8e51b13ac576cb765de401df))
* Client side metrics support for mutateRows ([#1638](https://togithub.com/googleapis/nodejs-bigtable/issues/1638)) ([7601e4d](https://togithub.com/googleapis/nodejs-bigtable/commit/7601e4da115ff6a5da411cc857917b579c70ced7))
* Collect client side metrics for sampleRowKeys calls ([#1660](https://togithub.com/googleapis/nodejs-bigtable/issues/1660)) ([6ed98fa](https://togithub.com/googleapis/nodejs-bigtable/commit/6ed98faefe446e67f83fd5394aae30374fd3ec3a))
* For client side metrics, record metrics as MUTATE_ROW for single row mutates ([#1650](https://togithub.com/googleapis/nodejs-bigtable/issues/1650)) ([f190a8c](https://togithub.com/googleapis/nodejs-bigtable/commit/f190a8c322498ddfbe73406759a43a268c16bdc4))
* Record ReadRows application latencies for client side metrics ([#1647](https://togithub.com/googleapis/nodejs-bigtable/issues/1647)) ([8af801b](https://togithub.com/googleapis/nodejs-bigtable/commit/8af801b3ecd7ff5e30e6c8cc67bd4123bdf34ee9))


### Bug Fixes

* FirstResponseLatencies should only be collected for readRows calls ([#1658](https://togithub.com/googleapis/nodejs-bigtable/issues/1658)) ([99cf5a6](https://togithub.com/googleapis/nodejs-bigtable/commit/99cf5a6010249ed0eedd88f23b2d32cacb106c07))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
thiyaguk09 pushed a commit to thiyaguk09/google-cloud-node-fork that referenced this pull request May 5, 2026
@danieljbruce @thiyaguk09
feat: Add client side metrics for checkAndMutateRow calls (googleapis…
50b1c26
…#1661)

## Description

This PR collects client side metrics for checkAndMutateRow calls and collects all the right types of metrics for these unary calls. They leverage the plumbing provided for unary calls to add interceptors to those calls so that we can record metrics for the right zone/cluster/server time.

## Impact

This PR collects client side metrics for checkAndMutateRow calls.

## Testing

For each readRows/mutateRows/mutateRow test we add a corresponding test for checkAndMutateRow.
thiyaguk09 pushed a commit to thiyaguk09/google-cloud-node-fork that referenced this pull request May 5, 2026
@release-please @thiyaguk09
chore(main): release 6.3.0 (googleapis#1648)
519d9b5
🤖 I have created a release *beep* *boop*
---


## [6.3.0](https://togithub.com/googleapis/nodejs-bigtable/compare/v6.2.0...v6.3.0) (2025-08-11)


### Features

* Add client side metrics for checkAndMutateRow calls ([googleapis#1661](https://togithub.com/googleapis/nodejs-bigtable/issues/1661)) ([c258ea1](https://togithub.com/googleapis/nodejs-bigtable/commit/c258ea1b29203aad3eaaf9cfe64ddabb8c1018bf))
* Add client side metrics for readModifyWriteRow calls ([googleapis#1656](https://togithub.com/googleapis/nodejs-bigtable/issues/1656)) ([2129312](https://togithub.com/googleapis/nodejs-bigtable/commit/2129312401bf9f5b8e51b13ac576cb765de401df))
* Client side metrics support for mutateRows ([googleapis#1638](https://togithub.com/googleapis/nodejs-bigtable/issues/1638)) ([7601e4d](https://togithub.com/googleapis/nodejs-bigtable/commit/7601e4da115ff6a5da411cc857917b579c70ced7))
* Collect client side metrics for sampleRowKeys calls ([googleapis#1660](https://togithub.com/googleapis/nodejs-bigtable/issues/1660)) ([6ed98fa](https://togithub.com/googleapis/nodejs-bigtable/commit/6ed98faefe446e67f83fd5394aae30374fd3ec3a))
* For client side metrics, record metrics as MUTATE_ROW for single row mutates ([googleapis#1650](https://togithub.com/googleapis/nodejs-bigtable/issues/1650)) ([f190a8c](https://togithub.com/googleapis/nodejs-bigtable/commit/f190a8c322498ddfbe73406759a43a268c16bdc4))
* Record ReadRows application latencies for client side metrics ([googleapis#1647](https://togithub.com/googleapis/nodejs-bigtable/issues/1647)) ([8af801b](https://togithub.com/googleapis/nodejs-bigtable/commit/8af801b3ecd7ff5e30e6c8cc67bd4123bdf34ee9))


### Bug Fixes

* FirstResponseLatencies should only be collected for readRows calls ([googleapis#1658](https://togithub.com/googleapis/nodejs-bigtable/issues/1658)) ([99cf5a6](https://togithub.com/googleapis/nodejs-bigtable/commit/99cf5a6010249ed0eedd88f23b2d32cacb106c07))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
@jskeet jskeet mentioned this pull request May 19, 2026
chore(test-release-please): release 1.0.0 #8308
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@nw @coveralls @stephenplusplus @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.