With the advent of TPC and PSC, there’s a lot of complexity with apiEndpoints. To improve, we should:
expose an async Storage#getEndpoint() method
make the apiEndpoint property private
remove the useAuthWithCustomEndpoint parameter/property
remove the internal customEndpoint parameter/property
Additionally, if STORAGE_EMULATOR_HOST is detected and used the PassThroughAuthClient 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:
Customers will not be required to manually provide the universeDomain - as we can determine it asynchronously via GoogleAuth#getUniverseDomain. This is a major convenience for TPC customers.
We can offer a predictable, secure experience by not disabling auth by default when an apiEndpoint has been provided
Classes will no longer have to distinguish between auth and non-auth contexts - we can simply use auth everywhere uniformly
With the advent of TPC and PSC, there’s a lot of complexity with apiEndpoints. To improve, we should:
async Storage#getEndpoint()
methodapiEndpoint
property privateuseAuthWithCustomEndpoint
parameter/propertycustomEndpoint
parameter/propertyAdditionally, if
STORAGE_EMULATOR_HOST
is detected and used thePassThrough
AuthClient
should be used by default (which can be overwritten via the existingauthClient
parameter) - removing the need for theuseAuthWithCustomEndpoint
parameter.This will greatly clean-up the code base as:
universeDomain
- as we can determine it asynchronously viaGoogleAuth#getUniverseDomain
. This is a major convenience for TPC customers.apiEndpoint
has been providedauth
everywhere uniformlyRelated:
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