From 57110f3b7502dcf574c1badb4958e706890c5b60 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Thu, 14 May 2026 20:46:10 +0200 Subject: [PATCH] feat(domain): add actor_json to FederationActionPort --- crates/domain/src/ports.rs | 1 + crates/domain/src/testing.rs | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/crates/domain/src/ports.rs b/crates/domain/src/ports.rs index 86d6ff3..95e8b28 100644 --- a/crates/domain/src/ports.rs +++ b/crates/domain/src/ports.rs @@ -198,6 +198,7 @@ pub trait RemoteActorRepository: Send + Sync { pub trait FederationActionPort: Send + Sync { async fn lookup_actor(&self, handle: &str) -> Result; async fn follow_remote(&self, local_user_id: &UserId, handle: &str) -> Result<(), DomainError>; + async fn actor_json(&self, user_id: &UserId) -> Result; } #[async_trait] diff --git a/crates/domain/src/testing.rs b/crates/domain/src/testing.rs index c0d81fe..2590789 100644 --- a/crates/domain/src/testing.rs +++ b/crates/domain/src/testing.rs @@ -547,6 +547,10 @@ impl FederationActionPort for TestStore { ) -> Result<(), DomainError> { Ok(()) } + + async fn actor_json(&self, _user_id: &UserId) -> Result { + Err(DomainError::NotFound) + } } #[async_trait] @@ -806,6 +810,13 @@ mod federation_port_tests { .await .unwrap(); } + + #[tokio::test] + async fn test_store_actor_json_returns_not_found() { + let store = TestStore::default(); + let err = store.actor_json(&UserId::new()).await.unwrap_err(); + assert!(matches!(err, DomainError::NotFound)); + } } #[cfg(test)]