diff options
author | Eitan Isaacson <eitan@monotonous.org> | 2010-05-22 08:59:16 -0700 |
---|---|---|
committer | Eitan Isaacson <eitan@monotonous.org> | 2010-06-02 22:29:19 -0700 |
commit | bb23e7068b2f60478f715b4b6b3b6d88c8054766 (patch) | |
tree | 2fce6a68afdd164839c8c381001bb3094e34617e /extensions | |
parent | 55a6aab942714de24582fc5ec0dec90c8af931e4 (diff) |
Added new SASL API to extensions.
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/Channel_Interface_Sasl_Authentication.xml | 221 | ||||
-rw-r--r-- | extensions/Channel_Type_Server_Authentication.xml | 93 | ||||
-rw-r--r-- | extensions/Makefile.am | 4 | ||||
-rw-r--r-- | extensions/all.xml | 3 |
4 files changed, 320 insertions, 1 deletions
diff --git a/extensions/Channel_Interface_Sasl_Authentication.xml b/extensions/Channel_Interface_Sasl_Authentication.xml new file mode 100644 index 000000000..d1000cd81 --- /dev/null +++ b/extensions/Channel_Interface_Sasl_Authentication.xml @@ -0,0 +1,221 @@ +<?xml version="1.0" ?> +<node name="/Channel_Interface_Sasl_Authentication" + xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> + <tp:copyright> Copyright © 2010 Collabora Limited </tp:copyright> + <tp:license xmlns="http://www.w3.org/1999/xhtml"> + <p>This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version.</p> + +<p>This library 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 +Lesser General Public License for more details.</p> + +<p>You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</p> + </tp:license> + <interface name="org.freedesktop.Telepathy.Channel.Interface.SaslAuthentication.DRAFT" tp:causes-havoc="experimental"> + <tp:requires interface="org.freedesktop.Telepathy.Channel"/> + <tp:requires interface="org.freedesktop.Telepathy.Channel.Type.Server.Authentication.DRAFT"/> + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + A channel interface for SASL authentication. + </tp:docstring> + + + <property name="AvailableMechanisms" + tp:name-for-bindings="Available_Mechanisms" + type="as" access="read"> + <tp:docstring> + Example: [ "PLAIN", "DIGEST-MD5", "SCRAM-SHA-1" ] + The SASL mechanisms as offered by the server. + </tp:docstring> + </property> + + <property name="CurrentChallenge" tp:name-for-bindings="Current_Challenge" + type="ay" access="read"> + <tp:docstring> + The current challenge from the server. change notification via + NewChallenge. The handler either needs to respond by calling Response + (if it needs to send reply data), Accept (If the challenge + contained final data) or Abort (in case of errors) + </tp:docstring> + </property> + + <property name="CurrentState" tp:name-for-bindings="Current_State" + type="(uss)" tp:type="Sasl_State" access="read"> + <tp:docstring> + The current state of the authentication. + Change notification via StateChanged signal. + </tp:docstring> + </property> + + <method name="StartMechanism" tp:name-for-bindings="Start_Mechanism"> + <arg direction="in" name="Mechanism" type="s"> + <tp:docstring> + The chosen mechanism. + </tp:docstring> + </arg> + <arg direction="in" name="InitialData" type="ay"> + <tp:docstring> + Initial data to send with the mechanism. + </tp:docstring> + </arg> + <tp:docstring> + Start an authentication try using Mechanism. If the choosen SASL + mechanism is client-first then the first data must be passed in + InitialData, otherwise InitialData must be an empty array. + </tp:docstring> + </method> + + <method name="Respond" tp:name-for-bindings="Respond"> + <arg direction="in" name="Response_Data" type="ay"> + <tp:docstring> + The response data. + </tp:docstring> + </arg> + <tp:docstring> + Our response to the CurrentChallenge if required. + </tp:docstring> + </method> + + <method name="Accept" tp:name-for-bindings="Accept"> + <tp:docstring> + Handler accepts the authentication as finished. Can be called + whenever the Handler considered the authentication process to + be (successfully) finished from its part. + </tp:docstring> + </method> + + <method name="Abort" tp:name-for-bindings="Abort"> + <arg direction="in" name="Reason" type="u" tp:type="Abort_Reason"> + <tp:docstring> + Reason for abort. + </tp:docstring> + </arg> + <arg direction="in" name="Debug_Message" type="s"> + <tp:docstring> + Debug message for abort. + </tp:docstring> + </arg> + <tp:docstring> + Abort the current authentication try. + </tp:docstring> + </method> + + <signal name="StateChanged" tp:name-for-bindings="State_Changed"> + <tp:docstring> + Notifies of CurrentState changing + </tp:docstring> + <arg type="u" tp:type="Sasl_Status" name="Status"> + <tp:docstring> + The status of the state. + </tp:docstring> + </arg> + <arg type="s" tp:type="DBus_Error_Name" name="Reason"> + <tp:docstring> + The reason for the state. + </tp:docstring> + </arg> + <arg type="s" name="DebugMessage"> + <tp:docstring> + A non-localized debug message. + </tp:docstring> + </arg> + </signal> + + <signal name="NewChallenge" tp:name-for-bindings="New_Challenge"> + <tp:docstring> + Recieved a new challenge from the server. + </tp:docstring> + <arg name="ChallengeData" type="ay"> + <tp:docstring> + The challenge data from the server. + </tp:docstring> + </arg> + </signal> + + <tp:enum name="Abort_Reason" type="u"> + <tp:enumvalue suffix="Invalid_Challenge" value="0"> + <tp:docstring> + Server sent an invalid challenge or data. + </tp:docstring> + </tp:enumvalue> + <tp:enumvalue suffix="User_Abort" value="1"> + <tp:docstring> + User aborted the authentication. + </tp:docstring> + </tp:enumvalue> + </tp:enum> + + <tp:enum name="Sasl_Status" type="u"> + <tp:enumvalue suffix="Not_Started" value="0"> + <tp:docstring> + Need to call StartMechanism to start. + </tp:docstring> + </tp:enumvalue> + <tp:enumvalue suffix="In_Progress" value="1"> + <tp:docstring> + Challenge/Response cycle in progress + </tp:docstring> + </tp:enumvalue> + <tp:enumvalue suffix="Server_Succeeded" value="2"> + <tp:docstring> + Server indicated successful authentication, handler needs to + Accept or Abort. + </tp:docstring> + </tp:enumvalue> + <tp:enumvalue suffix="Client_Accepted" value="3"> + <tp:docstring> + Handler indicates that from its perspective the + authentication has successfully finished. + </tp:docstring> + </tp:enumvalue> + <tp:enumvalue suffix="Succeeded" value="4"> + <tp:docstring> + Everyone is happy (server sent success, client sent Accept), up to the handler to close the channel. + </tp:docstring> + </tp:enumvalue> + <tp:enumvalue suffix="Server_Failed" value="5"> + <tp:docstring> + Server indicated an authentication failure, + Authentication can be restarted by calling + StartMechanism again or completely aborted by Closing + the channel. + </tp:docstring> + </tp:enumvalue> + <tp:enumvalue suffix="Client_Failed" value="6"> + <tp:docstring> + Client indicated an authentication failure, + Authentication can be restarted by calling + StartMechanism again or completely aborted by Closing + the channel. + </tp:docstring> + </tp:enumvalue> + </tp:enum> + + <tp:struct name="Sasl_State"> + <tp:member type="u" tp:type="Sasl_Status" name="Status"> + <tp:docstring> + The status of the state. + </tp:docstring> + </tp:member> + + <tp:member type="s" tp:type="DBus_Error_Name" name="Reason"> + <tp:docstring> + The reason for the state. + </tp:docstring> + </tp:member> + + <tp:member type="s" name="DebugMessage"> + <tp:docstring> + A non-localized debug message. + </tp:docstring> + </tp:member> + </tp:struct> + + </interface> +</node> +<!-- vim:set sw=2 sts=2 et ft=xml: --> diff --git a/extensions/Channel_Type_Server_Authentication.xml b/extensions/Channel_Type_Server_Authentication.xml new file mode 100644 index 000000000..bc9ca150e --- /dev/null +++ b/extensions/Channel_Type_Server_Authentication.xml @@ -0,0 +1,93 @@ +<?xml version="1.0" ?> +<node name="/Channel_Type_Server_Authentication" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> + <tp:copyright> Copyright © 2010 Collabora Limited </tp:copyright> + <tp:license xmlns="http://www.w3.org/1999/xhtml"> + <p>This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version.</p> + +<p>This library 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 +Lesser General Public License for more details.</p> + +<p>You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</p> + </tp:license> + <interface name="org.freedesktop.Telepathy.Channel.Type.ServerAuthentication.DRAFT" tp:causes-havoc="experimental"> + <tp:requires interface="org.freedesktop.Telepathy.Channel"/> + + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + An interface for SASL authentication. + </tp:docstring> + + <property name="AuthenticationInformation" + tp:name-for-bindings="Authentication_Information" + type="a{sv}" access="read"> + <tp:docstring> + Dictionary of information given by the CM which can be used by the + handler for authentication. + </tp:docstring> + </property> + + <property name="AuthenticationMethod" + tp:name-for-bindings="Authentication_Method" + type="u" tp:type="Authentication_Type" access="read"> + <tp:docstring> + This property defines the Method used for the current + authentication step. The method also defines which Interfaces + the channel implements. For exmaple if for the SASL method the + SaslAuthentication interface needs to be implemented. + </tp:docstring> + </property> + + <tp:enum name="Authentication_Type" type="u"> + <tp:enumvalue suffix="Sasl" value="0"> + <tp:docstring> + SASL authentication. + </tp:docstring> + </tp:enumvalue> + <tp:enumvalue suffix="Captcha" value="1"> + <tp:docstring> + Captcha authentication. + </tp:docstring> + </tp:enumvalue> + </tp:enum> + + <tp:mapping name="AuthDetails" array-name="AuthDetails_List"> + <tp:docstring> + An extensible map representing details provided by the server for + authentication. + </tp:docstring> + + <tp:member type="s" name="Key"> + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + <p> + Well-known keys: + <dl> + <dt>username</dt> + <dd> + string, Username to authenticate with if needed + </dd> + <dt>realm</dt> + <dd> + string, Realm to use for authentication if needed + </dd> + <dt>session-id</dt> + <dd> + XMPP session id as needed for the legacy jabber digest method. + </dd> + </dl> + </p> + </tp:docstring> + </tp:member> + + <tp:member name="Value" type="v"> + </tp:member> + </tp:mapping> + + </interface> +</node> +<!-- vim:set sw=2 sts=2 et ft=xml: --> diff --git a/extensions/Makefile.am b/extensions/Makefile.am index 9fc1df1f4..3f64546e0 100644 --- a/extensions/Makefile.am +++ b/extensions/Makefile.am @@ -24,7 +24,9 @@ EXTRA_DIST = \ OLPC_Gadget.xml \ OLPC_Channel_Interface_View.xml \ OLPC_Channel_Type_BuddyView.xml \ - OLPC_Channel_Type_ActivityView.xml + OLPC_Channel_Type_ActivityView.xml \ + Channel_Interface_Sasl_Authentication.xml \ + Channel_Type_Server_Authentication.xml noinst_LTLIBRARIES = libgabble-extensions.la diff --git a/extensions/all.xml b/extensions/all.xml index cd6913727..efcf5a9c4 100644 --- a/extensions/all.xml +++ b/extensions/all.xml @@ -60,6 +60,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA</p> <xi:include href="Call_Stream_Interface_Media.xml" /> <xi:include href="Channel_Type_Call.xml" /> +<xi:include href="Channel_Type_Server_Authentication.xml" /> +<xi:include href="Channel_Interface_Sasl_Authentication.xml" /> + <tp:generic-types> <tp:external-type name="Contact_Handle" type="u" from="Telepathy specification"/> |