feat: read-only live view at /view?key=<LIVEVIEW_KEY>

Implements issue #5. Off by default; set LIVEVIEW_KEY in .env to enable.
No JWT required — key-based auth via ?key= query param.
Returns 403 when disabled or key is wrong.
Read-only ReactFlow canvas (pan/zoom, no editing).
Standalone mode loads from localStorage without a key.
Includes 8 backend tests and 9 frontend tests.
This commit is contained in:
Pouzor
2026-03-28 15:27:54 +01:00
parent b35f34ae73
commit 210304394e
9 changed files with 527 additions and 2 deletions
+5
View File
@@ -30,6 +30,11 @@ class Settings(BaseSettings):
# Leave empty to disable MCP service key auth.
mcp_service_key: str = ""
# Live view — optional read-only public canvas endpoint.
# Set to a random secret string to enable /api/v1/liveview?key=<value>.
# Leave unset (or empty) to keep the feature disabled (default).
liveview_key: str | None = None
def _override_path(self) -> Path:
return Path(self.sqlite_path).parent / "scan_config.json"