pub struct ContextPolicy {
pub trusted_verifiers: Option<BTreeSet<String>>,
pub presentable_types: Option<BTreeSet<String>>,
pub signable_keys: Option<BTreeSet<String>>,
pub export_allowed: bool,
pub quotas: Option<Quotas>,
}Expand description
Per-context policy. See the module docs for the resolution model.
Fields§
§trusted_verifiers: Option<BTreeSet<String>>Verifier DIDs an actor in this context may present to. None = any.
presentable_types: Option<BTreeSet<String>>Credential types an actor may present. None = any.
signable_keys: Option<BTreeSet<String>>Key ids the signing oracle may be invoked on. None = any.
export_allowed: boolWhether sealed-transfer export is permitted. Defaults to true
(unrestricted) when absent from the wire.
quotas: Option<Quotas>Per-operation-class daily ceilings. None = no quota.
Implementations§
Source§impl ContextPolicy
impl ContextPolicy
Sourcepub fn unrestricted() -> Self
pub fn unrestricted() -> Self
A policy that imposes no constraints — the implicit policy of any context
without one, and the identity element for intersect.
Sourcepub fn intersect(&self, child: &ContextPolicy) -> ContextPolicy
pub fn intersect(&self, child: &ContextPolicy) -> ContextPolicy
Field-wise intersection of self (ancestor) with child. The result is
at least as strict as both inputs; allow-list fields become the set
intersection, export_allowed the logical AND, quotas the per-class
minimum.
Sourcepub fn resolve<'a, I>(chain: I) -> ContextPolicywhere
I: IntoIterator<Item = &'a ContextPolicy>,
pub fn resolve<'a, I>(chain: I) -> ContextPolicywhere
I: IntoIterator<Item = &'a ContextPolicy>,
Resolve the effective policy for a context from its ancestor chain,
ordered root→leaf. An empty chain resolves to
unrestricted.
Sourcepub fn allows_verifier(&self, verifier_did: &str) -> bool
pub fn allows_verifier(&self, verifier_did: &str) -> bool
Whether a credential may be presented to verifier_did.
Sourcepub fn allows_presentable_type(&self, credential_type: &str) -> bool
pub fn allows_presentable_type(&self, credential_type: &str) -> bool
Whether a credential of credential_type may be presented.
Sourcepub fn allows_signing_key(&self, key_id: &str) -> bool
pub fn allows_signing_key(&self, key_id: &str) -> bool
Whether the signing oracle may be invoked on key_id.
Sourcepub fn allows_export(&self) -> bool
pub fn allows_export(&self) -> bool
Whether sealed-transfer export is permitted.
Trait Implementations§
Source§impl Clone for ContextPolicy
impl Clone for ContextPolicy
Source§fn clone(&self) -> ContextPolicy
fn clone(&self) -> ContextPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more