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

Method query_allowed_ips

crates/openshell-supervisor-network/src/opa.rs:557–562  ·  view source on GitHub ↗

Query `allowed_ips` from the matched endpoint config for a given request. Returns the list of CIDR/IP strings from the endpoint's `allowed_ips` field, or an empty vec if the field is absent or the endpoint has no match. This is used by the proxy to decide between full SSRF blocking and allowlist-based IP validation.

(&self, input: &NetworkInput)

Source from the content-addressed store, hash-verified

555 /// match. This is used by the proxy to decide between full SSRF blocking
556 /// and allowlist-based IP validation.
557 pub fn query_allowed_ips(&self, input: &NetworkInput) -> Result<Vec<String>> {
558 Ok(self
559 .query_endpoint_config(input)?
560 .map(|val| get_str_array(&val, "allowed_ips"))
561 .unwrap_or_default())
562 }
563
564 /// Return true when the matched endpoint is an exact declared hostname.
565 ///

Calls 2

get_str_arrayFunction · 0.85
query_endpoint_configMethod · 0.80