fix: MD5-hash Qobuz password and never log credential-bearing login errors

streamrip's email/password login expects the MD5 digest, not plaintext
(caused 'Invalid credentials'). Also wrap login() so streamrip's exception —
which embeds the email/password/app_id — can never reach the worker logs;
re-raise a clean credential-free RuntimeError instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan
2026-07-11 00:30:34 +02:00
parent f91117092b
commit caa0d542ea
2 changed files with 30 additions and 3 deletions
+15
View File
@@ -0,0 +1,15 @@
import hashlib
from lyra_worker.adapters._streamrip import StreamripClient, _hashed_password
def test_hashed_password_is_md5_hex():
# streamrip's Qobuz email/password login expects the MD5 hex digest, not plaintext.
assert _hashed_password("hunter2") == hashlib.md5(b"hunter2").hexdigest()
assert len(_hashed_password("anything")) == 32
assert all(c in "0123456789abcdef" for c in _hashed_password("anything"))
def test_is_configured():
assert StreamripClient({"qobuz.email": "a@b.c", "qobuz.password": "p"}).is_configured() is True
assert StreamripClient({}).is_configured() is False