fix: propagate disabled state to lookup server - #215
Conversation
2707887 to
8f0d524
Compare
Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
8f0d524 to
84ba97a
Compare
Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
|
As described here, added a new commit to include some changes that I believe would be a good addition to this PR. Tested it locally and looks good. |
|
Maybe it would make sense to include the tests from here as well? |
hey @rikled, I don't think they'd quite apply here, since this PR takes a different approach: // lib/Listeners/UserChanged.php
// this PR:
if ($event->getValue() === false) {
// user was disabled, remove from lookup server
$this->slave->preDeleteUser($params);
$this->slave->deleteUser($params);
} else {
// user was enabled, add to lookup server
$this->slave->createUser($params);
}
// PR #213:
// updateUser() routes enabled→add, disabled→remove
$this->slave->updateUser($event->getUser());also since the tests from #213 were specifically checking that enabled/disabled users get pushed/deleted via that said, thanks for taking the time to write the tests, and feel free to open a separate PR with some tests if you feel like it |
|
@cristianscheid should we backport this to |
|
/backport to stable2.7 |
Summary
Currently, disabled users are kept on the lookup server as if they were enabled.
This PR introduces the following mechanisms to address this:
lib/Listeners/UserChangedlistens for enable/disable eventslib/Slave::batchUpdate()now checks if a user is enabled before registering them on the lookup serverocc globalsiteselector:users:updateand theBackgroundJobs/UpdateLookupServercron joblib/Controller/SlaveController::autoLogin()was updated to handle disabled users that were already present on the lookup serverDisabledUserExceptionon login and removes the user from the lookup server in that caseChecklist
3. to review, feature component)stable32)AI (if applicable)