#[non_exhaustive]pub struct WitnessQuorumPolicy {
pub trusted_witnesses: BTreeSet<String>,
pub pinned_documents: BTreeMap<String, Value>,
pub witness: WitnessPolicy,
pub enforcement: WitnessEnforcement,
}Expand description
Witness corroboration of the checkpoint carried in log_inclusion
(RFC-ACDP-0015 §8).
Cosignatures are read from the retrieval’s top-level
witness_signatures member (§6.1). Witness trust is deployment
policy, bootstrapped out of band (§13). Only the
trusted_witnesses can count toward the
quorum. Each witness’s DID document comes from one of two places:
pinned_documents, for a direct-from-witness deployment that already holds it (§6.2);- otherwise it is resolved:
did:webthrough the verification’sWebResolver(with its SSRF protections),did:keyoffline.
A witness whose document cannot be obtained does not count, and the
reason is recorded in WitnessQuorumReport::failures.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.trusted_witnesses: BTreeSet<String>Witness DIDs the consumer trusts.
pinned_documents: BTreeMap<String, Value>Witness DID documents held out of band, by witness DID. These take precedence over resolution.
witness: WitnessPolicyQuorum size, freshness bound and clock skew. Defaults to
WitnessPolicy::default: one witness, 300 s, 120 s.
enforcement: WitnessEnforcementWhether a shortfall fails verification. Default
WitnessEnforcement::Report.
Implementations§
Source§impl WitnessQuorumPolicy
impl WitnessQuorumPolicy
Sourcepub fn new<I, S>(witnesses: I) -> Self
pub fn new<I, S>(witnesses: I) -> Self
Trust witnesses, with the default quorum (one witness), report-only.
Sourcepub fn with_document(
self,
witness_id: impl Into<String>,
document: Value,
) -> Self
pub fn with_document( self, witness_id: impl Into<String>, document: Value, ) -> Self
Use document for witness_id instead of resolving it.
Sourcepub fn with_min_witnesses(self, n: u32) -> Self
pub fn with_min_witnesses(self, n: u32) -> Self
Require n distinct trusted witnesses.
Sourcepub fn with_witness_policy(self, witness: WitnessPolicy) -> Self
pub fn with_witness_policy(self, witness: WitnessPolicy) -> Self
Replace the quorum, freshness and skew settings.
Sourcepub fn enforce(self, enforcement: WitnessEnforcement) -> Self
pub fn enforce(self, enforcement: WitnessEnforcement) -> Self
Set when a shortfall fails verification.
Trait Implementations§
Source§impl Clone for WitnessQuorumPolicy
impl Clone for WitnessQuorumPolicy
Source§impl Debug for WitnessQuorumPolicy
impl Debug for WitnessQuorumPolicy
impl Eq for WitnessQuorumPolicy
Source§impl PartialEq for WitnessQuorumPolicy
impl PartialEq for WitnessQuorumPolicy
impl StructuralPartialEq for WitnessQuorumPolicy
Auto Trait Implementations§
impl Freeze for WitnessQuorumPolicy
impl RefUnwindSafe for WitnessQuorumPolicy
impl Send for WitnessQuorumPolicy
impl Sync for WitnessQuorumPolicy
impl Unpin for WitnessQuorumPolicy
impl UnsafeUnpin for WitnessQuorumPolicy
impl UnwindSafe for WitnessQuorumPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.