Skip to content

Commit

Permalink
remove jose dep (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
ciur authored Nov 16, 2024
1 parent c9dc6f8 commit 488797d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 69 deletions.
2 changes: 1 addition & 1 deletion auth_server/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from sqlalchemy.exc import NoResultFound

from datetime import datetime, timedelta, UTC
from jose import jwt
import jwt
from passlib.hash import pbkdf2_sha256

from fastapi import HTTPException
Expand Down
4 changes: 2 additions & 2 deletions auth_server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from sqlalchemy.exc import OperationalError, NoResultFound
from fastapi import FastAPI, HTTPException, Response, Request, status, APIRouter
from fastapi.security import OAuth2PasswordBearer
from jose import JWTError, jwt
import jwt

from auth_server.auth import authenticate, create_token
from auth_server.backends.oidc import introspect_token
Expand Down Expand Up @@ -113,7 +113,7 @@ async def verify_endpoint(request: Request) -> Response:
settings.papermerge__security__secret_key,
algorithms=[settings.papermerge__security__token_algorithm],
)
except JWTError:
except jwt.DecodeError:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid token",
Expand Down
83 changes: 18 additions & 65 deletions 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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ python = "^3.13"
fastapi = {extras = ["standard"], version = "^0.115"}
sqlalchemy = "^2.0.9"
passlib = "^1.7.4"
python-jose = "^3.3.0"
python-multipart = "^0.0.17"
httpx = "^0.27"
rich = "^13.3.5"
Expand All @@ -21,6 +20,7 @@ ldap3 = "^2.9.1"
typer = "^0.13.0"
psycopg2 = { version = "^2.9", optional = true}
mysqlclient = {version = "^2.2", optional = true}
pyjwt = "^2.9.0"

[tool.poetry.extras]
pg = ["psycopg2"]
Expand Down

0 comments on commit 488797d

Please sign in to comment.