From ad5a5a0f7b4ff2feb220affc3c3e768e71e3f54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=91=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=D1=80=D0=B5=D0=B2?= Date: Fri, 5 Jun 2026 19:52:33 +0300 Subject: [PATCH] fix: mask WARP license in API --- app.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 21af8a6..fa96e88 100755 --- a/app.py +++ b/app.py @@ -231,7 +231,8 @@ def warp_status(): def parse_registration(stdout: str): - info = {"raw": stdout, "account_type": None, "account_id": None, "device_id": None, "license_masked": None} + raw_lines = [] + info = {"raw": "", "account_type": None, "account_id": None, "device_id": None, "license_masked": None} for line in (stdout or "").splitlines(): l = line.strip() if l.lower().startswith("account type:"): @@ -244,6 +245,10 @@ def parse_registration(stdout: str): lic = l.split(":", 1)[1].strip() if lic: info["license_masked"] = lic[:4] + "…" + lic[-4:] if len(lic) > 10 else lic + raw_lines.append("License: " + info["license_masked"]) + continue + raw_lines.append(line) + info["raw"] = "\n".join(raw_lines) return info