Files
junhong_cmp_fiber/.scratch/tech-global-audit/issues/20-system-config-audit-adapter.md

21 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 20 — 接入公共系统配置正式审计 Adapter
**What to build:** 在系统配置更新的 Application 组合根注入正式 Audit Writer Adapter使关键配置变更进入统一 Audit Event并按公共基础已经确认的事务边界失败关闭。由真实全局审计替换公共基础的未装配占位不创建临时审计表或旁路 goroutine。
**Blocked by:**
- 01 — 交付不可变 Audit Event 写入闭环
- `.scratch/tech-public-foundation/issues/08-controlled-system-config-update.md` — 08 — 交付系统配置更新、权限和审计闭环
**Status:** ready-for-agent
**架构通道:** 主通道为 Application + Port/Adapter辅助通道为 Infrastructure。
**完整业务边界:** 本票仅收口公共系统配置更新既有用例的正式审计装配、事务一致性、脱敏和测试。明确不新增配置 Key、不建设配置前端页面、不迁移其他业务审计。
- [ ] 注册系统配置更新的稳定动作编码、中文名称、风险等级及允许资源类型,并写入全系统审计覆盖基线。
- [ ] 系统配置更新的业务事实与 Audit Event 使用同一 GORM 事务;审计失败时配置更新回滚,敏感配置只记录“是否配置”和安全摘要,不记录原值。
- [ ] 组合根显式注入正式 Audit Writer Adapter未装配时失败关闭禁止回退到空实现、旧审计表或裸 goroutine。
- [ ] PostgreSQL 集成测试覆盖成功同事务、审计失败整体回滚、敏感值不落库和未装配失败关闭。
- [ ] 发布检查能证明生产组合根已装配正式 Adapter并由 19 号一次性切换门禁纳入停机演练。