feat: Implement initial Homelab Automation API v2 with new models, routes, and core architecture, including a SQLAlchemy model refactoring script.
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
This commit is contained in:
@@ -53,8 +53,8 @@ async def verify_api_key(
|
||||
Returns:
|
||||
True si authentifié
|
||||
"""
|
||||
# Vérifier la clé API
|
||||
if api_key and api_key == settings.api_key:
|
||||
# Vérifier la clé API (en tant que header X-API-Key ou Bearer token)
|
||||
if (api_key and api_key == settings.api_key) or (token and token == settings.api_key):
|
||||
return True
|
||||
|
||||
# Vérifier le token JWT
|
||||
@@ -86,8 +86,8 @@ async def get_current_user_optional(
|
||||
Returns:
|
||||
Dictionnaire utilisateur si authentifié, None sinon
|
||||
"""
|
||||
# Vérifier d'abord la clé API (compatibilité legacy)
|
||||
if api_key and api_key == settings.api_key:
|
||||
# Vérifier la clé API (en tant que header X-API-Key ou Bearer token)
|
||||
if (api_key and api_key == settings.api_key) or (token and token == settings.api_key):
|
||||
return {"type": "api_key", "authenticated": True}
|
||||
|
||||
# Vérifier le token JWT
|
||||
|
||||
Reference in New Issue
Block a user