@@ -64,7 +64,6 @@ impl k_ap::EventPublisher for FederationEventBridge {
|
||||
|
||||
if let Some(outbox) = outbox_url {
|
||||
tracing::info!(outbox = %outbox, "importing remote outbox after follow accepted");
|
||||
// Handled by FollowBackfillHandler reacting to FollowAccepted
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -9,15 +9,6 @@ use domain::{
|
||||
use k_ap::ActivityPubService;
|
||||
use uuid::Uuid;
|
||||
|
||||
/// Adapts the federation library's service to the three domain-owned ports.
|
||||
///
|
||||
/// A wrapper rather than a bare `impl ... for ActivityPubService` because the
|
||||
/// orphan rule forbids implementing a foreign trait for a foreign type, and
|
||||
/// from this crate both `ApDocumentPort` (owned by `domain`) and
|
||||
/// `ActivityPubService` (owned by the external `k-ap` crate) are foreign.
|
||||
///
|
||||
/// One type carrying all three impls mirrors `CompositeSocialAdapter`, which
|
||||
/// serves `SocialCommand`, `FollowGraphQuery`, and `BlockQuery` the same way.
|
||||
pub struct ApServiceAdapter {
|
||||
service: Arc<ActivityPubService>,
|
||||
}
|
||||
@@ -28,10 +19,6 @@ impl ApServiceAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
/// Single conversion point from the federation library's `anyhow` errors to
|
||||
/// `DomainError`. The log line and the resulting error string reproduce what
|
||||
/// `presentation::handlers::social::ap_to_domain` produced before the port
|
||||
/// inversion moved the boundary here.
|
||||
fn ap_err(e: anyhow::Error) -> DomainError {
|
||||
tracing::error!("ActivityPub error: {:?}", e);
|
||||
DomainError::InfrastructureError(e.to_string())
|
||||
|
||||
@@ -14,7 +14,6 @@ pub mod watchlist_handler;
|
||||
pub const INSTANCE_ACTOR_ID: uuid::Uuid =
|
||||
uuid::Uuid::from_bytes([0, 0, 0, 0, 0, 0, 0x40, 0, 0x80, 0, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
// Re-export the generic base types that callers need
|
||||
pub use k_ap::{
|
||||
ActivityPubService, ActivityRepository, ActorRepository, ApContentReader, ApFederationConfig,
|
||||
ApObjectHandler, ApUser, ApUserRepository, BlocklistRepository, FederationData,
|
||||
@@ -41,15 +40,9 @@ pub struct FederationRepos {
|
||||
}
|
||||
|
||||
pub struct ActivityPubWire {
|
||||
/// AP document serving. Prefer this over `service` from outside this crate.
|
||||
pub document: std::sync::Arc<dyn domain::ports::ApDocumentPort>,
|
||||
/// Instance domain blocklist. Prefer this over `service` from outside this crate.
|
||||
pub blocklist: std::sync::Arc<dyn domain::ports::InstanceBlocklistPort>,
|
||||
/// Post-follow content backfill. Prefer this over `service` from outside this crate.
|
||||
pub backfill: std::sync::Arc<dyn domain::ports::ApBackfillPort>,
|
||||
/// The concrete service, consumed by `crates/server` to construct
|
||||
/// `CompositeSocialAdapter`. Everything else should use
|
||||
/// `document`/`blocklist`/`backfill`.
|
||||
pub service: std::sync::Arc<ActivityPubService>,
|
||||
pub router: axum::Router,
|
||||
pub event_handler: std::sync::Arc<dyn domain::ports::EventHandler>,
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
use domain::value_objects::{InstanceIdentity, ReviewId, UserId};
|
||||
use url::Url;
|
||||
|
||||
/// Builds the canonical actor URL: `{base_url}/users/{user_id}`
|
||||
pub fn actor_url(instance: &InstanceIdentity, user_id: uuid::Uuid) -> Url {
|
||||
Url::parse(&instance.actor_url_for(&UserId::from_uuid(user_id)))
|
||||
.expect("base_url is always a valid URL prefix")
|
||||
}
|
||||
|
||||
/// Builds the canonical review URL: `{base_url}/reviews/{review_id}`
|
||||
pub fn review_url(instance: &InstanceIdentity, review_id: &ReviewId) -> Url {
|
||||
Url::parse(&format!(
|
||||
"{}/reviews/{}",
|
||||
@@ -27,7 +25,6 @@ pub fn goal_url(instance: &InstanceIdentity, user_id: uuid::Uuid, year: u16) ->
|
||||
.expect("base_url is always a valid URL prefix")
|
||||
}
|
||||
|
||||
/// Builds the canonical watchlist entry URL: `{base_url}/users/{user_id}/watchlist/{movie_id}`
|
||||
pub fn watchlist_entry_url(
|
||||
instance: &InstanceIdentity,
|
||||
user_id: uuid::Uuid,
|
||||
|
||||
Reference in New Issue
Block a user