Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Rename auth to authClient & Use Generics for AuthClient #1371

Merged
merged 3 commits into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/auth/googleauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export interface GoogleAuthOptions {
/**
* An `AuthClient` to use
*/
auth?: AuthClient;
authClient?: AuthClient;
/**
* Path to a .json, .pem, or .p12 key file
*/
Expand Down Expand Up @@ -160,7 +160,7 @@ export class GoogleAuth {
opts = opts || {};

this._cachedProjectId = opts.projectId || null;
this.cachedCredential = opts.auth || null;
this.cachedCredential = opts.authClient || null;
this.keyFilename = opts.keyFilename || opts.keyFile;
this.scopes = opts.scopes;
this.jsonContent = opts.credentials || null;
Expand Down
4 changes: 1 addition & 3 deletions test/test.googleauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,7 @@ describe('googleauth', () => {

const authClient = new MyAuthClient();

const auth = new GoogleAuth({
auth: authClient,
});
const auth = new GoogleAuth({authClient});

assert.equal(auth.cachedCredential, authClient);
assert.equal(await auth.getClient(), authClient);
Expand Down