Skip to content

Commit

Permalink
Jwt package for 0.8.2 (#1690)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
tangy5 and pre-commit-ci[bot] authored May 17, 2024
1 parent 4dd1813 commit 1741cb5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions monailabel/endpoints/user/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
import logging
from typing import List, Sequence, Union

import jwt
import requests
from cachetools import cached
from fastapi import Depends, HTTPException, Security, status
from fastapi.security import OAuth2PasswordBearer
from jose import JWTError, jwt
from jwt import InvalidTokenError
from passlib.context import CryptContext
from pydantic import BaseModel

Expand Down Expand Up @@ -114,7 +115,7 @@ async def get_current_user(token: str = Depends(oauth2_scheme) if settings.MONAI
)
try:
return from_token(token)
except JWTError as e:
except InvalidTokenError as e:
logger.error(e)
raise credentials_exception

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ einops==0.7.0
pyyaml==6.0.1
filelock==3.11.0
passlib==1.7.4
python-jose[cryptography]==3.3.0
pyjwt==2.8.0
bcrypt==4.1.2
shapely==2.0.4
requests==2.31.0
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ install_requires =
pyyaml==6.0.1
filelock==3.11.0
passlib==1.7.4
python-jose[cryptography]==3.3.0
pyjwt==2.8.0
bcrypt==4.1.2
shapely==2.0.4
requests==2.31.0
Expand Down

0 comments on commit 1741cb5

Please sign in to comment.