[R3] 支持 PUT /clients/{cid}(mls_public_keys / capabilities / prekeys) #7

Closed
opened 2026-11-08 23:26:40 +00:00 by keith · 1 comment
Owner

部署背景

单域名 https://wire.treeden.app:根路径由 wire-webapp 提供前端;/api/* 与 /ws/* 由 Caddy 反代到 wire-rs 并剥离前缀(handle_path)。前端配置 BACKEND_REST=https://wire.treeden.app/api、BACKEND_WS=wss://wire.treeden.app/ws。

对接原则

前端尽量不改,由后端适配;后端保持最小,前端启动链路之外的接口返回空值或默认值。

现象

README 写明 PUT /clients/{cid} 刻意未实现,返回 405。但前端在以下位置必然调用它:

  • apps/webapp/src/script/core/messagingProtocols/mls/mlsService/mlsService.ts:注册设备后上传 MLS 签名公钥 {"mls_public_keys":{"ed25519":"<base64>"}};
  • apps/webapp/src/script/core/account.ts:设置通知流后上传 {"capabilities":["legalhold-implicit-consent"]};Proteus 预密钥用尽时上传 {"prekeys":[...]}。
    405 会导致 MLS 初始化失败。

期望行为

  • PUT /clients/{cid}(需 access token,且设备属于本人)体为 UpdateClientPayload 的子集:mls_public_keys(首次设置后不可改为不同值,相同值幂等;冲突 400 mls-public-key-in-use 风格错误)、capabilities(覆盖存储)、prekeys(接受并丢弃,与 POST /clients 一致)、label。成功 200 空体。
  • GET /clients/{cid} 返回 Self Client 对象(前端校验本地设备仍在)。
  • 未知设备 404 client-not-found。

涉及文件/模块

  • src/clients/、src/http.rs、README.md

工作量

S(半天)

## 部署背景 单域名 https://wire.treeden.app:根路径由 wire-webapp 提供前端;`/api/*` 与 `/ws/*` 由 Caddy 反代到 wire-rs 并剥离前缀(handle_path)。前端配置 `BACKEND_REST=https://wire.treeden.app/api`、`BACKEND_WS=wss://wire.treeden.app/ws`。 ## 对接原则 前端尽量不改,由后端适配;后端保持最小,前端启动链路之外的接口返回空值或默认值。 ## 现象 README 写明 `PUT /clients/{cid}` 刻意未实现,返回 405。但前端在以下位置必然调用它: - `apps/webapp/src/script/core/messagingProtocols/mls/mlsService/mlsService.ts`:注册设备后上传 MLS 签名公钥 `{"mls_public_keys":{"ed25519":"<base64>"}}`; - `apps/webapp/src/script/core/account.ts`:设置通知流后上传 `{"capabilities":["legalhold-implicit-consent"]}`;Proteus 预密钥用尽时上传 `{"prekeys":[...]}`。 405 会导致 MLS 初始化失败。 ## 期望行为 - `PUT /clients/{cid}`(需 access token,且设备属于本人)体为 `UpdateClientPayload` 的子集:`mls_public_keys`(首次设置后不可改为不同值,相同值幂等;冲突 400 `mls-public-key-in-use` 风格错误)、`capabilities`(覆盖存储)、`prekeys`(**接受并丢弃**,与 `POST /clients` 一致)、`label`。成功 200 空体。 - `GET /clients/{cid}` 返回 Self Client 对象(前端校验本地设备仍在)。 - 未知设备 404 `client-not-found`。 ## 涉及文件/模块 - `src/clients/`、`src/http.rs`、`README.md` ## 工作量 S(半天)
keith changed title from [R7][必需] 支持 PUT /clients/{cid}(mls_public_keys / capabilities / prekeys) to [R7] 支持 PUT /clients/{cid}(mls_public_keys / capabilities / prekeys) 2026-11-08 23:37:04 +00:00
keith changed title from [R7] 支持 PUT /clients/{cid}(mls_public_keys / capabilities / prekeys) to [R3] 支持 PUT /clients/{cid}(mls_public_keys / capabilities / prekeys) 2026-11-08 23:40:44 +00:00
Author
Owner

已实现并通过 M11 验收

  • PUT /clients/{cid}(access token + 设备归属校验):mls_public_keys 同值幂等、异值 400 mls-duplicate-public-key、多 scheme 原子;capabilities 覆盖;prekeys 校验后丢弃(与 POST /clients 一致);label 更新;成功 200 空体。
  • GET /clients/{cid} 返回 Self Client;未知设备 404 client-not-found。

M11 accepted · commit 56437e7 · doc docs/milestones/M11.md · gates: default 886 / test:db 177 (14 suites) / interop 971 / live 14 (×3, no flake) · integration agent 221 real-process assertions.

## 已实现并通过 M11 验收 - `PUT /clients/{cid}`(access token + 设备归属校验):`mls_public_keys` 同值幂等、异值 `400 mls-duplicate-public-key`、多 scheme 原子;`capabilities` 覆盖;`prekeys` 校验后丢弃(与 `POST /clients` 一致);`label` 更新;成功 200 空体。 - `GET /clients/{cid}` 返回 Self Client;未知设备 `404 client-not-found`。 M11 accepted · commit `56437e7` · doc `docs/milestones/M11.md` · gates: default **886** / test:db **177 (14 suites)** / interop **971** / live **14** (×3, no flake) · integration agent 221 real-process assertions.
keith closed this issue 2026-11-09 14:02:21 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
keith/wire-rs#7
No description provided.