fix(creds): HTTP-Basic-Benutzer optional (Password-only-Geraete)

Wie bei der FritzBox: manche Geraete nutzen HTTP-Basic-Auth nur mit Passwort.
Modal speichert HTTP-Creds jetzt bei User ODER Passwort; _do_http wendet die
Auth auch bei leerem Benutzer an. SNMP v1/v2c hat ohnehin nur die Community
(kein User); v3 braucht den securityName zwingend und bleibt Pflicht.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-09-19 17:45:39 +02:00
co-authored by Claude Opus 4.8
parent 16b6fbeaf6
commit 0612395bbf
2 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -622,8 +622,8 @@ def _do_http(action: str, params: dict) -> dict:
pass
user = params.get("user") or hcreds.get("user")
pw = params.get("pass") or params.get("password") or hcreds.get("pass")
if user:
auth = (str(user), str(pw or ""))
if user or pw: # Benutzer optional — manche Geraete nutzen Password-only-Basic-Auth
auth = (str(user or ""), str(pw or ""))
r = requests.request(method, url, data=params.get("body"),
headers=params.get("headers"), auth=auth,
timeout=HTTP_TIMEOUT_SEC)