pulseengine_mcp_security/
config.rs

1//! Security configuration
2
3use serde::{Deserialize, Serialize};
4
5/// Security configuration
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(default)]
8pub struct SecurityConfig {
9    /// Enable request validation
10    pub validate_requests: bool,
11    /// Enable rate limiting
12    pub rate_limiting: bool,
13    /// Maximum requests per minute
14    pub max_requests_per_minute: u32,
15    /// Enable CORS
16    pub cors_enabled: bool,
17    /// Allowed origins for CORS
18    pub cors_origins: Vec<String>,
19}
20
21impl Default for SecurityConfig {
22    fn default() -> Self {
23        Self {
24            validate_requests: true,
25            rate_limiting: true,
26            max_requests_per_minute: 60,
27            cors_enabled: false,
28            cors_origins: vec!["*".to_string()],
29        }
30    }
31}
32
33#[cfg(test)]
34#[path = "config_tests.rs"]
35mod config_tests;