feat: per-entity federation privacy toggles for reviews and watchlist
- add federate_reviews + federate_watchlist to UserSettings (default true) - new UserFederationSettingsQuery port with FederationFlags struct - remove get_user_federate_goals from LocalApContentQuery - gate ReviewLogged, ReviewUpdated, WatchlistEntryAdded, on_poster_synced on flags - goals gating migrated to UserFederationSettingsQuery - ReviewDeleted and WatchlistEntryRemoved ungated (tombstones always fire) - sqlite + postgres migrations and adapter impls - settings API and SPA toggles
This commit is contained in:
@@ -4,7 +4,7 @@ use anyhow::Context;
|
||||
use domain::ports::{
|
||||
ImageRefCommand, ImageRefQuery, ImportSessionRepository, LocalApContentQuery,
|
||||
MovieProfileRepository, MovieRepository, PersonCommand, PersonQuery, SearchCommand,
|
||||
UserRepository, WatchEventRepository,
|
||||
UserFederationSettingsQuery, UserRepository, WatchEventRepository,
|
||||
};
|
||||
|
||||
pub enum DbPool {
|
||||
@@ -30,6 +30,7 @@ pub struct WorkerDbOutput {
|
||||
pub wrapup_repo: Arc<dyn domain::ports::WrapUpRepository>,
|
||||
pub remote_goal: Arc<dyn domain::ports::RemoteGoalRepository>,
|
||||
pub refresh_session: Arc<dyn domain::ports::RefreshSessionRepository>,
|
||||
pub federation_settings: Arc<dyn domain::ports::UserFederationSettingsQuery>,
|
||||
pub db_pool: DbPool,
|
||||
}
|
||||
|
||||
@@ -64,6 +65,7 @@ pub async fn connect(database_url: &str, backend: &str) -> anyhow::Result<Worker
|
||||
refresh_session: Arc::new(postgres::PostgresRefreshSessionAdapter::new(
|
||||
w.pool.clone(),
|
||||
)) as _,
|
||||
federation_settings: w.federation_settings,
|
||||
db_pool: DbPool::Postgres(w.pool),
|
||||
})
|
||||
}
|
||||
@@ -95,6 +97,7 @@ pub async fn connect(database_url: &str, backend: &str) -> anyhow::Result<Worker
|
||||
remote_goal: w.remote_goal,
|
||||
refresh_session: Arc::new(sqlite::SqliteRefreshSessionAdapter::new(w.pool.clone()))
|
||||
as _,
|
||||
federation_settings: w.federation_settings,
|
||||
db_pool: DbPool::Sqlite(w.pool),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -241,6 +241,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
base_url,
|
||||
allow_registration,
|
||||
event_publisher: Arc::clone(&event_publisher),
|
||||
federation_settings: std::sync::Arc::clone(&db.federation_settings),
|
||||
})
|
||||
.await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user