oauth discovery and all new actions

Updated the spec to include OAuth discovery.

Added new actions for all the OMB URLs.

darcs-hash:20080526112700-84dde-b1800fb4a5ab830be065e736d2a74b742b7eb0f6.gz
This commit is contained in:
Evan Prodromou 2008-05-26 07:27:00 -04:00
parent c36c7db82c
commit 2fe978e1bb
6 changed files with 173 additions and 27 deletions

27
actions/accesstoken.php Normal file
View File

@ -0,0 +1,27 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
* Copyright (C) 2008, Controlez-Vous, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
if (!defined('LACONICA')) { exit(1); }
class AccesstokenAction extends Action {
function handle($args) {
parent::handle($args);
common_server_error(_t('Not yet implemented.'));
}
}

27
actions/postnotice.php Normal file
View File

@ -0,0 +1,27 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
* Copyright (C) 2008, Controlez-Vous, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
if (!defined('LACONICA')) { exit(1); }
class PostnoticeAction extends Action {
function handle($args) {
parent::handle($args);
common_server_error(_t('Not yet implemented.'));
}
}

27
actions/requesttoken.php Normal file
View File

@ -0,0 +1,27 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
* Copyright (C) 2008, Controlez-Vous, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
if (!defined('LACONICA')) { exit(1); }
class RequesttokenAction extends Action {
function handle($args) {
parent::handle($args);
common_server_error(_t('Not yet implemented.'));
}
}

27
actions/updateprofile.php Normal file
View File

@ -0,0 +1,27 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
* Copyright (C) 2008, Controlez-Vous, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
if (!defined('LACONICA')) { exit(1); }
class UpdateprofileAction extends Action {
function handle($args) {
parent::handle($args);
common_server_error(_t('Not yet implemented.'));
}
}

View File

@ -0,0 +1,27 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
* Copyright (C) 2008, Controlez-Vous, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
if (!defined('LACONICA')) { exit(1); }
class UserauthorizationAction extends Action {
function handle($args) {
parent::handle($args);
common_server_error(_t('Not yet implemented.'));
}
}

View File

@ -13,7 +13,7 @@ users of another service, given the other users' permission.
Enabling technologies Enabling technologies
===================== =====================
Depends on OAuth 1.0, YADIS 1.0. Depends on OAuth 1.0, OAuth Discovery 1.0, YADIS 1.0.
We piggy-back additional information onto these protocols to pass We piggy-back additional information onto these protocols to pass
microblogging information back and forth. microblogging information back and forth.
@ -33,9 +33,9 @@ listener
listenee listenee
the user sending notices. the user sending notices.
remote service remote service
the listenee's service. the listenee's microblogging service.
local service local service
the listener's service. the listener's microblogging service.
profile URL profile URL
"home" URL for the listener, typically their profile page on a "home" URL for the listener, typically their profile page on a
microblogging site. microblogging site.
@ -60,25 +60,26 @@ notice URI
Initiation Initiation
========== ==========
The user submits their profile URL to the remote service somehow -- The user submits their profile URL [*] to the remote service somehow --
for example, with an HTML form on the remote service's Web site. for example, with an HTML form on the remote service's Web site.
.. [*] For OAuth Discovery, this is the "protected resource". It may
be more correct that the protected resource is the postNotice URL
(see below), but the listener will be more familiar with their own
profile URL. So there will have to be discovery of the postNotice
URL anyways, and it might as well all be done in one step.
Discovery Discovery
========= =========
The remote service recovers a YADIS document from the profile URL, as The remote service recovers a YADIS document from the profile URL, as
described in YADIS 1.0. described in OAuth Discovery.
The remote service looks for the URIs of Service of these types: The request token service must have a LocalID associated with it,
containing the identifier URI for the listener.
http://openmicroblogging.org/protocol/0.1/requestToken The following two extra services must be included in the YADIS
Request Token URL, as in OAuth 1.0 document, with accompanying URIs.
http://openmicroblogging.org/protocol/0.1/userAuthorization
User Authorization URL, as in OAuth 1.0
http://openmicroblogging.org/protocol/0.1/accessToken
Access Token URL, as in OAuth 1.0
http://openmicroblogging.org/protocol/0.1/postNotice http://openmicroblogging.org/protocol/0.1/postNotice
Post Notice URL, as defined below. Post Notice URL, as defined below.
@ -86,9 +87,6 @@ http://openmicroblogging.org/protocol/0.1/postNotice
http://openmicroblogging.org/protocol/0.1/updateProfile http://openmicroblogging.org/protocol/0.1/updateProfile
Update Profile URL, as defined below. Update Profile URL, as defined below.
http://openmicroblogging.org/protocol/0.1/identifier
identifier URI for the user with this profile URL.
If any of the URIs is unavailable, the remote service MUST stop If any of the URIs is unavailable, the remote service MUST stop
processing. processing.
@ -202,6 +200,12 @@ omb_listener_avatar
This will allow the remote service to display information about the This will allow the remote service to display information about the
listener in the listenee's "listeners" or "subscribers" list. listener in the listenee's "listeners" or "subscribers" list.
Access token
------------
The access token step of the OAuth protocol requires no additional
parameters.
Posting a Notice Posting a Notice
================ ================
@ -289,18 +293,25 @@ omb_listenee_license
The default license URL for the listenee's stream. A change in the The default license URL for the listenee's stream. A change in the
default license only applies to future notices; notices previous default license only applies to future notices; notices previous
to the update SHOULD be treated as under the old license. to the update SHOULD be treated as under the old license.
omb_listener_fullname omb_listenee_fullname
The full name of the listener. Up to 255 chars. The full name of the listenee. Up to 255 chars.
omb_listener_homepage omb_listenee_homepage
The home page of the listener. The home page of the listenee.
omb_listener_bio omb_listenee_bio
A brief biography of the listener; less than 140 chars. A brief biography of the listenee; less than 140 chars.
omb_listener_location omb_listenee_location
Physical location of the listener; less that 255 chars. Physical location of the listenee; less that 255 chars.
omb_listener_avatar omb_listenee_avatar
URL of a 96px by 96px image in PNG, GIF or JPEG format representing URL of a 96px by 96px image in PNG, GIF or JPEG format representing
the listener. the listenee.
Missing parameters should not be construed to mean that the profile Missing parameters should not be construed to mean that the profile
field has been blanked. The remote service MUST set the parameter to field has been blanked. The remote service MUST set the parameter to
an empty string to show that the field is blank. an empty string to show that the field is blank.
References
==========
* OAuth: http://oauth.net/
* OAuth Discovery: http://oauth.net/discovery/1.0
* XRDS Simple: http://xrds-simple.net/core/1.0/