pub struct ReleaseCoordinator<C: ReleaseClock = SystemClock> { /* private fields */ }Expand description
Composes durability, accountability, and crypto validity into a single release decision, and enforces the 60-second re-verify window. One coordinator serves one asset’s release attempts; it caches the last verdict so a re-attempt inside the window skips a redundant round-trip.
Implementations§
Source§impl ReleaseCoordinator<SystemClock>
impl ReleaseCoordinator<SystemClock>
Sourcepub fn new(
client: StorageVerifyClient,
attestation_keys: Vec<HybridVerifyingKey>,
) -> Self
pub fn new( client: StorageVerifyClient, attestation_keys: Vec<HybridVerifyingKey>, ) -> Self
Build a coordinator over the wall clock with the default 60 s window.
Source§impl<C: ReleaseClock> ReleaseCoordinator<C>
impl<C: ReleaseClock> ReleaseCoordinator<C>
Sourcepub fn with_clock(
client: StorageVerifyClient,
attestation_keys: Vec<HybridVerifyingKey>,
window_secs: i64,
clock: C,
) -> Self
pub fn with_clock( client: StorageVerifyClient, attestation_keys: Vec<HybridVerifyingKey>, window_secs: i64, clock: C, ) -> Self
Build a coordinator with an explicit window and clock (tests advance the clock to drive the re-verify window deterministically).
Sourcepub async fn evaluate(&self, request: &ReleaseRequest) -> ReleaseDecision
pub async fn evaluate(&self, request: &ReleaseRequest) -> ReleaseDecision
Evaluate the full verify-before-destroy gate for one write. Returns
ReleaseDecision::Release only when the verdict is durable within the window, the
custody receipt verifies under a pinned attestation key with matching fields, and
verify_asset accepted the asset. Every other outcome is a Retain that names why — the
caller keeps the local copy and retries.
Sourcepub async fn fetch_verified_receipt(
&self,
upload_id: Uuid,
expectations: &ReceiptExpectations,
) -> Result<CustodyReceipt, VerifyError>
pub async fn fetch_verified_receipt( &self, upload_id: Uuid, expectations: &ReceiptExpectations, ) -> Result<CustodyReceipt, VerifyError>
The verified custody receipt for a write, for the caller to persist beside the provenance
chain (capsule_library::library::append_receipt) — evidence, not a cache. Returns the
receipt only when it verifies under a pinned attestation key with matching fields.
Sourcepub async fn fetch_verified_attestation(
&self,
assets: &[AssetQuery],
deep: bool,
) -> Result<VerifiedAttestation, VerifyError>
pub async fn fetch_verified_attestation( &self, assets: &[AssetQuery], deep: bool, ) -> Result<VerifiedAttestation, VerifyError>
A signed durability verdict for assets, under a nonce drawn fresh from the OS CSPRNG
and verified under the pinned attestation keys — the evidence form of the verdict
(transfer/durability.md, Signed Storage Attestation). The caller keeps
VerifiedAttestation::cbor beside the asset’s custody receipts.
Not part of evaluate: the release gate needs a fresh durable, not
evidence, and a signed request spends the account’s deep budget.
Sourcepub async fn resolve_custody(&self, releases: &[HeldRelease]) -> CustodyVerifier
pub async fn resolve_custody(&self, releases: &[HeldRelease]) -> CustodyVerifier
Fetch the server-side facts the release gate needs for each of releases, and hand
them back as a CustodyVerifier — the production
StorageVerifier the offline data plane’s gate
(Workspace::release_move_source)
consults synchronously.
Per asset: a verdict fresh within the re-verify window over its declared blobs, then —
only when that verdict is durable — the asset’s durable receipt log
(GET /assets/{id}/receipts), with every declared blob required to have a receipt that
verifies under the pinned attestation keys with fields matching what the client sent.
The log rather than the per-session fetch evaluate uses, because a
blob a push found already held has no upload session to ask about.
Never fails: a fetch that fails is recorded as that asset’s fact, and the gate turns it
into a Retain. Resolve immediately before releasing; the facts are point-in-time.
Auto Trait Implementations§
impl<C = SystemClock> !Freeze for ReleaseCoordinator<C>
impl<C = SystemClock> !RefUnwindSafe for ReleaseCoordinator<C>
impl<C = SystemClock> !UnwindSafe for ReleaseCoordinator<C>
impl<C> Send for ReleaseCoordinator<C>
impl<C> Sync for ReleaseCoordinator<C>
impl<C> Unpin for ReleaseCoordinator<C>where
C: Unpin,
impl<C> UnsafeUnpin for ReleaseCoordinator<C>where
C: UnsafeUnpin,
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
§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