feat: 平台预设字典+凭证加密+分库备份+Agent采集+移动端优先前端重做
This commit is contained in:
@@ -23,3 +23,16 @@ async def require_api_key(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail="API Key 无效或缺失",
|
||||
)
|
||||
|
||||
|
||||
async def require_agent_key(
|
||||
x_agent_key: Optional[str] = Header(default=None, alias="X-Agent-Key"),
|
||||
) -> None:
|
||||
"""校验 Agent 上报 Key(可选启用)"""
|
||||
if not settings.AGENT_KEY:
|
||||
return
|
||||
if x_agent_key != settings.AGENT_KEY:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail="Agent Key 无效或缺失",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user