API Key Config ist fertig
Dieser Commit ist enthalten in:
@@ -20,6 +20,7 @@ from app.schemas.license import (
|
||||
)
|
||||
from app.core.security import get_api_key
|
||||
from app.core.config import settings
|
||||
from app.core.api_key_auth import validate_api_key
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -27,7 +28,7 @@ router = APIRouter()
|
||||
async def activate_license(
|
||||
request: LicenseActivationRequest,
|
||||
db: Session = Depends(get_db),
|
||||
api_key = Depends(get_api_key)
|
||||
api_key: str = Depends(validate_api_key)
|
||||
):
|
||||
license = db.query(License).filter(
|
||||
License.license_key == request.license_key,
|
||||
@@ -106,7 +107,7 @@ async def activate_license(
|
||||
async def verify_license(
|
||||
request: LicenseVerificationRequest,
|
||||
db: Session = Depends(get_db),
|
||||
api_key = Depends(get_api_key)
|
||||
api_key: str = Depends(validate_api_key)
|
||||
):
|
||||
activation = db.query(Activation).filter(
|
||||
Activation.id == request.activation_id,
|
||||
@@ -180,7 +181,7 @@ async def verify_license(
|
||||
async def get_license_info(
|
||||
license_key: str,
|
||||
db: Session = Depends(get_db),
|
||||
api_key = Depends(get_api_key)
|
||||
api_key: str = Depends(validate_api_key)
|
||||
):
|
||||
license = db.query(License).filter(
|
||||
License.license_key == license_key
|
||||
@@ -219,7 +220,7 @@ async def get_license_info(
|
||||
async def start_session(
|
||||
request: SessionStartRequest,
|
||||
db: Session = Depends(get_db),
|
||||
api_key = Depends(get_api_key)
|
||||
api_key: str = Depends(validate_api_key)
|
||||
):
|
||||
# Verify API key matches client config
|
||||
from sqlalchemy import text
|
||||
@@ -320,7 +321,7 @@ async def start_session(
|
||||
async def session_heartbeat(
|
||||
request: SessionHeartbeatRequest,
|
||||
db: Session = Depends(get_db),
|
||||
api_key = Depends(get_api_key)
|
||||
api_key: str = Depends(validate_api_key)
|
||||
):
|
||||
# Update heartbeat
|
||||
result = db.execute(
|
||||
@@ -350,7 +351,7 @@ async def session_heartbeat(
|
||||
async def end_session(
|
||||
request: SessionEndRequest,
|
||||
db: Session = Depends(get_db),
|
||||
api_key = Depends(get_api_key)
|
||||
api_key: str = Depends(validate_api_key)
|
||||
):
|
||||
# Get session info before deleting
|
||||
session_info = db.execute(
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren