chore(sync): zsy_developcc 全量同步至 qyqy_develop(W26 口径)
- 分支内容对齐 qyqy_develop b6ec3aa,树完全一致(同步后 git diff 为空) - 覆盖本轮全部交付:客服 Agent 重构(安全路由 / 五出口 / 记忆与画像 / RAG 全链路) + 开发文档 62 份编号体系(D1.1 v1.17 索引) + 新增 D2.10-客服Agent端到端答辩文档-2026-09-21.html - 基线:e239eb7(2026-09-17 品牌口径统一快照),本提交为其直接后继
This commit is contained in:
@@ -3,6 +3,7 @@ from functools import lru_cache
|
||||
from fastapi import Depends, Request
|
||||
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
|
||||
|
||||
from app.core.actor import is_visitor
|
||||
from app.core.config import get_settings
|
||||
from app.core.contracts import RequestContext
|
||||
from app.core.errors import UnauthorizedAgentError
|
||||
@@ -49,7 +50,7 @@ async def build_request_context(
|
||||
raise unauthorized()
|
||||
try:
|
||||
context = _authenticator().authenticate(credentials.credentials)
|
||||
if "visitor" not in context.roles:
|
||||
if not is_visitor(context):
|
||||
context = await IdentityService().resolve(context)
|
||||
except Exception as exc:
|
||||
# 令牌非法、账号停用、角色读取失败一律按 401 处理,形态完全一致。
|
||||
|
||||
Reference in New Issue
Block a user