pub struct DelegationLink {
pub capability_id: String,
pub delegator: PublicKey,
pub delegatee: PublicKey,
pub attenuations: Vec<Attenuation>,
pub timestamp: u64,
pub scope_hash: Option<String>,
pub aggregate_budget: Option<AggregateBudgetDelegationMarker>,
pub cumulative_approval: Option<CumulativeApprovalDelegationMarker>,
pub signature: Signature,
}Expand description
A link in the delegation chain, recording that delegator granted a
narrowed capability to delegatee.
Delegation chain-binding: scope_hash records the hash of the canonical scope
that the delegator authorized at this step. When set, it ties the
delegation chain to the underlying capability lineage so a verifier
can check proof.parent_scope_hash == chain.last().scope_hash and
reject inflated parent-scope claims (the parent-scope-inflation
soundness bug).
Links omit scope_hash; verifiers must reject attenuated tokens
whose chain links lack this field via
validate_delegation_chain_with_trust_root.
Fields§
§capability_id: StringCapability ID of the ancestor token delegated at this step.
delegator: PublicKeyPublic key of the agent that delegated.
delegatee: PublicKeyPublic key of the agent that received the delegation.
attenuations: Vec<Attenuation>How the scope was narrowed in this delegation step.
timestamp: u64Unix timestamp of the delegation.
scope_hash: Option<String>Delegation chain-binding: SHA-256 hash of the canonical scope authorized
at this hop. Absent on older links; verifiers can enforce presence via
feature gate. Verifiers gated behind the delegation_chain_binding
feature flag enforce that this matches the parent_scope_hash carried by
the next hop.
aggregate_budget: Option<AggregateBudgetDelegationMarker>Authenticated preservation marker for a delegation-family invocation budget.
cumulative_approval: Option<CumulativeApprovalDelegationMarker>Authenticated preservation marker for cumulative approval root bindings.
signature: SignatureEd25519 signature by the delegator over the canonical form of the other fields in this link.
Implementations§
Source§impl DelegationLink
impl DelegationLink
Sourcepub fn sign(
body: DelegationLinkBody,
keypair: &Keypair,
) -> Result<DelegationLink, Error>
pub fn sign( body: DelegationLinkBody, keypair: &Keypair, ) -> Result<DelegationLink, Error>
Sign a delegation link body.
Sourcepub fn body(&self) -> DelegationLinkBody
pub fn body(&self) -> DelegationLinkBody
Extract the signable body.
Sourcepub fn verify_signature(&self) -> Result<bool, Error>
pub fn verify_signature(&self) -> Result<bool, Error>
Verify this link’s signature against the delegator’s key.
Trait Implementations§
Source§impl Clone for DelegationLink
impl Clone for DelegationLink
Source§fn clone(&self) -> DelegationLink
fn clone(&self) -> DelegationLink
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more