| 188 | } |
| 189 | |
| 190 | fn mcp_config_from_proto(max_body_bytes: u32, mcp: Option<&McpOptions>) -> Option<McpConfigDef> { |
| 191 | let strict_tool_names = mcp.and_then(|config| config.strict_tool_names); |
| 192 | let allow_all_known_mcp_methods = mcp.and_then(|config| config.allow_all_known_mcp_methods); |
| 193 | (max_body_bytes > 0 || strict_tool_names.is_some() || allow_all_known_mcp_methods.is_some()) |
| 194 | .then_some(McpConfigDef { |
| 195 | max_body_bytes, |
| 196 | strict_tool_names, |
| 197 | allow_all_known_mcp_methods, |
| 198 | }) |
| 199 | } |
| 200 | |
| 201 | /// Nested L7 config stanzas accepted by the YAML policy schema. |
| 202 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |