feat: 通过绑定的工作区路由 Core 笔记并保存持久操作回执

This commit is contained in:
2026-09-08 15:02:46 +08:00
parent 3439d1fe3f
commit 044e6d6146
18 changed files with 881 additions and 22 deletions
+10 -1
View File
@@ -77,7 +77,16 @@ class SessionAuth:
(b"cache-control", b"no-store")]})
await send({"type": "http.response.body", "body": body})
return
await self.app(scope, receive, send)
from app import host_bridge
vault = single(b"x-opennexus-vault").decode("ascii", errors="replace")
token = host_bridge.vault_id.set(vault if re.fullmatch(r"[0-9a-f-]{36}", vault) else None)
operation = single(b"x-request-id").decode("ascii", errors="replace")
operation_token = host_bridge.operation_id.set(operation if re.fullmatch(r"[0-9a-f-]{36}", operation) else None)
try:
await self.app(scope, receive, send)
finally:
host_bridge.vault_id.reset(token)
host_bridge.operation_id.reset(operation_token)
def main() -> int: