Fix authenticated relayer password verification - #631
Conversation
Confidence Score: 5/5Safe to merge: no blocking failure remains in the reviewed relayer authentication and startup paths. No blocking failure remains.
What T-Rex did
Reviews (4): Last reviewed commit: "Clean up relayer after startup failure" | Re-trigger Greptile |
|
Addressed in b491d32. Since the legacy hashes were created with salts that were never persisted, they cannot be migrated or verified. Authenticator initialization now validates the required columns and fails with an instruction to recreate the database using make_user_db.py. A regression test covers the legacy two-column schema, and the full suite passes with 568 tests. |
|
Addressed in 7643a49. The example now owns the main coroutine with asyncio.run(), so authenticator startup errors propagate and terminate the process. On successful startup, amain() waits until cancellation and stops the controller in its finally block instead of stopping it immediately. The new lifecycle test verifies that the controller remains running and is stopped on cancellation; the full suite passes with 569 tests. |
|
Addressed in d783988. |
What do these changes do?
Store each user's PBKDF2 salt in the authenticated relayer example database and use that salt when verifying a login. The authenticator decodes SMTP login bytes before querying SQLite, compares password digests with
hmac.compare_digest(), and rejects incompatible legacy databases with regeneration guidance.The example now propagates startup errors, remains active until shutdown, and cleans up its controller after cancellation or partial startup failure. Regression tests cover successful and failed authentication, the legacy schema, controller lifetime, and startup cleanup.
Are there changes in behavior for the user?
Yes. Credentials generated by
make_user_db.pycan now authenticate successfully. Existing databases using the old schema must be regenerated because their salts were never stored and cannot be recovered.Related issue number
Fixes #475
Checklist
NEWS.rstDrafted with OpenAI Codex; personal review by the contributor remains required before the PR is marked ready.