feat: add limited visitor tokens

This commit is contained in:
张胜宇
2026-09-10 13:56:08 +08:00
parent c6be99078e
commit ad7172367a
8 changed files with 137 additions and 2 deletions
+14
View File
@@ -0,0 +1,14 @@
from fastapi.testclient import TestClient
from app.main import create_app
def test_visitor_token_endpoint_returns_short_lived_bearer_token() -> None:
with TestClient(create_app()) as client:
response = client.post("/api/v1/visitor-tokens")
assert response.status_code == 201
body = response.json()
assert isinstance(body["access_token"], str)
assert body["token_type"] == "Bearer"
assert body["expires_in"] == 900