From 117e03cd23d7fd77f0027bde62bcf9f245d5f504 Mon Sep 17 00:00:00 2001 From: Thomas Stallinger Date: Fri, 28 Aug 2026 10:59:53 +0200 Subject: [PATCH] Fix: WLAN-SSID zeigte b'...' statt Klartext (psycopg bytes-vs-str) Live gefunden beim echten Self-Service-Flow-Test: fetch_konfiguration() gab wifi_ssid roh weiter, ohne den bekannten bytes-Decode-Guard, den andere Stellen im Projekt schon haben (siehe auth.py:_row_to_user()). Co-Authored-By: Claude Opus 5 --- routers/installationsmedium.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/routers/installationsmedium.py b/routers/installationsmedium.py index b8ba61d..8717468 100644 --- a/routers/installationsmedium.py +++ b/routers/installationsmedium.py @@ -33,6 +33,13 @@ def fetch_konfiguration(organization_id: str) -> dict | None: (wifi_ssid, wifi_psk_encrypted, bereitstellungsvorlage_id, max_devices, validity_days, enrollment_session_id, iso_build_id) = row + # psycopg liefert TEXT-Spalten hier teils als bytes zurueck, nicht str - + # dasselbe bekannte, nicht deterministische Verhalten wie in + # auth.py:_row_to_user() (live gefunden: b'...' erschien roh im + # WLAN-SSID-Feld auf /installationsmedium). + if isinstance(wifi_ssid, bytes): + wifi_ssid = wifi_ssid.decode("utf-8") + return { "wifi_ssid": wifi_ssid, "hat_wifi_psk": wifi_psk_encrypted is not None,