-
-
Notifications
You must be signed in to change notification settings - Fork 94
Description
Summary
Client-to-server interactions in the ActivityPub specification are defined as POST requests to the actor's outbox. Is there a plan to implement something like setOutboxListeners?
Problem
A custom client (e.g. a fediverse app) wants to interact with the server in a standard way — for example tell it about actions that user performed via app's UI, like creating a post, or following somebody.
Proposed Solution
The ActivityPub spec defines such interactions and contains numerous examples. POSTing an Activity to actor's outbox is a standard way to perform this communication.
The important consideration is the authentication and authorization:
The request MUST be authenticated with the credentials of the user to whom the outbox belongs.
Only the user represented by the actor is supposed to POST to their own outbox.
IIUC The outbox POST requests coming from the client may be authenticated in a custom way, as the Bearer in Example 11 in the spec indicates.
POST /outbox/ HTTP/1.1
Host: dustycloud.org
Authorization: Bearer XXXXXXXXXXX
Content-Type: application/ld+json; profile="https://www.w3.org/ns/activitystreams"
Alternatives Considered
I think servers (Mastodon) implement their custom non-standard API for the same purpose. Such interface may be better omitted from Fedify, as it is not ActivityPub.
I'm relatively new to tinkering with fediverse, so I may not be aware of some contexts.
Scope / Dependencies
It would probably mean implementing setOutboxListeners, a new listener to outbox POST requests.
Make a possibility for user to define a custom authentication.
Then for each received valid activity, the server is supposed to send the activity to the actors specified in the "to", "cc", and "bcc" fields. This process may or may not be user-defined in a callback. That's probably open to a discussion (as all of this, actually 🙂)