feat(work): add task-scoped attachment intake and durable file delivery

This commit is contained in:
ex_tianzy
2026-11-10 14:19:50 +08:00
parent ce64167627
commit 79c15ee7ce
16 changed files with 680 additions and 12 deletions
+2 -1
View File
@@ -52,7 +52,7 @@ async def routed(env, tmp_path):
await asyncio.wait_for(server_task,5)
async def device(env, host="a"*32, *, generation=None, legacy=False):
async def device(env, host="a"*32, *, generation=None, legacy=False, work_files=False):
ws = await connect(env["url"],proxy=None)
env["sessions"].append(ws)
challenge = json.loads(await ws.recv())["challenge"]
@@ -65,6 +65,7 @@ async def device(env, host="a"*32, *, generation=None, legacy=False):
plain.update(protocol_version=2,environment=env["settings"].environment,
app_id=env["settings"].feishu_app_id,binding_owner=row["owner"] or "ou_a",
binding_generation=row["binding_generation"] if generation is None else generation)
if work_files:plain['work_files']='work-files-v1'
await ws.send(json.dumps({"host_id":host,"cert":row["cert"],"proof":sign(plain,env["keys"][host])}))
accepted = json.loads(await asyncio.wait_for(ws.recv(),3))
assert accepted["type"] == "connected"