XEP-0137: Publishing Stream Initiation Requests

Abstract
This specification defines an XMPP protocol extension that enables an XMPP entity to advertise the fact that it is willing accept a particular Stream Initiation request. The protocol is used mainly to inform other entities that a particular file is available for transfer via the File Transfer protocol defined in XEP-0096.
Authors
  • Matthew Miller
  • Thomas Muldowney
Copyright
© 2004 – 2018 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

Deprecated

WARNING: This document has been Deprecated by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended. Developers desiring similar functionality are advised to implement the protocol that supersedes this one (if any).
Type
Standards Track
Version
1.1 (2018-02-28)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Stable
  4. Final
  5. Deprecated
  6. Obsolete

1. Introduction

SI File Transfer (XEP-0096) [2]). However, the sender is still responsible for informing potential receivers about the existence of a given stream. This document provides an automated way for a sender to announce the availability of a stream without initiating the data transfer. The purpose is to provide a "pull" protocol that enables a receiver to then request initiation of the stream from the sender.

2. Requirements

This proposal addresses the following requirements:

3. Use Cases

3.1 Publishing an SI Request

A stream owner uses the <sipub/> element to announce that it can perform a specific SI request. This element can be sent to a publish-subscribe (XEP-0060) node, or sent directly to potential recipients within a <message/> stanza.

The format of the <sipub/> element is as follows:

Example 1. Sample <sipub/>
  <sipub xmlns='http://jabber.org/protocol/sipub'
         from='sender-jid'
         id='publish-0123'
         profile='si-profile'
         mime-type='mime/type'>
    <profile xmlns='si-profile'></profile>
  </sipub>

This format is nearly identical to that for the stream initiation <si/> element (see Stream Initiation (XEP-0095) [1]). The major difference is the lack of the feature negotiation for the stream methods, and the addition of a 'from' attribute.

The 'from' attribute SHOULD be present, and MUST be present if the stanza containing the <sipub/> is not from the stream owner (e.g., if the stream is advertised at a publish-subscribe node). If present, this attribute MUST be the valid JID for the stream owner.

The 'id' attribute is an opaque identifier. This attribute MUST be present, and MUST be a valid non-empty string. It uniquely identifies the published request at the potential sender.

As with stream initiation, the 'profile' attribute MUST be present, and MUST be the namespace URI governing the profile information. It identifies the format for the SI profile.

As with stream initiation, the 'mime-type' attribute SHOULD be present, and MUST be an IANA-registered content type. [5] It provides the receiver with additional information about what the data stream will be.

The <sipub/> element MUST contain an element qualified by the namespace specified by the 'profile' attribute (e.g., <file xmlns='http://jabber.org/protocol/si/profile/file-transfer'/> for file transfer). This is the additional information about the data stream.

The <sipub/> information is typically provided via pubsub:

Example 2. Sender advertises stream via publish-subscribe
<iq from='[email protected]/globe'
    to='pubsub.shakespeare.lit'
    id='ps1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='characters'>
      <sipub xmlns='http://jabber.org/protocol/sipub'
          from='[email protected]'
          id='publish-0123'
          mime-type='application/pdf'
          profile='http://jabber.org/protocol/si/profile/file-transfer'>
        <file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
              name='NDA.pdf'
              size='138819'
              date='2004-01-28T10:07Z'>
          <desc>All Shakespearean characters must sign and return this NDA ASAP</desc>
        </file>
      </sipub>
    </publish>
  </pubsub>
</iq>
Example 3. Pubsub service pushes announcement to all subscribers
<message from='pubsub.shakespeare.lit' to='[email protected]/balcony'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='characters'>
      <item id='current'>
        <sipub xmlns='http://jabber.org/protocol/sipub'
            from='[email protected]'
            id='publish-0123'
            mime-type='application/pdf'
            profile='http://jabber.org/protocol/si/profile/file-transfer'>
          <file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
                name='NDA.pdf'
                size='138819'
                date='2004-01-28T10:07Z'>
            <desc>All Shakespearean characters must sign and return this NDA ASAP</desc>
          </file>
        </sipub>
      </item>
    </items>
  </event>
</message>

The <sipub/> element MAY also be included directly within a <message/> stanza sent to another entity (or multiple entities, e.g., in Extended Stanza Addressing (XEP-0033) [7]). This can be especially useful for informing an offline entity about an available stream.

Example 4. Advertising a stream in a message stanza
<message from='[email protected]/pda' to='[email protected]'>
  <sipub xmlns='http://jabber.org/protocol/sipub'
      id='publish-0123'
      mime-type='application/pdf'
      profile='http://jabber.org/protocol/si/profile/file-transfer'>
    <file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
          name='NDA.pdf'
          size='138819'
          date='2004-01-28T10:07Z'>
      <desc>All Shakespearean characters must sign and return this NDA ASAP</desc>
    </file>
  </sipub>
</message>

3.2 Integration with Data Forms

One of the goals of sipub is to integrate Stream Initiation with Data Forms to provide a "file upload" capability. This is accomplished via the datatypes specified in Data Forms Validation (XEP-0122) [8]. Each datatype is specific to the profile desired.

For example the datatype "sipub:file-transfer" is used to identify the file upload field(s) corresponding to SI File Transfer (XEP-0096) [2]:

Example 5. "Upload File" Data Forms Field
  <field var='file' type='text-single' label='File to Upload'>
    <validate xmlns='http://jabber.org/protocol/xdata-validate'
              datatype='sipub:file-transfer'/>
  </field>

When submitting such a form, a field's value(s) MUST be the <sipub/> identifier(s). Also, the submitter MUST provide an <sipub/> element within the data form for each file to be uploaded:

Example 6. Submitting an "Upload File" form
  <x xmlns='jabber:x:data' type='submit'>
    <field var='file'>
      <value>publish-0123</value>
    </field>
    <sipub xmlns='http://jabber.org/protocol/sipub'
           id='publish-0123'
           mime-type='text/html'
           profile='http://jabber.org/protocol/si/profile/file-transfer'>
      <file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
            name='missive.html'
            size='1024'
            date='2005-07-21T11:21Z'/>
    </sipub>
  </x>

The form processor will use this to retrieve the file(s) to be uploaded.

3.3 Triggering the Stream Initiation Request

A potential receiver starts the stream initiation session by sending an IQ-get to the sender, using the <start xmlns='http://jabber.org/protocol/sipub'/> element. This element contains the 'id' attribute to specify which published stream to retrieve:

Example 7. Receiver requests start of stream
  <iq type='get'
      id='sipub-request-0'
      from='[email protected]/balcony'
      to='[email protected]/pda'>
    <start xmlns='http://jabber.org/protocol/sipub'
           id='publish-0123'/>
  </iq>

If the sender accepts the request, it responds with an IQ-result containing a <starting/> element. This element indicates the stream initiation identifier to be used:

Example 8. Sender accepts request to start stream
  <iq type='result'
      id='sipub-request-0'
      from='[email protected]/pda'
      to='[email protected]/balcony'>
    <starting xmlns='http://jabber.org/protocol/sipub'
              sid='session-87651234'/>
  </iq>

Then the sender begins the stream initiation negotiation:

Example 9. Sender starts negotiation
  <iq type='set'
      id='sipub-set-1'
      from='[email protected]/pda'
      to='[email protected]/balcony'>
    <si xmlns='http://jabber.org/protocol/si'
        id='session-87651234'
        mime-type='text/html'
        profile='http://jabber.org/protocol/si/profile/file-transfer'>
      <file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
          name='missive.html'
          size='1024'
          date='2005-07-21T11:21Z'>
        <desc>A love letter</desc>
      </file>
    </si>
  </iq>

If the requested identifier is not valid, the sender SHOULD respond with a <not-acceptable/> error:

Example 10. Sender denies because of invalid id
  <iq type='error'
      id='sipub-set-1'
      from='[email protected]/pda'
      to='[email protected]/balcony'>
    <start xmlns='http://jabber.org/protocol/sipub'>publish-0123</start>
    <error code='405' type='modify'>
      <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
    </error>
  </iq>

If the receiver does not have permission to request the data stream, the sender SHOULD respond with a <forbidden/> error:

Example 11. Sender denies because receiver is forbidden
  <iq type='error'
      id='sipub-set-1'
      from='[email protected]/pda'
      to='[email protected]/balcony'>
    <start xmlns='http://jabber.org/protocol/sipub'>publish-0123</start>
    <error code='403' type='auth'>
      <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
    </error>
  </iq>

4. Implementation Notes

4.1 Publish ID versus SI ID

When publishing a stream via the <sipub/> element, the identifier SHOULD NOT be used as-is for the <si/> element, since a single publication will likely result in multiple <si/> requests, possibly from the same receiver.

5. Security Considerations

This document introduces no security concerns beyond those specified in Publish-Subscribe (XEP-0060) [3] and the relevant Stream Initiation profile in use.

6. IANA Considerations

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

7. XMPP Registrar Considerations

7.1 Protocol Namespaces

The XMPP Registrar [10] includes 'http://jabber.org/protocol/sipub' in its registry of protocol namespaces.

7.2 Data Form Validation Datatypes

The XMPP Registrar includes 'sipub:' in its registry of Data Forms Validation Datatype Prefixes.

Normally, each SI profile that wishes to be considered for use with Data Forms MUST register its own datatype qualified by the "sipub:" prefix. However, this document provides an initial seed, based on the currently accepted SI profiles. The following datatypes shall be registered for use with Data Forms Validation:

Data Forms Validation Datatypes Registry Submission
<datatype>
  <name>sipub:file-transfer</name>
  <desc>Datatype for publishing an SI using the File Transfer Profile</desc>
  <doc>XEP-0096</doc>
</datatype>

8. XML Schema

<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='http://jabber.org/protocol/sipub'
    xmlns='http://jabber.org/protocol/sipub'
    elementFormDefault='qualified'>

  <xs:annotation>
    <xs:documentation>
      The protocol documented by this schema is defined in
      XEP-0137: http://www.xmpp.org/extensions/xep-0137.html
    </xs:documentation>
  </xs:annotation>

  <xs:element name='sipub'>
    <xs:annotation>
      <xs:documentation>This is the root content element for advertising a stream.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:any namespace='##other' minOccurs='1' maxOccurs='1'/>
      </xs:sequence>
      <xs:attribute name='id' type='xs:string' use='required'/>
      <xs:attribute name='from' type='xs:string' use='optional'/>
      <xs:attribute name='mime-type' type='xs:string' use='optional'/>
      <xs:attribute name='profile' type='xs:string' use='optional'/>
    </xs:complexType>
  </xs:element>

  <xs:element name='start'>
    <xs:annotation>
      <xs:documentation>This is the element for requesting retrieval of a stream.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:attribute name='id' type='xs:string' use='required'/>
    </xs:complexType>
  </xs:element>

  <xs:element name='starting'>
    <xs:annotation>
      <xs:documentation>This is the element for specifying the stream to be retrieved.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:attribute name='sid' type='xs:string' use='required'/>
    </xs:complexType>
  </xs:element>

</xs:schema>

Appendices

Appendix A: Document Information

Series
XMPP Council
Dependencies
XMPP Core, XEP-0030, XEP-0095
Supersedes
None
Superseded By
None
Short Name
sipub
Schema
<HTML

This document in other formats: XML  CC-BY-SA 2.0 license.

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 <https://xmpp.org/extensions/xep-0095.html>.

2. XEP-0096: SI File Transfer <6. XEP-0045: Multi-User Chat <https://xmpp.org/registrar/>.

Appendix H: Revision History

Note: Older versions of this specification might be available at 0.3 (2005-07-21)Corrected several errors in the text and examples.

psa
  • Version 0.1 (2004-06-16)
    Initial version.
    lw/tjm
  • Appendix I: Bib(La)TeX Entry

    @report{miller2004sipub,
      title = {Publishing Stream Initiation Requests},
      author = {Miller, Matthew and Muldowney, Thomas},
      type = {XEP},
      number = {0137},
      version = {1.1},
      institution = {XMPP Standards Foundation},
      url = {https://xmpp.org/extensions/xep-0137.html},
      date = {2004-06-16/2018-02-28},
    }

    END

    Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

    Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant