googleapis / nodejs-common

🚀🐢 A set of classes and utilities used in Google npm modules.
Apache License 2.0
58 stars 35 forks source link

refactor!: Revamp `apiEndpoint` #821

Open danielbankhead opened 5 months ago

danielbankhead commented 5 months ago

With the advent of TPC and PSC, there’s a lot of complexity with apiEndpoints. To improve, we should:

Additionally, if STORAGE_EMULATOR_HOST is detected and used the PassThrough AuthClient should be used by default (which can be overwritten via the existing authClient parameter) - removing the need for the useAuthWithCustomEndpoint parameter.

This will greatly clean-up the code base as:

Related:

We this change we can remove the following:

https://github.com/googleapis/nodejs-common/blob/0b4380af5e347ef0855d1e0ad45e055a2a9c6120/src/util.ts#L140-L148

https://github.com/googleapis/nodejs-common/blob/0b4380af5e347ef0855d1e0ad45e055a2a9c6120/src/util.ts#L766-L777