Upgrade configuration and Docker stack to v2.0.0
This commit is contained in:
+2
-2
@@ -44,8 +44,8 @@ async def get_db() -> AsyncSession:
|
||||
async def init_db():
|
||||
"""Crée toutes les tables et initialise un client par défaut si nécessaire."""
|
||||
import secrets
|
||||
import hashlib
|
||||
from sqlalchemy import select
|
||||
from app.dependencies.auth import hash_api_key
|
||||
from app.models.client import APIClient, ClientPlan
|
||||
|
||||
async with engine.begin() as conn:
|
||||
@@ -59,7 +59,7 @@ async def init_db():
|
||||
if result.scalar_one_or_none() is None:
|
||||
# Table vide -> Création du client bootstrap
|
||||
raw_key = secrets.token_urlsafe(32)
|
||||
key_hash = hashlib.sha256(raw_key.encode("utf-8")).hexdigest()
|
||||
key_hash = hash_api_key(raw_key)
|
||||
|
||||
bootstrap_client = APIClient(
|
||||
name="Default Admin",
|
||||
|
||||
Reference in New Issue
Block a user