Skip to content

Commit 0086e23

Browse files
Pigbibiclaude
andcommitted
fix: final audit — remove current mode remnants, tighten CSP
Security: - Remove style-src 'unsafe-inline' (CSS now external via /app.css) - Cookie: HttpOnly, Secure, SameSite=Lax confirmed - Admin endpoints require session.admin check Consistency: - Remove 'current' from CASH_ONLY_EXECUTION_MODES (worker.js) - Remove 'current' from OPTION_OVERLAY_MODES (worker.js) - Update all ||current fallbacks to ||enabled - Worker and frontend mode lists now match Architecture: - Single config source: platform-config.json - Config injection: inject_platform_config.py - CSS: external /app.css with cache headers - All 6 platforms: 0 read failures Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 525736d commit 0086e23

4 files changed

Lines changed: 12 additions & 292 deletions

File tree

web/strategy-switch-console/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,7 @@
13251325
<!-- Generated by inject_platform_config.py -->
13261326
<!-- Generated by inject_platform_config.py -->
13271327
<!-- Generated by inject_platform_config.py -->
1328+
<!-- Generated by inject_platform_config.py -->
13281329
<script id="platform-config">
13291330
window.__PLATFORM_CONFIG__ = {"longbridge": {"dry_run_only": false, "margin_policy": true, "reserved_cash": true, "income_layer": true, "option_overlay": true, "dca": true, "execution_mode": "live", "service_name": "", "default_execution_mode": "live"}, "ibkr": {"dry_run_only": false, "margin_policy": true, "reserved_cash": true, "income_layer": true, "option_overlay": true, "dca": false, "execution_mode": "live", "service_name": "", "default_execution_mode": "live"}, "schwab": {"dry_run_only": false, "margin_policy": true, "reserved_cash": true, "income_layer": true, "option_overlay": true, "dca": true, "execution_mode": "live", "service_name": "charles-schwab-quant-service", "default_execution_mode": "live"}, "firstrade": {"dry_run_only": false, "margin_policy": true, "reserved_cash": true, "income_layer": true, "option_overlay": true, "dca": true, "execution_mode": "live", "service_name": "firstrade-quant-service", "default_execution_mode": "live"}, "qmt": {"dry_run_only": true, "margin_policy": false, "reserved_cash": false, "income_layer": false, "option_overlay": false, "dca": false, "execution_mode": "paper", "service_name": "qmt-quant-service", "default_execution_mode": "paper"}, "binance": {"dry_run_only": false, "margin_policy": false, "reserved_cash": false, "income_layer": false, "option_overlay": false, "dca": true, "execution_mode": "live", "service_name": "", "default_execution_mode": "live"}};
13301331
window.__DEFAULT_ACCOUNT_OPTIONS__ = {"longbridge": [{"key": "preview", "label": "LongBridge", "target_name": "preview", "supported_domains": ["us_equity", "hk_equity"], "cash_currency": "USD", "default_strategy_profile": "tqqq_growth_income", "default_execution_mode": "live", "reserved_cash_ratio": "0.03", "service_name": ""}], "ibkr": [{"key": "preview", "label": "IBKR", "target_name": "preview", "supported_domains": ["us_equity", "hk_equity"], "cash_currency": "USD", "default_strategy_profile": "soxl_soxx_trend_income", "default_execution_mode": "live", "reserved_cash_ratio": "0.03", "service_name": ""}], "schwab": [{"key": "preview", "label": "Schwab", "target_name": "preview", "supported_domains": ["us_equity"], "cash_currency": "USD", "default_strategy_profile": "soxl_soxx_trend_income", "default_execution_mode": "live", "min_reserved_cash_usd": "150", "reserved_cash_ratio": "0.03", "service_name": "charles-schwab-quant-service"}], "firstrade": [{"key": "preview", "label": "Firstrade", "target_name": "preview", "supported_domains": ["us_equity"], "cash_currency": "USD", "default_strategy_profile": "ibit_smart_dca", "default_execution_mode": "live", "reserved_cash_ratio": "0.03", "service_name": "firstrade-quant-service"}], "qmt": [{"key": "default", "label": "QMT", "target_name": "default", "supported_domains": ["cn_equity"], "cash_currency": "CNY", "default_strategy_profile": "cn_industry_etf_rotation", "service_name": "qmt-quant-service", "default_execution_mode": "paper"}], "binance": [{"key": "default", "label": "Binance", "target_name": "default", "supported_domains": ["crypto"], "cash_currency": "USD", "default_strategy_profile": "crypto_live_pool_rotation", "service_name": "", "default_execution_mode": "live"}]};

web/strategy-switch-console/page_asset.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/strategy-switch-console/strategy_profiles_asset.js

Lines changed: 2 additions & 283 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)