No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0104.xml 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM "xep.ent">
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>HTTP Scheme for URL Data</title>
  10. <abstract>This document provides a schema description for detailed information about HTTP URLs.</abstract>
  11. &LEGALNOTICE;
  12. <number>0104</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>RFC 3986</spec>
  19. <spec>RFC 2616</spec>
  20. <spec>RFC 2617</spec>
  21. <spec>XEP-0103</spec>
  22. </dependencies>
  23. <supersedes/>
  24. <supersededby/>
  25. <shortname>N/A</shortname>
  26. <author>
  27. <firstname>Matthew</firstname>
  28. <surname>Miller</surname>
  29. <email>linuxwolf@outer-planes.net</email>
  30. <jid>linuxwolf@outer-planes.net</jid>
  31. </author>
  32. <revision>
  33. <version>0.3</version>
  34. <date>2004-01-20</date>
  35. <initials>lw</initials>
  36. <remark>Reorganized for Editorial preferences; Removed (outdated) references to XEP-0070</remark>
  37. </revision>
  38. <revision>
  39. <version>0.2</version>
  40. <date>2003-09-19</date>
  41. <initials>lw</initials>
  42. <remark>Added more information about cookies; Added more information about headers</remark>
  43. </revision>
  44. <revision>
  45. <version>0.1</version>
  46. <date>2003-06-30</date>
  47. <initials>lw</initials>
  48. <remark>Initial version.</remark>
  49. </revision>
  50. </header>
  51. <section1 topic='Introduction'>
  52. <p>The most common URL scheme distributed over the Internet is HTTP and HTTPS. This document defines a structure that extends &xep0103; to enable more advanced access to such URLs within Jabber.</p>
  53. </section1>
  54. <section1 topic='Requirements'>
  55. <p>This document supplements XEP-0103 to provide more detailed information about HTTP and HTTPS URLs. The requirements this document fulfills are:</p>
  56. <ul>
  57. <li>Provide authentication information.</li>
  58. <li>Provide cookie data.</li>
  59. <li>Provide necessary headers.</li>
  60. </ul>
  61. <p>The intent of this information is to provide an HTTP client with enough information in order to construct the HTTP request and entity headers necessary, as defined in &rfc2616;.</p>
  62. <p>The use of this document in conjunction with XEP-0103 is OPTIONAL. The entity sending the URL is not required to provide any of this information, and receiving entities MAY ignore it.</p>
  63. </section1>
  64. <section1 topic='Basic Usage'>
  65. <p>The two most typical types of information that can be necessary for accessing an HTTP URL are authentication details and cookies. In some cases, custom headers MAY also be necessary for successful use. Authentication information is provided in a scheme-independent format. Cookie data provided includes what would be necessary for a client to properly persist the value.</p>
  66. <section2 topic='Providing Authentication'>
  67. <p>At a minimum, this document allows for an entity to indicate what authentication scheme is in use:</p>
  68. <example caption='Indicating auth scheme'><![CDATA[
  69. <message to='client@domain.com'>
  70. <url-data xmlns='http://jabber.org/protocol/url-data'
  71. xmlns:http='http://jabber.org/protocol/url-data/scheme/http'
  72. target='http://www.jabber.org/members/index.php'>
  73. <http:auth scheme='basic'/>
  74. </url-data>
  75. </message>
  76. ]]></example>
  77. <p>To provide additional parameters (such as a realm and username/password), the &lt;auth-param/&gt; element is used:</p>
  78. <code><![CDATA[
  79. <message to='client@domain.com'>
  80. <url-data xmlns='http://jabber.org/protocol/url-data'
  81. xmlns:http='http://jabber.org/protocol/url-data/scheme/http'
  82. target='http://www.jabber.org/members/index.php'>
  83. <http:auth scheme='basic'>
  84. <http:auth-param name='realm' value='www.jabber.org'/>
  85. <auth-param name='username' value='defaultuser'/>
  86. <auth-param name='password' value='defaultpwd'/>
  87. </http:auth>
  88. </url-data>
  89. </message>
  90. ]]></code>
  91. </section2>
  92. <section2 topic='Providing Cookies'>
  93. <p>Cookie information is provided by the &lt;cookie/&gt; element. This element can provide all of the information of the "Set-Cookie" response header<note>"Set-Cookie" is a message header for the HTTP response, and the &lt;header/&gt; element represents only message headers for HTTP requests. Therefore, cookies are handled differently.</note>. The simplest usage is:</p>
  94. <code><![CDATA[
  95. <message to='client@domain.com'>
  96. <url-data xmlns='http://jabber.org/protocol/url-data'
  97. xmlns:http='http://jabber.org/protocol/url-data/scheme/http'
  98. target='http://www.jabber.org/members/index.php'>
  99. <http:cookie name='jsessionid' value='1243asd234190sa32ds'/>
  100. </url-data>
  101. </message>
  102. ]]></code>
  103. <p>The above cookie is considered "transient", and will terminate when the HTTP session ends. Additional information about the cookie can be provided:</p>
  104. <code><![CDATA[
  105. <message to='client@domain.com'>
  106. <url-data xmlns='http://jabber.org/protocol/url-data'
  107. xmlns:http='http://jabber.org/protocol/url-data/scheme/http'
  108. target='http://www.jabber.org/members/index.php'>
  109. <http:cookie name='jsessionid'
  110. domain='jabber.org'
  111. max-age='1234000'
  112. path='/members'
  113. comment='Web Session Identifier'
  114. version='1.0'
  115. secure='false'
  116. value='1243asd234190sa32ds'/>
  117. </url-data>
  118. </message>
  119. ]]></code>
  120. <p>As demonstrated, the &lt;cookie/&gt; provides all the attributes provided by the "Set-Cookie" header. The only attributes required are "name" and "value".</p>
  121. </section2>
  122. <section2 topic='Providing Headers'>
  123. <p>In some cases, arbitrary headers are necessary. They are provided using the &lt;header/&gt; element:</p>
  124. <code><![CDATA[
  125. <message to='client@domain.com'>
  126. <url-data xmlns='http://jabber.org/protocol/url-data'
  127. xmlns:http='http://jabber.org/protocol/url-data/scheme/http'
  128. target='http://www.jabber.org/members/index.php'>
  129. <http:header name='Custom-Data' value='some custom data'/>
  130. </url-data>
  131. </message>
  132. ]]></code>
  133. </section2>
  134. </section1>
  135. <section1 topic='Implementation Notes'>
  136. <section2 topic='Cookies'>
  137. <p>Entities receiving cookie information SHOULD following the state management guidelines from &rfc2109;. In particular, the interpretation of the "persistence details" attribute values from &lt;cookie/&gt; is that defined in section 4.2.2 of RFC 1209.</p>
  138. <p>The attributes provided by &lt;cookie/&gt; MUST NOT be "pre-escaped" for HTTP message headers. it is the responsibility of the receiving entity to properly encode cookie information into the "cookie" message header, including any character escaping.</p>
  139. </section2>
  140. <section2 topic='Headers'>
  141. <p>The &lt;header/&gt; element only provides those message headers used for an HTTP request. There is currently no mechanism to convey HTTP response headers.</p>
  142. <p>The name and value attributes from &lt;header/&gt; MUST NOT be "pre-escaped" for HTTP message headers. It is the responsibility of the receiving entity to properly encode message headers, including any character escaping.</p>
  143. </section2>
  144. </section1>
  145. <section1 topic='Formal Description'>
  146. <section2 topic='Overview'>
  147. <p>The namespace for this structure is "http://jabber.org/protocol/url-data/scheme/http". Because this namespace is intended to supplement the &lt;url-data/&gt; element, this namespace SHOULD be declared within the &lt;url-data/&gt; element using the "http" namespace prefix (as demonstrated in the examples above). This namespace MUST only be applied when the "target" attribute in &lt;url-data/&gt; uses the scheme "http" or "https".</p>
  148. </section2>
  149. <section2 topic='&lt;auth/&gt; Element'>
  150. <p>The &lt;auth/&gt; element provides authentication information, including scheme. The contents of this element detail any additional parameters for authentication.</p>
  151. <p>The "scheme" attribute describes the HTTP authentication scheme to use. This attribute MUST be present, and MUST be the name of an HTTP authentication scheme (such as "basic").</p>
  152. </section2>
  153. <section2 topic='&lt;auth-param/&gt; Element'>
  154. <p>The &lt;auth-param/&gt; element provides authentication parameters. This element has attributes for the parameter name and value.</p>
  155. <p>The "name" attribute specifies the (logical) name of the authentication parameter. This attribute MUST be present, and MUST be applicable to the given scheme, although "realm" is always a valid parameter.</p>
  156. <p>The "value" attribute specifies the value for this authentication parameter. This attribute MUST be present, but MAY be empty if a value is not required.</p>
  157. </section2>
  158. <section2 topic='&lt;cookie/&gt; Element'>
  159. <p>The &lt;cookie/&gt; element provides client cookie data. This element has attributes for the cookie name and value, as well as the persistence details.</p>
  160. <p>The "name" attribute specifies the name of the cookie. This attribute MUST be present, and MUST NOT be empty. It corresponds to the "name" in the "name=value" syntax.</p>
  161. <p>The "value" attribute specifies the value for the cookie. This attribute MUST be present, but MAY be empty if a value is not required. It corresponds to the "value" in the "name=value" syntax.</p>
  162. <p>The "comment" attribute provides the description of the cookie, as would be provided via the "Set-Cookie" header. This attribute is OPTIONAL.</p>
  163. <p>The "domain" attribute provides the applicable domain of the cookie, as would be provided via the "Set-Cookie" header. This attribute is OPTIONAL.</p>
  164. <p>The "path" attribute provides the applicable HTTP path of the cookie, as would be provided via the "Set-Cookie" header. This attribute is OPTIONAL.</p>
  165. <p>The "max-age" attribute provides the maximum age for the cookie, as would be provided via the "Set-Cookie" header. This attribute is OPTIONAL, and MUST be a non-negative integer. If not specified, the default value is "0".</p>
  166. <p>The "secure" attribute indicates if this cookie is only offered in secure environments, as would be provided via the "Set-Cookie" header. This attribute is OPTIONAL, and MUST be a boolean value of "true" or "false". The default value is "false".</p>
  167. <p>The "version" attribute provides the version of the cookie, as would be provided via the "Set-Cookie" header. This attribute is OPTIONAL, and SHOULD be "1.0" unless otherwise needed. If not specified, the default value is "1.0".</p>
  168. </section2>
  169. <section2 topic='&lt;header/&gt; Element'>
  170. <p>The &lt;header/&gt; element provides generic request and entity header information, to be included in the connection attempt. This element is ONLY for message headers included in the HTTP request; it SHOULD NOT be used for message headers included in the HTTP response. The attributes for this element are the name and value of the header.</p>
  171. <p>The "name" attribute specifies the name of the header. This attribute MUST be present, and MUST conform to the "field-name" pattern for RFC 2616. It corresponds to the "name" in the (simplified) "name: value" header syntax.</p>
  172. <p>The "value" attribute specifies the value of the header. This attribute MUST be present, and MUST conform to the "field-value" pattern for RFC 2616. It MAY empty if a value is not required. It corresponds to the "value" in the (simplified) "name: value" header syntax.</p>
  173. </section2>
  174. <section2 topic='XML Schema'>
  175. <code><![CDATA[
  176. <?xml version='1.0' encoding='UTF-8'?>
  177. <xs:schema
  178. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  179. targetNamespace='http://jabber.org/protocol/url-data/scheme/http'
  180. xmlns='http://jabber.org/protocol/url-data/scheme/http'
  181. elementFormDefault='qualified'>
  182. <xs:element name='auth'>
  183. <xs:complexType>
  184. <xs:attribute name='scheme' use='required' type='xs:string'/>
  185. <xs:element name='auth-param' minOccurs='0' maxOccurs='unbounded'>
  186. <xs:complexType>
  187. <xs:simpleContent>
  188. <xs:extension base='xs:string'>
  189. <xs:attribute name='name' use='required' type='xs:string'/>
  190. <xs:attribute name='value' use='required' type='xs:string'/>
  191. </xs:extension>
  192. </xs:simpleContent>
  193. </xs:complexType>
  194. </xs:element>
  195. </xs:complexType>
  196. </xs:element>
  197. <xs:element name='cookie'>
  198. <xs:complexType>
  199. <xs:attribute name='name' use='required' type='xs:string'/>
  200. <xs:attribute name='value' use='required' type='xs:string'/>
  201. <xs:attribute name='comment' use='optional' type='xs:string'/>
  202. <xs:attribute name='domain' use='optional' type='xs:string'/>
  203. <xs:attribute name='max-age' use='optional' type='xs:integer'/>
  204. <xs:attribute name='path' use='optional' type='xs:string'/>
  205. <xs:attribute name='secure' use='optional' type='xs:boolean'/>
  206. <xs:attribute name='version' use='optional' type='xs:string'/>
  207. </xs:complexType>
  208. </xs:element>
  209. <xs:element name='header'>
  210. <xs:complexType>
  211. <xs:simpleContent>
  212. <xs:extension base='xs:string'>
  213. <xs:attribute name='name' use='required' type='xs:string'/>
  214. <xs:attribute name='value' use='required' type='xs:string'/>
  215. </xs:extension>
  216. </xs:simpleContent>
  217. </xs:complexType>
  218. </xs:element>
  219. </xs:schema>
  220. ]]></code>
  221. </section2>
  222. </section1>
  223. <section1 topic='Security Considerations'>
  224. <section2 topic='Authentication Information'>
  225. <p>This document allows complete authentication information to be passed. This information is only as secure as the connection-path between the provider and acceptor.</p>
  226. </section2>
  227. </section1>
  228. <section1 topic='IANA Considerations'>
  229. <p>This document requires no interaction with &IANA;.</p>
  230. </section1>
  231. <section1 topic='XMPP Registrar Considerations'>
  232. <p>The &REGISTRAR; shall register the "http://jabber.org/protocol/url-data/scheme/http" namespace.</p>
  233. </section1>
  234. </xep>