Socket
Socket
Sign inDemoInstall

@google-cloud/common

Package Overview
Dependencies
Maintainers
1
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/common - npm Package Compare versions

Comparing version 3.7.0 to 3.7.1

36

build/src/util.js

@@ -325,2 +325,3 @@ "use strict";

let stream;
let projectId;
const reqConfig = extend({}, config);

@@ -344,7 +345,2 @@ let activeRequest_;

if (!err || autoAuthFailed) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let projectId = authClient._cachedProjectId;
if (config.projectId && config.projectId !== '{{projectId}}') {
projectId = config.projectId;
}
try {

@@ -389,15 +385,19 @@ authenticatedReqOpts = util.decorateRequest(authenticatedReqOpts, projectId);

};
if (reqConfig.customEndpoint) {
// Using a custom API override. Do not use `google-auth-library` for
// authentication. (ex: connecting to a local Datastore server)
onAuthenticated(null, reqOpts);
}
else {
authClient.authorizeRequest(reqOpts).then(res => {
const opts = extend(true, {}, reqOpts, res);
onAuthenticated(null, opts);
}, err => {
onAuthenticated(err);
});
}
Promise.all([
config.projectId && config.projectId !== '{{projectId}}'
? // The user provided a project ID. We don't need to check with the
// auth client, it could be incorrect.
new Promise(resolve => resolve(config.projectId))
: authClient.getProjectId(),
reqConfig.customEndpoint
? // Using a custom API override. Do not use `google-auth-library` for
// authentication. (ex: connecting to a local Datastore server)
new Promise(resolve => resolve(reqOpts))
: authClient.authorizeRequest(reqOpts),
])
.then(([_projectId, authorizedReqOpts]) => {
projectId = _projectId;
onAuthenticated(null, authorizedReqOpts);
})
.catch(onAuthenticated);
if (stream) {

@@ -404,0 +404,0 @@ return stream;

@@ -7,2 +7,9 @@ # Changelog

### [3.7.1](https://www.github.com/googleapis/nodejs-common/compare/v3.7.0...v3.7.1) (2021-08-06)
### Bug Fixes
* correctly locate projectId from auth library ([#663](https://www.github.com/googleapis/nodejs-common/issues/663)) ([72e3168](https://www.github.com/googleapis/nodejs-common/commit/72e3168bcac1d177360257197293a566c5fb63d3))
## [3.7.0](https://www.github.com/googleapis/nodejs-common/compare/v3.6.0...v3.7.0) (2021-07-09)

@@ -9,0 +16,0 @@

{
"name": "@google-cloud/common",
"description": "Common components for Cloud APIs Node.js Client Libraries",
"version": "3.7.0",
"version": "3.7.1",
"license": "Apache-2.0",

@@ -6,0 +6,0 @@ "author": "Google Inc.",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc