Skip to content

Commit

Permalink
fix: proper fallback option handling (#486)
Browse files Browse the repository at this point in the history
* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* feat(secrets): begin migration to secret manager from keystore

Source-Author: Benjamin E. Coe <[email protected]>
Source-Date: Mon Jun 8 09:51:11 2020 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 1c92077459db3dc50741e878f98b08c6261181e0
Source-Link: googleapis/synthtool@1c92077

* chore(nodejs_templates): add script logging to node_library populate-secrets.sh

Co-authored-by: Benjamin E. Coe <[email protected]>

Source-Author: BenWhitehead <[email protected]>
Source-Date: Wed Jun 10 22:24:28 2020 -0400
Source-Repo: googleapis/synthtool
Source-Sha: e7034945fbdc0e79d3c57f6e299e5c90b0f11469
Source-Link: googleapis/synthtool@e703494
  • Loading branch information
yoshi-automation authored Jun 15, 2020
1 parent 4aeb7cb commit f17d915
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/google-privacy-dlp/protos/protos.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;

// Exported root namespace
var $root = $protobuf.roots._google_cloud_dlp_3_0_0_protos || ($protobuf.roots._google_cloud_dlp_3_0_0_protos = {});
var $root = $protobuf.roots._google_cloud_dlp_protos || ($protobuf.roots._google_cloud_dlp_protos = {});

$root.google = (function() {

Expand Down
20 changes: 12 additions & 8 deletions packages/google-privacy-dlp/src/v2/dlp_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,20 @@ export class DlpServiceClient {
}
opts.servicePath = opts.servicePath || servicePath;
opts.port = opts.port || port;

// users can override the config from client side, like retry codes name.
// The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546
// The way to override client config for Showcase API:
//
// const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}}
// const showcaseClient = new showcaseClient({ projectId, customConfig });
opts.clientConfig = opts.clientConfig || {};

const isBrowser = typeof window !== 'undefined';
if (isBrowser) {
opts.fallback = true;
}
// If we are in browser, we are already using fallback because of the
// "browser" field in package.json.
// But if we were explicitly requested to use fallback, let's do it now.
this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax;
// If we're running in browser, it's OK to omit `fallback` since
// google-gax has `browser` field in its `package.json`.
// For Electron (which does not respect `browser` field),
// pass `{fallback: true}` to the DlpServiceClient constructor.
this._gaxModule = opts.fallback ? gax.fallback : gax;

// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
Expand Down
4 changes: 2 additions & 2 deletions packages/google-privacy-dlp/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/nodejs-dlp.git",
"sha": "6711f62738058efaf3e565ce6e36b00e0347267c"
"sha": "574fff1a4f2a5912c80c2a4d7580c716efebc29a"
}
},
{
Expand All @@ -19,7 +19,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "65f8c647c0bc0c6b38211b969a2a003e271a5ef1"
"sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469"
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/google-privacy-dlp/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"outDir": "build",
"resolveJsonModule": true,
"lib": [
"es2016",
"es2018",
"dom"
]
},
Expand Down

0 comments on commit f17d915

Please sign in to comment.