Skip to content

Latest commit

 

History

History
105 lines (72 loc) · 3.51 KB

File metadata and controls

105 lines (72 loc) · 3.51 KB

ActivityPush Specification

A lightweight method for URI addressable resources to be automatically notified about remote (off-site) activites on them.

A crypto-free alternative to the Salmon Protocol for public activites.

Imagine

  1. Alice's website aggregates posts from eveyone she follows (via PubSubHubbub).
  2. Alice visits her website, notices a post by Bob (that he made on his website) and likes it (on her website).
  3. Alice's website notifies Bob's website about the (like) activity (using ActivityPush).
  4. Bob's website shows the activity on Bob's activity stream and with his original post.
  5. Other users following Bob's website are notified about the activity (via PubSubHubbub).

Protocol Flow

Sender discovers Receiver Endpoint

> GET /bob/post/2 HTTP/1.1
> Host: bobs.host


< HTTP/1.1 200 OK
< Link: <http://bobs.host/activitypush-endpoint>; rel="http://activitypush.org/"
< ...
<
< <html>
< ...
< <link href="http://bobs.host/activitypush-endpoint" rel="http://activitypush.org/" />
< ...

Sender Notifies Receiver

> POST /activitypush-endpoint HTTP/1.1
> Host: bobs.host
> Content-Type: application/x-www-url-form-encoded
>
> actor=http://alices.host/alice&\
> activityid=http://alices.host/alice/activity/42&\
> object=http://bobs.host/bob/post/2


< HTTP/1.1 202 Accepted

Note: the "" character is used here to indicate line wrapping in the request content and is not part of the content itself.

bobs.host should check that the object of the activity belongs to it.

Receiver discovers Actor Endpoint

> GET /alice HTTP/1.1
> Host: alices.host


< HTTP/1.1 200 OK
< Link: <http://alices.host/activitypush-endpoint>; rel="http://activitypush.org/"
< ...
<
< <html>
< ...
< <link href="http://alices.host/activitypush-endpoint" rel="http://activitypush.org/" />
< ...

Receiver gets Activity from Actor Endpoint & Validates it

> GET /activitypush-endpoint?actor=...&activityid=...&object=... HTTP/1.1
> Host: alices.host


< HTTP/1.1 200 OK
< Content-Type: application/stream+json
<
< {JSON Activity Streams}

bobs.host should check that the actor and the object of the activity are the same as the one it received in the notification.

ActivityPush is agnostic to how Activities are represented as long as it has an actor URL, a verb and an object URL. For example, instead of the application/stream+json, 'alices.host` could have returned an HTML representation containing activity microformats or RDFa.

See also

Let's collaborate

Feel free to file an issue if you have feedback/questions/suggestions.