fix(ci): 权限自举须在种子实体创建后重放——规则 ENTITYID 按表名动态绑定

CI 实跑暴露:bootstrap-privilege.sql 跑在 --seed 之前时,INSERT...SELECT 在空
sys_entity 上静默插 0 条规则 → 权限对拍负例不拒/正例 0 行。脚本本身幂等,
种子后重放即修复(eip4ci 实证 9/9+3/3)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 13:01:36 +08:00
parent 3ea1a5590c
commit 8e04aa25f0

View File

@@ -48,6 +48,10 @@ CP="platform-parity/target/classes:$(mvn -q org.apache.maven.plugins:maven-depen
-pl platform-parity -Dmdep.outputFile=/dev/stdout -o | tail -1)"
java -cp "$CP" com.eip4.platform.parity.selfcheck.ParityCli \
--engine="http://localhost:${CI_PORT}" --jdbc="$JDBC" --user="$CI_PG_USER" --pass= --seed --all
# 权限规则按表名动态绑定实体 ID,必须在种子实体创建后重放(脚本幂等);
# 否则 INSERT...SELECT 在空 sys_entity 上静默插 0 条规则 → 负例不拒、正例 0 行
psql -h "$CI_PG_HOST" -p "$CI_PG_PORT" -U "$CI_PG_USER" -d "$CI_DB" -q \
-f platform-parity/src/main/resources/bootstrap/bootstrap-privilege.sql
java -cp "$CP" com.eip4.platform.parity.selfcheck.ParityCli \
--engine="http://localhost:${CI_PORT}" --jdbc="$JDBC" --user="$CI_PG_USER" --pass= --privilege