| Abstract: | This document defines a protocol for managing access remote rosters. |
| Author: | Jan Kaluža |
| Copyright: | © 1999 - 2010 XMPP Standards Foundation. SEE LEGAL NOTICES. |
| Status: | ProtoXEP |
| Type: | Standards Track |
| Version: | 0.1 |
| Last Updated: | 2010-08-27 |
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. Use Cases
2.1. Server or component asks server permission to edit user's roster
2.2. User rejects permissions to edit his roster
2.3. Server or component requests user's roster
2.4. Client sends roster update
2.5. 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 how to manipulate with user's roster. 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.
Server or component can ask server to get permissions to edit user's roster.
Example 1. Server or component asks another server to get permissions to edit particular user's roster.
<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 generate form using Data Forms [2] 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.
Example 2. Server sends data form to the client and answers to initial IQ
<message from='example.com'
to='juliet@example.com'
xml:lang='en'
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.
Example 3. Client responds to data form
<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.
Example 4. Server informs component that it's allowed to change user's roster
<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>
Example 5. User rejects permissions to edit his roster
<iq from='juliet@example.com/home' to='icq.example.com' type='set' id='roster_3'>
<query xmlns='http://spectrum.im/protocol/remote-roster' type="reject"/>
</iq>
Server MUST inform component with remote-roster IQ of type="rejected" and MUST disallow any changes of user's roster.
Example 6. Server informs component about permission change
<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>
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).
Example 7. Component requests current roster from server
<iq from='icq.example.com' to='juliet@example.com' type='get' id='roster_5'>
<query xmlns='jabber:iq:roster'/>
</iq>
Example 8. Component receives roster from server
<iq to='icq.exampel.com' from='juliet@example.com' type='result' id='roster_5'>
<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 forwards only roster items which belongs to particular component.
Example 9. Client updates roster item
<iq from='juliet@example.com/chamber' type='set' id='roster_3'>
<query xmlns='jabber:iq:roster'>
<item jid='123456789@icq.example.net'
name='Romeo'
subscription='both'>
<group>Friends</group>
<group>Lovers</group>
</item>
</query>
</iq>
Example 10. Server forwards roster push to component
<iq from='juliet@example.com/chamber' to='icq.example.com' type='set' id='roster_3'>
<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.
Example 11. Component adds roster item
<iq to='juliet@example.com' type='set' id='roster_3'>
<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: 2010-08-27
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 3920) and XMPP IM (RFC 3921) 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-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