feat: implement federated profile handling with support for remote actor URLs across multiple components
All checks were successful
CI / Check / Test (push) Successful in 1h7m53s
All checks were successful
CI / Check / Test (push) Successful in 1h7m53s
This commit is contained in:
@@ -18,3 +18,13 @@ pub struct FederationFlags {
|
||||
pub reviews: bool,
|
||||
pub watchlist: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct FederatedProfile {
|
||||
pub actor_url: String,
|
||||
pub handle: String,
|
||||
pub display_name: Option<String>,
|
||||
pub bio: Option<String>,
|
||||
pub avatar_url: Option<String>,
|
||||
pub banner_url: Option<String>,
|
||||
}
|
||||
|
||||
@@ -133,6 +133,7 @@ pub struct DiaryFilter {
|
||||
pub movie_id: Option<MovieId>,
|
||||
pub user_id: Option<UserId>,
|
||||
pub search: Option<String>,
|
||||
pub include_remote: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
||||
11
crates/domain/src/ports/federated_profile.rs
Normal file
11
crates/domain/src/ports/federated_profile.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use async_trait::async_trait;
|
||||
|
||||
use crate::{errors::DomainError, models::FederatedProfile};
|
||||
|
||||
#[async_trait]
|
||||
pub trait FederatedProfileQuery: Send + Sync {
|
||||
async fn get_federated_profile(
|
||||
&self,
|
||||
synthetic_user_id: uuid::Uuid,
|
||||
) -> Result<Option<FederatedProfile>, DomainError>;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
pub mod auth;
|
||||
pub mod diary;
|
||||
pub mod events;
|
||||
pub mod federated_profile;
|
||||
pub mod goals;
|
||||
pub mod images;
|
||||
pub mod import;
|
||||
@@ -16,6 +17,7 @@ pub mod wrapup;
|
||||
pub use auth::*;
|
||||
pub use diary::*;
|
||||
pub use events::*;
|
||||
pub use federated_profile::*;
|
||||
pub use goals::*;
|
||||
pub use images::*;
|
||||
pub use import::*;
|
||||
|
||||
@@ -347,6 +347,18 @@ impl crate::ports::SocialQueryPort for PanicSocialQueryPort {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct PanicFederatedProfileQuery;
|
||||
|
||||
#[async_trait]
|
||||
impl crate::ports::FederatedProfileQuery for PanicFederatedProfileQuery {
|
||||
async fn get_federated_profile(
|
||||
&self,
|
||||
_: uuid::Uuid,
|
||||
) -> Result<Option<crate::models::FederatedProfile>, DomainError> {
|
||||
panic!("PanicFederatedProfileQuery called")
|
||||
}
|
||||
}
|
||||
|
||||
pub struct PanicWatchEventRepository;
|
||||
|
||||
#[async_trait]
|
||||
|
||||
Reference in New Issue
Block a user