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

Function mcp_config_from_proto

crates/openshell-policy/src/lib.rs:190–199  ·  view source on GitHub ↗
(max_body_bytes: u32, mcp: Option<&McpOptions>)

Source from the content-addressed store, hash-verified

188}
189
190fn 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)]

Callers 1

from_protoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected