Files
napalm-device-types/CHANGELOG.md
T
christianmanivong cb90fa9835
driver / standard (pull_request) Failing after 7s
driver / lint (pull_request) Successful in 20s
driver / types (pull_request) Successful in 1m8s
driver / test (3.12) (pull_request) Failing after 1m9s
driver / test (3.13) (pull_request) Failing after 1m3s
driver / lowest (pull_request) Failing after 33s
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m8s
CI / driver (pull_request) Failing after 2m24s
driver / publish (pull_request) Skipped
feat: SudoHistoryMixin, the sudo password left in shell histories (NetOrk/netork#1090)
A driver that typed `echo '<password>' | sudo -S -p "" <command>` into an
interactive shell left that line, password and all, in the login user's
shell history once per command, and where only the part before the first
`&&` ran as root, files root should own were left to the login user.

get_history_sudo_lines() counts the lines per history file with grep -c,
as the login user, without reading any back. remove_history_sudo_lines()
deletes exactly those lines with sed -i, overwrites the backup with
shred -u, and as root gives the driver's SUDO_ROOT_FILES back to root:root
where each is a regular file, not a link, owned by the login user. It
reports each file's lines before and after. Nothing goes to stdin.

The driver names the marker and the files and supplies run_command.
2026-10-30 21:09:24 +01:00

78 lines
4.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Changelog
All notable changes to napalm-device-types. The format follows
[Keep a Changelog](https://keepachangelog.com/), versions follow
[Semantic Versioning](https://semver.org/). Versions up to 4.21.0 were not
recorded here; their history is the git log.
## [Unreleased]
### Changed
- Python 3.12 is the floor (`requires-python = ">=3.12"`): netOrk runs every driver
on 3.12, so 3.10 and 3.11 are no longer tested (NAPALM/driver-standard#6).
- The floor on napalm is 5.1: older releases import `pkg_resources`, which a Python
3.12 venv no longer has.
### Added
- `ARP_AGE_UNKNOWN` (`napalm_device_types.arp`, `-1.0`): the `age` a driver reports
in `get_arp_table` and `get_ipv6_neighbors_table` when the device does not say how
old an entry is. `0.0` means "confirmed just now" and is no stand-in for it
(NetOrk/netork#1327).
- `NetworkTargetDict.uplinks` (optional): the physical NICs a bridge leaves the
host through, one group per way out -- a bond's slaves together, a single NIC
alone (`[["eno1", "eno2"]]`). A missing key means unknown, an empty list a
bridge without uplink. NetOrk follows their LLDP neighbours to the switch port
and its untagged VLAN; one slave's neighbour speaks for its bond
(NetOrk/netork#1325).
- `HostShutdownMixin.shutdown_host()`, on `DeviceTypeDriver`: shut the device itself
down cleanly through its own means; declared, so `hasattr` says whether a driver
can. No forced variant (NetOrk/netork#1636).
- `VmStopRequestMixin.begin_stop_vm(name)`: ask for a VM's clean shutdown and return
at once, for callers that wait on a timer instead of in `stop_vm`. No role demands
it (NetOrk/netork#1636).
- `SudoHistoryMixin` (`napalm_device_types.sudo_history`): the sudo password an earlier
driver typed into an interactive shell (`echo '<password>' | sudo -S -p "" …`) and
left in the login user's shell history, for a driver to mix in (NetOrk/netork#1090).
The driver says what its lines carry (`SUDO_HISTORY_MARKER`) and which files its
partial sudo left to the login user (`SUDO_ROOT_FILES`), and supplies `run_command`.
- `get_history_sudo_lines()` counts the lines per history file (`~/.bash_history`,
`~/.zsh_history`, `~/.ash_history`, `~/.sh_history`) with `grep -c` as the login
user. No line is read back; a file it cannot read raises.
- `remove_history_sudo_lines()` deletes exactly those lines as the login user (`sed
-i`, its backup overwritten with `shred -u`), and as root gives each of
`SUDO_ROOT_FILES` back to `root:root` where it is a regular file, not a symbolic
link, owned by the login user. It reports every file's lines before and after,
how many were removed and which files are root's again. Nothing goes to stdin.
## [4.22.0] - 2026-10-23
### Added
- `AptProxyMixin` (`napalm_device_types.apt_proxy`): apt's proxy on a
Debian-family host, for a driver to mix in (NetOrk/netork#1397).
- `get_package_proxy()` is the proxy apt really fetches through, as
`apt-config dump` says, and no longer the content of one file. A proxy the
Debian or Ubuntu installer set elsewhere wins over `00proxy`, and was missed.
- `get_package_proxy_report()` adds where it is set: every line of apt's
configuration that sets it, in the order apt reads them, the per-host
proxies, and the sources fetched over http and over https.
- `check_package_proxy(url, expect)` fetches a page from the host with apt's
own downloader, past any proxy, and says whether the host reached it and
whether the page says what you expected.
- `configure_package_proxy(url)` writes the proxy, comments out every other
line that sets a different one, reads the result back and fetches one
source through the proxy. It fails when apt still fetches elsewhere.
- `same_proxy_url()` compares two proxy URLs by scheme, host and port.
## [4.21.1] - 2026-10-22
The first release on PyPI since 0.1.0.
### Changed
- The package follows the NAPALM driver standard
(https://git.netork.io/NAPALM/driver-standard): CI on Gitea runs ruff, strict
mypy, the tests on Python 3.10–3.13 and at the lowest declared versions,
bandit, pip-audit and a build check, and a release tag publishes to PyPI.
- Type annotations use builtin generics (`list[str]`, `X | None`) instead of
`typing.List` and `Optional`. They mean the same to a type checker.
- The project links point at git.netork.io instead of GitHub.