From c6157cee4ff59445fe580fb5ac6627c73c37a0c5 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Fri, 3 Dec 2021 15:27:13 +0100 Subject: [PATCH] feat(api): disable on the fly edit feat(api): fixed redirect response feat(api): fixed jwt expiration date --- ee/api/chalicelib/blueprints/bp_saml.py | 2 +- ee/api/chalicelib/core/users.py | 3 ++- ee/api/entrypoint.sh | 3 --- 3 files changed, 3 insertions(+), 5 deletions(-) delete mode 100755 ee/api/entrypoint.sh diff --git a/ee/api/chalicelib/blueprints/bp_saml.py b/ee/api/chalicelib/blueprints/bp_saml.py index 4a0f057df..79adde8c7 100644 --- a/ee/api/chalicelib/blueprints/bp_saml.py +++ b/ee/api/chalicelib/blueprints/bp_saml.py @@ -85,7 +85,7 @@ def process_sso_assertion(): if jwt is None: return {"errors": ["null JWT"]} return Response( - status_code=307, + status_code=302, body='', headers={'Location': SAML2_helper.get_landing_URL(jwt), 'Content-Type': 'text/plain'}) diff --git a/ee/api/chalicelib/core/users.py b/ee/api/chalicelib/core/users.py index f6609aae4..80fd5f0de 100644 --- a/ee/api/chalicelib/core/users.py +++ b/ee/api/chalicelib/core/users.py @@ -693,7 +693,8 @@ def authenticate_sso(email, internal_id, exp=None): return authorizers.generate_jwt(r['id'], r['tenantId'], TimeUTC.datetime_to_timestamp(cur.fetchone()["jwt_iat"]), aud=f"front:{helper.get_stage_name()}", - exp=exp) + exp=exp + TimeUTC.datetime_to_timestamp(cur.fetchone()["jwt_iat"]) \ + if exp is not None else None) return None diff --git a/ee/api/entrypoint.sh b/ee/api/entrypoint.sh deleted file mode 100755 index 0b87bc311..000000000 --- a/ee/api/entrypoint.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -python env_handler.py -chalice local --host 0.0.0.0 --stage ${ENTERPRISE_BUILD}