Identify sessions by session key - a hash that can be safely shared.

This commit is contained in:
Leo Vasanko
2026-02-18 01:03:16 +00:00
parent 99893fbb62
commit 5750ae8e36
9 changed files with 23 additions and 19 deletions
+3 -3
View File
@@ -1300,7 +1300,7 @@ class TestAdminSessions:
)
response = await client.delete(
f"/auth/api/admin/users/{test_user.uuid}/sessions/{base64url.enc(extra_db_key)}",
f"/auth/api/admin/users/{test_user.uuid}/sessions/{extra_db_key}",
headers={**auth_headers(session_token), "Host": "localhost:4401"},
)
assert response.status_code == 200
@@ -1364,9 +1364,9 @@ class TestAdminSessions:
f"/auth/api/admin/users/{test_user.uuid}/sessions/invalid!!id",
headers={**auth_headers(session_token), "Host": "localhost:4401"},
)
assert response.status_code == 400
assert response.status_code == 404
data = response.json()
assert "Invalid session ID format" in data["detail"]
assert "Session not found" in data["detail"]
@pytest.mark.asyncio
async def test_delete_session_not_found(