pub struct DelegationLink {
pub capability_id: String,
pub delegator: PublicKey,
pub delegatee: PublicKey,
pub attenuations: Vec<Attenuation>,
pub timestamp: u64,
pub signature: Signature,
}Expand description
A link in the delegation chain, recording that delegator granted a
narrowed capability to delegatee.
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.
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DelegationLink
impl Debug for DelegationLink
Source§impl<'de> Deserialize<'de> for DelegationLink
impl<'de> Deserialize<'de> for DelegationLink
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DelegationLink, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DelegationLink, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for DelegationLink
impl Serialize for DelegationLink
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for DelegationLink
impl RefUnwindSafe for DelegationLink
impl Send for DelegationLink
impl Sync for DelegationLink
impl Unpin for DelegationLink
impl UnsafeUnpin for DelegationLink
impl UnwindSafe for DelegationLink
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
Mutably borrows from an owned value. Read more