pub struct SignedLicenceClient<T: LicenceTransport> { /* private fields */ }Expand description
LicenceClient that signs every request with the steward key.
Implementations§
Source§impl<T: LicenceTransport> SignedLicenceClient<T>
impl<T: LicenceTransport> SignedLicenceClient<T>
Sourcepub fn new(
key: SigningKey,
node: impl Into<String>,
seed_device_id: impl Into<String>,
transport: T,
clock: ClockMs,
) -> Arc<Self> ⓘ
pub fn new( key: SigningKey, node: impl Into<String>, seed_device_id: impl Into<String>, transport: T, clock: ClockMs, ) -> Arc<Self> ⓘ
A client for the steward node (its node id) holding key, talking
to the Seed seed_device_id (from the binding).
Sourcepub fn for_binding(
key: SigningKey,
binding: &BindingRecord,
transport: T,
clock: ClockMs,
) -> Arc<Self> ⓘ
pub fn for_binding( key: SigningKey, binding: &BindingRecord, transport: T, clock: ClockMs, ) -> Arc<Self> ⓘ
A client for the bound Seed: the audience is the binding’s device_id
and the node is its steward_node_id.
Trait Implementations§
Source§impl<T: LicenceTransport> LicenceClient for SignedLicenceClient<T>
impl<T: LicenceTransport> LicenceClient for SignedLicenceClient<T>
Source§fn checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 CheckoutWire,
) -> Pin<Box<dyn Future<Output = Result<SignedGrant, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 CheckoutWire,
) -> Pin<Box<dyn Future<Output = Result<SignedGrant, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
POST /licence/v1/checkout: the signed grant, with seq persisted
by the Seed before release.Source§fn artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
blake3_hex: &'life1 str,
max_len: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
blake3_hex: &'life1 str,
max_len: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
GET /licence/v1/artifact/<blake3>: the cached binary. At most
max_len bytes are accepted.Source§fn grants_since<'life0, 'async_trait>(
&'life0 self,
since: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<SignedGrant>, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn grants_since<'life0, 'async_trait>(
&'life0 self,
since: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<SignedGrant>, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
GET /licence/v1/grants?since=<seq>: renewal batch.Source§fn grants_page<'life0, 'async_trait>(
&'life0 self,
since: u64,
) -> Pin<Box<dyn Future<Output = Result<GrantsPage, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn grants_page<'life0, 'async_trait>(
&'life0 self,
since: u64,
) -> Pin<Box<dyn Future<Output = Result<GrantsPage, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Self::grants_since with the paging cursor.Source§fn renew<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GrantsPage, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn renew<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GrantsPage, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
POST /licence/v1/renew: a new grant (or a withdrawal) for every
active checkout, at most one batch. next is the Seed’s issue counter
after the renewal (the bound for the catch-up cursor).Source§fn release<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cog_id: &'life1 str,
version: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<GrantsPage, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn release<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cog_id: &'life1 str,
version: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<GrantsPage, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
POST /licence/v1/renew with {"release": [{cog_id, version}]}: the
Seed withdraws that checkout (a renewal whose expires_at <= issued_at) and, as for any renewal, renews every other active one.Auto Trait Implementations§
impl<T> !RefUnwindSafe for SignedLicenceClient<T>
impl<T> !UnwindSafe for SignedLicenceClient<T>
impl<T> Freeze for SignedLicenceClient<T>where
T: Freeze,
impl<T> Send for SignedLicenceClient<T>
impl<T> Sync for SignedLicenceClient<T>
impl<T> Unpin for SignedLicenceClient<T>where
T: Unpin,
impl<T> UnsafeUnpin for SignedLicenceClient<T>where
T: 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
Mutably borrows from an owned value. Read more
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