[client] F24: block and unblock as staged rotates, receipts with seq, readdress; payloads in PROTOCOL.md
ci / check (pull_request) Has been cancelled

This commit is contained in:
2026-11-17 12:01:32 +01:00
parent 0e6be38280
commit cfabc97d20
9 changed files with 652 additions and 57 deletions
+22
View File
@@ -32,6 +32,13 @@ pub trait Transport {
hash: &Sha256Hash,
) -> Result<(), TransportError>;
fn create_invite(&self, req: &CreateInvite) -> Result<(), TransportError>;
/// Block: the mailbox's post token becomes `new_hash`'s; the old one is refused from now on.
fn rotate_post_token(
&self,
id: &MailboxId,
fetch: &Token,
new_hash: &Sha256Hash,
) -> Result<(), TransportError>;
/// The KeyPackage, once.
fn claim_invite(&self, id: &InviteId, secret: &Token) -> Result<Vec<u8>, TransportError>;
}
@@ -129,6 +136,21 @@ impl Transport for MemoryTransport {
}
}
fn rotate_post_token(
&self,
id: &MailboxId,
fetch: &Token,
new_hash: &Sha256Hash,
) -> Result<(), TransportError> {
match self.boxes().mailboxes.get_mut(id) {
Some((post, f, _)) if *f == fetch.hash() => {
*post = *new_hash;
Ok(())
}
_ => Err(TransportError::NotFound),
}
}
fn create_invite(&self, req: &CreateInvite) -> Result<(), TransportError> {
let mut b = self.boxes();
if b.invites.contains_key(&req.id) {