From 49b067c266244c489cd4bb493e5c5d06c6faf7fa Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Fri, 30 Aug 2024 15:20:50 +0200 Subject: [PATCH] Dev (#2517) * fix(chalice): fixed Math-operators validation refactor(chalice): search for sessions that have events for heatmaps * refactor(chalice): search for sessions that have at least 1 location event for heatmaps * fix(chalice): fixed Math-operators validation refactor(chalice): search for sessions that have events for heatmaps * refactor(chalice): search for sessions that have at least 1 location event for heatmaps * feat(chalice): autocomplete return top 10 with stats * fix(chalice): fixed autocomplete top 10 meta-filters * debug(chalice): debugging spot login/refresh --- api/auth/auth_jwt.py | 4 ++-- api/chalicelib/core/authorizers.py | 1 + ee/api/auth/auth_jwt.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/auth/auth_jwt.py b/api/auth/auth_jwt.py index 5075ff331..9210ec5a9 100644 --- a/api/auth/auth_jwt.py +++ b/api/auth/auth_jwt.py @@ -36,7 +36,7 @@ class JWTAuth(HTTPBearer): if request.url.path in ["/refresh", "/api/refresh"]: return await self.__process_refresh_call(request) - elif request.url.path in ["/spot/refresh", "/spot/api/refresh"]: + elif request.url.path in ["/spot/refresh", "/api/spot/refresh"]: return await self.__process_spot_refresh_call(request) else: @@ -121,7 +121,7 @@ class JWTAuth(HTTPBearer): jwt_payload = None else: jwt_payload = authorizers.jwt_refresh_authorizer(scheme="Bearer", token=request.cookies["spotRefreshToken"]) - + logger.info(jwt_payload) if jwt_payload is None or jwt_payload.get("jti") is None: logger.warning("Null spotRefreshToken's payload, or null JTI.") raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, diff --git a/api/chalicelib/core/authorizers.py b/api/chalicelib/core/authorizers.py index 858b24b4f..c8aa311ec 100644 --- a/api/chalicelib/core/authorizers.py +++ b/api/chalicelib/core/authorizers.py @@ -17,6 +17,7 @@ def get_supported_audience(): def is_spot_token(token: str) -> bool: try: decoded_token = jwt.decode(token, options={"verify_signature": False, "verify_exp": False}) + logger.info(decoded_token) audience = decoded_token.get("aud") return audience == spot.AUDIENCE except jwt.InvalidTokenError: diff --git a/ee/api/auth/auth_jwt.py b/ee/api/auth/auth_jwt.py index 0fa8ea130..f56d7594d 100644 --- a/ee/api/auth/auth_jwt.py +++ b/ee/api/auth/auth_jwt.py @@ -43,7 +43,7 @@ class JWTAuth(HTTPBearer): if request.url.path in ["/refresh", "/api/refresh"]: return await self.__process_refresh_call(request) - elif request.url.path in ["/spot/refresh", "/spot/api/refresh"]: + elif request.url.path in ["/spot/refresh", "/api/spot/refresh"]: return await self.__process_spot_refresh_call(request) else: