pub struct CapabilityClaim {
pub node_id: String,
pub capabilities: Vec<String>,
pub issued_at: u64,
pub expires_at: Option<u64>,
}Expand description
Unsigned capability claim body.
Fields§
§node_id: StringAdvertising node id (DID / mesh node id string).
capabilities: Vec<String>Allow-listed capability tokens (sorted for stable signing).
issued_at: u64Unix epoch seconds when the claim was issued.
expires_at: Option<u64>Optional expiry (unix epoch seconds). None = no expiry checked here.
Implementations§
Source§impl CapabilityClaim
impl CapabilityClaim
Sourcepub fn new(
node_id: impl Into<String>,
capabilities: Vec<String>,
issued_at: u64,
) -> Result<Self, CapabilityClaimError>
pub fn new( node_id: impl Into<String>, capabilities: Vec<String>, issued_at: u64, ) -> Result<Self, CapabilityClaimError>
Build a claim after validating the allow-list and sorting tokens.
Sourcepub fn signing_bytes(&self) -> Result<Vec<u8>, CapabilityClaimError>
pub fn signing_bytes(&self) -> Result<Vec<u8>, CapabilityClaimError>
Canonical bytes signed / verified (stable JSON, sorted keys via serde field order on this struct).
Trait Implementations§
Source§impl Clone for CapabilityClaim
impl Clone for CapabilityClaim
Source§impl Debug for CapabilityClaim
impl Debug for CapabilityClaim
Source§impl<'de> Deserialize<'de> for CapabilityClaim
impl<'de> Deserialize<'de> for CapabilityClaim
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CapabilityClaim
Source§impl PartialEq for CapabilityClaim
impl PartialEq for CapabilityClaim
Source§impl Serialize for CapabilityClaim
impl Serialize for CapabilityClaim
impl StructuralPartialEq for CapabilityClaim
Auto Trait Implementations§
impl Freeze for CapabilityClaim
impl RefUnwindSafe for CapabilityClaim
impl Send for CapabilityClaim
impl Sync for CapabilityClaim
impl Unpin for CapabilityClaim
impl UnsafeUnpin for CapabilityClaim
impl UnwindSafe for CapabilityClaim
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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§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
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more