From 267840a3177c56678ff982c9494763e48df74055 Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 16 Apr 2024 19:19:49 +0200 Subject: [PATCH] fix: not all keys are #main-key --- src/server/auth.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/auth.rs b/src/server/auth.rs index db940b82..13528b1f 100644 --- a/src/server/auth.rs +++ b/src/server/auth.rs @@ -70,7 +70,10 @@ where let mut http_signature = HttpSignature::parse(sig); // TODO assert payload's digest is equal to signature's - let user_id = http_signature.key_id.replace("#main-key", ""); + let user_id = http_signature.key_id + .split('#') + .next().ok_or(UpubError::bad_request())? + .to_string(); match ctx.fetch().user(&user_id).await { Ok(user) => match http_signature