Salmon (protocol)

The Salmon Protocol is a message exchange protocol running over HTTP designed to decentralize commentary and annotations made against newsfeed articles such as blog posts. It allows a single discussion thread to be established between the article's origin and any feed reader or "aggregator" which is subscribing to the content. Put simply, that if an article appeared on 3 sites: A (the source), B and C (the aggregates), that members of all 3 sites could see and contribute to a single thread of conversation regardless of site they were viewing from.

Example

The origin supplies a Salmon end point – a URL in the metadata of an RSS/Atom (standard) feed. An aggregating site makes a note of the end point.

<link rel="salmon" href="http://example.org/salmon-endpoint"/>

If a member of the aggregator makes a comment, the aggregator will construct a comment for the benefit of the origin.

<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns='http://www.w3.org/2005/Atom'>
  <id>tag:example.com,2009:cmt-0.44775718</id>
  <author><name>test@example.com</name><uri>bob@example.com</uri></author>
  <thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0'
    ref='tag:blogger.com,1999:blog-893591374313312737.post-3861663258538857954'>
    tag:blogger.com,1999:blog-893591374313312737.post-3861663258538857954
  </thr:in-reply-to>
  <content>Salmon swim upstream!</content>
  <title>Salmon swim upstream!</title>
  <updated>2009-12-18T20:04:03Z</updated>
</entry>

The comment will be base64 encoded, digitally signed, placed in an envelope and POSTed back to the origin via the endpoint.

POST /salmon-endpoint HTTP/1.1
Host: example.org
Content-Type: application/atom+xml

<?xml version='1.0' encoding='UTF-8'?>
<me:env xmlns:me="http://salmon-protocol.org/ns/magic-env">
    <me:data type='application/atom+xml'>
    PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxlbnRyeSB4bWxucz0naHR0
    cDovL3d3dy53My5vcmcvMjAwNS9BdG9tJz4NCiAgPGlkPnRhZzpleGFtcGxlLmNvbSwyMDA5OmNt
    dC0wLjQ0Nzc1NzE4PC9pZD4NCiAgPGF1dGhvcj48bmFtZT50ZXN0QGV4YW1wbGUuY29tPC9uYW1l
    Pjx1cmk+Ym9iQGV4YW1wbGUuY29tPC91cmk+PC9hdXRob3I+DQogIDx0aHI6aW4tcmVwbHktdG8g
    eG1sbnM6dGhyPSdodHRwOi8vcHVybC5vcmcvc3luZGljYXRpb24vdGhyZWFkLzEuMCcNCiAgICBy
    ZWY9J3RhZzpibG9nZ2VyLmNvbSwxOTk5OmJsb2ctODkzNTkxMzc0MzEzMzEyNzM3LnBvc3QtMzg2
    MTY2MzI1ODUzODg1Nzk1NCc+DQogICAgdGFnOmJsb2dnZXIuY29tLDE5OTk6YmxvZy04OTM1OTEz
    NzQzMTMzMTI3MzcucG9zdC0zODYxNjYzMjU4NTM4ODU3OTU0DQogIDwvdGhyOmluLXJlcGx5LXRv
    Pg0KICA8Y29udGVudD5TYWxtb24gc3dpbSB1cHN0cmVhbSE8L2NvbnRlbnQ+DQogIDx0aXRsZT5T
    YWxtb24gc3dpbSB1cHN0cmVhbSE8L3RpdGxlPg0KICA8dXBkYXRlZD4yMDA5LTEyLTE4VDIwOjA0
    OjAzWjwvdXBkYXRlZD4NCjwvZW50cnk+
    </me:data>
    <me:encoding>base64url</me:encoding>
    <me:alg>RSA-SHA256</me:alg>
    <me:sig>
    EvGSD2vi8qYcveHnb-rrlok07qnCXjn8YSeCDDXlbhILSabgvNsPpbe76up8w63i2f
    WHvLKJzeGLKfyHg8ZomQ
    </me:sig>
</me:env>

The comment is then made available by the origin in its original feed so subscriber aggregators may refresh their view of the conversation. The protocol provides security so that each aggregator and each member is uniquely identified so that the upstream could employ measures to ban or filter out rogue sites or members if so desired.

Applications

Federated social networks such as GNU Social and Diaspora use Salmon as defined in the OStatus specification to coordinate discussion between members belonging to different servers. A member of one server can publish an article which is disseminated to other users over the network via Salmon who in turn can comment back in a similar fashion.

See also

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.