mirror of
https://github.com/clearml/clearml
synced 2025-01-31 09:07:00 +00:00
Fix PyJWT support v2
This commit is contained in:
parent
d39f7bc195
commit
189a2b54de
@ -3,6 +3,7 @@ from abc import ABCMeta, abstractmethod
|
|||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
import jwt
|
import jwt
|
||||||
|
from jwt.algorithms import get_default_algorithms
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
|
||||||
@ -69,7 +70,10 @@ class TokenManager(object):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def _get_token_exp(cls, token):
|
def _get_token_exp(cls, token):
|
||||||
""" Get token expiration time. If not present, assume forever """
|
""" Get token expiration time. If not present, assume forever """
|
||||||
return jwt.decode(token, verify=False).get('exp', sys.maxsize)
|
return jwt.decode(
|
||||||
|
token, verify=False,
|
||||||
|
options=dict(verify_signature=False),
|
||||||
|
algorithms=get_default_algorithms()).get('exp', sys.maxsize)
|
||||||
|
|
||||||
def _set_token(self, token):
|
def _set_token(self, token):
|
||||||
if token:
|
if token:
|
||||||
|
@ -13,7 +13,7 @@ Pillow>=4.1.1
|
|||||||
psutil>=3.4.2
|
psutil>=3.4.2
|
||||||
pyparsing>=2.0.3
|
pyparsing>=2.0.3
|
||||||
python-dateutil>=2.6.1
|
python-dateutil>=2.6.1
|
||||||
pyjwt>=1.6.4,<2.0.0
|
pyjwt>=1.6.4,<3.0.0
|
||||||
PyYAML>=3.12
|
PyYAML>=3.12
|
||||||
requests-file>=1.4.2
|
requests-file>=1.4.2
|
||||||
requests>=2.20.0
|
requests>=2.20.0
|
||||||
|
Loading…
Reference in New Issue
Block a user