M8: add operational authentication mode
This commit is contained in:
@@ -7,6 +7,7 @@ from fastapi.responses import JSONResponse
|
||||
|
||||
from app.api.routers import (
|
||||
audit,
|
||||
auth,
|
||||
bookings,
|
||||
dashboard,
|
||||
data_quality,
|
||||
@@ -19,7 +20,9 @@ from app.api.routers import (
|
||||
vehicles,
|
||||
workflows,
|
||||
)
|
||||
from app.api.routers.auth import bootstrap_initial_admin
|
||||
from app.core.config import PRODUCT_NAME, get_settings
|
||||
from app.core.db import SessionLocal
|
||||
from app.core.errors import AppError, error_body
|
||||
from app.services.dispatcher import start_background_dispatcher, stop_background_dispatcher
|
||||
|
||||
@@ -28,6 +31,8 @@ settings = get_settings()
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(_app: FastAPI):
|
||||
with SessionLocal() as db:
|
||||
bootstrap_initial_admin(db)
|
||||
start_background_dispatcher()
|
||||
yield
|
||||
stop_background_dispatcher()
|
||||
@@ -81,6 +86,7 @@ def system_status() -> dict[str, object]:
|
||||
|
||||
|
||||
app.include_router(demo.router)
|
||||
app.include_router(auth.router)
|
||||
app.include_router(dashboard.router)
|
||||
app.include_router(vehicles.router)
|
||||
app.include_router(bookings.router)
|
||||
|
||||
Reference in New Issue
Block a user