diff --git a/src/auth/authclient.ts b/src/auth/authclient.ts index fecb5cda..cd7096b4 100644 --- a/src/auth/authclient.ts +++ b/src/auth/authclient.ts @@ -86,13 +86,13 @@ export interface AuthClientOptions * * @see {@link AuthClientOptions.useAuthRequestParameters} */ - gaxios?: Gaxios; + transporter?: Gaxios; /** * Provides default options to the transporter, such as {@link GaxiosOptions.agent `agent`} or * {@link GaxiosOptions.retryConfig `retryConfig`}. * - * This option is ignored if {@link AuthClientOptions.gaxios `gaxios`} has been provided + * This option is ignored if {@link AuthClientOptions.transporter `gaxios`} has been provided */ transporterOptions?: GaxiosOptions; @@ -112,7 +112,7 @@ export interface AuthClientOptions /** * Enables/disables the adding of the AuthClient's default interceptor. * - * @see {@link AuthClientOptions.gaxios} + * @see {@link AuthClientOptions.transporter} * * @remarks * @@ -223,7 +223,7 @@ export abstract class AuthClient this.universeDomain = options.get('universe_domain') ?? DEFAULT_UNIVERSE; // Shared client options - this.transporter = opts.gaxios ?? new Gaxios(opts.transporterOptions); + this.transporter = opts.transporter ?? new Gaxios(opts.transporterOptions); if (options.get('useAuthRequestParameters') !== false) { this.transporter.interceptors.request.add( diff --git a/test/test.authclient.ts b/test/test.authclient.ts index 28261eed..b93aa81a 100644 --- a/test/test.authclient.ts +++ b/test/test.authclient.ts @@ -45,7 +45,7 @@ describe('AuthClient', () => { const originalInterceptorCount = gaxios.interceptors.request.size; const authClient = new PassThroughClient({ - gaxios, + transporter: gaxios, useAuthRequestParameters: false, }); @@ -61,8 +61,8 @@ describe('AuthClient', () => { const originalInterceptorCount = gaxios.interceptors.request.size; const expectedInterceptorCount = originalInterceptorCount + 1; - new PassThroughClient({gaxios}); - new PassThroughClient({gaxios}); + new PassThroughClient({transporter: gaxios}); + new PassThroughClient({transporter: gaxios}); assert.equal(gaxios.interceptors.request.size, expectedInterceptorCount); });