Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
350 lines (320 sloc) 11 KB
QUICKSOCIAL
-------------
Appleseed QuickSocial is a simple, unified protocol for distributed social networking
that uses HTTP and JSON to pass data between nodes.
More information is available at: http://opensource.appleseedproject.org/quicksocial/
Overview
-------------
QuickSocial is a unified protocol, and much of it's implementation relies on other parts of
the protocol. For instance, QuickFriend requires QuickConnect to verify identify before the
establishment of a relationship can be made. A few simple rules define the protocol flow:
0. Users have to remotely login to establish their identity.
1. Stored tokens are used to verify identity through callbacks before actions are taken.
2. Actions (friending, messaging) are taken by the home node only.
There are three levels of protocol support. Each level is dependant on the level above it.
0. Social, Node, Connect, User
1. Friend, Message
2. Feed, Tag, Search
Optimization
--------------
Where possible, the QuickSocial library does various optimizations, including concurrent and/or
persistent HTTP connections, and bulk data retrieval.
Token and node discovery caching must be handled by the application.
Protocol
-------------
-- IMPLEMENTED, ALPHA --
QuickSocial
- Verify / ReplyToVerify ## Verify a user.
- GET: _social=true
_task=verify
_token=<token> # Required for verification
_account=<user@domain> # Subject user who is taking the action.
_source=<domain> # Domain source
- JSON: success=<true|false>
error=<error>
- NOTE: If _username is empty, represents a site verification token only.
- RemoteVerify / ReplyToRemoteVerify ## Verify a user as a 3rd party node.
- GET: _social=true
_task=verify
_token=<token> # One-Way Encrypted, required for verification
_account=<user@domain> # Subject user who is taking the action.
_source=<domain> # Domain source
- JSON: success=<true|false>
error=<error>
- NOTE: If _username is empty, represents a site verification token only.
QuickNode
- Synchronize / ReplyToSynchronize
- GET: _social=true
_task=node.synchronize
_source=<domain> # Domain source
_token=<token> # Required for verification
_trusted=<[array]>
_discovered=<[array]>
_blocked=<[array]>
[unimplemented]
- Callback / ReplyToCallback
- GET: _social=true
_task=node.callback
_method=<method> # http, https, ws, etc
_token=<token> # Required for verification
_source=<domain> # Domain source
_description=<description> # Brief site description. Plain text.
_users=<#users> # User count for node.
_admin=<user@domain> # Admin emergency contact email
- JSON: success=<true|false>
error=<error>
QuickConnect
- Redirect / Check / Process
- GET: _social=true
_task=connect.check
_username=<username> # User we are authenticating.
_method=<method> # http, https, ws, etc
_source=<domain> # Domain source, required for token verification
- GET: _social=true
_task=connect.return
_username=<username> # User we are authenticating.
_source=<domain> # Domain source, required for token verification
_token=<token> # Required for verification
_success=<true|false>
_error=<error>
QuickUser
- UserInfo / ReplyToUserInfo
- GET: _social=true
_task=user.info
_token=<token> # Required for verification
_method=<method> # http, https, ws, etc
_request=<user@domain> # Who you are looking for
_account=<user@domain> # Subject user who is taking the action.
_request=<user[@domain]> # User whose info we're requesting.
_source=<domain> # Domain source, required for token verification
- JSON: success=<true|false>
error=<error>
fullname=<fullname>
online=<true|false> # User is currently online
blocked=<true|false> # Whether requesting user is blocked
status=<status> # Current user status line
friends=<array> # List of friends
- Icon
- GET: _social=true
_task=user.icon
_account=<user@domain> # Subject user who is taking the action.
_request=<user[@domain]> # User whose icon we're requesting.
_width=<width>
_height=<height>
QuickRedirect ## Used for redirecting requests to user's home node.
- GET: _social=true
_task=redirect
_action=<friend.add|friend.remove|
messages|messages.compose|
approval|notifications|
profile>
_account=<user@domain> # Subject user who is taking the action.
_request=<user@domain> # A user account associated with the action being taken.
_source=<domain> # Domain source, required for token verification
QuickFriend
- Friend / ReplyToFriend
- GET: _social=true
_task=friend.add
_token=<token> # Required for verification
_method=<method> # http, https, ws, etc
_account=<user@domain> # Subject user who is taking the action.
_request=<user[@domain]> # Friend being requested (domain optional).
_source=<domain> # Domain source, required for token verification
- JSON: success=<true|false>
error=<error>
- Approve / ReplyToApprove
- GET: _social=true
_task=friend.approve
_token=<token> # Required for verification
_method=<method> # http, https, ws, etc
_account=<user@domain> # Subject user who is taking the action.
_request=<user[@domain]> # Friend being requested (domain optional).
_source=<domain> # Domain source, required for token verification
- JSON: success=<true|false>
error=<error>
- Remove / ReplyToRemove
- GET: _social=true
_task=friend.remove
_token=<token> # Required for verification
_method=<method> # http, https, ws, etc
_account=<user@domain> # Subject user who is taking the action.
_request=<user[@domain]> # Friend being requested (domain optional).
_source=<domain> # Domain source, required for token verification
- JSON: success=<true|false>
error=<error>
QuickFeed
- Synchronize / ReplyToSynchronize
- GET: _social=true
_task=feed.synchronize
_token=<token> # Required for verification
_method=<method> # http, https, ws, etc
_account=<user@domain>
_source=<domain>
_recipient=<username>
_actionOwner=<user@domain>
_action=<action>
_actionLink=<actionlink>
_subjectOwner=<user@domain>
_contextOwner=<user@domain>
_context=<context>
_contextLink=<contextlink>
_title=<title>
_icon=<icon>
_comment=<comment>
_identifier=<identifier>
_description=<description>
_updated=<datetime>
_created=<datetime>
- JSON: success=<true|false>
error=<error>
incoming=<array>
actionOwner=<user@domain>
action=<action>
actionLink=<actionlink>
subjectOwner=<user@domain>
contextOwner=<user@domain>
context=<context>
contextLink=<contextlink>
title=<title>
icon=<icon>
comment=<comment>
identifier=<identifier>
description=<description>
stamp=<datetime>
-- FUTURE IMPLEMENTATION --
QuickMessage
- Notify / ReplyToNotify
- GET: _social=true
_task=message.notify
_account=<user@domain>
_source=<domain>
_recipient=<recipient>
_token=<token> # Required for verification
_subject=<subject>
_fullname=<fullname>
_identifier=<identifier>
- JSON: success=<true|false>
error=<error>
- Retrieve / ReplyToRetrieve
- GET: _social=true
_task=message.retrieve
_token=<token> # Required for verification
_method=<method> # http, https, ws, etc
_account=<user@domain>
_source=<domain>
_subject=<subject>
_identifier=<identifier>
- JSON: success=<true|false>
error=<error>
fullname=<fullname>
body=<body>
QuickFeed
- Report / ReplyToReport
- GET: _social=true
_task=feed.report
_token=<token> # Required for verification
_method=<method> # http, https, ws, etc
_account=<user@domain>
_actionOwner=<user@domain>
_action=<action>
_actionLink=<actionlink>
_subjectOwner=<user@domain>
_contextOwner=<user@domain>
_context=<context>
_contextLink=<contextlink>
_comment=<comment>
_description=<description>
_stamp=<datetime>
_identifier=<identifier>
- JSON: success=<true|false>
error=<error>
QuickNotification
- GET: _social=true
_task=notification.feed
_token=<token> # Required for verification
_method=<method> # http, https, ws, etc
_account=<user@domain>
_source=<domain>
- JSON success=<true|false>
error=<error>
results=<array>
type=<general|mail|request>
actionOwner=<user@domain>
action=<action>
actionLink=<actionlink>
subjectOwner=<user@domain>
contextOwner=<user@domain>
context=<context>
contextLink=<contextlink>
comment=<comment>
description=<description>
stamp=<datetime>
- GET: _social=true
_task=notification.read
_token=<token> # Required for verification
_method=<method> # http, https, ws, etc
_account=<user@domain>
_source=<domain>
_stamp=<stamp>
- JSON success=<true|false>
error=<error>
QuickTag
- Tag / ReplyToTag
- GET: _social=true
_task=tag.add
_token=<token> # Required for verification
_method=<method> # http, https, ws, etc
_account=<user@domain>
_source=<domain>
_tagged=<username>
_context=<context>
_contextLink=<contextlink>
_identifier=<identifier>
- JSON: success=<true|false>
error=<error>
- Approve / ReplyToApprove
- GET: _social=true
_task=tag.approve
_token=<token> # Required for verification
_method=<method> # http, https, ws, etc
_account=<user@domain>
_source=<domain>
_tagged=<username>
_identifier=<identifier>
- JSON: success=<true|false>
error=<error>
- Remove / ReplyToRemove
- GET: _social=true
_task=tag.remove
_token=<token> # Required for verification
_method=<method> # http, https, ws, etc
_account=<user@domain>
_source=<domain>
_tagged=<username>
_identifier=<identifier>
- JSON: success=<true|false>
error=<error>
QuickSearch
- Search / ReplyToSearch
- GET: _social=true
_task=search.keyword
_token=<token> # Required for verification
_method=<method> # http, https, ws, etc
_account=<user@domain>
_source=<domain>
_keywords=<array> # Array of keywords to search for.
- JSON: success=<true|false>
error=<error>
results=<array>
title=<title>
link=<link>
icon=<icon>
owner=<owner>
description=<description>
stamp=<datetime>
network=<array>
user=<username>
domain=<domain>
fullname=<fullname>
online=<online>
- NOTE: Must prevent recursive loops.