FEP-c3ab: Referencing Existing Objects in ActivityPub Client-to-Server Create - Fediverse Enhancement Proposals
Client-to-server interactions are described for objects that are born with their activity: a client posts a Note, the server wraps it in a Create, and both are given identifiers. Where federation is added to a content store that already exists, the order is reversed, and that is the normal case for a content management system. The store assigns an identifier, an author and an audience when the content is written; a module or plugin adds federation later; and so an object can sit there for years before any actor decides to publish it. Publishing older content, publishing selectively, and publishing under one of several actors are then ordinary requests rather than edge cases. The same is true of any server that serves the same content both as a website and to the fediverse, since the website copy exists whether or not an activity was ever recorded for it. In this case the object already has an identifier and is publicly retrievable by GET. What the hosting server has not done is record or deliver a Create for it. A referenced Create records that publication and makes it eligible for delivery under the ordinary addressing rules; it does not make the object retrievable for the first time. For those servers the client has nothing new to submit. It wants to name an object the server already hosts and ask for it to be published: json { "@context": "https://www.w3.org/ns/activitystreams", "type": "Create", "actor": "https://example.org/actors/alice", "object": "https://example.org/articles/123" } The syntax is already defined by ActivityStreams — this is the shape of the Minimal Activity example, with both properties given as URIs rather than inlined documents. What is missing is what an outbox should do with it. There are two separable proposals here, and it is worth saying which is which. Referencing an existing object. When Create.object is a URI the server already hosts, what happens to the object's identifier, its existing attribution, and its addressing. This is specific to a submission that names something rather than carrying it. Responding to a retry. When a server recognises a submission as one it has already recorded and creates no new activity, what status and Location it returns. This is not specific to Create at all: the same question arises for any submission a server deduplicates, Follow and Like among them. The second is the one this proposal exists for, and it survives a change of activity type — if the publication were expressed as something other than a Create, the retry contract would read the same. The first is what makes a referenced submission well defined in the first place, so both are specified here. Note what decides the status code. The object already existing does not make the first submission a retry: that request records a new activity and gets 201. A later submission recognised as a retry gets 200 because the activity already exists and this request recorded nothing, not because the object does. The rules here are written for a URI-referenced Create or Delete, which Activity Streams lists under both Content Management and Relationship Management, so the target may be an article or a relationship without changing anything. The same response pattern can be used for other client-to-server activities — Follow, Like, Block and Undo among them — wherever a server recognises a retry and records nothing new. How to recognise a retry for those is not defined here. The proposal does not specify how many such activities an object may have, or who may publish one. Nor does it cover actor types. Section 6.2.1 obliges an outbox to accept any non-Activity Object submitted directly to it, so a client-to-server implementation already has to answer for a Person, a Group or a Collection as well as an Article. Section 6.2.1 says nothing about references, but a URI can name one of those just as easily, and that case does need an answer eventually. This proposal is written from an implementation of the object types only — a list that does not include Collection, which is a core type — and the author has not examined the actor types closely enough to say what a referenced Create should mean for one, and would rather implement and measure that than guess at it here.