Skip to content

Commit 1741cb5

Browse files
Jwt package for 0.8.2 (#1690)
* change to pyjwt replace josejwt Signed-off-by: tangy5 <[email protected]> * change to pyjwt replace josejwt Signed-off-by: tangy5 <[email protected]> * change to pyjwt replace josejwt Signed-off-by: tangy5 <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: tangy5 <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 4dd1813 commit 1741cb5

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

monailabel/endpoints/user/auth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
import logging
1212
from typing import List, Sequence, Union
1313

14+
import jwt
1415
import requests
1516
from cachetools import cached
1617
from fastapi import Depends, HTTPException, Security, status
1718
from fastapi.security import OAuth2PasswordBearer
18-
from jose import JWTError, jwt
19+
from jwt import InvalidTokenError
1920
from passlib.context import CryptContext
2021
from pydantic import BaseModel
2122

@@ -114,7 +115,7 @@ async def get_current_user(token: str = Depends(oauth2_scheme) if settings.MONAI
114115
)
115116
try:
116117
return from_token(token)
117-
except JWTError as e:
118+
except InvalidTokenError as e:
118119
logger.error(e)
119120
raise credentials_exception
120121

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ einops==0.7.0
3535
pyyaml==6.0.1
3636
filelock==3.11.0
3737
passlib==1.7.4
38-
python-jose[cryptography]==3.3.0
38+
pyjwt==2.8.0
3939
bcrypt==4.1.2
4040
shapely==2.0.4
4141
requests==2.31.0

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ install_requires =
6161
pyyaml==6.0.1
6262
filelock==3.11.0
6363
passlib==1.7.4
64-
python-jose[cryptography]==3.3.0
64+
pyjwt==2.8.0
6565
bcrypt==4.1.2
6666
shapely==2.0.4
6767
requests==2.31.0

0 commit comments

Comments
 (0)