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

Function parse_tls_mode

crates/openshell-supervisor-network/src/l7/mod.rs:300–306  ·  view source on GitHub ↗

Parse the `tls` field from an endpoint config, independent of L7 protocol. Used to check for `tls: skip` even on L4-only endpoints (no `protocol` field) that explicitly opt out of TLS auto-detection.

(val: &regorus::Value)

Source from the content-addressed store, hash-verified

298/// Used to check for `tls: skip` even on L4-only endpoints (no `protocol`
299/// field) that explicitly opt out of TLS auto-detection.
300pub fn parse_tls_mode(val: &regorus::Value) -> TlsMode {
301 match get_object_str(val, "tls").as_deref() {
302 Some("skip") => TlsMode::Skip,
303 // "terminate" and "passthrough" are deprecated aliases (logged by parse_l7_config); fall through to Auto.
304 _ => TlsMode::Auto,
305 }
306}
307
308/// Extract a bool value from a regorus object. Returns `None` when the key
309/// is absent or not a boolean.

Callers 1

query_tls_modeFunction · 0.85

Calls 1

get_object_strFunction · 0.85

Tested by

no test coverage detected