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/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/", + }), ); } 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()) }