Skip to content

Commit 9c02941

Browse files
authored
refactor!: remove deprecated DeprecatedGetClientOptions (#1393)
1 parent 416ea93 commit 9c02941

File tree

4 files changed

+1
-26
lines changed

4 files changed

+1
-26
lines changed

src/auth/googleauth.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ export interface CredentialCallback {
5959
(err: Error | null, result?: JSONClient): void;
6060
}
6161

62-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
63-
interface DeprecatedGetClientOptions {}
64-
6562
export interface ADCCallback {
6663
(err: Error | null, credential?: AuthClient, projectId?: string | null): void;
6764
}
@@ -790,12 +787,7 @@ export class GoogleAuth<T extends AuthClient = JSONClient> {
790787
* Automatically obtain a client based on the provided configuration. If no
791788
* options were passed, use Application Default Credentials.
792789
*/
793-
async getClient(options?: DeprecatedGetClientOptions) {
794-
if (options) {
795-
throw new Error(
796-
'Passing options to getClient is forbidden in v5.0.0. Use new GoogleAuth(opts) instead.'
797-
);
798-
}
790+
async getClient() {
799791
if (!this.cachedCredential) {
800792
if (this.jsonContent) {
801793
this._cacheClientFromJSON(this.jsonContent, this.clientOptions);

src/auth/oauth2client.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,6 @@ export class OAuth2Client extends AuthClient {
709709
/**
710710
* Retrieves the access token using refresh token
711711
*
712-
* @deprecated use getRequestHeaders instead.
713712
* @param callback callback
714713
*/
715714
refreshAccessToken(): Promise<RefreshAccessTokenResponse>;

test/test.googleauth.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,14 +1496,6 @@ describe('googleauth', () => {
14961496
);
14971497
});
14981498

1499-
it('should throw if options are passed to getClient()', async () => {
1500-
const auth = new GoogleAuth();
1501-
await assert.rejects(
1502-
auth.getClient({hello: 'world'}),
1503-
/Passing options to getClient is forbidden in v5.0.0/
1504-
);
1505-
});
1506-
15071499
it('getRequestHeaders populates x-goog-user-project with quota_project if present', async () => {
15081500
const tokenReq = mockApplicationDefaultCredentials(
15091501
'./test/fixtures/config-with-quota'

test/test.oauth2.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -900,14 +900,6 @@ describe('oauth2', () => {
900900
});
901901
});
902902

903-
it('should not emit warning on refreshAccessToken', async () => {
904-
let warned = false;
905-
sandbox.stub(process, 'emitWarning').callsFake(() => (warned = true));
906-
client.refreshAccessToken(() => {
907-
assert.strictEqual(warned, false);
908-
});
909-
});
910-
911903
it('should return error in callback on refreshAccessToken', done => {
912904
client.refreshAccessToken((err, result) => {
913905
assert.strictEqual(err!.message, 'No refresh token is set.');

0 commit comments

Comments
 (0)