Personal accounts on OpenMediaVault now follow what the person changes. See NetOrk/netork#2013.
Needs the releases first: napalm-device-types (NAPALM/napalm-device-types#90, assumed to be 4.28.0) and napalm-linux (NAPALM/napalm-linux#69, assumed to be 0.17.0). The floors are raised to napalm-device-types>=4.28.0 and napalm-linux>=0.17.0. CI pre-installs both from git main.
OMV keeps a user's keys in its own database and deploys them to /var/lib/openmediavault/ssh/authorized_keys/<user>, which the person cannot write to. If only the mixin's ~/.ssh handling ran, the replaced key would stay deployed. The red tests show exactly that: "alice still has a key that was to go". So _account_drop_keys is overridden:
UserMgmt.getUser, then the stored keys minus the ones to go (matched by base64, RFC 4716 or OpenSSH form).
When something changed: UserMgmt.setUser with every other field as getUser returned it and an empty password (meaning "keep"), then Config.applyChanges with only the modules that made dirty (ssh, postfix). Changes already pending in the web UI stay pending.
Then napalm-linux and the mixin take the keys out of ~/.ssh as the person and check that none of them is left in any key file, including OMV's deployed one.
The same applies to add_local_account(..., replaces=[...]) (step old keys) and to remove_local_account_keys. Clearing the password is napalm-linux's usermod -p '*'. OMV keeps no password of its own, and setUser is never sent one.
Tests
Fixtures only, no device. Three tests failed first: test_a_replaced_key_goes_from_omvs_database_and_the_others_stay, test_a_person_who_replaced_a_key_and_removed_the_password_gets_both_on_omv and test_a_deleted_key_goes_through_omv_and_the_account_stays_open. Further tests cover a key in ~/.ssh only (no OMV write), a deploy that does not happen (the step fails) and the inherited clear command. 129 tests pass against the device-types and napalm-linux branches. ruff, napalm-standard check and ratchet are clean, and mypy reports nothing in napalm_openmediavault.
## What
Personal accounts on OpenMediaVault now follow what the person changes. See NetOrk/netork#2013.
**Needs the releases first:** napalm-device-types (NAPALM/napalm-device-types#90, assumed to be 4.28.0) and napalm-linux (NAPALM/napalm-linux#69, assumed to be 0.17.0). The floors are raised to `napalm-device-types>=4.28.0` and `napalm-linux>=0.17.0`. CI pre-installs both from git main.
OMV keeps a user's keys in its own database and deploys them to `/var/lib/openmediavault/ssh/authorized_keys/<user>`, which the person cannot write to. If only the mixin's `~/.ssh` handling ran, the replaced key would stay deployed. The red tests show exactly that: "alice still has a key that was to go". So `_account_drop_keys` is overridden:
1. `UserMgmt.getUser`, then the stored keys minus the ones to go (matched by base64, RFC 4716 or OpenSSH form).
2. When something changed: `UserMgmt.setUser` with every other field as `getUser` returned it and an empty password (meaning "keep"), then `Config.applyChanges` with only the modules that made dirty (`ssh`, `postfix`). Changes already pending in the web UI stay pending.
3. Then napalm-linux and the mixin take the keys out of `~/.ssh` as the person and check that none of them is left in any key file, including OMV's deployed one.
The same applies to `add_local_account(..., replaces=[...])` (step `old keys`) and to `remove_local_account_keys`. **Clearing the password** is napalm-linux's `usermod -p '*'`. OMV keeps no password of its own, and `setUser` is never sent one.
## Tests
Fixtures only, no device. Three tests failed first: `test_a_replaced_key_goes_from_omvs_database_and_the_others_stay`, `test_a_person_who_replaced_a_key_and_removed_the_password_gets_both_on_omv` and `test_a_deleted_key_goes_through_omv_and_the_account_stays_open`. Further tests cover a key in `~/.ssh` only (no OMV write), a deploy that does not happen (the step fails) and the inherited clear command. 129 tests pass against the device-types and napalm-linux branches. ruff, `napalm-standard check` and `ratchet` are clean, and mypy reports nothing in `napalm_openmediavault`.
napalm-device-types 4.28.0 lets add_local_account remove the old keys
(replaces) and adds remove_local_account_keys. OMV keeps a user's keys
in its own database and deploys them where the person cannot write, so
the mixin's key files alone would leave the old key deployed. The keys
go through UserMgmt.setUser, applying only what that made dirty, and
then out of ~/.ssh. Clearing the password is napalm-linux 0.17.0's.
See NetOrk/netork#2013
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
Personal accounts on OpenMediaVault now follow what the person changes. See NetOrk/netork#2013.
Needs the releases first: napalm-device-types (NAPALM/napalm-device-types#90, assumed to be 4.28.0) and napalm-linux (NAPALM/napalm-linux#69, assumed to be 0.17.0). The floors are raised to
napalm-device-types>=4.28.0andnapalm-linux>=0.17.0. CI pre-installs both from git main.OMV keeps a user's keys in its own database and deploys them to
/var/lib/openmediavault/ssh/authorized_keys/<user>, which the person cannot write to. If only the mixin's~/.sshhandling ran, the replaced key would stay deployed. The red tests show exactly that: "alice still has a key that was to go". So_account_drop_keysis overridden:UserMgmt.getUser, then the stored keys minus the ones to go (matched by base64, RFC 4716 or OpenSSH form).UserMgmt.setUserwith every other field asgetUserreturned it and an empty password (meaning "keep"), thenConfig.applyChangeswith only the modules that made dirty (ssh,postfix). Changes already pending in the web UI stay pending.~/.sshas the person and check that none of them is left in any key file, including OMV's deployed one.The same applies to
add_local_account(..., replaces=[...])(stepold keys) and toremove_local_account_keys. Clearing the password is napalm-linux'susermod -p '*'. OMV keeps no password of its own, andsetUseris never sent one.Tests
Fixtures only, no device. Three tests failed first:
test_a_replaced_key_goes_from_omvs_database_and_the_others_stay,test_a_person_who_replaced_a_key_and_removed_the_password_gets_both_on_omvandtest_a_deleted_key_goes_through_omv_and_the_account_stays_open. Further tests cover a key in~/.sshonly (no OMV write), a deploy that does not happen (the step fails) and the inherited clear command. 129 tests pass against the device-types and napalm-linux branches. ruff,napalm-standard checkandratchetare clean, and mypy reports nothing innapalm_openmediavault.