feat(工作台): 优化入口布局与连接安全状态
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from datetime import datetime, timedelta, timezone
|
||||
import uuid
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -20,6 +21,13 @@ def test_legacy_session_id_is_stable_without_storing_a_token():
|
||||
assert isinstance(first, uuid.UUID)
|
||||
|
||||
|
||||
def test_session_heartbeat_returns_server_observed_client_ip():
|
||||
auth_source = (Path(__file__).resolve().parents[1] / "app" / "api" / "v1" / "auth.py").read_text()
|
||||
|
||||
assert "resolve_client_ip(request)" in auth_source
|
||||
assert '"client_ip": resolve_client_ip(request)' in auth_source
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_login_summary_marks_recent_unended_sessions_online(db_session, monkeypatch):
|
||||
now = datetime.now(timezone.utc)
|
||||
|
||||
Reference in New Issue
Block a user