@@ -30,7 +30,7 @@ import LegacyFirebaseTokenGenerator = require('firebase-token-generator');
30
30
import * as mocks from '../../resources/mocks' ;
31
31
import { FirebaseTokenGenerator , ServiceAccountSigner } from '../../../src/auth/token-generator' ;
32
32
import * as verifier from '../../../src/utils/token-verifier' ;
33
- import * as verifierUtil from '../../../src/auth/token-verifier' ;
33
+ import * as verifierAuth from '../../../src/auth/token-verifier' ;
34
34
35
35
import { ServiceAccountCredential } from '../../../src/credential/credential-internal' ;
36
36
import { FirebaseAuthError } from '../../../src/utils/error' ;
@@ -115,7 +115,7 @@ function createTokenVerifier(
115
115
'https://www.googleapis.com/robot/v1/metadata/x509/[email protected] ' ,
116
116
algorithm ,
117
117
'https://securetoken.google.com/' ,
118
- verifierUtil . ID_TOKEN_INFO ,
118
+ verifierAuth . ID_TOKEN_INFO ,
119
119
app
120
120
) ;
121
121
}
@@ -160,7 +160,7 @@ describe('FirebaseTokenVerifier', () => {
160
160
verifyApiName : 'verifyToken()' ,
161
161
jwtName : 'Important Token' ,
162
162
shortName : 'token' ,
163
- errorCodeConfig : verifierUtil . ID_TOKEN_ERROR_CODE_CONFIG ,
163
+ errorCodeConfig : verifierAuth . ID_TOKEN_ERROR_CODE_CONFIG ,
164
164
errorType : FirebaseAuthError ,
165
165
} ,
166
166
app ,
@@ -176,7 +176,7 @@ describe('FirebaseTokenVerifier', () => {
176
176
invalidCertUrl as any ,
177
177
'RS256' ,
178
178
'https://www.example.com/issuer/' ,
179
- verifierUtil . ID_TOKEN_INFO ,
179
+ verifierAuth . ID_TOKEN_INFO ,
180
180
app ,
181
181
) ;
182
182
} ) . to . throw ( 'The provided public client certificate URL is an invalid URL.' ) ;
@@ -191,7 +191,7 @@ describe('FirebaseTokenVerifier', () => {
191
191
'https://www.example.com/publicKeys' ,
192
192
invalidAlgorithm as any ,
193
193
'https://www.example.com/issuer/' ,
194
- verifierUtil . ID_TOKEN_INFO ,
194
+ verifierAuth . ID_TOKEN_INFO ,
195
195
app ) ;
196
196
} ) . to . throw ( 'The provided JWT algorithm is an empty string.' ) ;
197
197
} ) ;
@@ -205,7 +205,7 @@ describe('FirebaseTokenVerifier', () => {
205
205
'https://www.example.com/publicKeys' ,
206
206
'RS256' ,
207
207
invalidIssuer as any ,
208
- verifierUtil . ID_TOKEN_INFO ,
208
+ verifierAuth . ID_TOKEN_INFO ,
209
209
app ,
210
210
) ;
211
211
} ) . to . throw ( 'The provided JWT issuer is an invalid URL.' ) ;
@@ -225,7 +225,7 @@ describe('FirebaseTokenVerifier', () => {
225
225
verifyApiName : invalidVerifyApiName as any ,
226
226
jwtName : 'Important Token' ,
227
227
shortName : 'token' ,
228
- errorCodeConfig : verifierUtil . ID_TOKEN_ERROR_CODE_CONFIG ,
228
+ errorCodeConfig : verifierAuth . ID_TOKEN_ERROR_CODE_CONFIG ,
229
229
errorType : FirebaseAuthError ,
230
230
} ,
231
231
app ,
@@ -247,7 +247,7 @@ describe('FirebaseTokenVerifier', () => {
247
247
verifyApiName : 'verifyToken()' ,
248
248
jwtName : invalidJwtName as any ,
249
249
shortName : 'token' ,
250
- errorCodeConfig : verifierUtil . ID_TOKEN_ERROR_CODE_CONFIG ,
250
+ errorCodeConfig : verifierAuth . ID_TOKEN_ERROR_CODE_CONFIG ,
251
251
errorType : FirebaseAuthError ,
252
252
} ,
253
253
app ,
@@ -269,7 +269,7 @@ describe('FirebaseTokenVerifier', () => {
269
269
verifyApiName : 'verifyToken()' ,
270
270
jwtName : 'Important Token' ,
271
271
shortName : invalidShortName as any ,
272
- errorCodeConfig : verifierUtil . ID_TOKEN_ERROR_CODE_CONFIG ,
272
+ errorCodeConfig : verifierAuth . ID_TOKEN_ERROR_CODE_CONFIG ,
273
273
errorType : FirebaseAuthError ,
274
274
} ,
275
275
app ,
@@ -291,7 +291,7 @@ describe('FirebaseTokenVerifier', () => {
291
291
verifyApiName : 'verifyToken()' ,
292
292
jwtName : 'Important Token' ,
293
293
shortName : 'token' ,
294
- errorCodeConfig : verifierUtil . ID_TOKEN_ERROR_CODE_CONFIG ,
294
+ errorCodeConfig : verifierAuth . ID_TOKEN_ERROR_CODE_CONFIG ,
295
295
errorType : invalidErrorCodeTypes as any ,
296
296
} ,
297
297
app ,
@@ -339,7 +339,7 @@ describe('FirebaseTokenVerifier', () => {
339
339
340
340
it ( 'should throw with the correct error type and code set in token info' , ( ) => {
341
341
const errorType = FirebaseAuthError ;
342
- const errorCodeConfig = verifierUtil . ID_TOKEN_ERROR_CODE_CONFIG ;
342
+ const errorCodeConfig = verifierAuth . ID_TOKEN_ERROR_CODE_CONFIG ;
343
343
const tokenVerifier = new verifier . FirebaseTokenVerifier (
344
344
'https://www.example.com/publicKeys' ,
345
345
'RS256' ,
@@ -383,7 +383,7 @@ describe('FirebaseTokenVerifier', () => {
383
383
'https://www.googleapis.com/robot/v1/metadata/x509/[email protected] ' ,
384
384
'RS256' ,
385
385
'https://securetoken.google.com/' ,
386
- verifierUtil . ID_TOKEN_INFO ,
386
+ verifierAuth . ID_TOKEN_INFO ,
387
387
mocks . mockCredentialApp ( ) ,
388
388
) ;
389
389
const mockIdToken = mocks . generateIdToken ( ) ;
@@ -490,7 +490,7 @@ describe('FirebaseTokenVerifier', () => {
490
490
'https://www.googleapis.com/identitytoolkit/v3/relyingparty/publicKeys' ,
491
491
'RS256' ,
492
492
'https://session.firebase.google.com/' ,
493
- verifierUtil . SESSION_COOKIE_INFO ,
493
+ verifierAuth . SESSION_COOKIE_INFO ,
494
494
app ,
495
495
) ;
496
496
mockedRequests . push ( mockFetchPublicKeys ( '/identitytoolkit/v3/relyingparty/publicKeys' ) ) ;
@@ -535,7 +535,7 @@ describe('FirebaseTokenVerifier', () => {
535
535
'https://www.googleapis.com/identitytoolkit/v3/relyingparty/publicKeys' ,
536
536
'RS256' ,
537
537
'https://session.firebase.google.com/' ,
538
- verifierUtil . SESSION_COOKIE_INFO ,
538
+ verifierAuth . SESSION_COOKIE_INFO ,
539
539
app ,
540
540
) ;
541
541
return tokenGenerator . createCustomToken ( mocks . uid )
@@ -561,7 +561,7 @@ describe('FirebaseTokenVerifier', () => {
561
561
'https://www.googleapis.com/identitytoolkit/v3/relyingparty/publicKeys' ,
562
562
'RS256' ,
563
563
'https://session.firebase.google.com/' ,
564
- verifierUtil . SESSION_COOKIE_INFO ,
564
+ verifierAuth . SESSION_COOKIE_INFO ,
565
565
app ,
566
566
) ;
567
567
const legacyTokenGenerator = new LegacyFirebaseTokenGenerator ( 'foo' ) ;
@@ -654,7 +654,7 @@ describe('FirebaseTokenVerifier', () => {
654
654
'https://www.googleapis.com/robot/v1/metadata/x509/[email protected] ' ,
655
655
'RS256' ,
656
656
'https://securetoken.google.com/' ,
657
- verifierUtil . ID_TOKEN_INFO ,
657
+ verifierAuth . ID_TOKEN_INFO ,
658
658
appWithAgent ,
659
659
) ;
660
660
mockedRequests . push ( mockFetchPublicKeys ( ) ) ;
@@ -677,7 +677,7 @@ describe('FirebaseTokenVerifier', () => {
677
677
'https://www.googleapis.com/robot/v1/metadata/x509/[email protected] ' ,
678
678
'RS256' ,
679
679
'https://securetoken.google.com/' ,
680
- verifierUtil . ID_TOKEN_INFO ,
680
+ verifierAuth . ID_TOKEN_INFO ,
681
681
app ,
682
682
) ;
683
683
expect ( https . request ) . not . to . have . been . called ;
0 commit comments