v.0.4.6
All checks were successful
CI / fmt (push) Successful in 1m1s
CI / clippy (push) Successful in 4m41s
CI / test (push) Successful in 5m34s

This commit is contained in:
2026-07-16 09:54:02 +02:00
parent 4d7117b123
commit 17b57fb9b5
4 changed files with 34 additions and 3 deletions

View File

@@ -1,5 +1,14 @@
# Changelog # Changelog
## [0.4.6] — 2026-07-16
### New features
- `ActivityPubServiceBuilder::nodeinfo_services(inbound, outbound)` — forward NodeInfo services config through the builder
- `ActivityPubServiceBuilder::nodeinfo_metadata(value)` — forward arbitrary NodeInfo metadata through the builder
---
## [0.4.5] — 2026-07-16 ## [0.4.5] — 2026-07-16
### Bug fixes ### Bug fixes

2
Cargo.lock generated
View File

@@ -1368,7 +1368,7 @@ dependencies = [
[[package]] [[package]]
name = "k-ap" name = "k-ap"
version = "0.4.5" version = "0.4.6"
dependencies = [ dependencies = [
"activitypub_federation", "activitypub_federation",
"anyhow", "anyhow",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "k-ap" name = "k-ap"
version = "0.4.5" version = "0.4.6"
edition = "2024" edition = "2024"
description = "Generic ActivityPub protocol layer" description = "Generic ActivityPub protocol layer"
license = "MIT" license = "MIT"

View File

@@ -62,6 +62,9 @@ pub struct ActivityPubServiceBuilder {
delivery_initial_delay_secs: u64, delivery_initial_delay_secs: u64,
signed_fetch_actor_id: Option<uuid::Uuid>, signed_fetch_actor_id: Option<uuid::Uuid>,
actor_cache_ttl_secs: u64, actor_cache_ttl_secs: u64,
nodeinfo_services_inbound: Vec<String>,
nodeinfo_services_outbound: Vec<String>,
nodeinfo_metadata: serde_json::Value,
} }
impl ActivityPubServiceBuilder { impl ActivityPubServiceBuilder {
@@ -125,6 +128,17 @@ impl ActivityPubServiceBuilder {
self self
} }
pub fn nodeinfo_services(mut self, inbound: Vec<String>, outbound: Vec<String>) -> Self {
self.nodeinfo_services_inbound = inbound;
self.nodeinfo_services_outbound = outbound;
self
}
pub fn nodeinfo_metadata(mut self, metadata: serde_json::Value) -> Self {
self.nodeinfo_metadata = metadata;
self
}
/// Set a local actor whose keypair signs all outgoing fetch requests /// Set a local actor whose keypair signs all outgoing fetch requests
/// (HTTP Signature on GETs). Required for federating with instances /// (HTTP Signature on GETs). Required for federating with instances
/// that enforce authorized-fetch / Secure Mode. /// that enforce authorized-fetch / Secure Mode.
@@ -168,7 +182,12 @@ impl ActivityPubServiceBuilder {
self.software_name, self.software_name,
self.event_publisher, self.event_publisher,
std::time::Duration::from_secs(self.actor_cache_ttl_secs), std::time::Duration::from_secs(self.actor_cache_ttl_secs),
); )
.with_nodeinfo_services(
self.nodeinfo_services_inbound,
self.nodeinfo_services_outbound,
)
.with_nodeinfo_metadata(self.nodeinfo_metadata);
let signing_actor = if let Some(uid) = self.signed_fetch_actor_id { let signing_actor = if let Some(uid) = self.signed_fetch_actor_id {
let actor = crate::actors::build_local_actor( let actor = crate::actors::build_local_actor(
uid, uid,
@@ -211,6 +230,9 @@ impl ActivityPubService {
delivery_initial_delay_secs: DELIVERY_INITIAL_DELAY_SECS, delivery_initial_delay_secs: DELIVERY_INITIAL_DELAY_SECS,
signed_fetch_actor_id: None, signed_fetch_actor_id: None,
actor_cache_ttl_secs: ACTOR_CACHE_TTL_SECS, actor_cache_ttl_secs: ACTOR_CACHE_TTL_SECS,
nodeinfo_services_inbound: vec![],
nodeinfo_services_outbound: vec![],
nodeinfo_metadata: serde_json::json!({}),
} }
} }