feat(map): add guarded map gateway BFF

This commit is contained in:
DCCONSTRUCTIONS
2026-07-29 16:45:11 +03:00
parent d95a13059c
commit 66f8d7a1fa
7 changed files with 1118 additions and 0 deletions
+14
View File
@@ -42,6 +42,12 @@ from k1link.web.e30_review_api import build_e30_review_router
from k1link.web.environment_api import build_environment_router
from k1link.web.laboratory_api import build_laboratory_router
from k1link.web.lidar_api import build_lidar_router
from k1link.web.map_api import (
MapGatewayConfiguration,
MapGatewayProxy,
build_map_router,
)
from k1link.web.map_view_api import build_map_view_router
from k1link.web.plugin_catalog import DevicePluginCatalog, PluginCatalogError
from k1link.web.plugin_runtime import (
STATE_READ_ACTION_ID,
@@ -151,6 +157,7 @@ session_perception_epoch_store = (
if _ffprobe is not None
else None
)
map_gateway_proxy = MapGatewayProxy(MapGatewayConfiguration.from_environment())
def _prepare_recorded_media_for_launch(
@@ -291,6 +298,7 @@ async def app_lifespan(_: FastAPI) -> AsyncIterator[None]:
reconciler = asyncio.create_task(_recording_preparation_reconciler())
yield
finally:
await map_gateway_proxy.close()
if reconciler is not None:
reconciler.cancel()
with suppress(asyncio.CancelledError):
@@ -417,6 +425,12 @@ app.include_router(
root_provider=lambda: session_store.data_dir / "ui-environment"
)
)
app.include_router(build_map_router(map_gateway_proxy))
app.include_router(
build_map_view_router(
root_provider=lambda: session_store.data_dir / "map-view",
)
)
app.include_router(
build_polygon_router(
root_provider=lambda: configured_polygon_runs_root()