
adminandClaude Code
77c2df577c
test(api): 补一条 HTTP 层的 secretKey 去敏回归
**影响**
- 改动前:R10 的回归只在 **CRUD 引擎层**(`tests/crud_engine.rs`)覆盖,
路由 + 业务信封层没有断言。
- 改动后:`/api/ssw/tdc/Identity` 的**详情 / 列表 / 新建**三处出参都断言
「没有 `secretKey` 这个键」,且入参送 `secretKey` 不落库。
**改动**
- `tests/api_smoke.rs` 新增 `identity_secret_key_is_never_exposed_over_http`:
直插一条**带密钥**的身份行(绕开 CRUD 写路径的「静默忽略」)⇒
详情 / 列表(按 `identityCode` 过滤)都不得出现 `secretKey` 键;
再 POST 一条带 `secretKey` 的身份 ⇒ 响应不含该键、库里那列仍为空。
**设计**
- 🔴 断言只看**键名**,不回显任何值 ⇒ 密钥不会进 transcript。
- **变异验证过是 load-bearing**:把 `row_to_json_spec` 里的 `obj.remove(*key)` 关掉
⇒ 本用例在 `tests/api_smoke.rs:559` 变红(已还原,`shasum` 与提交版逐字节一致)。
- 验收:`cargo test` ⇒ **223 passed / 0 failed / 1 ignored**;clippy 干净;`cargo fmt --check` 干净。
Co-Authored-By: Claude Code <[email protected]>
2026-10-25 15:27:07 +08:00
..
2026-10-25 15:10:15 +08:00
2026-10-25 15:27:07 +08:00
2026-10-25 13:16:25 +08:00
2026-10-25 13:16:25 +08:00
2026-10-25 15:08:25 +08:00
2026-10-25 10:54:19 +08:00
2026-10-25 10:45:35 +08:00
2026-10-25 13:44:25 +08:00