MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / write_cluster_secret

Function write_cluster_secret

nodedb/src/control/cluster/tls.rs:370–377  ·  view source on GitHub ↗
(path: &Path, secret: &[u8; CLUSTER_SECRET_LEN])

Source from the content-addressed store, hash-verified

368}
369
370fn write_cluster_secret(path: &Path, secret: &[u8; CLUSTER_SECRET_LEN]) -> crate::Result<()> {
371 fs::write(path, secret).map_err(|e| crate::Error::Config {
372 detail: format!("write cluster secret {}: {e}", path.display()),
373 })?;
374 super::pem_io::set_private_key_perms(path).map_err(|e| crate::Error::Config {
375 detail: format!("chmod 0600 {}: {e}", path.display()),
376 })
377}
378
379fn read_single_cert(path: &Path) -> crate::Result<CertificateDer<'static>> {
380 let bytes = fs::read(path).map_err(|e| crate::Error::Config {

Callers 2

bootstrap_credentialsFunction · 0.85

Calls 2

set_private_key_permsFunction · 0.85
writeFunction · 0.50

Tested by

no test coverage detected