* 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
This commit is contained in:
Kraiem Taha Yassine 2024-08-30 15:43:05 +02:00 committed by GitHub
parent 49b067c266
commit 10430e21a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -32,7 +32,6 @@ class JWTAuth(HTTPBearer):
super(JWTAuth, self).__init__(auto_error=auto_error)
async def __call__(self, request: Request) -> Optional[schemas.CurrentContext]:
logger.info(request.url.path)
if request.url.path in ["/refresh", "/api/refresh"]:
return await self.__process_refresh_call(request)
@ -121,6 +120,7 @@ class JWTAuth(HTTPBearer):
jwt_payload = None
else:
jwt_payload = authorizers.jwt_refresh_authorizer(scheme="Bearer", token=request.cookies["spotRefreshToken"])
logger.info("__process_spot_refresh_call")
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.")

View file

@ -17,11 +17,13 @@ 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("---- is spot token ----")
logger.info(decoded_token)
audience = decoded_token.get("aud")
logger.info(f"{audience} == {spot.AUDIENCE} = {audience == spot.AUDIENCE}")
return audience == spot.AUDIENCE
except jwt.InvalidTokenError:
logger.error(f"Invalid token: {token}")
logger.error(f"Invalid token for is_spot_token: {token}")
raise