Skip to content

Commit

Permalink
feat!: make transporter attribute type more generic (#1406)
Browse files Browse the repository at this point in the history
* feat: make tranporter attribute type more generic

* fix: keep `quotaProjectId` public

* fix: Use `Transporter` instead of `DefaultTransporter`

---------

Co-authored-by: Benjamin E. Coe <[email protected]>
Co-authored-by: sofisl <[email protected]>
Co-authored-by: Daniel Bankhead <[email protected]>
  • Loading branch information
4 people authored Jul 10, 2023
1 parent 11241e4 commit dfac525
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/auth/authclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import {EventEmitter} from 'events';
import {GaxiosOptions, GaxiosPromise, GaxiosResponse} from 'gaxios';

import {DefaultTransporter} from '../transporters';
import {DefaultTransporter, Transporter} from '../transporters';
import {Credentials} from './credentials';
import {Headers} from './oauth2client';

Expand Down Expand Up @@ -93,7 +93,7 @@ export abstract class AuthClient
* See {@link https://cloud.google.com/docs/quota| Working with quotas}
*/
quotaProjectId?: string;
transporter = new DefaultTransporter();
transporter: Transporter = new DefaultTransporter();
credentials: Credentials = {};
projectId?: string | null;
eagerRefreshThresholdMillis = 5 * 60 * 1000;
Expand Down
4 changes: 2 additions & 2 deletions src/auth/externalAccountAuthorizedUserClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
OAuthClientAuthHandler,
OAuthErrorResponse,
} from './oauth2common';
import {BodyResponseCallback, DefaultTransporter} from '../transporters';
import {BodyResponseCallback, Transporter} from '../transporters';
import {
GaxiosError,
GaxiosOptions,
Expand Down Expand Up @@ -83,7 +83,7 @@ class ExternalAccountAuthorizedUserHandler extends OAuthClientAuthHandler {
*/
constructor(
private readonly url: string,
private readonly transporter: DefaultTransporter,
private readonly transporter: Transporter,
clientAuthentication?: ClientAuthentication
) {
super(clientAuthentication);
Expand Down
4 changes: 2 additions & 2 deletions src/auth/stscredentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import {GaxiosError, GaxiosOptions, GaxiosResponse} from 'gaxios';
import * as querystring from 'querystring';

import {DefaultTransporter} from '../transporters';
import {DefaultTransporter, Transporter} from '../transporters';
import {Headers} from './oauth2client';
import {
ClientAuthentication,
Expand Down Expand Up @@ -131,7 +131,7 @@ export interface StsSuccessfulResponse {
* https://tools.ietf.org/html/rfc8693
*/
export class StsCredentials extends OAuthClientAuthHandler {
private transporter: DefaultTransporter;
private transporter: Transporter;

/**
* Initializes an STS credentials instance.
Expand Down

0 comments on commit dfac525

Please sign in to comment.