From 88bee713f755dacc42f603489edd4954de92beb0 Mon Sep 17 00:00:00 2001 From: Viacheslav Khromiak Date: Sun, 5 Jun 2022 02:59:17 +0300 Subject: [PATCH 1/2] Upgrade PyJWT 1.7.1 -> 2.4.0 --- pythx/api/client.py | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pythx/api/client.py b/pythx/api/client.py index 03376b0..764c196 100644 --- a/pythx/api/client.py +++ b/pythx/api/client.py @@ -141,7 +141,7 @@ def _get_jwt_expiration_ts(token: str) -> datetime: :param token: The JWT to perform the check on :return: The UTC expiration datetime object """ - return datetime.utcfromtimestamp((jwt.decode(token, verify=False)["exp"])) + return datetime.utcfromtimestamp((jwt.decode(token, algorithms=["HS256"], options={"verify_signature": False})["exp"])) def assert_authentication(self) -> None: """Make sure the user is authenticated. diff --git a/requirements.txt b/requirements.txt index 64c482b..f45047a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ python-dateutil==2.8.1 inflection==0.5.1 -PyJWT==1.7.1 +PyJWT==2.4.0 requests==2.25.1 mythx-models==2.2.0 From f60f00483b1effec61b66fd817ebc0104b1ce9b9 Mon Sep 17 00:00:00 2001 From: Slava Date: Sun, 25 Sep 2022 00:26:53 +0300 Subject: [PATCH 2/2] Update README.rst --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index b11fa1e..5486c68 100644 --- a/README.rst +++ b/README.rst @@ -1,3 +1,7 @@ +----- + +This fork has an upgraded PyJWT version: 1.7.1 -> 2.4.0 + ===== PythX =====