Fix geo_re_resolve async mocks and mark tasks complete

This commit is contained in:
2026-03-17 18:54:25 +01:00
parent 25d43ffb96
commit 6515164d53
12 changed files with 208 additions and 136 deletions

View File

@@ -7,7 +7,7 @@ directly — to keep coupling explicit and testable.
"""
import time
from typing import Annotated
from typing import Annotated, Protocol, cast
import aiosqlite
import structlog
@@ -19,6 +19,13 @@ from app.utils.time_utils import utc_now
log: structlog.stdlib.BoundLogger = structlog.get_logger()
class AppState(Protocol):
"""Partial view of the FastAPI application state used by dependencies."""
settings: Settings
_COOKIE_NAME = "bangui_session"
# ---------------------------------------------------------------------------
@@ -85,7 +92,8 @@ async def get_settings(request: Request) -> Settings:
Returns:
The application settings loaded at startup.
"""
return request.app.state.settings # type: ignore[no-any-return]
state = cast(AppState, request.app.state)
return state.settings
async def require_auth(