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

Function remove_trusted_ca

nodedb/src/control/cluster/tls.rs:249–259  ·  view source on GitHub ↗

Delete the overlap-CA file identified by `fp` from `tls_dir/ca.d/`. No-op (and returns `Ok(())`) when the file isn't present — applier behaviour must be idempotent across re-apply and snapshot replay.

(tls_dir: &Path, fp: &[u8; 32])

Source from the content-addressed store, hash-verified

247/// No-op (and returns `Ok(())`) when the file isn't present — applier
248/// behaviour must be idempotent across re-apply and snapshot replay.
249pub fn remove_trusted_ca(tls_dir: &Path, fp: &[u8; 32]) -> crate::Result<()> {
250 let dir = tls_dir.join(CA_TRUST_DIR);
251 let path = dir.join(format!("{}.crt", nodedb_cluster::ca_fingerprint_hex(fp)));
252 match fs::remove_file(&path) {
253 Ok(()) => Ok(()),
254 Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()),
255 Err(e) => Err(crate::Error::Config {
256 detail: format!("remove ca.d entry {}: {e}", path.display()),
257 }),
258 }
259}
260
261/// L.4 joiner-side helper: connect to `seed`'s bootstrap listener with
262/// `token`, receive `(ca_cert, node_cert, node_key, cluster_secret)`,

Callers 1

apply_ca_trust_changeFunction · 0.85

Calls 2

joinMethod · 0.80
kindMethod · 0.80

Tested by

no test coverage detected