Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
419598220a | ||
|
|
565dc5f710 | ||
|
|
4078295ea9 | ||
|
|
6b5cbc722f |
+4
-3
@@ -3,9 +3,10 @@
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
import jwt
|
||||||
from fastapi import Depends, HTTPException, status
|
from fastapi import Depends, HTTPException, status
|
||||||
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
|
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
|
||||||
from jose import JWTError, jwt
|
from jwt import PyJWTError
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
|
|
||||||
from app.database import get_db
|
from app.database import get_db
|
||||||
@@ -56,7 +57,7 @@ def verify_mfa_token(token: str) -> str:
|
|||||||
detail="Invalid MFA token.",
|
detail="Invalid MFA token.",
|
||||||
)
|
)
|
||||||
return username
|
return username
|
||||||
except JWTError:
|
except PyJWTError:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||||
detail="MFA token expired or invalid.",
|
detail="MFA token expired or invalid.",
|
||||||
@@ -95,7 +96,7 @@ def get_current_user(
|
|||||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||||
detail="Invalid token payload.",
|
detail="Invalid token payload.",
|
||||||
)
|
)
|
||||||
except JWTError:
|
except PyJWTError:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||||
detail="Invalid or expired token.",
|
detail="Invalid or expired token.",
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ logger = logging.getLogger(__name__)
|
|||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title="NetBird MSP Appliance",
|
title="NetBird MSP Appliance",
|
||||||
description="Multi-tenant NetBird management platform for MSPs",
|
description="Multi-tenant NetBird management platform for MSPs",
|
||||||
version="1.6.0",
|
version="1.6.2",
|
||||||
docs_url="/api/docs",
|
docs_url="/api/docs",
|
||||||
redoc_url="/api/redoc",
|
redoc_url="/api/redoc",
|
||||||
openapi_url="/api/openapi.json",
|
openapi_url="/api/openapi.json",
|
||||||
|
|||||||
+9
-9
@@ -5,24 +5,24 @@ sqlalchemy==2.0.23
|
|||||||
aiosqlite==0.19.0
|
aiosqlite==0.19.0
|
||||||
pydantic==2.5.2
|
pydantic==2.5.2
|
||||||
pydantic-settings==2.1.0
|
pydantic-settings==2.1.0
|
||||||
python-jose[cryptography]==3.3.0
|
PyJWT==2.15.1
|
||||||
passlib[bcrypt]==1.7.4
|
passlib[bcrypt]==1.7.4
|
||||||
bcrypt==4.1.2
|
bcrypt==4.1.2
|
||||||
cryptography==41.0.7
|
cryptography==50.0.0
|
||||||
python-multipart==0.0.6
|
python-multipart==0.0.31
|
||||||
httpx==0.26.0
|
httpx==0.28.1
|
||||||
jinja2==3.1.2
|
jinja2==3.1.6
|
||||||
docker==7.0.0
|
docker==7.0.0
|
||||||
requests<2.32.0
|
requests<2.32.0
|
||||||
urllib3<2
|
urllib3<2
|
||||||
psutil==5.9.7
|
psutil==5.9.7
|
||||||
pyyaml==6.0.1
|
pyyaml==6.0.1
|
||||||
msal==1.28.0
|
msal==1.39.0
|
||||||
pyotp==2.9.0
|
pyotp==2.9.0
|
||||||
qrcode[pil]==7.4.2
|
qrcode[pil]==7.4.2
|
||||||
slowapi==0.1.9
|
slowapi==0.1.9
|
||||||
pywinrm>=0.4.3
|
pywinrm>=0.4.3
|
||||||
ldap3>=2.9.1
|
ldap3>=2.9.1
|
||||||
pytest==7.4.3
|
pytest==9.0.3
|
||||||
pytest-asyncio==0.23.2
|
pytest-asyncio==1.4.0
|
||||||
pytest-httpx==0.28.0
|
pytest-httpx==0.36.2
|
||||||
|
|||||||
Reference in New Issue
Block a user