feat(chalice): jwt expiration changes

This commit is contained in:
Taha Yassine Kraiem 2022-09-30 17:02:17 +02:00
parent 91202cfa38
commit 6f190f3a81
4 changed files with 8 additions and 6 deletions

View file

@ -89,7 +89,7 @@ def __get_agent_token(project_id, project_key, session_id):
"projectId": project_id,
"sessionId": session_id,
"iat": iat // 1000,
"exp": iat // 1000 + config("JWT_EXP_DELTA_SECONDS", cast=int) + TimeUTC.get_utc_offset() // 1000,
"exp": iat // 1000 + config("ASSIST_JWT_EXPIRATION", cast=int) + TimeUTC.get_utc_offset() // 1000,
"iss": config("JWT_ISSUER"),
"aud": f"openreplay:agent"
},

View file

@ -42,7 +42,7 @@ def generate_jwt(id, tenant_id, iat, aud):
payload={
"userId": id,
"tenantId": tenant_id,
"exp": iat // 1000 + config("ASSIST_JWT_EXPIRATION", cast=int) + TimeUTC.get_utc_offset() // 1000,
"exp": iat // 1000 + config("JWT_EXPIRATION", cast=int) + TimeUTC.get_utc_offset() // 1000,
"iss": config("JWT_ISSUER"),
"iat": iat // 1000,
"aud": aud

View file

@ -18,7 +18,7 @@ change_password_link=/reset-password?invitation=%s&&pass=%s
invitation_link=/api/users/invitation?token=%s
js_cache_bucket=sessions-assets
jwt_algorithm=HS512
JWT_EXP_DELTA_SECONDS=2592000
JWT_EXPIRATION=2592000
JWT_ISSUER=openreplay-oss
jwt_secret="SET A RANDOM STRING HERE"
ASSIST_URL=http://assist-openreplay.app.svc.cluster.local:9001/assist/%s
@ -48,5 +48,5 @@ SESSION_MOB_PATTERN_S=%(sessionId)s/dom.mobs
SESSION_MOB_PATTERN_E=%(sessionId)s/dom.mobe
DEVTOOLS_MOB_PATTERN=%(sessionId)s/devtools.mob
PRESIGNED_URL_EXPIRATION=3600
ASSIST_JWT_EXPIRATION=1800
ASSIST_JWT_EXPIRATION=144000
ASSIST_JWT_SECRET=

View file

@ -28,7 +28,7 @@ idp_x509cert=
invitation_link=/api/users/invitation?token=%s
js_cache_bucket=sessions-assets
jwt_algorithm=HS512
JWT_EXP_DELTA_SECONDS=2592000
JWT_EXPIRATION=2592000
JWT_ISSUER=openreplay-ee
jwt_secret="SET A RANDOM STRING HERE"
ASSIST_URL=http://assist-openreplay.app.svc.cluster.local:9001/assist/%s
@ -66,4 +66,6 @@ EFS_DEVTOOLS_MOB_PATTERN=%(sessionId)s/devtools.mob
SESSION_MOB_PATTERN_S=%(sessionId)s/dom.mobs
SESSION_MOB_PATTERN_E=%(sessionId)s/dom.mobe
DEVTOOLS_MOB_PATTERN=%(sessionId)s/devtools.mob
PRESIGNED_URL_EXPIRATION=3600
PRESIGNED_URL_EXPIRATION=3600
ASSIST_JWT_EXPIRATION=144000
ASSIST_JWT_SECRET=