Skip to main content

Module trust

Module trust 

Source
Expand description

Trust: what a verified advertisement is allowed to mean. Verification (the signature proves the key) happens in the protocol; trust (this key is one of ours) is decided here, by policy — and by default the policy is that an unknown key is observed, recorded, visible in every listing, and trusted for nothing.

Discovery creates awareness, not authority: even a Trusted node gains no execution rights anywhere in this codebase. Trust gates which nodes surfaces mark as ours and which endpoints later negotiation may approach — nothing else.

use majordomus_cli::mesh::trust::{evaluate, TrustPolicy, TrustState};

// the default: a valid unknown key is observed and trusted for nothing
assert_eq!(evaluate(&TrustPolicy::DenyUnknown, &[], "aa", None, None), TrustState::Observed);
// an allowlisted key is trusted under every policy
let listed = evaluate(&TrustPolicy::DenyUnknown, &["aa".into()], "aa", None, None);
assert!(listed.is_trusted());

Enums§

TrustPolicy
The policy, from the mesh declaration.
TrustState
What the policy decided about one node.

Functions§

evaluate
Evaluate the policy for a node’s key against what the registry already knows.