feat: add instance actor for signed fetch (Secure Mode support)
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled

This commit is contained in:
2026-05-30 03:11:15 +02:00
parent 78daca0377
commit 0c8fa01ab9
3 changed files with 65 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
pub mod handler;
pub mod instance_actor;
pub mod note;
pub mod port;
pub mod service;
@@ -33,17 +34,22 @@ pub struct ApServiceConfig {
pub async fn build_ap_service(
cfg: ApServiceConfig,
) -> (Arc<ActivityPubService>, Arc<ApFederationAdapter>) {
let user_repo = Arc::new(instance_actor::InstanceActorUserRepo::new(
cfg.user_repo,
cfg.base_url.clone(),
));
let mut builder = ActivityPubService::builder(cfg.base_url)
.activity_repo(cfg.activity_repo)
.follow_repo(cfg.follow_repo)
.actor_repo(cfg.actor_repo)
.blocklist_repo(cfg.blocklist_repo)
.user_repo(cfg.user_repo)
.user_repo(user_repo)
.content_reader(cfg.ap_handler.clone())
.object_handler(cfg.ap_handler)
.allow_registration(cfg.allow_registration)
.software_name("thoughts")
.debug(cfg.debug);
.debug(cfg.debug)
.signed_fetch_actor_id(instance_actor::INSTANCE_ACTOR_ID);
if let Some(publisher) = cfg.event_publisher {
builder = builder.event_publisher(publisher);
}