//! API Gateway for Foxhunt HFT Trading System //! //! Provides zero-copy gRPC proxying with: //! - RBAC authorization with sub-100ns cached permission checks //! - <10μs routing overhead //! - Connection pooling //! - Circuit breaker pattern //! - Health checking //! - Performance monitoring //! - Token bucket rate limiting with <50ns cache hits // Include generated protobuf code FIRST (needed by other modules) pub mod foxhunt { pub mod tli { tonic::include_proto!("foxhunt.tli"); } pub mod config_proto { tonic::include_proto!("foxhunt.config"); } } pub mod ml_training { tonic::include_proto!("ml_training"); } // Trading Agent Service proto (for proxy) pub mod trading_agent { tonic::include_proto!("trading_agent"); } // Trading Service backend proto (for protocol translation) pub mod trading_backend { tonic::include_proto!("trading"); } // Risk Service backend proto pub mod risk { tonic::include_proto!("risk"); } // Monitoring Service backend proto pub mod monitoring { tonic::include_proto!("monitoring"); } // Config Service backend proto pub mod config_backend { tonic::include_proto!("config"); } // Error module MUST come before modules that use it pub mod error; // Now other modules can use error types and proto definitions pub mod auth; pub mod config; pub mod grpc; pub mod handlers; pub mod health_router; pub mod metrics; pub mod routing; // Re-export error types pub use error::{ConfigError, ConfigResult}; // Re-export configuration management types pub use config::{ AuthzMetrics, AuthzService, ConfigItem, ConfigValidator, ConfigurationManager, ConfigurationServiceImpl, PermissionResult, }; // Re-export routing and rate limiting types pub use routing::{CacheStats, RateLimitConfig, RateLimiter}; // Re-export gRPC proxy types pub use grpc::{ setup_ml_training_client, setup_ml_training_proxy, setup_trading_agent_client, setup_trading_agent_proxy, BacktestingServiceProxy, HealthChecker, MlTradingProxy, MlTrainingBackendConfig, MlTrainingProxy, TradingAgentBackendConfig, TradingAgentProxy, TradingServiceProxy, }; // Re-export health router types pub use health_router::{health_router, HealthState}; // Re-export REST API handlers pub use handlers::{ jwt_auth_middleware, ml_router, AuthMiddlewareState, BatchPredictRequest, BatchPredictResponse, HotSwapRequest, HotSwapResponse, MlHandlerState, ModelStatusResponse, PredictRequest, PredictResponse, };