From 60a179748474f831b25b14a0af90f4e94cc2bcf3 Mon Sep 17 00:00:00 2001 From: a Date: Thu, 3 Oct 2024 21:21:52 +0000 Subject: [PATCH] [0499] Add example for embedded activity delivery (#405) Reviewed-on: https://codeberg.org/fediverse/fep/pulls/405 Co-authored-by: a Co-committed-by: a --- fep/0499/fep-0499.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/fep/0499/fep-0499.md b/fep/0499/fep-0499.md index a21af49..7eae6b4 100644 --- a/fep/0499/fep-0499.md +++ b/fep/0499/fep-0499.md @@ -19,7 +19,7 @@ This FEP introduces a server-wide endpoint for delivering activities to multiple sharedInbox allows servers to reduce network traffic when delivering Public activities to multiple recipients, but it doesn't work when delivering to collections of actors, or when delivering to private audiences using bto or bcc. If an activity is addressed to a collection and that activity is delivered to a remote sharedInbox endpoint, then this introduces a requirement for the remote server to know the contents of the collection (or at least the local subset of its contents). In the common case of delivering activities addressing followers collections to a sharedInbox endpoint, then the remote server must first recognize that this collection id is specifically a followers collection, and then guess which local actors are following that activity's actor. This is prone to issues and can also have disastrous outcomes when follower state drifts out of sync. -We can eliminate the dependency on shared follower state and allow for delivery of non-Public activities by introducing a new endpoint that likewise allows delivering to multiple inboxes, but without requiring the remote server to know anything. +We can eliminate the dependency on shared follower state and allow for delivery of non-Public activities by introducing a new endpoint that likewise allows delivering to multiple inboxes, but without requiring the remote server to know anything. This enables addressing arbitrary collections as well as the use of `bto` and `bcc` more efficiently. ## Prior art @@ -115,6 +115,33 @@ Content-Type: application/ld+json; profile="https://www.w3.org/ns/activitystream } ``` +For transient activities or for cases not requiring a fetch (e.g. no access control), you can embed the activity inline: + +```http +POST /multibox HTTP/1.1 +Host: remote.example +Content-Type: application/ld+json; profile="https://www.w3.org/ns/activitystreams" + +{ + "@context": "https://www.w3.org/ns/activitystreams", + "type": "Add", + "object": { + "@context": "https://context.example" + "actor": "https://example.com/some-actor", + "type": "InGameNotification", + "content": "The payload is nearing the checkpoint!", + "generator": "https://game.example" + }, + "target": [ + "https://remote.example/inboxes/fbb433c8e6c4", + "https://remote.example/inboxes/d21f509146e5", + "https://remote.example/inboxes/68a7453f79e4", + "https://remote.example/inboxes/655216a0be07", + "https://remote.example/inboxes/84907eff485d", + ] +} +``` + ## Terms defined