(
protocol: &str,
allow: L7Allow,
mcp_allow_all_known_mcp_methods: bool,
)
| 585 | } |
| 586 | |
| 587 | fn allow_proto_to_def( |
| 588 | protocol: &str, |
| 589 | allow: L7Allow, |
| 590 | mcp_allow_all_known_mcp_methods: bool, |
| 591 | ) -> L7AllowDef { |
| 592 | let params: BTreeMap<String, QueryMatcherDef> = allow |
| 593 | .params |
| 594 | .into_iter() |
| 595 | .map(|(key, matcher)| (key, matcher_proto_to_def(matcher))) |
| 596 | .collect(); |
| 597 | let (tool, params) = split_tool_param(protocol, params); |
| 598 | let params = flat_params_to_def(protocol, params); |
| 599 | let method = yaml_mcp_method( |
| 600 | protocol, |
| 601 | &allow.method, |
| 602 | tool.is_some(), |
| 603 | mcp_allow_all_known_mcp_methods, |
| 604 | ); |
| 605 | L7AllowDef { |
| 606 | method, |
| 607 | path: allow.path, |
| 608 | command: allow.command, |
| 609 | query: allow |
| 610 | .query |
| 611 | .into_iter() |
| 612 | .map(|(key, matcher)| (key, matcher_proto_to_def(matcher))) |
| 613 | .collect(), |
| 614 | operation_type: allow.operation_type, |
| 615 | operation_name: allow.operation_name, |
| 616 | fields: allow.fields, |
| 617 | tool, |
| 618 | params, |
| 619 | } |
| 620 | } |
| 621 | |
| 622 | fn deny_proto_to_def( |
| 623 | protocol: &str, |
no test coverage detected