This JEP defines protocol for publishing the availability of a particular Stream Initiation request, such as a file.
WARNING: This Standards-Track JEP is Experimental. Publication as a Jabber Enhancement Proposal does not imply approval of this proposal by the Jabber Software Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems should not deploy implementations of this protocol until it advances to a status of Draft.
Status: Experimental
Type: Standards Track
Number: 0137
Version: 0.1
Last Updated: 2004-06-16
JIG: Standards JIG
Approving Body: Jabber Council
Dependencies: XMPP Core, JEP-0030, JEP-0095
Supersedes: None
Superseded By: None
Short Name: sipub
Email: linuxwolf@outer-planes.net
JID: linuxwolf@outer-planes.net
Email: temas@jabber.org
JID: temas@jabber.org
This Jabber Enhancement Proposal is copyright 1999 - 2004 by the Jabber Software Foundation (JSF) and is in full conformance with the JSF's Intellectual Property Rights Policy <http://www.jabber.org/jsf/ipr-policy.php>. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at <http://www.opencontent.org/openpub/>).
The preferred venue for discussion of this document is the Standards-JIG discussion list: <http://mail.jabber.org/mailman/listinfo/standards-jig>.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core and XMPP IM specifications contributed by the Jabber Software Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocols defined in this JEP have been developed outside the Internet Standards Process and are to be understood as extensions to XMPP rather than as an evolution, development, or modification of XMPP itself.
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
Stream Initiation [1] is a protocol to initiate a data stream within Jabber/XMPP. However, the sender is still responsible for informing receivers about this stream. This JEP provides a standardized way for a sender to announce a stream's availability without initiating the data transfer. The purpose is to provide a "pull" protocol for a receiver to request a transfer from a sender.
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [2].
A stream owner uses the <sipub/> element to announce it can perform a specific SI request. This element can be used with pubsub, or sent directly to potential recipients within a <message/>. The following represents the format of <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>
The format for sipub is nearly identical to that for SI. The major difference is the lack of the feature negogiation for the stream methods, and the addition of a "from" attribute.
The "from" attribute SHOULD normally be present, and MUST be present if the stanza containing the <sipub/> is not from the sipub sender. If present, this attribute MUST be the valid JID for the actual sipub sender.
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 for the potential sender.
As with SI, 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 SI, the "mime-type" attribute SHOULD be present, and MUST be a valid mime-type. It provides the receiver with additional information about what the data stream will be.
The <sipub/> MUST contain an element in the namespace specified by "profile". This is the additional information about the data stream.
The <sipub/> information is typically provided via pubsub:
<message to="receiver" from="pubsub.jabber.org"> <event xmlns="http://jabber.org/protocol/pubsub#event"> <items node="generic/si-publish"> <item id="current"> <sipub xmlns='http://jabber.org/protocol/si-pub' from='sender' id='publish-0123' mime-type='text/plain' profile='http://jabber.org/protocol/si/profile/file-transfer'> <file xmlns='http://jabber.org/protocol/si/profile/file-transfer' name='special.txt' size='1024' date='2004-01-28T10:07:00-07:00'> <desc>The special file</desc> </file> </sipub> </item> </items> </event> </message>
Since the announcement did not come directly from the sender, the <sipub/> MUST specify that using the "from" attribute.
The <sipub/> MAY also be used directly within a <message/> [5]:
<message from='sender' to='receiver'> <body>Here is the file you requested...</body> <sipub xmlns='http://jabber.org/protocol/si-pub' id='publish-0123' mime-type='text/plain' profile='http://jabber.org/protocol/si/profile/file-transfer'> <file xmlns='http://jabber.org/protocol/si/profile/file-transfer' name='special.txt' size='1024' date='2004-01-28T10:07:00-07:00'> <desc>The special file</desc> </file> </sipub> </message>
Since the announcement came directly from the sender, the "from" attribute is OPTIONAL.
One of the goals of sipub is to integrate SI with Data Forms to provide a "file upload" capability. this is accomplished via the datatypes specified in Data Forms Validation [6]. 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 File Transfer [7]):
<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, field's value(s) MUST be the <sipub/> identier(s). Also, the submitter MUST provide a <sipub/> within the data form for each file to be uploaded:
<x xmlns='jabber:x:data' type='submit'> <field var='file'><value>publish-0123</value> ... <sipub xmlns='http://jabber.org/protocol/sipub' id='publish-0123' mime-type='text/plain' profile='http://jabber.org/protocol/si/profile/file-transfer'> <file xmlns='http://jabber.org/protocol/si/profile/file-transfer' name='special.txt' size='1024' date='2004-01-28T10:07:00-07:00'/> </x>
The form processor will use this to retrieve the file(s) to be uploaded.
A potential receiver starts the SI session by performing an IQ-GET to the sender, using the <start xmlns='http://jabber.org/protocol/sipub'/> element. This element contains the attribute "id" to indicate the published SI to retrieve:
<iq type='get' id='sipub-request-0' to='sender' from='receiver'> <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 SI identifier to be used:
<iq type='result' id='sipub-request-0' from='sender' to='receiver'> <starting xmlns='http://jabber.org/protocol/sipub' sid='session-87651234'/> </iq>
Then the sender begins the SI negotiation:
<iq type='set' id='si-0' from='sender' to='receiver'> <si xmlns='http://jabber.org/protocol/si' id='session-87651234' mime-type='text/plain' profile='http://jabber.org/protocol/si/profile/file-transfer'> <file xmlns='http://jabber.org/protocol/si/profile/file-transfer' name='special.txt' size='1024' date='2004-01-28T10:07:00-07:00'> <desc>The special file</desc> </file> </si> </iq>
If the requested identifier is not valid, the sender SHOULD respond with a "not-acceptable" error:
<iq type='error' id='sipub-requeset-0' from='sender' to='receiver'> <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:
<iq type='error' id='sipub-requeset-0' from='sender' to='receiver'> <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>
When publishing a <sipub/>, the identifier SHOULD NOT be used as-is for the <si/>. A single publication will likely result in multiple <si/> requests, possibly from the same receiver.
There are no security features or concerns related to this proposal.
This JEP requires no interaction with the Internet Assigned Numbers Authority (IANA) [8]
SI Publication uses the following protocol namespaces:
The "sipub" datatype prefix shall be registered with the Jabber Registrar [9].
Normally, each SI profile that wishes to be considered for use with Data Forms MUST register their own datatype qualified by "sipub". However, this JEP provides an initial seed, based on the currently accepted SI profiles. The following datatypes shall be registered for use with Data Forms Validation:
<datatype> <name>sipub:file-transfer</name> <desc>Datatype for publishing an SI using the File Transfer Profile</desc> <doc>JEP-0096</doc> </datatype>
<?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:import namespace='http://jabber.org/protocol/si' schemaLocation='http://jabber.org/protocol/si/si.xsd'/> <xs:annotation> <xs:documentation> The protocol documented by this schema is defined in JEP-0xxx: http://www.jabber.org/jeps/jep-0xxx.html </xs:documentation> </xs:annotation> <xs:element name='sipub'> <xs:annotation> <xs:documentation>This is the root content element for publication.</xs:documentation> </xs:annotation> <xs:complexType> <xs:choice> <xs:any namespace='##other' minOccurs='1'/> </xs:choice> <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 an SI be retrieved.</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 indicating the SI to be retrieved.</xs:documentation> </xs:annotation> <xs:complexType> <xs:attribute name='sid' type='xs:string' use='required'/> </xs:complexType> </xs:element> </xs:schema>
1. JEP-0095: Stream Initiation <http://www.jabber.org/jeps/jep-0095.html>.
2. RFC 2119: Key words for use in RFCs to Indicate Requirement Levels <http://www.ietf.org/rfc/rfc2119.txt>.
3. JEP-0060: Publish-Subscribe <http://www.jabber.org/jeps/jep-0060.html>.
4. JEP-0004: Data Forms <http://www.jabber.org/jeps/jep-0004.html>.
5. This is most useful for informing an offline entity about an SI request.
6. JEP-0122: Data Forms Validation <http://www.jabber.org/jeps/jep-0122.html>.
7. JEP-0096: File Transfer <http://www.jabber.org/jeps/jep-0096.html>.
8. 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/>.
9. The Jabber Registrar maintains a list of reserved Jabber protocol namespaces as well as registries of parameters used in the context of protocols approved by the Jabber Software Foundation. For further information, see <http://www.jabber.org/registrar/>.
END