feat(local-accounts): a deleted key can take the password with it #71

Merged
christianmanivong merged 1 commits from feat/remove-keys-clear-password into main 2026-11-04 14:45:06 +00:00
Owner

What

napalm-device-types 4.29.0 adds remove_local_account_keys(name, keys, *, clear_password=False) (NAPALM/napalm-device-types#92, see NetOrk/netork#2033). This driver's _account_clear_password already does the work (usermod -p '*'), so no code changes here:

  • a test pins what the call does on this host: the keys go as the person, then the password, then the sudo rule and the admin groups; the account stays open;
  • the floor rises to napalm-device-types>=4.29.0;
  • a CHANGELOG entry under [Unreleased].

Why

When a person deletes their key, netOrk forgets the account password that went with it, but the host kept it, and sudo with it.

Tests

The new test fails against napalm-device-types 4.28.0 (TypeError: no clear_password) and passes against the dt PR. The full suite, ruff, mypy, napalm-standard check and ratchet pass. CI stays red until 4.29.0 is on PyPI.

## What napalm-device-types 4.29.0 adds `remove_local_account_keys(name, keys, *, clear_password=False)` (NAPALM/napalm-device-types#92, see NetOrk/netork#2033). This driver's `_account_clear_password` already does the work (usermod -p '*'), so no code changes here: - a test pins what the call does on this host: the keys go as the person, then the password, then the sudo rule and the admin groups; the account stays open; - the floor rises to `napalm-device-types>=4.29.0`; - a CHANGELOG entry under [Unreleased]. ## Why When a person deletes their key, netOrk forgets the account password that went with it, but the host kept it, and sudo with it. ## Tests The new test fails against napalm-device-types 4.28.0 (`TypeError`: no `clear_password`) and passes against the dt PR. The full suite, ruff, mypy, `napalm-standard check` and `ratchet` pass. CI stays red until 4.29.0 is on PyPI.
christianmanivong added 1 commit 2026-11-04 14:22:50 +00:00
feat(local-accounts): a deleted key can take the password with it
driver / lint (pull_request) Successful in 17s
driver / standard (pull_request) Successful in 20s
driver / types (pull_request) Successful in 1m3s
driver / test (3.13) (pull_request) Successful in 1m2s
driver / test (3.12) (pull_request) Successful in 1m11s
driver / lowest (pull_request) Successful in 38s
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m7s
CI / driver (pull_request) Successful in 2m29s
driver / publish (pull_request) Skipped
60ccea9a98
napalm-device-types 4.29.0 lets remove_local_account_keys clear the password and sudo too (NetOrk/netork#2033). This driver's _account_clear_password already does the work; a test pins the commands, and the floor rises to 4.29.0.
christianmanivong merged commit 249046512d into main 2026-11-04 14:45:06 +00:00
christianmanivong deleted branch feat/remove-keys-clear-password 2026-11-04 14:45:06 +00:00
Sign in to join this conversation.