From 4b1e7565ac405f5c0f8888ff9525d23ecc44f6d8 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Sat, 16 May 2026 11:21:19 +0200 Subject: [PATCH] feat(bootstrap): wire ApiKeyServiceImpl + PgEngagementRepository --- crates/bootstrap/src/factory.rs | 6 ++++++ crates/presentation/src/testing.rs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/crates/bootstrap/src/factory.rs b/crates/bootstrap/src/factory.rs index 55306a6..bc1d553 100644 --- a/crates/bootstrap/src/factory.rs +++ b/crates/bootstrap/src/factory.rs @@ -7,10 +7,12 @@ use std::sync::Arc; use activitypub::ThoughtsObjectHandler; use activitypub_base::service::ActivityPubService; +use auth::ApiKeyServiceImpl; use domain::{errors::DomainError, events::DomainEvent, ports::{EventPublisher, OutboxWriter}}; use event_transport::EventPublisherAdapter; use nats::NatsTransport; use postgres::activitypub::PgActivityPubRepository; +use postgres::engagement::PgEngagementRepository; use postgres::outbox::PgOutboxWriter; use postgres::remote_actor_connections::PgRemoteActorConnectionRepository; use postgres_federation::{PostgresApUserRepository, PostgresFederationRepository}; @@ -127,6 +129,10 @@ pub async fn build(cfg: &Config) -> Infrastructure { ap_repo: Arc::new(PgActivityPubRepository::new(pool.clone())), remote_actor_connections: Arc::new(PgRemoteActorConnectionRepository::new(pool.clone())), federation_scheduler: ap_service.clone() as Arc, + api_key_auth: Arc::new(ApiKeyServiceImpl::new( + Arc::new(postgres::api_key::PgApiKeyRepository::new(pool.clone())), + )), + engagement: Arc::new(PgEngagementRepository::new(pool.clone())), }; Infrastructure { state, ap_service } diff --git a/crates/presentation/src/testing.rs b/crates/presentation/src/testing.rs index b1bc505..16f7506 100644 --- a/crates/presentation/src/testing.rs +++ b/crates/presentation/src/testing.rs @@ -133,5 +133,7 @@ pub fn make_state() -> AppState { ap_repo: Arc::new(NoOpApRepo), remote_actor_connections: store.clone(), federation_scheduler: store.clone(), + api_key_auth: store.clone(), + engagement: store.clone(), } }