Files
eip4-platform/platform-parity/parity-reports/privilege-parity-20260611-000631.json
zhengwr 83c6abb1f9 test(parity): C2 数据行级权限自举 + 对拍样本(3 实体×3 用户 100% + 负例)
自举 + 对拍证明保真层数据权限真实现与物理事实逐行对齐:

- bootstrap-privilege.sql(幂等):建 SYS_FILTERRULE + 中间表 SYS_FILTERRULEROLE
  (LIST 多值列经 REFERENCEVALUE→中间表落地)+ 自描述元数据;为 EIP4PT_TASK/
  PROJECT/CUSTOMER 各配 1 条 "CREATEBY = {CURRENTUSERID}" 规则,并把 CREATEBY
  重分区到 USER_ALICE/BOB/CAROL 使过滤可判别。
- ParityCli 增 --privilege 模式 + PrivilegeCheckRunner:被测侧经引擎
  GET /list?asUser&roles 触发行级过滤,基线侧 JDBC 同语义 WHERE,RowDiff 逐行比。
- EngineHttpClient 增 asUser/roles 透传 + statusOf(负例取状态码)。
- EntityController.list 增可选 asUser/roles 构造非 ADMIN ctx(引擎仅非 ADMIN 才过滤)。

实测:正例 3 实体×3 用户=9 例 150 行 100% 逐行一致;负例错误角色 3/3 抛
PrivilegeException(HTTP 500)被拒;回归 ParityCli --all 21/21、1108 行 100%。
报告:platform-auth/C2实测报告.md + parity-reports/privilege-parity-*.{json,md}。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 00:11:08 +08:00

125 lines
3.1 KiB
JSON

{
"summary" : {
"mode" : "privilege",
"positiveCases" : 9,
"positiveClean" : 9,
"totalRows" : 150,
"positiveConsistencyRate" : 1.0,
"negativeStatus" : {
"EIP4PT_CUSTOMER" : 500,
"EIP4PT_PROJECT" : 500,
"EIP4PT_TASK" : 500
},
"allNegativeRejected" : true,
"allPass" : true
},
"positive" : [ {
"label" : "EIP4PT_CUSTOMER[USER_ALICE]",
"keyColumns" : [ "EIP4PT_CUSTOMER_ID" ],
"leftRowCount" : 16,
"rightRowCount" : 16,
"matchedRows" : 16,
"mismatchRows" : 0,
"onlyInLeft" : [ ],
"onlyInRight" : [ ],
"clean" : true,
"consistencyRate" : 1.0,
"mismatches" : [ ]
}, {
"label" : "EIP4PT_CUSTOMER[USER_BOB]",
"keyColumns" : [ "EIP4PT_CUSTOMER_ID" ],
"leftRowCount" : 17,
"rightRowCount" : 17,
"matchedRows" : 17,
"mismatchRows" : 0,
"onlyInLeft" : [ ],
"onlyInRight" : [ ],
"clean" : true,
"consistencyRate" : 1.0,
"mismatches" : [ ]
}, {
"label" : "EIP4PT_CUSTOMER[USER_CAROL]",
"keyColumns" : [ "EIP4PT_CUSTOMER_ID" ],
"leftRowCount" : 17,
"rightRowCount" : 17,
"matchedRows" : 17,
"mismatchRows" : 0,
"onlyInLeft" : [ ],
"onlyInRight" : [ ],
"clean" : true,
"consistencyRate" : 1.0,
"mismatches" : [ ]
}, {
"label" : "EIP4PT_PROJECT[USER_ALICE]",
"keyColumns" : [ "EIP4PT_PROJECT_ID" ],
"leftRowCount" : 16,
"rightRowCount" : 16,
"matchedRows" : 16,
"mismatchRows" : 0,
"onlyInLeft" : [ ],
"onlyInRight" : [ ],
"clean" : true,
"consistencyRate" : 1.0,
"mismatches" : [ ]
}, {
"label" : "EIP4PT_PROJECT[USER_BOB]",
"keyColumns" : [ "EIP4PT_PROJECT_ID" ],
"leftRowCount" : 17,
"rightRowCount" : 17,
"matchedRows" : 17,
"mismatchRows" : 0,
"onlyInLeft" : [ ],
"onlyInRight" : [ ],
"clean" : true,
"consistencyRate" : 1.0,
"mismatches" : [ ]
}, {
"label" : "EIP4PT_PROJECT[USER_CAROL]",
"keyColumns" : [ "EIP4PT_PROJECT_ID" ],
"leftRowCount" : 17,
"rightRowCount" : 17,
"matchedRows" : 17,
"mismatchRows" : 0,
"onlyInLeft" : [ ],
"onlyInRight" : [ ],
"clean" : true,
"consistencyRate" : 1.0,
"mismatches" : [ ]
}, {
"label" : "EIP4PT_TASK[USER_ALICE]",
"keyColumns" : [ "EIP4PT_TASK_ID" ],
"leftRowCount" : 16,
"rightRowCount" : 16,
"matchedRows" : 16,
"mismatchRows" : 0,
"onlyInLeft" : [ ],
"onlyInRight" : [ ],
"clean" : true,
"consistencyRate" : 1.0,
"mismatches" : [ ]
}, {
"label" : "EIP4PT_TASK[USER_BOB]",
"keyColumns" : [ "EIP4PT_TASK_ID" ],
"leftRowCount" : 17,
"rightRowCount" : 17,
"matchedRows" : 17,
"mismatchRows" : 0,
"onlyInLeft" : [ ],
"onlyInRight" : [ ],
"clean" : true,
"consistencyRate" : 1.0,
"mismatches" : [ ]
}, {
"label" : "EIP4PT_TASK[USER_CAROL]",
"keyColumns" : [ "EIP4PT_TASK_ID" ],
"leftRowCount" : 17,
"rightRowCount" : 17,
"matchedRows" : 17,
"mismatchRows" : 0,
"onlyInLeft" : [ ],
"onlyInRight" : [ ],
"clean" : true,
"consistencyRate" : 1.0,
"mismatches" : [ ]
} ]
}