pub enum ServiceResponse {
Show 13 variants
Entry(Entry),
Entries(Vec<Entry>),
Ids(Vec<ID>),
Ok,
TransactionContext(TransactionContext),
CrdtValue(WireCrdtValue),
MergeState(MergeState),
InstanceMetadata(Option<InstanceMetadata>),
CachedCrdtState(Option<Vec<u8>>),
Error(ServiceError),
TrustedLoginChallenge {
challenge: Vec<u8>,
user_uuid: String,
user_info: UserInfo,
},
TrustedLoginOk,
SessionKeyChallenge {
challenge: Vec<u8>,
},
}Expand description
Response from server to client.
Variants§
Entry(Entry)
Single entry
Entries(Vec<Entry>)
Multiple entries
Ids(Vec<ID>)
Multiple IDs
Ok
Success with no data
TransactionContext(TransactionContext)
Transaction-build context (response to DatabaseOp::BeginTransaction).
CrdtValue(WireCrdtValue)
Materialized CRDT store state (response to DatabaseOp::GetStoreState).
MergeState(MergeState)
Merge state: lowest common ancestor + path to tips (response to
DatabaseOp::ComputeMergeState).
InstanceMetadata(Option<InstanceMetadata>)
Optional instance metadata
CachedCrdtState(Option<Vec<u8>>)
Optional cached CRDT state blob (response to
DatabaseOp::GetCachedCrdtState). None on cache miss; the daemon
does not synthesize a value, so the client falls back to recomputing
from store entries.
Error(ServiceError)
Error response
TrustedLoginChallenge
Challenge bytes returned in response to TrustedLoginUser, plus the
user’s full record so the client can derive the password→key, decrypt
the root signing key locally, sign the challenge in a single
round-trip, and then build the User session from data the daemon
already returned — no second wire read of _users is required.
user_info.credentials carries the (encrypted) root private key, its
KeyStorage envelope (algorithm/ciphertext/nonce for password-protected
users, raw PrivateKey for passwordless users), and the Argon2id salt
when password-protected. The non-credential fields (user_database_id,
status, timestamps) are what User::new consumes after the proof
step succeeds. See § Trusted login threat model in the Service
Architecture doc for why this is safe to ship to anyone who can
reach the socket.
TrustedLoginOk
Trusted login succeeded; the connection is now authenticated.
SessionKeyChallenge
Challenge bytes returned in response to SessionKeyChallenge. The
client signs these with the named pubkey’s private key and returns the
signature in SessionKeyRegister.
Trait Implementations§
Source§impl Clone for ServiceResponse
impl Clone for ServiceResponse
Source§fn clone(&self) -> ServiceResponse
fn clone(&self) -> ServiceResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServiceResponse
impl Debug for ServiceResponse
Source§impl<'de> Deserialize<'de> for ServiceResponse
impl<'de> Deserialize<'de> for ServiceResponse
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 ServiceResponse
impl RefUnwindSafe for ServiceResponse
impl Send for ServiceResponse
impl Sync for ServiceResponse
impl Unpin for ServiceResponse
impl UnsafeUnpin for ServiceResponse
impl UnwindSafe for ServiceResponse
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