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

Function validate_cli_mtls_bundle_dir

crates/openshell-bootstrap/src/mtls.rs:92–103  ·  view source on GitHub ↗
(dir: &std::path::Path)

Source from the content-addressed store, hash-verified

90}
91
92fn validate_cli_mtls_bundle_dir(dir: &std::path::Path) -> Result<()> {
93 for name in ["ca.crt", "tls.crt", "tls.key"] {
94 let path = dir.join(name);
95 let metadata = std::fs::metadata(&path)
96 .into_diagnostic()
97 .map_err(|e| e.wrap_err(format!("failed to read {}", path.display())))?;
98 if metadata.len() == 0 {
99 return Err(miette::miette!("{} is empty", path.display()));
100 }
101 }
102 Ok(())
103}
104
105#[cfg(test)]
106mod tests {

Callers 1

store_pki_bundleFunction · 0.85

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected