File tree Expand file tree Collapse file tree 4 files changed +1
-26
lines changed Expand file tree Collapse file tree 4 files changed +1
-26
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,6 @@ export interface CredentialCallback {
59
59
( err : Error | null , result ?: JSONClient ) : void ;
60
60
}
61
61
62
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
63
- interface DeprecatedGetClientOptions { }
64
-
65
62
export interface ADCCallback {
66
63
( err : Error | null , credential ?: AuthClient , projectId ?: string | null ) : void ;
67
64
}
@@ -790,12 +787,7 @@ export class GoogleAuth<T extends AuthClient = JSONClient> {
790
787
* Automatically obtain a client based on the provided configuration. If no
791
788
* options were passed, use Application Default Credentials.
792
789
*/
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 ( ) {
799
791
if ( ! this . cachedCredential ) {
800
792
if ( this . jsonContent ) {
801
793
this . _cacheClientFromJSON ( this . jsonContent , this . clientOptions ) ;
Original file line number Diff line number Diff line change @@ -709,7 +709,6 @@ export class OAuth2Client extends AuthClient {
709
709
/**
710
710
* Retrieves the access token using refresh token
711
711
*
712
- * @deprecated use getRequestHeaders instead.
713
712
* @param callback callback
714
713
*/
715
714
refreshAccessToken ( ) : Promise < RefreshAccessTokenResponse > ;
Original file line number Diff line number Diff line change @@ -1496,14 +1496,6 @@ describe('googleauth', () => {
1496
1496
) ;
1497
1497
} ) ;
1498
1498
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
- / P a s s i n g o p t i o n s t o g e t C l i e n t i s f o r b i d d e n i n v 5 .0 .0 /
1504
- ) ;
1505
- } ) ;
1506
-
1507
1499
it ( 'getRequestHeaders populates x-goog-user-project with quota_project if present' , async ( ) => {
1508
1500
const tokenReq = mockApplicationDefaultCredentials (
1509
1501
'./test/fixtures/config-with-quota'
Original file line number Diff line number Diff line change @@ -900,14 +900,6 @@ describe('oauth2', () => {
900
900
} ) ;
901
901
} ) ;
902
902
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
-
911
903
it ( 'should return error in callback on refreshAccessToken' , done => {
912
904
client . refreshAccessToken ( ( err , result ) => {
913
905
assert . strictEqual ( err ! . message , 'No refresh token is set.' ) ;
You can’t perform that action at this time.
0 commit comments