(
protocol: &str,
deny: &L7DenyRule,
mcp_allow_all_known_mcp_methods: bool,
)
| 620 | } |
| 621 | |
| 622 | fn deny_proto_to_def( |
| 623 | protocol: &str, |
| 624 | deny: &L7DenyRule, |
| 625 | mcp_allow_all_known_mcp_methods: bool, |
| 626 | ) -> L7DenyRuleDef { |
| 627 | let params: BTreeMap<String, QueryMatcherDef> = deny |
| 628 | .params |
| 629 | .iter() |
| 630 | .map(|(key, matcher)| (key.clone(), matcher_proto_to_def(matcher.clone()))) |
| 631 | .collect(); |
| 632 | let (tool, params) = split_tool_param(protocol, params); |
| 633 | let params = flat_params_to_def(protocol, params); |
| 634 | let method = yaml_mcp_method( |
| 635 | protocol, |
| 636 | &deny.method, |
| 637 | tool.is_some(), |
| 638 | mcp_allow_all_known_mcp_methods, |
| 639 | ); |
| 640 | L7DenyRuleDef { |
| 641 | method, |
| 642 | path: deny.path.clone(), |
| 643 | command: deny.command.clone(), |
| 644 | query: deny |
| 645 | .query |
| 646 | .iter() |
| 647 | .map(|(key, matcher)| (key.clone(), matcher_proto_to_def(matcher.clone()))) |
| 648 | .collect(), |
| 649 | operation_type: deny.operation_type.clone(), |
| 650 | operation_name: deny.operation_name.clone(), |
| 651 | fields: deny.fields.clone(), |
| 652 | tool, |
| 653 | params, |
| 654 | } |
| 655 | } |
| 656 | |
| 657 | fn yaml_mcp_method( |
| 658 | protocol: &str, |
no test coverage detected