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
+2 -1
View File
@@ -24,7 +24,8 @@ async def build_request_context(
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Unauthorized")
try:
context = _authenticator().authenticate(credentials.credentials)
context = await IdentityService().resolve(context)
if "visitor" not in context.roles:
context = await IdentityService().resolve(context)
except Exception as exc:
from app.core.errors import UnauthorizedAgentError