From 9231079e92c8f3a90780fd1c8dc2699d4325be9d Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Thu, 26 Mar 2026 14:53:38 -0700 Subject: [PATCH] Format, lint, check --- backend/src/api.rs | 9 ++++++--- backend/src/repo.rs | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/backend/src/api.rs b/backend/src/api.rs index 24252f5..d5f4e1c 100644 --- a/backend/src/api.rs +++ b/backend/src/api.rs @@ -161,7 +161,7 @@ impl Api { .map_err(ApiError::Unauthorized)?; let mut got_u = None::; - for tag in &event.tags { + for tag in event.tags.iter() { let values = tag.as_slice(); if values.len() >= 2 && values[0] == "u" { got_u = Some(values[1].to_string()); @@ -173,7 +173,9 @@ impl Api { }; if !self.host.is_empty() && !got_u.contains(&self.host) { - return Err(ApiError::Unauthorized(anyhow!("authorization host mismatch"))); + return Err(ApiError::Unauthorized(anyhow!( + "authorization host mismatch" + ))); } Ok(event.pubkey.to_hex()) @@ -192,7 +194,8 @@ impl Api { authorized_pubkey: &str, tenant_pubkey: &str, ) -> std::result::Result<(), ApiError> { - if self.admins.iter().any(|a| a == authorized_pubkey) || authorized_pubkey == tenant_pubkey { + if self.admins.iter().any(|a| a == authorized_pubkey) || authorized_pubkey == tenant_pubkey + { Ok(()) } else { Err(ApiError::Forbidden("not authorized")) diff --git a/backend/src/repo.rs b/backend/src/repo.rs index d9d8ed6..e9b077d 100644 --- a/backend/src/repo.rs +++ b/backend/src/repo.rs @@ -481,7 +481,11 @@ impl Repo { Ok(rows) } - pub async fn list_activity_for_tenant(&self, tenant: &str, since: &i64) -> Result> { + pub async fn list_activity_for_tenant( + &self, + tenant: &str, + since: &i64, + ) -> Result> { let rows = sqlx::query_as::<_, Activity>( "SELECT id, tenant, created_at, activity_type, resource_type, resource_id FROM activity