test: 集成测试改用真 LLDAP 容器;修复两处物化缺陷
- 集成测试重构:syncer e2e/materialize、ldaplib 读路径、lldapgql 全改用本地 LLDAP 容器(LDAP 3890 / GraphQL /api/graphql 17170),删旧 OpenLDAP 断言 - 修复 1:ActiveUsers 不填 DepartmentIDs(存于关系表),BuildFromMirror 拿到空成员; 新增 ActiveUsersWithDepts,物化 plan 用之 - 修复 2:deleted 用户重新可见后不回 active,无法重建;RevertToActive 纳入 deleted, 快照 reconcile 对其置回 active + 作废 token - 关键安全回归单测保留并配变异验证:未确认不删、非受管不删、admin 永不移出、 删除最后阶段、绝不碰密码。全量单测+vet+集成全绿
This commit is contained in:
@@ -210,9 +210,11 @@ func (r *SnapshotRunner) reconcile(ctx context.Context, present map[string]bool,
|
||||
}
|
||||
|
||||
if present[u.UID] {
|
||||
// 本轮在飞书重新可见:撤销离职流程并作废未用的 token。
|
||||
// 本轮在飞书可见:撤销离职流程并作废未用的 token。
|
||||
switch u.State {
|
||||
case store.StateLeaveCandidate, store.StatePendingConfirm, store.StateConfirmedLeave:
|
||||
case store.StateLeaveCandidate, store.StatePendingConfirm,
|
||||
store.StateConfirmedLeave, store.StateDeleted:
|
||||
// 含已删除用户重新入职:置回 active,物化以「重建」处理。
|
||||
if err := r.store.RevertToActive(u.UID); err != nil {
|
||||
return fmt.Errorf("撤销离职流程 uid=%s: %w", u.UID, err)
|
||||
}
|
||||
@@ -221,9 +223,6 @@ func (r *SnapshotRunner) reconcile(ctx context.Context, present map[string]bool,
|
||||
}
|
||||
res.Reinstated++
|
||||
r.log.Info("用户重新可见,已撤销离职流程", "uid", u.UID)
|
||||
case store.StateDeleted:
|
||||
// 已物理删除又可见,物化阶段会以「重建」处理,这里只记录。
|
||||
r.log.Info("已删除用户重新可见,将按重建处理", "uid", u.UID)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user