MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / deny_def_to_proto

Function deny_def_to_proto

crates/openshell-policy/src/lib.rs:520–539  ·  view source on GitHub ↗
(_protocol: &str, deny: L7DenyRuleDef)

Source from the content-addressed store, hash-verified

518}
519
520fn deny_def_to_proto(_protocol: &str, deny: L7DenyRuleDef) -> L7DenyRule {
521 let params = flatten_param_matchers(params_with_tool(deny.params, deny.tool));
522 L7DenyRule {
523 method: deny.method,
524 path: deny.path,
525 command: deny.command,
526 operation_type: deny.operation_type,
527 operation_name: deny.operation_name,
528 fields: deny.fields,
529 query: deny
530 .query
531 .into_iter()
532 .map(|(key, matcher)| (key, matcher_def_to_proto(matcher)))
533 .collect(),
534 params: params
535 .into_iter()
536 .map(|(key, matcher)| (key, matcher_def_to_proto(matcher)))
537 .collect(),
538 }
539}
540
541fn json_rpc_max_body_bytes(json_rpc: &Option<JsonRpcConfigDef>, mcp: &Option<McpConfigDef>) -> u32 {
542 // The proto has one JSON-RPC-family body limit. Prefer the MCP stanza when

Callers 1

to_protoFunction · 0.85

Calls 3

flatten_param_matchersFunction · 0.85
params_with_toolFunction · 0.85
matcher_def_to_protoFunction · 0.85

Tested by

no test coverage detected