From 0612395bbf988ea070e7aa0664f9842527c7db8d Mon Sep 17 00:00:00 2001 From: duffyduck Date: Sat, 19 Sep 2026 17:45:39 +0200 Subject: [PATCH] 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 --- diagnostic/index.html | 6 ++++-- satellite/satellite.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/diagnostic/index.html b/diagnostic/index.html index 4f363bd..db3dc0f 100644 --- a/diagnostic/index.html +++ b/diagnostic/index.html @@ -238,7 +238,7 @@
HTTP-Basic
- +
@@ -4647,8 +4647,10 @@ const c = document.getElementById('dc-snmp-community').value.trim(); if (c) creds.snmp = { version: v, community: c }; } + // HTTP-Basic: Benutzer optional (manche Geraete nutzen Password-only). const hu = document.getElementById('dc-http-user').value.trim(); - if (hu) creds.http = { user: hu, pass: document.getElementById('dc-http-pass').value }; + const hp = document.getElementById('dc-http-pass').value; + if (hu || hp) creds.http = { user: hu, pass: hp }; // FritzBox: Benutzer optional (Password-only-Boxen haben keinen) — es reicht // ein Passwort. Gespeichert wird, sobald User ODER Passwort gesetzt ist. const fu = document.getElementById('dc-fb-user').value.trim(); diff --git a/satellite/satellite.py b/satellite/satellite.py index 7e8954f..dd38ba1 100644 --- a/satellite/satellite.py +++ b/satellite/satellite.py @@ -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)