XEP-0267: Server Buddies

Abstract:This specification defines a convention for presence subscriptions between XMPP servers.
Authors:Artur Hefczyc, Florian Jensen, Mickaël Rémond, Peter Saint-Andre, Matthew Wild
Copyright:© 1999 - 2012 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:Experimental
Type:Standards Track
Version:0.4
Last Updated:2011-12-12

WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.


Table of Contents


1. Description
2. Ad-Hoc Command
3. Determining Support
4. Security Considerations
5. IANA Considerations
6. XMPP Registrar Considerations
    6.1. Service Discovery Features
    6.2. Field Standardization
7. Acknowledgements

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


1. Description

In XMPP, rosters and presence subscriptions have been used to date only among IM users (see XMPP IM [1]). However, nothing prevents the application of these concepts to other XMPP entities, such as components and servers. Given that a presence subscription typically indicates some level of trust in a peer, server deployments can use the sharing of XMPP presence information as a way to indicate that a given server has a trust relationship with a peer server (informally, we can say that the two servers consider each other "buddies"). The server might then share certain kinds of additional information only with its trusted peers, for example Incident Reporting [2].

To establish such a trust relationship with a peer, a server sends a presence subscription request to the peer, just as is done between XMPP users.

Example 1. Service sends subscription request to peer

<presence from='montague.lit'
          to='capulet.lit'
          type='subscribe'/>
  

A server MUST NOT send such a presence subscription request unless explicitly requested to do so by a server administrator (see below).

Upon receiving such a presence subscription request, the XMPP server software running at the peer shall either prompt the server administrator to approve the request or (if explicitly configured to accept subscriptions requests) automatically approve it. (A future version of this specification might define an approval method based on Data Forms [3].)

If the request is approved, the peer server then informs the originating server that the request has been approved.

Example 2. Peer sends approval to server

<presence from='capulet.lit'
          to='montague.lit'
          type='subscribed'/>
  

The peer SHOULD also send a subscription request to the originating server.

Example 3. Peer sends subscription request to server

<presence from='capulet.lit'
          to='montague.lit'
          type='subscribe'/>
  

The originating server would then approve that subscription request.

Example 4. Services sends approval to peer

<presence from='montague.lit'
          to='capulet.lit'
          type='subscribed'/>
  

If an XMPP server implementation supports this usage of presence subscriptions, it MUST keep a list of approved entities, which we denote a "server roster". The implementation MAY use that roster for access control purposes defined in other specifications.

2. Ad-Hoc Command

This section defines an Ad-Hoc Commands [4] node scoped by the Field Standardization for Data Forms [5] FORM_TYPE specified in Service Administration [6]. Upon advancement of this specification to Draft, this section ought to be moved to XEP-0133.

The command node for this use case SHOULD be "http://jabber.org/protocol/admin#server-buddy".

A sample protocol flow for this use case is shown below.

Example 5. Admin Subscribes Server to Peer Server

<iq from='bard@shakespeare.lit/globe'
    id='server-buddy-1'
    to='shakespeare.lit'
    type='set'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands' 
           action='execute'
           node='http://jabber.org/protocol/admin#server-buddy'/>
</iq>
    

Unless an error occurs (see the "Error Handling" section of XEP-0133), the service SHOULD return the appropriate form.

Example 6. Service Returns Server Buddy Form to Admin

<iq from='shakespeare.lit'
    id='server-buddy-1'
    to='bard@shakespeare.lit/globe'
    type='result'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands' 
           node='http://jabber.org/protocol/admin#server-buddy'
           sessionid='server-buddy:20040408T0337Z'
           status='executing'>
    <x xmlns='jabber:x:data' type='form'>
      <title>Subscribing to a Peer Server</title>
      <instructions>Fill out this form to subscribe your server to a peer server.</instructions>
      <field type='hidden' var='FORM_TYPE'>
        <value>http://jabber.org/protocol/admin</value>
      </field>
      <field label='The domain name of the peer server'
             type='jid-single'
             var='peerjid'>
        <required/>
      </field>
    </x>
  </command>
</iq>
    

Note: In virtual hosting environments, the server can determine the the domain name from which to send the presence subscription based on the 'to' address of the <iq/> stanza.

Example 7. Admin Submits Server Buddy Form to Service

<iq from='bard@shakespeare.lit/globe'
    id='server-buddy-2'
    to='shakespeare.lit'
    type='set'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands' 
           node='http://jabber.org/protocol/admin#server-buddy'
           sessionid='server-buddy:20040408T0337Z'>
    <x xmlns='jabber:x:data' type='submit'>
      <field type='hidden' var='FORM_TYPE'>
        <value>http://jabber.org/protocol/admin</value>
      </field>
      <field var='serverjid'>
        <value>shakespeare.lit</value>
      </field>
      <field var='peerjid'>
        <value>marlowe.lit</value>
      </field>
    </x>
  </command>
</iq>
    

Example 8. Service Informs Admin of Completion

<iq from='shakespeare.lit'
    id='server-buddy-2'
    to='bard@shakespeare.lit/globe'
    type='result'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands' 
           node='http://jabber.org/protocol/admin#server-buddy'
           sessionid='server-buddy:20040408T0337Z'
           status='completed'/>
</iq>
    

Notification of completion MAY include the processed data in a data form of type "result".

3. Determining Support

To advertise its support for the server buddy feature, when replying to service discovery information ("disco#info") requests a server MUST return a URNs "urn:xmpp:server-presence".

Example 9. Service discovery information request

<iq from='jabber.org'
    id='uw72g176'
    to='xmpp.net'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
  

Example 10. Service discovery information response

<iq from='xmpp.net'
    id='uw72g176'
    to='jabber.org'
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <feature var='urn:xmpp:server-presence'/>
  </query>
</iq>
  

4. Security Considerations

Because server "buddies" might be granted greater privileges than unknown peers, care should be taken in sending or approving presence subscription requests. In particular, a server MUST NOT send a presence subscription request unless explicitly requested to do so by a server administrator.

5. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [7].

6. XMPP Registrar Considerations

6.1 Service Discovery Features

Registry Submission

<var>
  <name>urn:xmpp:server-presence</name>
  <desc>Support for subscriptions to server presence</desc>
  <doc>XEP-0267</doc>
</var>
    

6.2 Field Standardization

Field Standardization for Data Forms [8] defines a process for standardizing the fields used within Data Forms scoped by a particular namespace. This registration adds two more reserved fields to the 'http://jabber.org/protocol/admin' namespace defined in XEP-0133.

Registry Submission

<form_type>
  <name>http://jabber.org/protocol/admin</name>
  <field var='peerjid'
         type='jid-single'
         label='The Jabber ID of a peer server'/>
</form_type>
    

7. Acknowledgements

Thanks to Kim Alvefur, Waqas Hussain, and Tobias Markmann for their feedback.


Appendices


Appendix A: Document Information

Series: XEP
Number: 0267
Publisher: XMPP Standards Foundation
Status: Experimental
Type: Standards Track
Version: 0.4
Last Updated: 2011-12-12
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: NOT_YET_ASSIGNED
Source Control: HTML
This document in other formats: XML  PDF


Appendix B: Author Information

Artur Hefczyc

Email: artur.hefczyc@gmail.com
JabberID: artur.hefczyc@tigase.org

Florian Jensen

Email: admin@flosoft.biz
JabberID: admin@im.flosoft.biz

Mickaël Rémond

Email: mickael.remond@process-one.net
JabberID: mremond@process-one.net

Peter Saint-Andre

Email: stpeter@jabber.org
JabberID: stpeter@jabber.org
URI: https://stpeter.im/

Matthew Wild

Email: mwild1@gmail.com
JabberID: mwild1@jaim.at


Appendix C: Legal Notices

Copyright

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

Permissions

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


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. RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://tools.ietf.org/html/rfc6121>.

2. XEP-0268: Incident Reporting <http://xmpp.org/extensions/xep-0268.html>.

3. XEP-0004: Data Forms <http://xmpp.org/extensions/xep-0004.html>.

4. XEP-0050: Ad-Hoc Commands <http://xmpp.org/extensions/xep-0050.html>.

5. XEP-0068: Field Data Standardization for Data Forms <http://xmpp.org/extensions/xep-0068.html>.

6. XEP-0133: Service Administration <http://xmpp.org/extensions/xep-0133.html>.

7. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

8. XEP-0068: Field Data Standardization for Data Forms <http://xmpp.org/extensions/xep-0068.html>.


Appendix H: Revision History

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

Version 0.4 (2011-12-12)

Noted that sending server can be derived from 'to' address on IQ stanza, so removed serverjid field from FORM_TYPE; defined method for determining support; added further XMPP Registrar Considerations.

(psa)

Version 0.3 (2011-12-12)

Updated ad-hoc command with field for the sending server; added XMPP Registrar Considerations.

(psa)

Version 0.2 (2011-12-09)

Defined ad-hoc command for admin generation of outbound presence subscription; added security considerations.

(psa)

Version 0.1 (2009-04-30)

Initial published version.

(psa)

Version 0.0.1 (2009-04-30)

First draft, split from the incident reporting proposal.

(ah/fj/psa/mr/mw)

END