Fix onboard BLE admission and stage wireless device enrollment
This commit is contained in:
@@ -7,6 +7,7 @@ invocations. Its public projection contains no credentials or raw evidence.
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
|
||||
@@ -151,6 +152,7 @@ class NodeBridge:
|
||||
{
|
||||
"duration_seconds": BLE_SCAN_DEFAULT_TIMEOUT_SECONDS,
|
||||
"operation_id": identifier,
|
||||
"expected_snapshot_runtime_id": command["runtime_id"],
|
||||
},
|
||||
identifier,
|
||||
)
|
||||
@@ -288,7 +290,17 @@ def create_app(repository_root: Path):
|
||||
raise ValueError("Request too large")
|
||||
body = await request.json()
|
||||
return await bridge.deliver(body)
|
||||
except Exception:
|
||||
except Exception as error:
|
||||
# Class and admitted action are sufficient for transport diagnosis.
|
||||
# Never log the exception text, incoming payload or credentials.
|
||||
action = body.get("action") if isinstance(body, dict) else None
|
||||
logging.getLogger(__name__).warning(
|
||||
"K1 operation failed: action=%s exception=%s",
|
||||
action
|
||||
if isinstance(action, str) and action in {"scan", "networks", "connect", "verify"}
|
||||
else "invalid",
|
||||
type(error).__name__,
|
||||
)
|
||||
return JSONResponse(
|
||||
{
|
||||
"error": (
|
||||
|
||||
Reference in New Issue
Block a user