trading/services/api_gateway/config.py
Viktor Barzin 2a56727267
fix: resolve 8 critical issues from code review
C1: Fix BacktestDataLoader constructor args (was passing wrong kwargs)
C2: Fix BacktestResult attribute names (max_drawdown_pct, avg_hold_duration)
C3: Remove insecure JWT secret default (now required via env var)
C4: Fix .env.example to use TRADING_ prefix for all config vars
C5: Add missing fields to portfolio endpoint (daily_pnl_pct, total_pnl, trading_active)
C6: Add missing /portfolio/metrics endpoint
C7: Add 'value' field to equity curve response for frontend compatibility
C8: Add 6M/ALL periods and case-insensitive period enum parsing
Also: make app creation lazy to avoid config validation at import time
2026-02-22 17:48:40 +00:00

25 lines
774 B
Python

"""API Gateway configuration — extends shared BaseConfig with JWT, CORS, and WebAuthn settings."""
from shared.config import BaseConfig
class ApiGatewayConfig(BaseConfig):
"""Configuration for the API Gateway service.
All settings can be overridden via environment variables
prefixed with ``TRADING_``.
"""
# JWT settings — TRADING_JWT_SECRET_KEY must be set in environment
jwt_secret_key: str
jwt_algorithm: str = "HS256"
access_token_expire_minutes: int = 15
refresh_token_expire_days: int = 7
# CORS settings
cors_origins: list[str] = ["http://localhost:5173"]
# WebAuthn (passkey) relying party settings
rp_id: str = "localhost"
rp_name: str = "Trading Bot"
rp_origin: str = "http://localhost:5173"