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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user