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

Function ensure_method_path_endpoint

crates/openshell-policy/src/merge.rs:681–700  ·  view source on GitHub ↗
(
    endpoint: &NetworkEndpoint,
    host: &str,
    port: u32,
)

Source from the content-addressed store, hash-verified

679}
680
681fn ensure_method_path_endpoint(
682 endpoint: &NetworkEndpoint,
683 host: &str,
684 port: u32,
685) -> Result<(), PolicyMergeError> {
686 if endpoint.protocol.is_empty() {
687 return Err(PolicyMergeError::EndpointHasNoL7Inspection {
688 host: host.to_string(),
689 port,
690 });
691 }
692 if !matches!(endpoint.protocol.as_str(), "rest" | "websocket") {
693 return Err(PolicyMergeError::UnsupportedEndpointProtocol {
694 host: host.to_string(),
695 port,
696 protocol: endpoint.protocol.clone(),
697 });
698 }
699 Ok(())
700}
701
702fn expand_existing_access(
703 endpoint: &mut NetworkEndpoint,

Callers 1

apply_operationFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected