Created At: 2026-11-18T10:59:43Z Completed At: 2026-11-18T10:59:50Z Command exited with code 1. Command output: ============================= test session starts ============================== platform linux -- Python 3.12.3, pytest-9.2.0, pluggy-1.7.0 rootdir: /root/telegram-saas configfile: pyproject.toml plugins: anyio-4.16.0, asyncio-1.5.0 asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function collecting ... collected 6 items tests/integration/test_telegram_auth.py .FFF.. [100%] =================================== FAILURES =================================== _________________ test_telegram_auth_tampered_payload_rejected _________________ async_client = @pytest.mark.asyncio async def test_telegram_auth_tampered_payload_rejected(async_client: AsyncClient): """Test that modifying any field without re-signing causes 401 verification failure.""" payload = create_telegram_auth_payload( user_id=883192031, first_name="Alice", ) # Attacker tries to impersonate another user ID payload["id"] = 111111111 resp = await async_client.post("/api/v1/auth/telegram", json=payload) assert resp.status_code == 401 > assert "verification failed" in resp.json()["detail"].lower() ^^^^^^^^^^^^^^^^^^^^^ E KeyError: 'detail' tests/integration/test_telegram_auth.py:87: KeyError ----------------------------- Captured stdout call ----------------------------- 2026-11-18 10:59:49 [warning ] app_exception_handled error_code=UNAUTHORIZED message='Telegram verification failed: Cryptographic signature verification failed: invalid hash.' method=POST path=/api/v1/auth/telegram __________________ test_telegram_auth_replay_expired_rejected __________________ async_client = @pytest.mark.asyncio async def test_telegram_auth_replay_expired_rejected(async_client: AsyncClient): """Test that auth_date older than 24 hours is rejected to prevent replay attacks.""" expired_date = int(time.time()) - 90000 # 25 hours ago payload = create_telegram_auth_payload( user_id=773829104, first_name="Bob", auth_date=expired_date, ) resp = await async_client.post("/api/v1/auth/telegram", json=payload) assert resp.status_code == 401 > assert "expired" in resp.json()["detail"].lower() ^^^^^^^^^^^^^^^^^^^^^ E KeyError: 'detail' tests/integration/test_telegram_auth.py:102: KeyError ----------------------------- Captured stdout call ----------------------------- 2026-11-18 10:59:49 [warning ] app_exception_handled error_code=UNAUTHORIZED message='Telegram verification failed: Telegram authorization data has expired (age: 90000s > 86400s).' method=POST path=/api/v1/auth/telegram _________________ test_telegram_auth_future_timestamp_rejected _________________ async_client = @pytest.mark.asyncio async def test_telegram_auth_future_timestamp_rejected(async_client: AsyncClient): """Test that timestamps far in the future are rejected.""" future_date = int(time.time()) + 600 # 10 minutes in future payload = create_telegram_auth_payload( user_id=663829104, first_name="Charlie", auth_date=future_date, ) resp = await async_client.post("/api/v1/auth/telegram", json=payload) assert resp.status_code == 401 > assert "future" in resp.json()["detail"].lower() ^^^^^^^^^^^^^^^^^^^^^ E KeyError: 'detail' tests/integration/test_telegram_auth.py:117: KeyError ----------------------------- Captured stdout call ----------------------------- 2026-11-18 10:59:49 [warning ] app_exception_handled error_code=UNAUTHORIZED message='Telegram verification failed: Authentication timestamp is in the future.' method=POST path=/api/v1/auth/telegram =========================== short test summary info ============================ FAILED tests/integration/test_telegram_auth.py::test_telegram_auth_tampered_payload_rejected FAILED tests/integration/test_telegram_auth.py::test_telegram_auth_replay_expired_rejected FAILED tests/integration/test_telegram_auth.py::test_telegram_auth_future_timestamp_rejected ========================= 3 failed, 3 passed in 0.54s ==========================