feat(file-check): 更新文件检核工具 API Key 配置及相关文档
This commit is contained in:
1 parent
634dee4b81
commit
55cf7ff734
74 files changed
+1525
-1182
No files matched your search
@@ -33,7 +33,7 @@ _TASK_LOCK_KEY_BASE = 8700000000
|
||||
|
||||
def _tool_token_secret() -> str:
|
||||
return str(
|
||||
current_app.config.get("FILE_CHECK_TOOLS_API_KEY")
|
||||
current_app.config.get("FILE_CHECK_TOOL_API_KEY")
|
||||
or current_app.config.get("INTEGRATION_API_KEY")
|
||||
or current_app.config.get("SECRET_KEY")
|
||||
or "default-secret"
|
||||
@@ -56,13 +56,13 @@ def _decode_download_token(token: str | None) -> dict | None:
|
||||
|
||||
def _require_tool_auth() -> None:
|
||||
configured = str(
|
||||
current_app.config.get("FILE_CHECK_TOOLS_API_KEY")
|
||||
current_app.config.get("FILE_CHECK_TOOL_API_KEY")
|
||||
or current_app.config.get("INTEGRATION_API_KEY")
|
||||
or ""
|
||||
).strip()
|
||||
if not configured:
|
||||
raise ServiceUnavailableError(
|
||||
"FILE_CHECK_TOOLS_API_KEY or INTEGRATION_API_KEY is not configured",
|
||||
"FILE_CHECK_TOOL_API_KEY or INTEGRATION_API_KEY is not configured",
|
||||
code="missing_auth",
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user