pub enum ServiceRequest {
TrustedLoginUser {
username: String,
},
TrustedLoginProve {
signature: Vec<u8>,
},
GetInstanceMetadata,
SessionKeyChallenge {
pubkey: PublicKey,
},
SessionKeyRegister {
pubkey: PublicKey,
signature: Vec<u8>,
},
AuthenticatedDb(Box<AuthenticatedDbRequest>),
}Expand description
Top-level request from client to server.
The shape is intentionally flat: pre-auth lifecycle and queries sit beside
the AuthenticatedDb wrapper rather than under a nested enum. This makes the
pre-auth surface visible at a glance and keeps the server’s dispatch
branches symmetric.
Variants§
TrustedLoginUser
Step 1 of the trusted login flow. Client names a user; server responds
with a TrustedLoginChallenge carrying random bytes the client must
sign. The “Trusted” qualifier is a load-bearing reminder that this flow
assumes the caller is already trusted by the socket’s filesystem
permissions — over a network transport this would need PAKE instead.
TrustedLoginProve
Step 2 of the trusted login flow. Client returns a signature over the
challenge from TrustedLoginUser, computed with the user’s root key.
Server verifies against the stored pubkey and, on success, marks the
connection authenticated.
GetInstanceMetadata
Fetch the server’s instance metadata (including device id). Used by
Instance::connect during the handshake to establish server identity.
SessionKeyChallenge
Step 1 of registering an additional pubkey on an already-authenticated
connection. The client names a pubkey; the server issues a random
challenge bound to that pubkey. The pubkey is added to the keyset only
after the client returns a valid signature in SessionKeyRegister.
Session-key registration extends the connection’s identity from the
single login_pubkey (from TrustedLogin*) to a set of pubkeys the
client has proven possession of. Per-tree reads gate against this set,
so a user can drive operations on databases authored by any of their
per-DB keys without re-authenticating the whole connection.
SessionKeyRegister
Step 2 of registering an additional pubkey. Carries a signature over
the challenge issued by the matching SessionKeyChallenge. Server
verifies the signature with the named pubkey; on success the pubkey
joins the connection’s session keyset and the challenge is consumed.
AuthenticatedDb(Box<AuthenticatedDbRequest>)
All storage ops travel inside this wrapper. The inner
AuthenticatedDbRequest carries (root_id, identity, op) and is boxed
to keep the enum’s discriminated size compact.
Trait Implementations§
Source§impl Clone for ServiceRequest
impl Clone for ServiceRequest
Source§fn clone(&self) -> ServiceRequest
fn clone(&self) -> ServiceRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServiceRequest
impl Debug for ServiceRequest
Source§impl<'de> Deserialize<'de> for ServiceRequest
impl<'de> Deserialize<'de> for ServiceRequest
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>,
Auto Trait Implementations§
impl Freeze for ServiceRequest
impl RefUnwindSafe for ServiceRequest
impl Send for ServiceRequest
impl Sync for ServiceRequest
impl Unpin for ServiceRequest
impl UnsafeUnpin for ServiceRequest
impl UnwindSafe for ServiceRequest
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
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> 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