(
protocol: &str,
method: &str,
has_tool: bool,
mcp_allow_all_known_mcp_methods: bool,
)
| 655 | } |
| 656 | |
| 657 | fn yaml_mcp_method( |
| 658 | protocol: &str, |
| 659 | method: &str, |
| 660 | has_tool: bool, |
| 661 | mcp_allow_all_known_mcp_methods: bool, |
| 662 | ) -> String { |
| 663 | if is_mcp_protocol(protocol) { |
| 664 | if !has_tool && method == "*" { |
| 665 | return String::new(); |
| 666 | } |
| 667 | if has_tool && method == "tools/call" && mcp_allow_all_known_mcp_methods { |
| 668 | return String::new(); |
| 669 | } |
| 670 | } |
| 671 | method.to_string() |
| 672 | } |
| 673 | |
| 674 | fn to_proto(raw: PolicyFile) -> SandboxPolicy { |
| 675 | let network_policies = raw |
no test coverage detected