From 7502eb6e7ab920617037c882bdf7c6a7957609d1 Mon Sep 17 00:00:00 2001 From: Davis Wolfermann Date: Sun, 1 Nov 2026 12:33:27 +0100 Subject: [PATCH 1/2] fix(clippy): expect dead code --- rust/crates/keygo-server/src/api/authenticated.rs | 6 ++++++ rust/crates/keygo-server/src/api/error.rs | 4 ++++ rust/crates/keygo-server/src/domain/access_token.rs | 12 ++++++++++++ 3 files changed, 22 insertions(+) diff --git a/rust/crates/keygo-server/src/api/authenticated.rs b/rust/crates/keygo-server/src/api/authenticated.rs index 2e27653b7..f1f735f31 100644 --- a/rust/crates/keygo-server/src/api/authenticated.rs +++ b/rust/crates/keygo-server/src/api/authenticated.rs @@ -113,6 +113,10 @@ impl FromRequestParts for Authenticated { } } +#[cfg_attr( + not(test), + expect(dead_code, reason = "no route requires a fresh sign-in yet") +)] #[derive(Debug, Error)] #[error("recent sign-in required")] pub struct FreshAuthRequired; @@ -123,8 +127,10 @@ impl HttpError for FreshAuthRequired { } } +#[expect(dead_code, reason = "no route requires a fresh sign-in yet")] pub struct FreshAuthenticated(Authenticated); +#[expect(dead_code, reason = "no route requires a fresh sign-in yet")] impl FreshAuthenticated { pub fn claims(&self) -> &Claims { self.0.claims() diff --git a/rust/crates/keygo-server/src/api/error.rs b/rust/crates/keygo-server/src/api/error.rs index 36a05ca7d..5f2cc9fe5 100644 --- a/rust/crates/keygo-server/src/api/error.rs +++ b/rust/crates/keygo-server/src/api/error.rs @@ -26,6 +26,10 @@ pub enum ErrorCode { RegistrationExpired, LoginExpired, // session + #[cfg_attr( + not(test), + expect(dead_code, reason = "no route requires a fresh sign-in yet") + )] FreshAuthRequired, InvalidToken, RefreshExpired, diff --git a/rust/crates/keygo-server/src/domain/access_token.rs b/rust/crates/keygo-server/src/domain/access_token.rs index 85838a116..e0d5b0f34 100644 --- a/rust/crates/keygo-server/src/domain/access_token.rs +++ b/rust/crates/keygo-server/src/domain/access_token.rs @@ -143,6 +143,10 @@ impl Claims { } } + #[cfg_attr( + not(test), + expect(dead_code, reason = "no route requires a fresh sign-in yet") + )] pub fn user_id(&self) -> UserId { self.user_id } @@ -151,6 +155,10 @@ impl Claims { self.session_id } + #[cfg_attr( + not(test), + expect(dead_code, reason = "no route requires a fresh sign-in yet") + )] pub fn auth_time(&self) -> u64 { self.auth_time } @@ -159,6 +167,10 @@ impl Claims { &self.cnf.jkt } + #[cfg_attr( + not(test), + expect(dead_code, reason = "no route requires a fresh sign-in yet") + )] pub fn is_fresh(&self) -> bool { self.is_fresh_at(unix_now()) } From 7653c184295324265b8747864438cc663ba34e90 Mon Sep 17 00:00:00 2001 From: Davis Wolfermann Date: Sun, 1 Nov 2026 12:33:59 +0100 Subject: [PATCH 2/2] fix(tests): add public_url --- rust/crates/keygo-server/src/api/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust/crates/keygo-server/src/api/mod.rs b/rust/crates/keygo-server/src/api/mod.rs index 0620e77e3..850f68a36 100644 --- a/rust/crates/keygo-server/src/api/mod.rs +++ b/rust/crates/keygo-server/src/api/mod.rs @@ -115,7 +115,11 @@ mod tests { let body: Value = serde_json::from_slice(&body).unwrap(); assert_eq!( body, - json!({ "version": env!("CARGO_PKG_VERSION"), "allow_signups": true }), + json!({ + "version": env!("CARGO_PKG_VERSION"), + "allow_signups": true, + "public_url": "http://localhost/", + }), ); }