pub struct CapabilitySet { /* private fields */ }Expand description
Set of capabilities currently granted to a connection. Deterministically
ordered (BTreeSet) so granted() returns a stable sequence — important for
wire-level reproducibility and test assertions.
SP-observability-completeness-v1 Axis C: carries optional per-capability
provenance alongside the granted set. The granted set is the result;
provenance records the source of each grant (operator allow-list vs a
UCAN chain link). Provenance is best-effort metadata for the audit sink —
it never affects gating (which reads contains / granted only).
Implementations§
Source§impl CapabilitySet
impl CapabilitySet
pub fn empty() -> Self
Sourcepub fn with_provenance<I>(granted: I, provenance: Vec<CapProvenance>) -> Selfwhere
I: IntoIterator<Item = String>,
pub fn with_provenance<I>(granted: I, provenance: Vec<CapProvenance>) -> Selfwhere
I: IntoIterator<Item = String>,
Construct a set from a granted iterable plus its provenance records.
Used at Hello time so the audit sink can attribute each capability.
pub fn contains(&self, cap: &str) -> bool
Sourcepub fn provenance(&self) -> &[CapProvenance]
pub fn provenance(&self) -> &[CapProvenance]
Per-capability source attribution (SP-observability-completeness-v1 Axis C). Empty when provenance wasn’t recorded. A capability granted by both the string allow-list and a UCAN chain appears twice (once per source) — that’s the honest record.
Trait Implementations§
Source§impl Clone for CapabilitySet
impl Clone for CapabilitySet
Source§fn clone(&self) -> CapabilitySet
fn clone(&self) -> CapabilitySet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more