Abstract: | This document defines a protocol for managing rosters remotely. |
Author: | Jan Kaluža |
Copyright: | © 1999 - 2013 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | ProtoXEP |
Type: | Standards Track |
Version: | 0.1 |
Last Updated: | 2013-01-29 |
WARNING: This document has not yet been accepted for consideration or approved in any official manner by the XMPP Standards Foundation, and this document is not yet an XMPP Extension Protocol (XEP). If this document is accepted as a XEP by the XMPP Council, it will be published at <http://xmpp.org/extensions/> and announced on the <standards@xmpp.org> mailing list.
1. Introduction
2. Requirements
3. Use Cases
3.1. Determining Support
3.2. Server or component asks another server to get permission to edit user's roster
3.3. Client requests list of components with permissions to edit his roster
3.4. Server or component requests user's roster
3.5. Client sends roster update
3.6. Component sends roster update
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
Currently there's no solid way for components to manipulate with user's roster. This is typically used by gateways on first login when they have to add contacts from legacy network to user's roster or when synchronizing them later. Roster Item Exchange [1] allows component to suggest roster change, but it doesn't help in situations when component wants to be informed about contact's group/nickname change, which is important especially for gateways.
The motivations for this document are to:
If an entity supports the protocol specified herein, it MUST advertise that fact by returning a feature of "http://spectrum.im/protocol/remote-roster" in response to Service Discovery [2] information requests (see Protocol Namespaces regarding issuance of one or more permanent namespaces).
<iq from='icq.example.com' id='disco1' to=shakespeare.lit' type='get'> <query xmlns='http://jabber.org/protocol/disco#info'/> </iq>
<iq from='shakespeare.lit' id='disco1' to='icq.example.com' type='result'> <query xmlns='http://jabber.org/protocol/disco#info'> <feature var='http://spectrum.im/protocol/remote-roster'/> </query> </iq>
In order for an application to determine whether an entity supports this protocol, where possible it SHOULD use the dynamic, presence-based profile of service discovery defined in Entity Capabilities [3]. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.
To edit user's roster, server or component has to ask another server for the permission to do so. Server SHOULD allow administrator to configure list of default components which have permissions to edit rosters of this server users.
<iq from='icq.example.com' to='juliet@example.com' type='set' id='roster_1'> <query xmlns='http://spectrum.im/protocol/remote-roster' reason='Manage ICQ contacts.' type='request'/> </iq>
Server SHOULD then generate form using Data Forms [4] and send it to the user's client. "challenge" field is generated by the server and it's used to identify client's response. Server also MUST answer original IQ with empty result IQ.
<message from='example.com' to='juliet@example.com' id='F3A6292C'> <body> icq.example.com wants to edit your roster with following reason: Manage ICQ contacts. Do you want to allow it? Send "yes F3A6292C" or "no F3A6292C" back, please. </body> <x xmlns='jabber:x:data' type='form'> <title>Roster change permissions</title> <instructions>icq.example.com wants to edit your roster with following reason: Manage ICQ contacts. Do you want to allow it?</instructions> <field type='hidden' var='challenge'><value>F3A6292C</value></field> <field type='hidden' var='FORM_TYPE'> <value>http://spectrum.im/protocol/remote-roster</value> </field> <field type='boolean' label='Allow icq.example.com to edit roster?' var='answer'> <value>1</value> </field> </x> </message> <iq from='juliet@example.com' to='icq.example.com' type='result' id='roster_1'/>
If the client supports data forms it MUST respond using them. Otherwise it responds by sending a message described in <body/> tag.
<message from='juliet@example.com/home' to='example.com' xml:lang='en' id='F3A6292C'> <x xmlns='jabber:x:data' type='submit'> <field var='FORM_TYPE'> <value>http://spectrum.im/protocol/remote-roster</value> </field> <field var='challenge'><value>F3A6292C</value></field> <field var='answer'><value>1</value></field> </x> </message>
If user allowed the component to edit the roster, server MUST send remote-roster IQ of type="allowed" to the component and MUST allow component to edit user's roster. Otherwise server MUST send remote-roster IQ of type="rejected". Component MUST respond with empty result IQ.
<iq from='juliet@example.com' to='icq.example.com' type='set' id='roster_2'> <query xmlns='http://spectrum.im/protocol/remote-roster' type="allowed"/> </iq>
Alternatively, user can reject the request. In this case, server MUST inform component with remote-roster IQ of type="rejected" and MUST disallow any changes of user's roster done by this component.
<iq from='juliet@example.com' to='icq.example.com' type='set' id='roster_4'> <query xmlns='http://spectrum.im/protocol/remote-roster' type="rejected"/> </iq>
User can ask the server to provide list of components or servers which have permissions to edit their roster.
<iq from='juliet@example.com/home' to='icq.example.com' type='get' id='roster_5'> <query xmlns='http://spectrum.im/protocol/remote-roster'/> </iq>
In this case, server responds with list of components or servers which can edit user's roster.
<iq from='juliet@example.com/home' to='icq.example.com' type='result' id='roster_5'> <query xmlns='http://spectrum.im/protocol/remote-roster'> <item jid='icq.example.com' reason='Manage ICQ contacts.'/> <item jid='j2j.example.com' reason='Manage Jabber gateway contacts.'/> </query> </iq>
Eventually, user can reject permission granted to component to edit their roster.
<iq from='juliet@example.com/home' to='icq.example.com' type='set' id='roster_6'> <query xmlns='http://spectrum.im/protocol/remote-roster' type="reject"/> </iq>
If component is allowed to change user's roster, it can also fetch it. Server MUST send only contacts owned by asking server or component (So it sends contacts with the same hostname as server or component has).
<iq from='icq.example.com' to='juliet@example.com' type='get' id='roster_7'> <query xmlns='jabber:iq:roster'/> </iq>
<iq to='icq.exampel.com' from='juliet@example.com' type='result' id='roster_7'> <query xmlns='jabber:iq:roster'> <item jid='123456789@icq.example.com' name='Romeo' subscription='both'> <group>Friends</group> </item> <item jid='554323654@icq.example.com' name='Mercutio' subscription='from'> <group>Friends</group> </item> <item jid='997665667@icq.example.com' name='Benvolio' subscription='both'> <group>Friends</group> </item> </query> </iq>
If client sends roster update and component is allowed to change user's roster, server MUST forward it to the component. Server MUST change only roster items which belongs to particular component.
<iq from='juliet@example.com/chamber' type='set' id='roster_8'> <query xmlns='jabber:iq:roster'> <item jid='123456789@icq.example.net' name='Romeo' subscription='both'> <group>Friends</group> <group>Lovers</group> </item> </query> </iq>
<iq from='juliet@example.com/chamber' to='icq.example.com' type='set' id='roster_9'> <query xmlns='jabber:iq:roster'> <item jid='123456789@icq.example.net' name='Romeo' subscription='both'> <group>Friends</group> <group>Lovers</group> </item> </query> </iq>
If component sends roster update, server MUST treat it as roster push from user defined in "to" attribute. Server MUST allow to edit only roster items which belongs to the particular component. Server MUST honor subscription attribute.
<iq to='juliet@example.com' type='set' id='roster_10'> <query xmlns='jabber:iq:roster'> <item jid='123456789@icq.example.net' name='Romeo' subscription='both'> <group>Friends</group> <group>Lovers</group> </item> </query> </iq>
Series: XEP
Number: xxxx
Publisher: XMPP Standards Foundation
Status:
ProtoXEP
Type:
Standards Track
Version: 0.1
Last Updated: 2013-01-29
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: remote-roster
Schema: <http://www.xmpp.org/schemas/remote-roster.xsd>
This document in other formats:
XML
PDF
Email:
hanzz.k@gmail.com
JabberID:
hanzz@njs.netlab.cz
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. XEP-0144: Roster Item Exchange <http://xmpp.org/extensions/xep-0144.html>.
2. XEP-0030: Service Discovery <http://xmpp.org/extensions/xep-0030.html>.
3. XEP-0115: Entity Capabilities <http://xmpp.org/extensions/xep-0115.html>.
4. XEP-0004: Data Forms <http://xmpp.org/extensions/xep-0004.html>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Initial version.
(jk)END