From 87ae6e001bce50e9d08fbd2e152e0eb4e2f31db8 Mon Sep 17 00:00:00 2001 From: Waylon Cude Date: Sat, 16 May 2026 14:51:02 -0700 Subject: [PATCH] Made all client enums public Oops. Also I don't think I can flatten the message alongside the signature as theoretically those are the bytes that are getting signed. --- src/client.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/client.rs b/src/client.rs index 4ad4d6b..d9c754b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -23,7 +23,11 @@ pub struct TaggedClientMessage { pub struct SignedClientMessage { message: ClientMessage, // Should I enforce this being a ecdsa signature? - #[serde(with = "serde_bytes",flatten)] + // What is the signature of???? + // Can I reserialize the message and check the signature that way?? + // That would be very brittle but there isn't a good way to extract the + // bytes using serde. I'll write something better at some point + #[serde(with = "serde_bytes")] signature: Box<[u8]> } @@ -175,15 +179,16 @@ pub enum ClientMessage { } #[derive(Serialize,Deserialize)] -enum ServerError { +pub enum ServerError { InvalidPermission, // Server can specify the required challenge ChallengeInvitecode, + NotAuthenticated, } #[derive(Serialize,Deserialize)] -enum ServerMessage { +pub enum ServerMessage { // Returned on fetch or naturally from subscribe Messages(Vec), MediaUploaded(Uuid),