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

Method with_default_paths

crates/openshell-cli/src/tls.rs:79–101  ·  view source on GitHub ↗
(&self, server: &str)

Source from the content-addressed store, hash-verified

77
78 #[must_use]
79 pub fn with_default_paths(&self, server: &str) -> Self {
80 let base = self
81 .gateway_name
82 .as_deref()
83 .and_then(tls_dir_for_gateway)
84 .or_else(|| default_tls_dir(server));
85 Self {
86 ca: self
87 .ca
88 .clone()
89 .or_else(|| base.as_ref().map(|dir| dir.join("ca.crt"))),
90 cert: self
91 .cert
92 .clone()
93 .or_else(|| base.as_ref().map(|dir| dir.join("tls.crt"))),
94 key: self
95 .key
96 .clone()
97 .or_else(|| base.as_ref().map(|dir| dir.join("tls.key"))),
98 gateway_name: self.gateway_name.clone(),
99 ..self.clone()
100 }
101 }
102
103 /// Returns `true` when using bearer token auth.
104 pub fn is_bearer_auth(&self) -> bool {

Callers 2

require_tls_materialsFunction · 0.80
build_channelFunction · 0.80

Calls 1

default_tls_dirFunction · 0.85

Tested by

no test coverage detected