Skip to main content

Module node_facts_advert

Module node_facts_advert 

Source
Expand description

Signed node facts, beside capability_claim (card mesh-placement-03). Signed node facts (ADR-099 section 2, card mesh-placement-03).

The companion of crate::capability_claim::SignedCapabilityAdvertisement: the coarse allow-listed tokens stay there, and the open-vocabulary NodeFacts block is signed here with the same node Ed25519 key.

The envelope carries the exact JSON bytes that were signed (payload), so verification never depends on re-serialising floats or maps. The signature covers a domain tag plus the payload, so facts, deltas and capability claims can never be replayed as one another.

Verification checks, in order: key and signature sizes, payload bound, the signature, the payload’s structure, that node_id is the id derived from the signing key (so a node cannot speak for another), and the time window (not expired, not issued in the future beyond MAX_CLOCK_SKEW_SECS).

Structs§

SignedFactsDelta
A signed FactsDelta (busy/free update).
SignedNodeFacts
A signed NodeFacts block as exchanged on the mesh.

Enums§

NodeFactsAdvertError
Why a signed facts block or delta was refused.

Constants§

DELTA_DOMAIN
Domain tag signed before a delta payload.
FACTS_DOMAIN
Domain tag signed before a facts payload.
MAX_CLOCK_SKEW_SECS
Tolerated clock skew for issued_at, in seconds.
MAX_PAYLOAD_BYTES
Largest signed payload accepted, in bytes.

Functions§

sign_facts_delta
Sign a delta with the node key.
sign_node_facts
Sign facts with the node key. The facts must validate and their node_id must be the id derived from key.
verify_facts_delta
Verify a signed delta and return it with the signer’s key. Whether it fits the cached base is checked by the cache (NodeFacts::apply_delta).
verify_node_facts
Verify a signed facts block at time now (unix seconds) and return the facts. Tampered, foreign-keyed, expired or future-dated facts are refused.