Commit Graph
14 Commits
Author SHA1 Message Date
Christian Manivong d56da13b4c chore(release): 0.2.0
driver / standard (pull_request) Successful in 13s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 53s
driver / test (3.10) (pull_request) Successful in 55s
driver / test (3.11) (pull_request) Successful in 58s
driver / test (3.12) (pull_request) Successful in 52s
driver / test (3.13) (pull_request) Successful in 48s
driver / lowest (pull_request) Successful in 29s
driver / security (pull_request) Successful in 56s
driver / build (pull_request) Successful in 30s
CI / driver (pull_request) Successful in 6m46s
driver / publish (pull_request) Skipped
2026-10-23 10:29:08 +02:00
Christian Manivong 75869eae06 chore: adopt the NAPALM driver standard
driver / standard (pull_request) Successful in 13s
driver / lint (pull_request) Successful in 11s
driver / types (pull_request) Successful in 44s
driver / test (3.10) (pull_request) Successful in 45s
driver / test (3.11) (pull_request) Successful in 47s
driver / test (3.12) (pull_request) Successful in 44s
driver / test (3.13) (pull_request) Successful in 41s
driver / lowest (pull_request) Successful in 22s
driver / security (pull_request) Successful in 46s
driver / build (pull_request) Successful in 22s
CI / driver (pull_request) Successful in 5m35s
driver / publish (pull_request) Skipped
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard; .github/ is gone.
- license = "Apache-2.0" and a LICENSE file: the package declared no
  license at all. README and CHANGELOG.md, py.typed, links to
  git.netork.io, a dev extra with floors; .venv/ and build output ignored.
- Floors on every dependency: napalm-device-types>=4.21.1 (had none),
  napalm>=4.0 (what napalm-device-types needs) and requests>=2.28.0.
  Without them the lowest CI job resolves napalm 0.10, which does not
  build; the tests pass at exactly these floors.
- mypy strict for the package; napalm_yealink.yealink is exempt for now
  (20 errors), recorded in the quality baseline with get_facts'
  complexity. Coverage floor 42 % (measured 42.61 %).

Closes #4
2026-10-23 08:46:20 +02:00
Christian Manivong 946dff5d08 fix: what bandit and the remaining lint rules found
- The MD5 of the password is what the phone's login API expects, the wire
  format and no protection of ours (the session runs over HTTPS):
  hashlib.md5(..., usedforsecurity=False) (B324). The digest is the same.
- A failed logout in close() and an unreadable system info in get_facts()
  now log at debug level (B110), so a swallowed failure leaves a trace; the
  module gets its logger.
- The comment on the "yealink" fingerprint rule moves above it (ruff
  format had split the line around it) and is in English.
2026-10-23 08:42:31 +02:00
Christian Manivong 4a4f9378c5 style: ruff format and the lint rules of the driver standard
Mechanical: ruff format, and ruff check --fix with the rule set every NAPALM
driver uses (E, F, I, UP, B at line length 100, Python 3.10). What ruff
cannot fix comes in the next commit.
2026-10-23 08:42:02 +02:00
Christian Manivong 46ff971953 fix: drop stubs that claim what a phone cannot do (0.1.1)
CI / test (3.10) (push) Successful in 29s
CI / test (3.11) (push) Successful in 26s
CI / test (3.12) (push) Successful in 28s
CI / test (3.10) (pull_request) Successful in 30s
CI / test (3.11) (pull_request) Successful in 28s
CI / test (3.12) (pull_request) Successful in 29s
get_health_metrics, get_ssids, get_radio_info and get_wireless_clients
only raised NotImplementedError. They are left over from when the
driver sat on AccessPointDriver, and a stub makes a capability check
(callable(getattr(driver, name))) answer yes. The application polls
SNMP itself (napalm-device-types docs/STRUCTURE.md); a phone has no
profile to declare.

Also stops tracking the .pyc and egg-info files .gitignore already
lists.

Closes #2
2026-10-16 12:03:38 +02:00
Christian Manivong a7a8b2080c ci: run the tests and build the package on every push and pull request
CI / test (3.10) (push) Successful in 27s
CI / test (3.11) (push) Successful in 35s
CI / test (3.12) (push) Successful in 38s
CI / test (3.10) (pull_request) Successful in 24s
CI / test (3.11) (pull_request) Successful in 23s
CI / test (3.12) (pull_request) Successful in 25s
The same job as napalm-fritzbox and napalm-opnsense: Python 3.10, 3.11 and
3.12, pytest, then wheel and sdist. napalm-device-types comes from
git.netork.io first, because PyPI has an unrelated package of that name.

pyproject gains a dev extra with pytest, which the job installs.
2026-10-07 07:52:44 +02:00
Christian Manivong 33d07bed58 fix: inherit PhoneDriver, and stop asserting a contract the driver rejected
Closes netork#117.

A Yealink is a desk phone. It inherited AccessPointDriver because nothing better
existed, and netOrk reads that role to populate its wireless page, its AP
profile pickers and its SSID drift view — so a phone appeared in all three.
napalm-device-types now has PhoneDriver. TYPE_LABEL comes from it, so the local
override is gone.

The two failing fingerprint tests were asserting the opposite of a deliberate
decision. HTTP_FINGERPRINT carries "yealink" as a heavy but *not* mandatory
rule, with the reason written next to it: some models answer / with a redirect
to their API page, whose body says "yealink" nowhere, and a mandatory rule
disqualifies the driver whenever its pattern is absent. Making it mandatory
would rule out a real phone.

The tests demanded it be mandatory, and the Cisco test then asserted `not
all(...)` over an empty list, which is False. Both now check the property that
actually protects against a false match: none of this driver's patterns appear
on a Cisco page, so it contributes no score and never wins.
2026-08-21 13:07:37 +07:00
Christian ManivongandClaude Sonnet 4.6 459178a2f4 fix: mandatory von HTTP_FINGERPRINT entfernen — Yealink /api-Redirect hat kein 'yealink' im Body
OUI-Treffer (80:5E:0C, 80:5E:C0) sind der zuverlässigere Identifier.
mandatory=True disqualifizierte Geräte bei denen nur der JS-Redirect abgeholt
wurde statt der vollständigen Login-Seite.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 17:29:13 +02:00
Christian Manivong 30fc536394 fix: falsche OUI-Prefixes entfernen (gegen IEEE verifiziert) 2026-06-24 17:06:45 +02:00
Christian ManivongandClaude Sonnet 4.6 d31f1f18f8 fix: falsche OUI-Prefixes entfernen (00:1A:8C = AzureWave, nicht Yealink)
Nur IEEE-verifizierte und an echten Geraeten bestaetigen OUIs behalten.
00:1A:8C gehoert AzureWave Technology (OpenWrt-WLAN-Chips), nicht Yealink.
24:9A:D8, 70:32:17, 34:6B:D3 entfernt bis Bestaetigung vorliegt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 16:46:26 +02:00
Christian Manivong a38db4f605 fix: OUI-Prefix 80:5E:0C für zweite Yealink-MAC-Allokation 2026-06-24 15:48:49 +02:00
Christian ManivongandClaude Sonnet 4.6 14ea3ab9e6 feat: OUI_PREFIXES für MAC/ARP-Fingerprinting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 15:41:45 +02:00
Christian Manivong 8ba421b234 chore: add .gitignore 2026-06-24 15:17:12 +02:00
Christian ManivongandClaude Sonnet 4.6 60525bd35e feat: initial napalm-yealink driver
Discovery-Fingerprinting für Yealink IP-Phones (T-series, W-series,
CP-series, VP-series) und Video-Endpoints.

- TYPE_LABEL = "Phone" (Override von AccessPointDriver)
- SNMP_OBJECT_ID_PREFIX = "1.3.6.1.4.1.37403" (Yealink Enterprise OID)
- HTTP_FINGERPRINT: "yealink" (mandatory, weight 10), Modell-Patterns
- get_facts(): liest phoneName + firmware aus dem noauth-API-Response
  (/api/v1/system/info liefert Gerätedaten auch ohne Authentication)
- Login via MD5-gehashtem Passwort auf /api/v1/session/login (HTTPS)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 15:17:08 +02:00