Struct noosphere_core::api::headers::Ucan
source · pub struct Ucan(/* private fields */);Expand description
A typed header for the ucan header, a tuple of Cid and Jwt,
adhering to the UCAN as Bearer Token
specification.
TODO(#708): Note that in the 0.3.0 spec, a single ucans header is used.
This implementation is based on an earlier version with multiple ucan
headers.
The values are not validated during parsing beyond legitimate looking Cids and Jwts here. Use Ucan::as_proof_chain to validate and construct a ProofChain.
Implementations§
source§impl Ucan
impl Ucan
sourcepub async fn as_proof_chain(
&self,
bearer: &Bearer,
db: impl UcanJwtStore
) -> Result<ProofChain>
pub async fn as_proof_chain( &self, bearer: &Bearer, db: impl UcanJwtStore ) -> Result<ProofChain>
Construct a ProofChain from the collected ucan header
values, validating the cryptographic integrity and time bounds
of the UCANs. Capabilities can then be assessed using the ProofChain.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Ucan
impl Send for Ucan
impl Sync for Ucan
impl Unpin for Ucan
impl UnwindSafe for Ucan
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