Skip to content

Commit

Permalink
refactor: keep old name to reduce refactoring downstream (if used)
Browse files Browse the repository at this point in the history
  • Loading branch information
d-goog committed Feb 6, 2025
1 parent b6852df commit fd55840
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/auth/authclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
*
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions test/test.authclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('AuthClient', () => {
const originalInterceptorCount = gaxios.interceptors.request.size;

const authClient = new PassThroughClient({
gaxios,
transporter: gaxios,
useAuthRequestParameters: false,
});

Expand All @@ -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);
});
Expand Down

0 comments on commit fd55840

Please sign in to comment.