INNER CODE UNIT · Python
_get_jwt_identifier
IndominusByte/fastapi-jwt-auth · fastapi_jwt_auth/auth_jwt.py:63
def _get_jwt_identifier(self) -> str:
return str(uuid.uuid4())
def _get_int_from_datetime(self,value: datetime) -> int:
"""
:param value: datetime with or without timezone, if don't contains timezone
it will managed as it is UTC
:return: Seconds since the Epoch
"""
if not isinstance(value, datetime): # pragma: no cover
raise TypeError('a datetime is required')
return int(value.timestamp())
def _get_secret_key(self, algorithm: str, process: str) -> str:
"""
Get key with a different algorithm
:param algorithm: algorithm for decode and encode token