googleapis / googleapis/google-cloud-node
FR: gax-fallback support for `options.sslCreds` and "insecure credentials"
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 712
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 99
Description
When using gax-fallback we would like support for passing credentials via `options.sslCreds`. These ssl creds will be used by the fallback instead of initializing the auth client ([as done in gax grpc](https://github.com/googleapis/gax-nodejs/blob/324ff49fe059e1453bf751247e07e460d11c281a/src/grpc.ts#L194)).
Additionally, the gax fallback needs a method similar to `grpc.credentials.createInsecure()`, which creates a credential that when passed via `options.sslCreds`, will be detected by the fallback transport and cause it to use the fake auth client. As Alex suggested, a possible solution is to create `getInsecureCredentials()` in `google-gax` (both in grpc and fallback) that creates and returns these credentials.
Why? In nodejs-firestore customers are facing an issue where the client is unable to generate credentials when connecting to the emulator using REST transport over http ([1811](https://github.com/googleapis/google-cloud-node/issues/7470)). Several workarounds were investigated, including ([1812](https://github.com/googleapis/nodejs-firestore/pull/1812)). But the workarounds faced their own challenges with the initialization of GoogleAuth. Ultimately, we believe it's better to have gax and gax-fallback behavior be consistent with respect to support for `options.sslCreds`.
Contributor guide
Assessment
This issue has not been assessed yet.