@@ -43,7 +43,7 @@ chai.use(chaiAsPromised);
43
43
const expect = chai . expect ;
44
44
45
45
const ALGORITHM = 'RS256' ;
46
- const ONE_HOUR_IN_SECONDS = 60 * 60 ;
46
+ const FIVE_MIN_IN_SECONDS = 60 * 5 ;
47
47
const FIREBASE_APP_CHECK_AUDIENCE = 'https://firebaseappcheck.googleapis.com/google.firebase.appcheck.v1beta.TokenExchangeService' ;
48
48
49
49
/**
@@ -184,7 +184,7 @@ describe('AppCheckTokenGenerator', () => {
184
184
// eslint-disable-next-line @typescript-eslint/camelcase
185
185
app_id : APP_ID ,
186
186
iat : 1 ,
187
- exp : ONE_HOUR_IN_SECONDS + 1 ,
187
+ exp : FIVE_MIN_IN_SECONDS + 1 ,
188
188
aud : FIREBASE_APP_CHECK_AUDIENCE ,
189
189
iss : mocks . certificateObject . client_email ,
190
190
sub : mocks . certificateObject . client_email ,
@@ -205,7 +205,7 @@ describe('AppCheckTokenGenerator', () => {
205
205
// eslint-disable-next-line @typescript-eslint/camelcase
206
206
app_id : APP_ID ,
207
207
iat : 1 ,
208
- exp : ONE_HOUR_IN_SECONDS + 1 ,
208
+ exp : FIVE_MIN_IN_SECONDS + 1 ,
209
209
aud : FIREBASE_APP_CHECK_AUDIENCE ,
210
210
iss : mocks . certificateObject . client_email ,
211
211
sub : mocks . certificateObject . client_email ,
@@ -233,7 +233,7 @@ describe('AppCheckTokenGenerator', () => {
233
233
// eslint-disable-next-line @typescript-eslint/camelcase
234
234
app_id : APP_ID ,
235
235
iat : 1 ,
236
- exp : ONE_HOUR_IN_SECONDS + 1 ,
236
+ exp : FIVE_MIN_IN_SECONDS + 1 ,
237
237
aud : FIREBASE_APP_CHECK_AUDIENCE ,
238
238
iss : mocks . certificateObject . client_email ,
239
239
sub : mocks . certificateObject . client_email ,
@@ -275,15 +275,15 @@ describe('AppCheckTokenGenerator', () => {
275
275
} ) ;
276
276
} ) ;
277
277
278
- it ( 'should be fulfilled with a JWT which expires after one hour ' , ( ) => {
278
+ it ( 'should be fulfilled with a JWT which expires after five minutes ' , ( ) => {
279
279
clock = sinon . useFakeTimers ( 1000 ) ;
280
280
281
281
let token : string ;
282
282
return tokenGenerator . createCustomToken ( APP_ID )
283
283
. then ( ( result ) => {
284
284
token = result ;
285
285
286
- clock ! . tick ( ( ONE_HOUR_IN_SECONDS * 1000 ) - 1 ) ;
286
+ clock ! . tick ( ( FIVE_MIN_IN_SECONDS * 1000 ) - 1 ) ;
287
287
288
288
// Token should still be valid
289
289
return verifyToken ( token , mocks . keyPairs [ 0 ] . public ) ;
0 commit comments