feat(domain): add federation management methods to FederationActionPort

This commit is contained in:
2026-05-15 03:35:58 +02:00
parent 3903421d54
commit 1b0bb911a0
3 changed files with 113 additions and 0 deletions

View File

@@ -1769,6 +1769,51 @@ impl domain::ports::FederationActionPort for ActivityPubService {
})
.collect()
}
async fn get_pending_followers(
&self,
_user_id: &domain::value_objects::UserId,
) -> Result<Vec<domain::models::remote_actor::RemoteActor>, domain::errors::DomainError> {
Ok(vec![])
}
async fn accept_follow_request(
&self,
_user_id: &domain::value_objects::UserId,
_actor_url: &str,
) -> Result<(), domain::errors::DomainError> {
Ok(())
}
async fn reject_follow_request(
&self,
_user_id: &domain::value_objects::UserId,
_actor_url: &str,
) -> Result<(), domain::errors::DomainError> {
Ok(())
}
async fn get_remote_followers(
&self,
_user_id: &domain::value_objects::UserId,
) -> Result<Vec<domain::models::remote_actor::RemoteActor>, domain::errors::DomainError> {
Ok(vec![])
}
async fn remove_remote_follower(
&self,
_user_id: &domain::value_objects::UserId,
_actor_url: &str,
) -> Result<(), domain::errors::DomainError> {
Ok(())
}
async fn get_remote_following(
&self,
_user_id: &domain::value_objects::UserId,
) -> Result<Vec<domain::models::remote_actor::RemoteActor>, domain::errors::DomainError> {
Ok(vec![])
}
}
#[cfg(test)]

View File

@@ -228,6 +228,29 @@ pub trait FederationActionPort: Send + Sync {
local_user_id: &UserId,
handle: &str,
) -> Result<(), DomainError>;
async fn get_pending_followers(
&self,
user_id: &UserId,
) -> Result<Vec<RemoteActor>, DomainError>;
async fn accept_follow_request(
&self,
user_id: &UserId,
actor_url: &str,
) -> Result<(), DomainError>;
async fn reject_follow_request(
&self,
user_id: &UserId,
actor_url: &str,
) -> Result<(), DomainError>;
async fn get_remote_followers(&self, user_id: &UserId)
-> Result<Vec<RemoteActor>, DomainError>;
async fn remove_remote_follower(
&self,
user_id: &UserId,
actor_url: &str,
) -> Result<(), DomainError>;
async fn get_remote_following(&self, user_id: &UserId)
-> Result<Vec<RemoteActor>, DomainError>;
async fn actor_json(&self, user_id: &UserId) -> Result<String, DomainError>;
async fn followers_collection_json(
&self,

View File

@@ -556,6 +556,51 @@ impl FederationActionPort for TestStore {
Ok(())
}
async fn get_pending_followers(
&self,
_user_id: &UserId,
) -> Result<Vec<RemoteActor>, DomainError> {
Ok(vec![])
}
async fn accept_follow_request(
&self,
_user_id: &UserId,
_actor_url: &str,
) -> Result<(), DomainError> {
Ok(())
}
async fn reject_follow_request(
&self,
_user_id: &UserId,
_actor_url: &str,
) -> Result<(), DomainError> {
Ok(())
}
async fn get_remote_followers(
&self,
_user_id: &UserId,
) -> Result<Vec<RemoteActor>, DomainError> {
Ok(vec![])
}
async fn remove_remote_follower(
&self,
_user_id: &UserId,
_actor_url: &str,
) -> Result<(), DomainError> {
Ok(())
}
async fn get_remote_following(
&self,
_user_id: &UserId,
) -> Result<Vec<RemoteActor>, DomainError> {
Ok(vec![])
}
async fn actor_json(&self, _user_id: &UserId) -> Result<String, DomainError> {
Err(DomainError::NotFound)
}