Audit fixes: LIVE symbols/fills/expiry/pending, security harden, add 更新说明.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-26 22:28:03 +08:00
parent bc8d1fb127
commit f48ea5bbcc
18 changed files with 1389 additions and 1069 deletions
+7
View File
@@ -215,6 +215,7 @@ async def put_strategy_settings(
class RuntimeSettingsBody(BaseModel):
mode: Literal["SIM", "LIVE"] | None = None
confirm_live: bool | None = False
confirm_live_phrase: str | None = None
okx_api_key: str | None = None
okx_api_secret: str | None = None
okx_api_passphrase: str | None = None
@@ -272,6 +273,12 @@ async def put_runtime_settings(
status_code=400,
detail="切换到 LIVE 须二次确认(confirm_live=true",
)
phrase = (body.confirm_live_phrase or "").strip()
if phrase != "LIVE":
raise HTTPException(
status_code=400,
detail="切换到 LIVE 须在 confirm_live_phrase 传入 LIVE",
)
updates: dict[str, str] = {}
if body.okx_api_key is not None and body.okx_api_key.strip():