Fix version check endpoint authentication

Changed version check endpoints to use X-API-Key authentication instead of Bearer token authentication. This makes them consistent with all other license server endpoints.

Changes:
- Updated /api/version/check to use validate_api_key dependency
- Updated /api/version/latest to use validate_api_key dependency
- Both endpoints now expect X-API-Key header instead of Authorization Bearer
- Fixes HTTP 403 errors reported by client applications

This resolves the issue where session heartbeat worked but version check failed with 403 Forbidden.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Dieser Commit ist enthalten in:
2025-07-02 21:37:58 +00:00
Ursprung 735e42a9c4
Commit ffc6aa744a
3 geänderte Dateien mit 235 neuen und 3 gelöschten Zeilen

Datei anzeigen

@@ -5,7 +5,7 @@ from packaging import version
from app.db.database import get_db
from app.models.models import Version, License
from app.schemas.license import VersionCheckRequest, VersionCheckResponse
from app.core.security import get_api_key
from app.core.api_key_auth import validate_api_key
router = APIRouter()
@@ -13,7 +13,7 @@ router = APIRouter()
async def check_version(
request: VersionCheckRequest,
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,
@@ -63,7 +63,7 @@ async def check_version(
@router.get("/latest")
async def get_latest_version(
db: Session = Depends(get_db),
api_key = Depends(get_api_key)
api_key: str = Depends(validate_api_key)
):
latest_version = db.query(Version).order_by(Version.release_date.desc()).first()