feat(logins): get_login_accounts through napalm-device-types' LoginAccountsMixin (NetOrk/netork#2707)

The transport runs the shared, read-only command on an exec channel, as root
first for the lock, the expiry and the failed logins, and as the login user
where root is refused.
This commit is contained in:
Christian Manivong committed 2026-11-28 03:46:50 +01:00
1 parent 963f6d2736
commit ae71047f7f
3 files changed
+95 -4

No files matched your search

+7 -4
View File
@@ -10,7 +10,8 @@ NetOrk/netork#2700) are read as root only: a reading of the login user's own pro
would read as clean. It is one fixed command and reads no stdin.
The running backups need no root: every process's command line and cgroup are
readable to the login user (``_running_backups``). How the host is hardened
(``_hardening``) is read as root first, as the login user where root is refused.
(``_hardening``) and who can log in to it (``_logins``, NetOrk/netork#2707) are read
as root first, as the login user where root is refused.
"""
from __future__ import annotations
@@ -20,6 +21,7 @@ from typing import TYPE_CHECKING
from napalm_device_types import ListeningSocketsMixin, LogSourcesMixin, ServicesRestartMixin
from napalm_linux._hardening import LinuxHardeningMixin
from napalm_linux._logins import LinuxLoginAccountsMixin
from napalm_linux._running_backups import LinuxRunningBackupsMixin
#: Seconds either reading may take; a busy host lists thousands of descriptors.
@@ -32,11 +34,12 @@ class LinuxProcessReadingsMixin(
ServicesRestartMixin,
LinuxRunningBackupsMixin,
LinuxHardeningMixin,
LinuxLoginAccountsMixin,
):
"""The transports for ``get_listening_sockets``, ``get_log_sources`` and
``get_services_need_restart``, and ``get_running_backups`` and ``get_hardening``
(``_hardening``, NetOrk/netork#2706), which ride along here rather than lengthen
``linux.py``."""
``get_services_need_restart``, and ``get_running_backups``, ``get_hardening``
(``_hardening``, NetOrk/netork#2706) and ``get_login_accounts`` (``_logins``,
NetOrk/netork#2707), which ride along here rather than lengthen ``linux.py``."""
if TYPE_CHECKING: # pragma: no cover - the driver's own, declared for type checkers