remove_local_account_keys(name, keys, *, clear_password=False). With clear_password the account's password goes too, and so do its sudo rule and its admin groups, because sudo asks for that password. The account stays open and keeps its other keys.
Steps: keys, then password and sudo (with the flag). Each step runs even when another failed: sudo goes even when the password could not be cleared. An account that is not there fails keys and clears nothing. A driver without _account_clear_password fails the password step and says so, as add_local_account(clear_password=True) does.
Why
When a person deletes their personal key, netOrk deletes the account password it kept for them along with it. The devices kept that password, and sudo kept working with it. The contract had no public way to clear a password without a key: add_local_account needs a public_key, and lock_local_account would lock an account that is meant to stay open. See NetOrk/netork#2033.
A keyword on remove_local_account_keys rather than a separate method, so a deleted key and the password that went with it are one change on the device and one result.
Tests
tests/test_local_accounts.py gains 5 tests: keys, password and sudo in one call; each step running when one failed; a driver that cannot clear a password; a missing account; the keyword-only flag. The first four failed before the change; the last one guards the signature. The full suite passes (1355), ruff and mypy are clean, and napalm-standard check and ratchet pass.
A minor release, assumed to be 4.29.0. The PRs for napalm-linux, napalm-bsd and napalm-openmediavault raise their floor to it. napalm-qnap-qts stays opted out.
## What
`remove_local_account_keys(name, keys, *, clear_password=False)`. With `clear_password` the account's password goes too, and so do its sudo rule and its admin groups, because sudo asks for that password. The account stays open and keeps its other keys.
Steps: `keys`, then `password` and `sudo` (with the flag). Each step runs even when another failed: sudo goes even when the password could not be cleared. An account that is not there fails `keys` and clears nothing. A driver without `_account_clear_password` fails the `password` step and says so, as `add_local_account(clear_password=True)` does.
## Why
When a person deletes their personal key, netOrk deletes the account password it kept for them along with it. The devices kept that password, and sudo kept working with it. The contract had no public way to clear a password without a key: `add_local_account` needs a `public_key`, and `lock_local_account` would lock an account that is meant to stay open. See NetOrk/netork#2033.
A keyword on `remove_local_account_keys` rather than a separate method, so a deleted key and the password that went with it are one change on the device and one result.
## Tests
`tests/test_local_accounts.py` gains 5 tests: keys, password and sudo in one call; each step running when one failed; a driver that cannot clear a password; a missing account; the keyword-only flag. The first four failed before the change; the last one guards the signature. The full suite passes (1355), ruff and mypy are clean, and `napalm-standard check` and `ratchet` pass.
A minor release, assumed to be **4.29.0**. The PRs for napalm-linux, napalm-bsd and napalm-openmediavault raise their floor to it. napalm-qnap-qts stays opted out.
A person who deletes their key loses the password that went with it in netOrk, but the devices kept it, and sudo with it. remove_local_account_keys(name, keys, clear_password=True) takes the keys, the password and sudo in one call; the account stays open. Each step runs when another failed.
See NetOrk/netork#2033.
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
remove_local_account_keys(name, keys, *, clear_password=False). Withclear_passwordthe account's password goes too, and so do its sudo rule and its admin groups, because sudo asks for that password. The account stays open and keeps its other keys.Steps:
keys, thenpasswordandsudo(with the flag). Each step runs even when another failed: sudo goes even when the password could not be cleared. An account that is not there failskeysand clears nothing. A driver without_account_clear_passwordfails thepasswordstep and says so, asadd_local_account(clear_password=True)does.Why
When a person deletes their personal key, netOrk deletes the account password it kept for them along with it. The devices kept that password, and sudo kept working with it. The contract had no public way to clear a password without a key:
add_local_accountneeds apublic_key, andlock_local_accountwould lock an account that is meant to stay open. See NetOrk/netork#2033.A keyword on
remove_local_account_keysrather than a separate method, so a deleted key and the password that went with it are one change on the device and one result.Tests
tests/test_local_accounts.pygains 5 tests: keys, password and sudo in one call; each step running when one failed; a driver that cannot clear a password; a missing account; the keyword-only flag. The first four failed before the change; the last one guards the signature. The full suite passes (1355), ruff and mypy are clean, andnapalm-standard checkandratchetpass.A minor release, assumed to be 4.29.0. The PRs for napalm-linux, napalm-bsd and napalm-openmediavault raise their floor to it. napalm-qnap-qts stays opted out.