Skip to content

Commit

Permalink
fix: replace python-jose by PyJWT
Browse files Browse the repository at this point in the history
  • Loading branch information
montezdesousa committed May 13, 2024
1 parent f47e7ad commit 1b1e3a7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 71 deletions.
6 changes: 2 additions & 4 deletions openbb_platform/core/openbb_core/app/service/hub_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
from warnings import warn

from fastapi import HTTPException
from jose import JWTError
from jose.exceptions import ExpiredSignatureError
from jose.jwt import decode, get_unverified_header
from jwt import ExpiredSignatureError, PyJWTError, decode, get_unverified_header
from openbb_core.app.model.abstract.error import OpenBBError
from openbb_core.app.model.credentials import Credentials
from openbb_core.app.model.hub.hub_session import HubSession
Expand Down Expand Up @@ -271,5 +269,5 @@ def check_token_expiration(token: str) -> None:
)
except ExpiredSignatureError as e:
raise OpenBBError("Platform personal access token expired.") from e
except JWTError as e:
except PyJWTError as e:
raise OpenBBError("Failed to decode Platform token.") from e
84 changes: 18 additions & 66 deletions openbb_platform/core/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion openbb_platform/core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ websockets = "^12.0"
pandas = ">=1.5.3"
html5lib = "^1.1"
fastapi = "^0.104.1"
python-jose = "^3.3.0"
uuid7 = "^0.1.0"
posthog = "^3.3.1"
python-multipart = "^0.0.7"
Expand All @@ -23,6 +22,7 @@ importlib-metadata = "^6.8.0"
python-dotenv = "^1.0.0"
aiohttp = "^3.9.5"
ruff = "^0.1.6"
pyjwt = "^2.8.0"

[tool.poetry.group.dev.dependencies]
pytest = "^7.0.0"
Expand Down

0 comments on commit 1b1e3a7

Please sign in to comment.