GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing w3c.github.io — ActivityPub The ActivityPub protocol is a decentralized social networking protocol based upon the [[activitystreams-core]] 2.0 data format. It provides a client to server API for creating, updating and deleting content, as well as a federated server to server API for delivering notifications and content. OverviewActivityPub provides two layers:
ActivityPub implementations can implement just one of these things or both of them. However, once you've implemented one, it isn't too many steps to implement the other, and there are a lot of benefits to both (making your website part of the decentralized social web, and being able to use clients and client libraries that work across a wide variety of social websites). In ActivityPub, a user is represented by "actors" via the user's accounts on servers. User's accounts on different servers correspond to different actors. Every Actor has:
These are endpoints, or really, just URLs which are listed in the ActivityPub actor's Activity Streams description. (More on Activity Streams later). Here's an example of the record of our friend Alyssa P. Hacker: {"@context": "https://www.w3.org/ns/activitystreams",
"type": "Person",
"id": "https://social.example/alyssa/",
"name": "Alyssa P. Hacker",
"preferredUsername": "alyssa",
"summary": "Lisp enthusiast hailing from MIT",
"inbox": "https://social.example/alyssa/inbox/",
"outbox": "https://social.example/alyssa/outbox/",
"followers": "https://social.example/alyssa/followers/",
"following": "https://social.example/alyssa/following/",
"liked": "https://social.example/alyssa/liked/"}
ActivityPub uses [[!activitystreams-core]] for its vocabulary. This is pretty great because Activity Streams includes all the common terms you need to represent all the activities and content flowing around a social network. It's likely that Activity Streams already includes all the vocabulary you need, but even if it doesn't, Activity Streams can be extended via [[!JSON-LD]]. If you know what JSON-LD is, you can take advantage of the cool linked data approaches provided by JSON-LD. If you don't, don't worry, JSON-LD documents and Activity Streams can be understood as plain old simple JSON. (If you're going to add extensions, that's the point at which JSON-LD really helps you out). So, okay. Alyssa wants to talk to her friends, and her friends want to talk to her! Luckily these "inbox" and "outbox" things can help us out. They both behave differently for GET and POST. Let's see how that works:
Hey nice, so just as a recap:
Of course, if that last one (GET'ing from someone's outbox) was the only way to see what people have sent, this wouldn't be a very efficient federation protocol! Indeed, federation happens usually by servers posting messages sent by actors to actors on other servers' inboxes. Let's see an example! Let's say Alyssa wants to catch up with her friend, Ben Bitdiddle. She lent him a book recently and she wants to make sure he returns it to her. Here's the message she composes, as an Activity Streams object: {"@context": "https://www.w3.org/ns/activitystreams",
"type": "Note",
"to": ["https://chatty.example/ben/"],
"attributedTo": "https://social.example/alyssa/",
"content": "Say, did you finish reading that book I lent you?"}
This is a note addressed to Ben. She POSTs it to her outbox.
Since this is a non-activity object, the server recognizes that this is an object being newly created, and does the courtesy of wrapping it in a Create activity. (Activities sent around in ActivityPub generally follow the pattern of some activity by some actor being taken on some object. In this case the activity is a Create of a Note object, posted by a Person). {"@context": "https://www.w3.org/ns/activitystreams",
"type": "Create",
"id": "https://social.example/alyssa/posts/a29a6843-9feb-4c74-a7f7-081b9c9201d3",
"to": ["https://chatty.example/ben/"],
"actor": "https://social.example/alyssa/",
"object": {"type": "Note",
"id": "https://social.example/alyssa/posts/49e2d03d-b53a-4c4c-a95c-94a6abf45a19",
"attributedTo": "https://social.example/alyssa/",
"to": ["https://chatty.example/ben/"],
"content": "Say, did you finish reading that book I lent you?"}}
Alyssa's server looks up Ben's Activity Streams actor object, finds his inbox endpoint, and POSTs her object to his inbox.
Technically these are two separate steps... one is client to server communication, and one is server to server communication (federation). But, since we're using them both in this example, we can abstractly think of this as being a streamlined submission from outbox to inbox:
Cool! A while later, Alyssa checks what new messages she's gotten. Her phone polls her inbox via GET, and amongst a bunch of cat videos posted by friends and photos of her nephew posted by her sister, she sees the following: {"@context": "https://www.w3.org/ns/activitystreams",
"type": "Create",
"id": "https://chatty.example/ben/p/51086",
"to": ["https://social.example/alyssa/"],
"actor": "https://chatty.example/ben/",
"object": {"type": "Note",
"id": "https://chatty.example/ben/p/51085",
"attributedTo": "https://chatty.example/ben/",
"to": ["https://social.example/alyssa/"],
"inReplyTo": "https://social.example/alyssa/posts/49e2d03d-b53a-4c4c-a95c-94a6abf45a19",
"content": "<p>Argh, yeah, sorry, I'll get it back to you tomorrow.</p>
<p>I was reviewing the section on register machines,
since it's been a while since I wrote one.</p>"}}
Alyssa is relieved, and likes Ben's post: {"@context": "https://www.w3.org/ns/activitystreams",
"type": "Like",
"id": "https://social.example/alyssa/posts/5312e10e-5110-42e5-a09b-934882b3ecec",
"to": ["https://chatty.example/ben/"],
"actor": "https://social.example/alyssa/",
"object": "https://chatty.example/ben/p/51086"}
She POSTs this message to her outbox. (Since it's an activity, her server knows it doesn't need to wrap it in a Create object). Feeling happy about things, she decides to post a public message to her followers. Soon the following message is blasted to all the members of her followers collection, and since it has the special Public group addressed, is generally readable by anyone. {"@context": "https://www.w3.org/ns/activitystreams",
"type": "Create",
"id": "https://social.example/alyssa/posts/9282e9cc-14d0-42b3-a758-d6aeca6c876b",
"to": ["https://social.example/alyssa/followers/",
"as:Public"],
"actor": "https://social.example/alyssa/",
"object": {"type": "Note",
"id": "https://social.example/alyssa/posts/d18c55d4-8a63-4181-9745-4e6cf7938fa1",
"attributedTo": "https://social.example/alyssa/",
"to": ["https://social.example/alyssa/followers/",
"as:Public"],
"content": "Lending books to friends is nice. Getting them back is even nicer! :)"}}
Social Web Working GroupActivityPub is one of several related specifications being produced by the Social Web Working Group. Implementers interested in alternative approaches and complementary protocols should review [[Micropub]] and the overview document [[Social-Web-Protocols]]. Specification ProfilesThis specification defines two closely related and interacting protocols:
The ActivityPub specification is designed so that once either of these protocols are implemented, supporting the other is of very little additional effort. However, servers may still implement one without the other. This gives three conformance classes:
It is called out whenever a portion of the specification only applies to implementation of the federation protocol. In addition, whenever requirements are specified, it is called out whether they apply to the client or server (for the client-to-server protocol) or whether referring to a sending or receiving server in the server-to-server protocol. ObjectsObjects are the core concept around which both [[!activitystreams-core]] and ActivityPub are built. Objects are often wrapped in Activities and are contained in streams of Collections, which are themselves subclasses of Objects. See the [[!activitystreams-vocabulary]] document, particularly the Core Classes; ActivityPub follows the mapping of this vocabulary very closely.
ActivityPub defines some terms in addition to those provided by
Activity Streams.
These terms are provided in the ActivityPub
JSON-LD context
at
ActivityPub shares the same URI / IRI conventions as in Activity Streams. Servers SHOULD validate the content they receive to avoid content spoofing attacks. (A server should do something at least as robust as checking that the object appears as received at its origin, but mechanisms such as checking signatures would be better if available). No particular mechanism for verification is authoritatively specified by this document, but please see Security Considerations for some suggestions and good practices.
As an example, if example.com receives the activity
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Like",
"actor": "https://example.net/~mallory",
"to": ["https://hatchat.example/sarah/",
"https://example.com/peeps/john/"],
"object": {
"@context": {"@language": "en"},
"id": "https://example.org/~alice/note/23",
"type": "Note",
"attributedTo": "https://example.org/~alice",
"content": "I'm a goat"
}
}
it should dereference the id both to ensure that it exists
and is a valid object, and that it is not misrepresenting the object.
(In this example, Mallory could be spoofing an object allegedly posted
by Alice).
Object IdentifiersAll Objects in [[!activitystreams-core]] should have unique global identifiers. ActivityPub extends this requirement; all objects distributed by the ActivityPub protocol MUST have unique global identifiers, unless they are intentionally transient or anonymous, in which case the identifier MAY be omitted. If present, the identifiers MUST be publicly dereferencable URIs, such as HTTPS URIs, with their authority belonging to that of their originating server. (Publicly facing content SHOULD use HTTPS URIs).
Identifiers MUST be provided for activities posted in server to
server communication, unless the activity is intentionally transient.
However, for client to server communication, a server receiving an
object posted to the outbox with no specified All objects have the following properties:
Retrieving objects
The HTTP GET method may be used to dereference an object's Servers MAY implement other behavior for requests which do not comply with the above requirement. (For example, servers may implement additional legacy protocols, or may use the same URI for both HTML and Activity Streams representations of a resource). Servers MAY require authorization as specified in , and may additionally implement their own authorization rules. Servers SHOULD fail requests which do not pass their authorization checks with the appropriate HTTP error code, or the 403 Forbidden error code where the existence of the object is considered private. An origin server which does not wish to disclose the existence of a private target MAY instead respond with a status code of 404 Not Found. The source property
In addition to all the properties defined by the
[[!activitystreams-vocabulary]], ActivityPub extends the
The value of {
"@context": ["https://www.w3.org/ns/activitystreams",
{"@language": "en"}],
"type": "Note",
"id": "http://postparty.example/p/2415",
"content": "<p>I <em>really</em> like strawberries!</p>",
"source": {
"content": "I *really* like strawberries!",
"mediaType": "text/markdown"}
}
In general, it's best to let a user edit their original post
in the same source format they originally composed it in.
But not all clients can reliably provide a nice interface for
all source types, and since clients are expected to do the
conversion from
For example, Alyssa P. Hacker likes to post to her ActivityPub
powered blog via an Emacs client she has written, leveraging
Org mode.
Later she switches to editing on her phone's client, which
has no idea what Actors
ActivityPub actors are generally one of the
Activity Streams Actor Types,
but they don't have to be. For example, a
Profile object
might be used as an actor, or a type from an Activity Streams extension.
Actors are retrieved like any other
Object in ActivityPub.
Like other Activity Streams objects, actors have an
Once the actor's URI has been identified, it should be dereferenced.
ActivityPub does not dictate a specific relationship between
"users" and Actors; many configurations are possible.
There may be multiple human users or organizations controlling an
Actor, or likewise one human or organization may control multiple
Actors. Similarly, an Actor may represent a piece of software,
like a bot, or an automated process.
More detailed "user" modelling, for example linking together of Actors which
are controlled by the same entity, or allowing one Actor to be presented
through multiple alternate profiles or aspects, are at the discretion
of the implementation.
Actor objectsActor objects MUST have, in addition to the properties mandated by , the following properties:
Implementations SHOULD, in addition, provide the following properties:
Implementations MAY provide the following properties: {
"@context": ["https://www.w3.org/ns/activitystreams",
{"@language": "ja"}],
"type": "Person",
"id": "https://kenzoishii.example.com/",
"following": "https://kenzoishii.example.com/following.json",
"followers": "https://kenzoishii.example.com/followers.json",
"liked": "https://kenzoishii.example.com/liked.json",
"inbox": "https://kenzoishii.example.com/inbox.json",
"outbox": "https://kenzoishii.example.com/feed.json",
"preferredUsername": "kenzoishii",
"name": "石井健蔵",
"summary": "この方はただの例です",
"icon": [
"https://kenzoishii.example.com/image/165987aklre4"
]
}
Implementations MAY, in addition, provide the following properties:
The
As the upstream vocabulary for ActivityPub, any applicable [[!activitystreams-core]] property may be used on ActivityPub Actors. Some Activity Streams properties are particularly worth highlighting to demonstrate how they are used in ActivityPub implementations.
Properties containing natural language values,
such as Collections[[!activitystreams-core]] defines the collection concept; ActivityPub defines several collections with special behavior. Note that ActivityPub makes use of Activity Streams paging to traverse large sets of objects.
Note that some of these collections are specified to be of type
What property is used to determine the reverse chronological order is intentionally left as an implementation detail. For example, many SQL-style databases use an incrementing integer as an identifier, which can be reasonably used for handling insertion order in most cases. In other databases, an insertion time timestamp may be preferred. What is used isn't important, but the ordering of elements must remain intact, with newer items first. A property which changes regularly, such a "last updated" timestamp, should not be used. Outbox
The outbox is discovered through the The outbox stream contains activities the user has published, subject to the ability of the requestor to retrieve the activity (that is, the contents of the outbox are filtered by the permissions of the person reading it). If a user submits a request without Authorization the server SHOULD respond with all of the Public posts. This could potentially be all relevant objects published by the user, though the number of available items is left to the discretion of those implementing and deploying the server. The outbox accepts HTTP POST requests, with behaviour described in Client to Server Interactions. Inbox
The inbox is discovered through the The inbox stream contains all activities received by the actor. The server SHOULD filter content according to the requester's permission. In general, the owner of an inbox is likely to be able to access all of their inbox contents. Depending on access control, some other content may be public, whereas other content may require authentication for non-owner users, if they can access the inbox at all.
The server MUST perform de-duplication of activities returned by
the inbox. Duplication can occur if an activity is addressed both
to an actor's followers, and a specific
actor who also follows the recipient actor, and the server has failed
to de-duplicate the recipients list.
Such deduplication MUST be performed by comparing the
The inboxes of actors on federated servers accepts HTTP POST requests, with behaviour described in Delivery. Non-federated servers SHOULD return a 405 Method Not Allowed upon receipt of a POST request. Followers Collection
Every actor SHOULD have a The follow activity generally is a request to see the objects an actor creates. This makes the Followers collection an appropriate default target for delivery of notifications. Following Collection
Every actor SHOULD have a Liked Collection
Every actor MAY have a Public Addressing
In addition to [[!activitystreams-core]] collections and objects,
Activities may additionally be addressed to the special "public"
collection, with the identifier
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "as:Public",
"type": "Collection"
}
Activities addressed to this special URI shall be accessible to all
users, without authentication.
Implementations MUST NOT deliver to the "public" special collection;
it is not capable of receiving actual activities.
However, actors MAY have a
Compacting an Activity Streams object using the Activity Streams
JSON-LD context might result in
Likes Collection
Every object MAY have a
Care should be taken to not confuse the
Shares Collection
Every object MAY have a Client to Server InteractionsActivities as defined by [[!activitystreams-core]] are the core mechanism for creating, modifying and sharing content within the social graph.
Client to server interaction takes place through clients posting
Activities to an actor's outbox.
To do this, clients MUST discover the URL of the actor's outbox from
their profile and then MUST make an HTTP
POST /outbox/ HTTP/1.1
Host: dustycloud.org
Authorization: Bearer XXXXXXXXXXX
Content-Type: application/ld+json; profile="https://www.w3.org/ns/activitystreams"
{
"@context": ["https://www.w3.org/ns/activitystreams",
{"@language": "en"}],
"type": "Like",
"actor": "https://dustycloud.org/christine/",
"name": "Christine liked 'Minimal ActivityPub update client'",
"object": "https://rhiaro.co.uk/2016/05/minimal-activitypub",
"to": ["https://rhiaro.co.uk/#amy",
"https://dustycloud.org/followers",
"https://rhiaro.co.uk/followers/"],
"cc": "https://e14n.com/evan"
}
If an Activity is submitted with a value in the HTTP/1.1 201 Created
Location: https://dustycloud.org/likes/345
The server MUST remove the The server MUST then add this new Activity to the outbox collection. Depending on the type of Activity, servers may then be required to carry out further side effects. (However, there is no guarantee that time the Activity may appear in the outbox. The Activity might appear after a delay or disappear at any period). These are described per individual Activity below.
Attempts to submit objects to servers not implementing client to server
support SHOULD result in a HTTP caching mechanisms [[!RFC9111]] SHOULD be respected when appropriate, both in clients receiving responses from servers as well as servers sending responses to clients. Client Addressing
Clients are responsible for addressing new Activities
appropriately.
To some extent, this is dependent upon the particular client
implementation, but clients must be aware that the server will only
forward new Activities to addressees in the The Followers Collection and/or the Public Collection are good choices for the default addressing of new Activities.
Clients SHOULD look at any objects attached to the new Activity via the
Clients MAY give the user the chance to amend this addressing in the UI. For example, when Christine likes the following article by Amy: {
"@context": ["https://www.w3.org/ns/activitystreams",
{"@language": "en-GB"}],
"id": "https://rhiaro.co.uk/2016/05/minimal-activitypub",
"type": "Article",
"name": "Minimal ActivityPub update client",
"content": "Today I finished morph, a client for posting Activity Streams2...",
"attributedTo": "https://rhiaro.co.uk/#amy",
"to": "https://rhiaro.co.uk/followers/",
"cc": "https://e14n.com/evan"
}
the like is generated by the client as: {
"@context": ["https://www.w3.org/ns/activitystreams",
{"@language": "en"}],
"type": "Like",
"actor": "https://dustycloud.org/christine/",
"summary": "Christine liked 'Minimal ActivityPub update client'",
"object": "https://rhiaro.co.uk/2016/05/minimal-activitypub",
"to": ["https://rhiaro.co.uk/#amy",
"https://dustycloud.org/followers",
"https://rhiaro.co.uk/followers/"],
"cc": "https://e14n.com/evan"
}
The receiving outbox can then perform delivery to not only the followers of Christine (the liker), but also to Amy, and Amy's followers and Evan, both of whom received the original article.
Clients submitting the following activities to an Create Activity
The
When a
A mismatch between addressing of the Create activity and its
Object creation without a Create Activity
For client to server posting, it is possible to submit an object for
creation without a surrounding activity.
The server MUST accept a valid [[!activitystreams-core]] object that
isn't a subtype of
The
Any {
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Note",
"content": "This is a note",
"published": "2015-02-10T15:04:55Z",
"to": ["https://example.org/~john/"],
"cc": ["https://example.com/~erik/followers",
"as:Public"]
}
The above example could be converted to this:
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Create",
"id": "https://example.net/~mallory/87374",
"actor": "https://example.net/~mallory",
"object": {
"id": "https://example.com/~mallory/note/72",
"type": "Note",
"attributedTo": "https://example.net/~mallory",
"content": "This is a note",
"published": "2015-02-10T15:04:55Z",
"to": ["https://example.org/~john/"],
"cc": ["https://example.com/~erik/followers",
"as:Public"]
},
"published": "2015-02-10T15:04:55Z",
"to": ["https://example.org/~john/"],
"cc": ["https://example.com/~erik/followers",
"as:Public"]
}
Update Activity
The Partial UpdatesFor client to server interactions, updates are partial; rather than updating the document all at once, any key value pair supplied is used to replace the existing value with the new value. This only applies to the top-level fields of the updated object. Note that this behavior is for client to server interaction where the client is posting to the server only. Server to server interaction and updates from the server to the client should contain the entire new representation of the object, after the partial update application has been applied. See the description of the Update activity for server to server interactions for more details. Delete Activity
The A deleted object: {
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://example.com/~alice/note/72",
"type": "Tombstone",
"published": "2015-02-10T15:04:55Z",
"updated": "2015-02-10T15:04:55Z",
"deleted": "2015-02-10T15:04:55Z"
}
Follow Activity
The
The side effect of receiving this in an outbox
is that the server SHOULD add the Add Activity
Upon receipt of an
Remove Activity
Upon receipt of a
Like Activity
The
The side effect of receiving this in an outbox
is that the server SHOULD add the Block Activity
The
Servers SHOULD NOT deliver Block Activities to their Undo Activity
The
There are some exceptions where there is an existing and explicit
"inverse activity" which should be used instead.
DeliveryFederated servers SHOULD perform delivery on all Activities posted to the outbox according to outbox delivery. Servers MAY filter activities for privacy, abuse mitigation, or other reasons. Uploading MediaServers MAY support uploading document types to be referenced in activites, such as images, video or other binary data, but the precise mechanism is out of scope for this version of ActivityPub. The Social Web Community Group is refining the protocol in the ActivityPub Media Upload report. Server to Server Interactions
Servers communicate with other servers and propagate information across
the social graph by posting activities to actors'
inbox endpoints.
An Activity sent over the network SHOULD have an
In order to propagate updates throughout the social graph, Activities are sent to the appropriate recipients. First, these recipients are determined through following the appropriate links between objects until you reach an actor, and then the Activity is inserted into the actor's inbox (delivery). This allows recipient servers to:
Delivery is usually triggered by, for example:
Servers performing delivery to the HTTP caching mechanisms [[!RFC9111]] SHOULD be respected when appropriate, both when receiving responses from other servers as well as sending responses to other servers. DeliveryThe following is required by federated servers communicating with other federated servers only.
An activity is delivered to its targets (which are
actors) by first looking up the targets'
inboxes and then posting the activity to those inboxes.
Targets for delivery are determined by checking the
Activity Streams audience targeting;
namely, the
The inbox is determined by first
retrieving the target actor's JSON-LD representation
and then looking up the
Servers MUST de-duplicate the final recipient list. Servers MUST also
exclude actors from the list which are the same as the What to do when there are no recipients specified is not defined, however it's recommended that if no recipients are specified the object remains completely private and access controls restrict the access to object. If the object is addressed exclusively to the "public" collection, the object may be publicly viewable in the actor's outbox without being delivered to any actors.
An HTTP POST request (with authorization of the submitting user) is
then made to the inbox, with the Activity as
the body of the request.
This Activity is added by the receiver as an For federated servers performing delivery to a third party server, delivery SHOULD be performed asynchronously, and SHOULD additionally retry delivery to recipients if it fails due to network error. Note: Activities being distributed between actors on the same origin may use any internal mechanism, and are not required to use HTTP.
While it is not required reading to understand this specification,
it is worth noting that ActivityPub's targeting and delivery
mechanism overlaps with the
Linked Data Notifications
specification, and the two specifications may interoperably
combined.
In particular, the Outbox Delivery Requirements for Server to ServerWhen objects are received in the outbox (for servers which support both Client to Server interactions and Server to Server Interactions), the server SHOULD target and deliver to:
Servers MAY filter activities for privacy, abuse mitigation, or other reasons. Servers MAY deliver objects that are addressed to the Public special collection, to additional inboxes, such as `sharedInbox` endpoints" . These fields will have been populated appropriately by the client which posted the Activity to the outbox. Forwarding from InboxThe following section is to mitigate the "ghost replies" problem which occasionally causes problems on federated networks. This problem is best demonstrated with an example. Alyssa makes a post about her having successfully presented a paper at a conference and sends it to her followers collection, which includes her friend Ben. Ben replies to Alyssa's message congratulating her and includes her followers collection on the recipients. However, Ben has no access to see the members of Alyssa's followers collection, so his server does not forward his messages to their inbox. Without the following mechanism, if Alyssa were then to reply to Ben, her followers would see Alyssa replying to Ben without having ever seen Ben interacting. This would be very confusing!
When Activities are received in the inbox, the
server needs to forward these to recipients that the origin was unable
to deliver them to. To do this, the server MUST target and
deliver
to the values of
The server MAY filter its delivery targets according to implementation-specific rules (for example, spam filtering). Shared Inbox DeliveryFor servers hosting many actors, delivery to all followers can result in an overwhelming number of messages sent. Some servers would also like to display a list of all messages posted publicly to the "known network". Thus ActivityPub provides an optional mechanism for serving these two use cases.
When an object is being delivered to the originating actor's
followers, a server MAY reduce the number of receiving actors
delivered to by identifying all followers which share the same
sharedInbox
who would otherwise be individual recipients and instead deliver
objects to said
Additionally, if an object is addressed to the
Public special collection, a
server MAY deliver that object to additional
Origin servers sending publicly addressed activities to
Create Activity
Receiving a Update Activity
For server to server interactions, an
The receiving server MUST take care to be sure that the
Delete Activity
The side effect of receiving this is that (assuming the
(Note that after an activity has been transmitted from an origin server to a remote server, there is nothing in the ActivityPub protocol that can enforce remote deletion of an object's representation). Follow Activity
The side effect of receiving this in an inbox is
that the server SHOULD generate either an
Sometimes a successful Accept Activity
The side effect of receiving this in an inbox is
determined by the type of the
If the Reject Activity
The side effect of receiving this in an inbox is
determined by the type of the
If the Add Activity
Upon receipt of an
Remove Activity
Upon receipt of a
Like Activity
The side effect of receiving this in an inbox is
that the server SHOULD increment the object's count of likes by
adding the received activity to the
Announce Activity (sharing)
Upon receipt of an
The
Announce activity is effectively what is known as
"sharing", "reposting", or "boosting" in other social networks.
Undo Activity
The Internationalization
Building an international base of users is important in a federated
network.
Activity Streams provides tooling for internationalization of content,
which should be used whenever possible.
However, it can be difficult for implementations to determine which
Security ConsiderationsAuthentication and AuthorizationActivityPub uses authentication for two purposes; first, to authenticate clients to servers, and secondly in federated implementations to authenticate servers to each other. Unfortunately at the time of standardization, there are no strongly agreed upon mechanisms for authentication. Some possible directions for authentication are laid out in the Social Web Community Group Authentication and Authorization best practices report. VerificationServers should not trust client submitted content, and federated servers also should not trust content received from a server other than the content's origin without some form of verification. Servers should be careful to verify that new content is really posted by the actor that claims to be posting it, and that the actor has permission to update the resources it claims to. See also and . Accessing localhost URIsIt is often convenient while developing to test against a process running on localhost. However, permitting requests to localhost in a production client or server instance can be dangerous. Making requests to URIs on localhost which do not require authorization may unintentionally access or modify resources assumed to be protected to be usable by localhost-only. If your ActivityPub server or client does permit making requests to localhost URIs for development purposes, consider making it a configuration option which defaults to off. URI Schemes
There are many types of URIs aside from just Recursive ObjectsServers should set a limit on how deep to recurse while resolving objects, or otherwise specially handle Activity Streams objects with recursive references. Failure to properly do so may result in denial-of-service security vulnerabilities. SpamSpam is a problem in any network, perhaps especially so in federated networks. While no specific mechanism for combating spam is provided in ActivityPub, it is recommended that servers filter incoming content both by local untrusted users and any remote users through some sort of spam filter. Federation denial-of-serviceServers should implement protections against denial-of-service attacks from other, federated servers. This can be done using, for example, some kind of ratelimiting mechanism. Servers should be especially careful to implement this protection around activities that involve side effects. Servers SHOULD also take care not to overload servers with submissions, for example by using an exponential backoff strategy. Client-to-server ratelimitingServers should ratelimit API client submissions. This serves two purposes:
Client-to-server response denial-of-serviceIn order to prevent a client from being overloaded by oversized Collections, servers should take care to limit the size of Collection pages they return to clients. Clients should still be prepared to limit the size of responses they are willing to handle in case they connect to malicious or compromised servers, for example by timing out and generating an error. Sanitizing ContentAny activity field being rendered for browsers (or other rich text enabled applications) should take care to sanitize fields containing markup to prevent cross site scripting attacks. Not displaying bto and bcc properties
AcknowledgementsThis specification comes from years of hard work and experience by a number of communities exploring the space of federation on the web. In particular, much of this specification is informed by OStatus and the Pump API, as pioneered by StatusNet (now GNU Social) and Pump.io. Both of those initiatives were the product of many developers' hard work, but more than anyone, Evan Prodromou has been a constant leader in this space, and it is unlikely that ActivityPub would exist in something resembling its current state without his hard work. Erin Shepherd built the initial version of this specification, borrowed from the ideas in the Pump API document, mostly as a complete rewrite of text, but sharing most of the primary ideas while switching from Activity Streams 1 to Activity Streams 2. Jessica Tallon and Christine Lemmer-Webber took over as editors when the standard moved to the W3C Social Working Group and did the majority of transition from Erin Shepherd's document to its current state as ActivityPub. Much of the document was rewritten and reorganized under the long feedback process of the Social Working Group. ActivityPub has been shaped by the careful input of many members in the W3C Social Working Group. ActivityPub especially owes a great debt to Amy Guy, who has done more than anyone to map the ideas across the different Social Working Group documents through her work on [[Social-Web-Protocols]]. Amy also laid out the foundations for a significant refactoring of the ActivityPub spec while sprinting for four days with Christine Lemmer-Webber. These revisions lead to cleaner separation between the client to server and server components, along with clarity about ActivityPub's relationship to [[LDN]], among many other improvements. Special thanks also goes to Benjamin Goering for putting together the implementation report template. We also thank mray for producing the spectacular tutorial illustrations (which are licensed under the same license as the rest of this document). Many people also helped ActivityPub along through careful review. In particular, thanks to: Aaron Parecki, AJ Jordan, Benjamin Goering, Caleb Langeslag, Elsa Balderrama, elf Pavlik, Eugen Rochko, Erik Wilde, Jason Robinson, Manu Sporny, Michael Vogel, Mike Macgirvin, nightpool, Puck Meerburg, Sandro Hawke, Sarven Capadisli, Tantek Çelik, and Yuri Volkov. This document is dedicated to all citizens of planet Earth. You deserve freedom of communication; we hope we have contributed in some part, however small, towards that goal and right. ChangelogThis section is non-normative.
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |