Repository navigation
WIP(A01): 逐账号激活事务与操作内权限复查(待接线验证) - #881
LIghtJUNction wants to merge 4 commits into
Conversation
Add type-safe permission decisions for the reviewed main resources, strict legacy override conversion, single-identity offline approval binding validation, and 34 synthetic contract tests. No runtime gates, database activation transaction, schema or shared wiring are added. This remains blocked pending A01/S11 integration. Rust tests are authored but unexecuted in the required environment.
|
补充当前 MK-01 CI 证据:head 该 job 当前失败点是 Rust 1.99 的 rustfmt,以及 admin_approval.rs:79 的 以上是已有 CI 日志核对,不是本地复跑,也不代表完整授权/激活链路已验收;其他 protocol 检查仍有失败,保持 Draft/BLOCKED。 |
… drafts Extend the A01-only files with transaction-bound role/policy reads, HMAC-verified single-user approval artifacts, durable receipt lookup, and owner-only activation transaction logic. Add synthetic concurrency, rollback, credential-version, and PostgreSQL test cases. Keep new modules unmounted: S11 must apply and review shared schema, owner key/source-proof staging, runtime ACL, and real business gates. No administrator is activated and no production database is changed. Checks: delivery SHA/patch/text checks pass; Rust and PG unexecuted.
Base this follow-up on c8b8011 and preserve its offline activation writer. Replace the A01 gate's call to private authorize_in_transaction with a Core-authenticated Principal and same-transaction credential/user/account/ browser-family revalidation. Keep policy SELECT-only and sensitive actions closed until A02 action-bound confirmation is integrated. Update provider tests to use public IdentityStore authentication. Add PostgreSQL regressions for a revoked earlier principal, disabled personal account, expired credential and revoked browser family. The suite now has 38 pure and 10 PostgreSQL authored tests, not executed locally. Checks: exact patch replay, source delimiter sanity, schema fixture parity, and uploaded blob hashes. Rust format/clippy/build/tests and PG execution remain unverified; shared S11 wiring and complete main permission parity remain blocked. No production changes or real administrator activation.
|
本轮已保留并行提交 c8b8011,并追加 1c9a5bc(仅 3 个 A01 独占文件)。已核对新旧文件 SHA 和远端增量,不强推。 关键接入修正:require_platform_in_transaction 接收 Core 已验证的 &Principal,并在业务事务内重新核查持久凭据/用户/账户/浏览器会话;不需要把 A02 的 authorize_in_transaction 从 pub(crate) 改为 pub。请 S11 删除第二轮共享 patch 中那一处扩大可见性的 hunk。 新增三个 PostgreSQL 用例,覆盖先取得身份、再撤销凭据/停用账户/令凭据过期/撤销浏览器会话后的操作拒绝。当前共编写 38 个纯逻辑、10 个 PostgreSQL 用例,不能视为通过数。 最新 CI 观测(run 38241037997,job 114783413463,精确提交 1c9a5bc):格式检查失败;Rust locked-dependency 检查失败;隔离 PostgreSQL 测试步骤尚在运行。步骤摘要没有给出具体 Rust 诊断,不能据此认定编译或数据库验收通过。本地只通过了补丁精确应用、文本分隔符和 schema-fixture 一致性检查,Rust/PG 未在本地执行。 保持 Draft/BLOCKED。尚需修复 CI、S11 公共装配及完整业务 gate、原 A2 证明与安全离线命令、A02 确认接口和最终真实进程验收。没有恢复真实管理员,也没有修改生产/冻结库或部署。 |
Apply the exact rustfmt changes reported by MK-01 for the six A01-owned files, without modifying shared owner code or other contributors' work. Replace chunks_exact(2) with as_chunks::<2>() per Rust 1.99 clippy. Print only synthetic Result errors in competing approval test failures so a later isolated PG run can distinguish conflict from lock timeout. Compilation/PG green status is NOT claimed. No real admin activation.
|
补充当前 CI:head 失败是 admin_activation.rs:661 的第二个断言:预期一个 建议先在失败断言打印两个结果,并给“已激活目标”补纯逻辑回归,再核对 check_bindings 的错误分类顺序:密码登录状态检查位于版本/状态冲突检查之前,可能使串行化后的竞争失败方先返回另一种拒绝。日志未记录该返回值,因此这是源码定位假设,不能以放宽拒绝条件来消除失败。 对最终 SHA 重跑并发测试及整组验收后再更新状态。以上为现有 CI/源码核对,未本地复跑,也不代表实际管理员恢复或 S11 组合验收。 |
A01 — 管理员权限、团队与开发者授权(Draft / BLOCKED)
目标:为 Rust Core 提供可信身份驱动的权限判断和逐账号旧管理员恢复,不靠菜单、客户端字段或 Go 宿主凭据授权。
已推送代码
b369c222:九项已审管理权限的类型化决策、旧 override 严格转换、单账号批准材料预检及合成测试。c8b80111:持久化权限读取、HMAC-SHA256 离线单账号批准校验、owner 限定的原子激活草稿、策略/账号版本检查、旧凭据与 Web 会话撤销、最后启用账号、按原批准 ID 查询提交结果。1c9a5bc6:保留上述并行提交,只修改三个独占文件。权限检查现在接收 Core 已验证的&Principal,在同一操作事务重新检查真实凭据、用户角色、账户、认证版本、有效期、撤销与浏览器会话状态。不再调用或扩大 A02 的私有认证接口。1c9a5bc6:测试通过既有公开IdentityStore::authorize取得真实 Principal,再测试状态变化后的拒绝。新增 PostgreSQL 回归覆盖旧 Principal 撤销、账户停用、凭据到期、浏览器会话撤销。权限表仍只需 SELECT,敏感渠道修改和密钥查看仍等待 A02 独立确认。合计编写 38 个纯逻辑测试、10 个 PostgreSQL 测试。这是用例数量,不是通过数量。
仅涉及 A01 的 6 个独占文件;最新提交改其中 3 个。没有修改共享入口、运行 schema、A2 importer、生产数据或部署状态。
验证
c8b80111对应源码的git apply --check、实际应用和逐字节比较。已核对三个被替换文件的远端旧 blob SHA,并使用 expected-SHA、非强制更新保留并行提交。1c9a5bc6已触发新 CI;初次回读时尚在运行,不在这里宣称通过。早先提交的格式/clippy 失败也不能据文本检查宣布修复。仍不可合并或恢复真实管理员
authorize_in_transaction的接线必须删掉;本轮不需要它。不修改冻结 v3、原 A2 材料、现有管理员或生产状态;不绕过
/api/setup,不创建新 root。模块接线、合并与部署不是本 PR 已完成的结果。原始任务:A01。