XEP-xxxx: Remote Roster Management

Abstract:This document defines a protocol for managing rosters remotely.
Author:Jan Kaluža
Copyright:© 1999 - 2013 XMPP Standards Foundation. SEE LEGAL NOTICES.
Type:Standards Track
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.

Table of Contents

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

    A: Document Information
    B: Author Information
    C: Legal Notices
    D: Relation to XMPP
    E: Discussion Venue
    F: Requirements Conformance
    G: Notes
    H: Revision History

1. Introduction

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.

2. Requirements

The motivations for this document are to:

3. Use Cases

3.1 Determining Support

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).

Example 1. Service discovery information request

<iq from='icq.example.com'
  <query xmlns='http://jabber.org/protocol/disco#info'/>

Example 2. Service discovery information response

<iq from='shakespeare.lit'
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <feature var='http://spectrum.im/protocol/remote-roster'/>

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.

3.2 Server or component asks another server to get permission to edit user's roster

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.

Example 3. 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'/>

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.

Example 4. Server sends data form to the client and answers to initial IQ

<message from='example.com'
    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.
  <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'>
    <field type='boolean'
            label='Allow icq.example.com to edit roster?'

<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 5. Client responds to data form

<message from='juliet@example.com/home'
  <x xmlns='jabber:x:data' type='submit'>
    <field var='FORM_TYPE'>
    <field var='challenge'><value>F3A6292C</value></field>
    <field var='answer'><value>1</value></field>

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 6. 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"/>

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.

Example 7. Server informs component that user rejected the request

<iq from='juliet@example.com' to='icq.example.com' type='set' id='roster_4'>
  <query xmlns='http://spectrum.im/protocol/remote-roster' type="rejected"/>

3.3 Client requests list of components with permissions to edit his roster

User can ask the server to provide list of components or servers which have permissions to edit their roster.

Example 8. User asks the server to get list of components which can 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'/>

In this case, server responds with list of components or servers which can edit user's roster.

Example 9. Server responds with list of componentss 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.'/>

Eventually, user can reject permission granted to component to edit their roster.

Example 10. User rejects permissions to edit his 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"/>

3.4 Server or component requests user's roster

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 11. Component requests current roster from server

<iq from='icq.example.com' to='juliet@example.com' type='get' id='roster_7'>
  <query xmlns='jabber:iq:roster'/>

Example 12. Component receives roster from server

<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'
    <item jid='554323654@icq.example.com'
    <item jid='997665667@icq.example.com'

3.5 Client sends roster update

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.

Example 13. Client updates roster item

<iq from='juliet@example.com/chamber' type='set' id='roster_8'>
  <query xmlns='jabber:iq:roster'>
    <item jid='123456789@icq.example.net'

Example 14. Server forwards roster push to component

 <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'

3.6 Component sends roster update

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 15. Component adds roster item

<iq to='juliet@example.com' type='set' id='roster_10'>
  <query xmlns='jabber:iq:roster'>
    <item jid='123456789@icq.example.net'


Appendix A: Document Information

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

Appendix B: Author Information

Jan Kaluža

Email: hanzz.k@gmail.com
JabberID: hanzz@njs.netlab.cz

Appendix C: Legal Notices


This XMPP Extension Protocol is copyright © 1999 - 2013 by the XMPP Standards Foundation (XSF).


Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <http://xmpp.org/about-xmpp/xsf/xsf-ipr-policy/> or obtained by writing to XMPP Standards Foundation, 1899 Wynkoop Street, Suite 600, Denver, CO 80202 USA).

Appendix D: Relation to XMPP

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.

Appendix E: Discussion Venue

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>.

Appendix F: Requirements Conformance

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".

Appendix G: Notes

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>.

Appendix H: Revision History

Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/

Version 0.1 (2013-01-29)

Initial version.