pub struct StorageVerifyClient { /* private fields */ }Expand description
The storage-verification + custody-receipt client over an authorized VerifyTransport.
Implementations§
Source§impl StorageVerifyClient
impl StorageVerifyClient
Sourcepub fn new(transport: VerifyTransport) -> Self
pub fn new(transport: VerifyTransport) -> Self
Build a client over an authorized transport.
Sourcepub async fn verify(
&self,
assets: &[AssetQuery],
deep: bool,
) -> Result<Vec<StorageVerdict>, VerifyError>
pub async fn verify( &self, assets: &[AssetQuery], deep: bool, ) -> Result<Vec<StorageVerdict>, VerifyError>
POST /storage/verify: confirm each asset’s declared blobs are stored, indexed, and
retrievable. deep opt-in re-hashes bytes (server-priced) — leave false on the hot
verify-before-destroy path.
Sourcepub async fn verify_signed(
&self,
assets: &[AssetQuery],
deep: bool,
nonce: &AttestationNonce,
pinned_keys: &[HybridVerifyingKey],
) -> Result<VerifiedAttestation, VerifyError>
pub async fn verify_signed( &self, assets: &[AssetQuery], deep: bool, nonce: &AttestationNonce, pinned_keys: &[HybridVerifyingKey], ) -> Result<VerifiedAttestation, VerifyError>
POST /storage/verify for the signed verdict, bound to nonce, verified under
pinned_keys (the published attestation-key history).
Returns the attestation only when its signature verifies, it carries nonce, and its
verdicts answer exactly assets — the same assets and declared hashes, in order. Anything
else is VerifyError::Attestation; a response with no attestation at all is
VerifyError::Malformed. The server prices a signed request like deep, so a spent
budget is VerifyError::Status with 429 and error.storage.deep_rate_limited.
nonce must be fresh per request — ReleaseCoordinator::fetch_verified_attestation
draws one — or a replayed answer to an earlier request would verify.
Sourcepub async fn fetch_receipt(
&self,
upload_id: Uuid,
) -> Result<CustodyReceipt, VerifyError>
pub async fn fetch_receipt( &self, upload_id: Uuid, ) -> Result<CustodyReceipt, VerifyError>
GET /upload/{id}/receipt: the session-window custody-receipt fetch (pairs with lost-ACK
recovery). Returns the decoded, signed receipt — verify it with
capsule_library::library::verify_receipt before trusting it.
The server serves the receipt as application/cbor: the body is the signed canonical
encoding, so it is decoded from the bytes as they arrived and never round-trips through
a JSON or base64 projection that could hand the verifier bytes the signature does not
cover.
Sourcepub async fn fetch_asset_receipts(
&self,
asset_id: Uuid,
) -> Result<Vec<CustodyReceipt>, VerifyError>
pub async fn fetch_asset_receipts( &self, asset_id: Uuid, ) -> Result<Vec<CustodyReceipt>, VerifyError>
GET /assets/{asset_id}/receipts: the durable, permanent receipt log for an asset, in
chain order. Each is signed — verify before trusting.
Sourcepub async fn fetch_attestation_keys(
&self,
) -> Result<Vec<HybridVerifyingKey>, VerifyError>
pub async fn fetch_attestation_keys( &self, ) -> Result<Vec<HybridVerifyingKey>, VerifyError>
Fetch the server’s published attestation-key history from
GET {origin}/.well-known/capsule/attestation-keys. This only fetches: the caller checks
the result against the history it pinned for the server before trusting it
(capsule_library::library::pin_attestation_keys — TOFU on first contact, append-only
after). Every published key is returned so a receipt’s server_key_id resolves against the whole
history — a pre-rotation receipt still verifies.
The record lives at the origin (RFC 8615), not under the API root the other methods
use: the transport’s base_url path (/v1) is replaced, not extended. A base that does
not parse as a URL is a VerifyError::Transport raised before any request is sent.
Trait Implementations§
Source§impl Clone for StorageVerifyClient
impl Clone for StorageVerifyClient
Source§fn clone(&self) -> StorageVerifyClient
fn clone(&self) -> StorageVerifyClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for StorageVerifyClient
impl !UnwindSafe for StorageVerifyClient
impl Freeze for StorageVerifyClient
impl Send for StorageVerifyClient
impl Sync for StorageVerifyClient
impl Unpin for StorageVerifyClient
impl UnsafeUnpin for StorageVerifyClient
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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