中控增加下单,关键位,系统设置

This commit is contained in:
dekun
2026-05-22 10:04:28 +08:00
parent ed6b56ff87
commit 46f73fce43
19 changed files with 1844 additions and 568 deletions
+20
View File
@@ -0,0 +1,20 @@
"""中控调用实例 API 时的鉴权辅助(各 crypto_monitor_* 的 login_required 共用)。"""
from __future__ import annotations
import os
from flask import request
def hub_bridge_token() -> str:
return (os.getenv("HUB_BRIDGE_TOKEN") or "").strip()
def request_allowed(session_logged_in: bool, auth_disabled: bool) -> bool:
if auth_disabled or session_logged_in:
return True
tok = hub_bridge_token()
if tok and request.headers.get("X-Hub-Token") == tok:
return True
return False