Commit d040c70
committed
perf(plugin-audit): 审计跳过名单上到注册面,平台内部表不再买单前置行读 (#5860)
五个写入注册(captureBefore 的 beforeUpdate/beforeDelete,writeAudit 的
afterInsert/afterUpdate/afterDelete)此前不带任何对象范围,在引擎眼里全部是
全局 hook。SKIP_OBJECTS 这份知识停在 handler 早退里,注册面上看不见,于是
#5284 的单 id update() 前置行门与 #5038 的批量门只能保守判真,对 sys_job_queue
一类平台内部表每次写入白读一遍行集 —— 而 handler 第一行就返回。
现在五个注册带上 #5928 / PR #6575 落地的 excludeObjects,名单由 SKIP_OBJECTS
派生而非重抄,两个面无法各自漂移;handler 早退保留为纵深防御,审计行为守恒。
排除面(减法)而非允许列表(枚举补集):对象全集在运行期开放,枚举出来的名单
会在启动时冻结并静默漏审此后新建的对象。
顺带把 writeCommentMentions 收为 { object: 'sys_comment' } —— 封闭单名允许
列表,现有契约一直表达得了,行为不变。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JwwiU9bjhwy2SWj13ho8uv1 parent 82397b6 commit d040c70
6 files changed
Lines changed: 613 additions & 19 deletions
File tree
- .changeset
- packages/plugins/plugin-audit
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
0 commit comments