1
2
3
4
5
6
7Network Working Group C. Daboo
8Request for Comments: 5689 Apple Inc.
9Updates: 4791, 4918 September 2009
10Category: Standards Track
11
12
13 Extended MKCOL for Web Distributed Authoring and Versioning (WebDAV)
14
15Abstract
16
17 This specification extends the Web Distributed Authoring and
18 Versioning (WebDAV) MKCOL (Make Collection) method to allow
19 collections of arbitrary resourcetype to be created and to allow
20 properties to be set at the same time.
21
22Status of This Memo
23
24 This document specifies an Internet standards track protocol for the
25 Internet community, and requests discussion and suggestions for
26 improvements. Please refer to the current edition of the "Internet
27 Official Protocol Standards" (STD 1) for the standardization state
28 and status of this protocol. Distribution of this memo is unlimited.
29
30Copyright Notice
31
32 Copyright (c) 2009 IETF Trust and the persons identified as the
33 document authors. All rights reserved.
34
35 This document is subject to BCP 78 and the IETF Trust's Legal
36 Provisions Relating to IETF Documents
37 (http://trustee.ietf.org/license-info) in effect on the date of
38 publication of this document. Please review these documents
39 carefully, as they describe your rights and restrictions with respect
40 to this document. Code Components extracted from this document must
41 include Simplified BSD License text as described in Section 4.e of
42 the Trust Legal Provisions and are provided without warranty as
43 described in the BSD License.
44
45 This document may contain material from IETF Documents or IETF
46 Contributions published or made publicly available before November
47 10, 2008. The person(s) controlling the copyright in some of this
48 material may not have granted the IETF Trust the right to allow
49 modifications of such material outside the IETF Standards Process.
50 Without obtaining an adequate license from the person(s) controlling
51 the copyright in such materials, this document may not be modified
52 outside the IETF Standards Process, and derivative works of it may
53
54
55
56
57
58Daboo Standards Track [Page 1]
59
60RFC 5689 Extended MKCOL for WebDAV September 2009
61
62
63 not be created outside the IETF Standards Process, except to format
64 it for publication as an RFC or to translate it into languages other
65 than English.
66
67Table of Contents
68
69 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
70 2. Conventions Used in This Document . . . . . . . . . . . . . . 3
71 3. WebDAV Extended MKCOL . . . . . . . . . . . . . . . . . . . . 4
72 3.1. Extended MKCOL Support . . . . . . . . . . . . . . . . . . 5
73 3.1.1. Example: Using OPTIONS for the Discovery of
74 Support for Extended MKCOL . . . . . . . . . . . . . . 5
75 3.2. Status Codes . . . . . . . . . . . . . . . . . . . . . . . 5
76 3.3. Additional Precondition for Extended MKCOL . . . . . . . . 5
77 3.4. Example: Successful Extended MKCOL Request . . . . . . . . 6
78 3.5. Example: Unsuccessful Extended MKCOL Request . . . . . . . 6
79 4. Using Extended MKCOL as an Alternative for MKxxx Methods . . . 8
80 4.1. MKCALENDAR Alternative . . . . . . . . . . . . . . . . . . 8
81 4.1.1. Example: Using MKCOL Instead of MKCALENDAR . . . . . . 8
82 5. XML Element Definitions . . . . . . . . . . . . . . . . . . . 10
83 5.1. mkcol XML Element . . . . . . . . . . . . . . . . . . . . 10
84 5.2. mkcol-response XML Element . . . . . . . . . . . . . . . . 10
85 6. Security Considerations . . . . . . . . . . . . . . . . . . . 11
86 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 11
87 8. Normative References . . . . . . . . . . . . . . . . . . . . . 11
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114Daboo Standards Track [Page 2]
115
116RFC 5689 Extended MKCOL for WebDAV September 2009
117
118
1191. Introduction
120
121 WebDAV [RFC4918] defines the HTTP [RFC2616] method MKCOL. This
122 method is used to create WebDAV collections on the server. However,
123 several WebDAV-based specifications (e.g., CalDAV [RFC4791]) define
124 "special" collections -- ones that are identified by additional
125 values in the DAV:resourcetype property assigned to the collection
126 resource or by other means. These "special" collections are created
127 by new methods (e.g., MKCALENDAR). The addition of a new MKxxx
128 method for each new "special" collection adds to server complexity
129 and is detrimental to overall reliability due to the need to make
130 sure intermediaries are aware of these methods.
131
132 This specification defines an extension to the WebDAV MKCOL method
133 that adds a request body allowing a client to specify WebDAV
134 properties to be set on the newly created collection or resource. In
135 particular, the DAV:resourcetype property can be used to create a
136 "special" collection; alternatively, other properties can be used to
137 create a "special" resource. This avoids the need to invent new
138 MKxxx methods.
139
1402. Conventions Used in This Document
141
142 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
143 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
144 document are to be interpreted as described in [RFC2119].
145
146 This document uses XML DTD fragments (Section 3.2 of
147 [W3C.REC-xml-20081126]) as a purely notational convention. WebDAV
148 request and response bodies cannot be validated by a DTD due to the
149 specific extensibility rules defined in Section 17 of [RFC4918] and
150 due to the fact that all XML elements defined by this specification
151 use the XML namespace name "DAV:". In particular:
152
153 1. Element names use the "DAV:" namespace.
154
155 2. Element ordering is irrelevant unless explicitly stated.
156
157 3. Extension elements (elements not already defined as valid child
158 elements) may be added anywhere, except when explicitly stated
159 otherwise.
160
161 4. Extension attributes (attributes not already defined as valid for
162 this element) may be added anywhere, except when explicitly
163 stated otherwise.
164
165
166
167
168
169
170Daboo Standards Track [Page 3]
171
172RFC 5689 Extended MKCOL for WebDAV September 2009
173
174
175 When an XML element type in the "DAV:" namespace is referenced in
176 this document outside of the context of an XML fragment, the string
177 "DAV:" will be prefixed to the element type.
178
179 This document inherits, and sometimes extends, DTD productions from
180 Section 14 of [RFC4918].
181
1823. WebDAV Extended MKCOL
183
184 The WebDAV MKCOL request is extended to allow the inclusion of a
185 request body. The request body is an XML document containing a
186 single DAV:mkcol XML element as the root element. The Content-Type
187 request header MUST be set appropriately for an XML body (e.g., set
188 to "text/xml" or "application/xml"). XML-typed bodies for an MKCOL
189 request that do not have DAV:mkcol as the root element are reserved
190 for future usage.
191
192 One or more DAV:set XML elements may be included in the DAV:mkcol XML
193 element to allow setting properties on the collection as it is
194 created. In particular, to create a collection of a particular type,
195 the DAV:resourcetype XML element MUST be included in a DAV:set XML
196 element and MUST specify the expected resource type elements for the
197 new resource, which MUST include the DAV:collection element that
198 needs to be present for any WebDAV collection.
199
200 As per the PROPPATCH method (Section 9.2 of [RFC4918]), servers MUST
201 process any DAV:set instructions in document order (an exception to
202 the normal rule that ordering is irrelevant). If any one instruction
203 fails to execute successfully, all instructions MUST fail (i.e.,
204 either all succeed or all fail). Thus, if any error occurs during
205 processing, all executed instructions MUST be undone and a proper
206 error result returned. Failure to set a property value on the
207 collection MUST result in a failure of the overall MKCOL request --
208 i.e., the collection is not created.
209
210 The response to an extended MKCOL request MUST be an XML document
211 containing a single DAV:mkcol-response XML element, which MUST
212 contain DAV:propstat XML elements with the status of each property
213 when the request fails due to a failure to set one or more of the
214 properties specified in the request body. The server MAY return a
215 response body in the case where the request is successful, indicating
216 success for setting each property specified in the request body.
217 When an empty response body is returned with a success request status
218 code, the client can assume that all properties were set.
219
220 In all other respects, the behavior of the extended MKCOL request
221 follows that of the standard MKCOL request.
222
223
224
225
226Daboo Standards Track [Page 4]
227
228RFC 5689 Extended MKCOL for WebDAV September 2009
229
230
2313.1. Extended MKCOL Support
232
233 A server supporting the features described in this document MUST
234 include "extended-mkcol" as a field in the DAV response header from
235 an OPTIONS request on any URI that supports use of the extended MKCOL
236 method.
237
2383.1.1. Example: Using OPTIONS for the Discovery of Support for Extended
239 MKCOL
240
241 >> Request <<
242
243 OPTIONS /addressbooks/users/ HTTP/1.1
244 Host: addressbook.example.com
245
246 >> Response <<
247
248 HTTP/1.1 200 OK
249 Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
250 Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, REPORT, ACL
251 DAV: 1, 2, 3, access-control, extended-mkcol
252 Date: Sat, 11 Nov 2006 09:32:12 GMT
253 Content-Length: 0
254
2553.2. Status Codes
256
257 As per Section 9.3.1 of [RFC4918].
258
2593.3. Additional Precondition for Extended MKCOL
260
261 WebDAV ([RFC4918], Section 16) defines preconditions and
262 postconditions for request behavior. This specification adds the
263 following precondition for the extended MKCOL request.
264
265 Name: valid-resourcetype
266
267 Namespace: DAV:
268
269 Use with: Typically 403 (Forbidden)
270
271 Purpose: (precondition) -- The server MUST support the specified
272 resourcetype value for the specified collection.
273
274
275
276
277
278
279
280
281
282Daboo Standards Track [Page 5]
283
284RFC 5689 Extended MKCOL for WebDAV September 2009
285
286
2873.4. Example: Successful Extended MKCOL Request
288
289 This example shows how the extended MKCOL request is used to create a
290 collection of a fictitious type "special-resource". The response
291 body is empty as the request completed successfully.
292
293 >> Request <<
294
295 MKCOL /home/special/ HTTP/1.1
296 Host: special.example.com
297 Content-Type: application/xml; charset="utf-8"
298 Content-Length: xxxx
299
300 <?xml version="1.0" encoding="utf-8" ?>
301 <D:mkcol xmlns:D="DAV:"
302 xmlns:E="http://example.com/ns/">
303 <D:set>
304 <D:prop>
305 <D:resourcetype>
306 <D:collection/>
307 <E:special-resource/>
308 </D:resourcetype>
309 <D:displayname>Special Resource</D:displayname>
310 </D:prop>
311 </D:set>
312 </D:mkcol>
313
314 >> Response <<
315
316 HTTP/1.1 201 Created
317 Cache-Control: no-cache
318 Date: Sat, 11 Nov 2006 09:32:12 GMT
319
3203.5. Example: Unsuccessful Extended MKCOL Request
321
322 This example shows an attempt to use the extended MKCOL request to
323 create a collection of a fictitious type "special-resource", which is
324 not actually supported by the server. The response body shows that
325 an error occurred specifically with the DAV:resourcetype property.
326
327
328
329
330
331
332
333
334
335
336
337
338Daboo Standards Track [Page 6]
339
340RFC 5689 Extended MKCOL for WebDAV September 2009
341
342
343 >> Request <<
344
345 MKCOL /home/special/ HTTP/1.1
346 Host: special.example.com
347 Content-Type: application/xml; charset="utf-8"
348 Content-Length: xxxx
349
350 <?xml version="1.0" encoding="utf-8" ?>
351 <D:mkcol xmlns:D="DAV:"
352 xmlns:E="http://example.com/ns/">
353 <D:set>
354 <D:prop>
355 <D:resourcetype>
356 <D:collection/>
357 <E:special-resource/>
358 </D:resourcetype>
359 <D:displayname>Special Resource</D:displayname>
360 </D:prop>
361 </D:set>
362 </D:mkcol>
363
364 >> Response <<
365
366 HTTP/1.1 403 Forbidden
367 Cache-Control: no-cache
368 Date: Sat, 11 Nov 2006 09:32:12 GMT
369 Content-Type: application/xml; charset="utf-8"
370 Content-Length: xxxx
371
372 <?xml version="1.0" encoding="utf-8" ?>
373 <D:mkcol-response xmlns:D="DAV:">
374 <D:propstat>
375 <D:prop>
376 <D:resourcetype/>
377 </D:prop>
378 <D:status>HTTP/1.1 403 Forbidden</D:status>
379 <D:error><D:valid-resourcetype /></D:error>
380 <D:responsedescription>Resource type is not
381 supported by this server</D:responsedescription>
382 </D:propstat>
383 <D:propstat>
384 <D:prop>
385 <D:displayname/>
386 </D:prop>
387 <D:status>HTTP/1.1 424 Failed Dependency</D:status>
388 </D:propstat>
389 </D:mkcol-response>
390
391
392
393
394Daboo Standards Track [Page 7]
395
396RFC 5689 Extended MKCOL for WebDAV September 2009
397
398
3994. Using Extended MKCOL as an Alternative for MKxxx Methods
400
401 One of the goals of this extension is to eliminate the need for other
402 extensions to define their own variant of MKCOL to create the special
403 collections they need. This extension can be used as an alternative
404 to existing MKxxx methods in other extensions as detailed below. If
405 a server supports this extension and the other extension listed, then
406 the server MUST support use of the extended MKCOL method to achieve
407 the same result as the MKxxx method of the other extension.
408
4094.1. MKCALENDAR Alternative
410
411 CalDAV defines the MKCALENDAR method to create a calendar collection
412 as well as to set properties during creation (Section 5.3.1 of
413 [RFC4791]).
414
415 The extended MKCOL method can be used instead by specifying both DAV:
416 collection and CALDAV:calendar-collection XML elements in the DAV:
417 resourcetype property, set during the extended MKCOL request.
418
4194.1.1. Example: Using MKCOL Instead of MKCALENDAR
420
421 The first example below shows an MKCALENDAR request containing a
422 CALDAV:mkcalendar XML element in the request body and returning a
423 CALDAV:mkcalendar-response XML element in the response body.
424
425 >> MKCALENDAR Request <<
426
427 MKCALENDAR /home/lisa/calendars/events/ HTTP/1.1
428 Host: calendar.example.com
429 Content-Type: application/xml; charset="utf-8"
430 Content-Length: xxxx
431
432 <?xml version="1.0" encoding="utf-8" ?>
433 <C:mkcalendar xmlns:D="DAV:"
434 xmlns:C="urn:ietf:params:xml:ns:caldav">
435 <D:set>
436 <D:prop>
437 <D:displayname>Lisa's Events</D:displayname>
438 </D:prop>
439 </D:set>
440 </C:mkcalendar>
441
442
443
444
445
446
447
448
449
450Daboo Standards Track [Page 8]
451
452RFC 5689 Extended MKCOL for WebDAV September 2009
453
454
455 >> MKCALENDAR Response <<
456
457 HTTP/1.1 201 Created
458 Cache-Control: no-cache
459 Date: Sat, 11 Nov 2006 09:32:12 GMT
460 Content-Type: application/xml; charset="utf-8"
461 Content-Length: xxxx
462
463 <?xml version="1.0" encoding="utf-8" ?>
464 <C:mkcalendar-response xmlns:D="DAV:"
465 xmlns:C="urn:ietf:params:xml:ns:caldav">
466 <D:propstat>
467 <D:prop>
468 <D:displayname/>
469 </D:prop>
470 <D:status>HTTP/1.1 200 OK</D:status>
471 </D:propstat>
472 </C:mkcalendar-response>
473
474 The second example shows the equivalent extended MKCOL request with
475 the same request and response XML elements.
476
477 >> MKCOL Request <<
478
479 MKCOL /home/lisa/calendars/events/ HTTP/1.1
480 Host: calendar.example.com
481 Content-Type: application/xml; charset="utf-8"
482 Content-Length: xxxx
483
484 <?xml version="1.0" encoding="utf-8" ?>
485 <D:mkcol xmlns:D="DAV:"
486 xmlns:C="urn:ietf:params:xml:ns:caldav">
487 <D:set>
488 <D:prop>
489 <D:resourcetype>
490 <D:collection/>
491 <C:calendar/>
492 </D:resourcetype>
493 <D:displayname>Lisa's Events</D:displayname>
494 </D:prop>
495 </D:set>
496 </D:mkcol>
497
498
499
500
501
502
503
504
505
506Daboo Standards Track [Page 9]
507
508RFC 5689 Extended MKCOL for WebDAV September 2009
509
510
511 >> MKCOL Response <<
512
513 HTTP/1.1 201 Created
514 Cache-Control: no-cache
515 Date: Sat, 11 Nov 2006 09:32:12 GMT
516 Content-Type: application/xml; charset="utf-8"
517 Content-Length: xxxx
518
519 <?xml version="1.0" encoding="utf-8" ?>
520 <D:mkcol-response xmlns:D="DAV:"
521 xmlns:C="urn:ietf:params:xml:ns:caldav">
522 <D:propstat>
523 <D:prop>
524 <D:resourcetype/>
525 <D:displayname/>
526 </D:prop>
527 <D:status>HTTP/1.1 200 OK</D:status>
528 </D:propstat>
529 </D:mkcol-response>
530
5315. XML Element Definitions
532
5335.1. mkcol XML Element
534
535 Name: mkcol
536
537 Namespace: DAV:
538
539 Purpose: Used in a request to specify properties to be set in an
540 extended MKCOL request, as well as any additional information
541 needed when creating the resource.
542
543 Description: This XML element is a container for the information
544 required to modify the properties on a collection resource as it
545 is created in an extended MKCOL request.
546
547 Definition:
548
549 <!ELEMENT mkcol (set+)>
550
5515.2. mkcol-response XML Element
552
553 Name: mkcol-response
554
555 Namespace: DAV:
556
557
558
559
560
561
562Daboo Standards Track [Page 10]
563
564RFC 5689 Extended MKCOL for WebDAV September 2009
565
566
567 Purpose: Used in a response to indicate the status of properties
568 that were set or failed to be set during an extended MKCOL
569 request.
570
571 Description: This XML element is a container for the information
572 returned about a resource that has been created in an extended
573 MKCOL request.
574
575 Definition:
576
577 <!ELEMENT mkcol-response (propstat+)>
578
5796. Security Considerations
580
581 This extension does not introduce any new security concerns beyond
582 those already described in HTTP [RFC2616] and WebDAV [RFC4918].
583
5847. Acknowledgments
585
586 Thanks to Bernard Desruisseaux, Mike Douglass, Alexey Melnikov,
587 Julian Reschke, and Simon Vaillancourt.
588
589
5908. Normative References
591
592 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
593 Requirement Levels", BCP 14, RFC 2119, March 1997.
594
595 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
596 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
597 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
598
599 [RFC4791] Daboo, C., Desruisseaux, B., and L. Dusseault,
600 "Calendaring Extensions to WebDAV (CalDAV)", RFC 4791,
601 March 2007.
602
603 [RFC4918] Dusseault, L., "HTTP Extensions for Web Distributed
604 Authoring and Versioning (WebDAV)", RFC 4918, June 2007.
605
606 [W3C.REC-xml-20081126]
607 Maler, E., Yergeau, F., Paoli, J., Bray, T., and C.
608 Sperberg-McQueen, "Extensible Markup Language (XML) 1.0
609 (Fifth Edition)", World Wide Web Consortium
610 Recommendation REC-xml-20081126, November 2008,
611 <http://www.w3.org/TR/2008/REC-xml-20081126>.
612
613
614
615
616
617
618Daboo Standards Track [Page 11]
619
620RFC 5689 Extended MKCOL for WebDAV September 2009
621
622
623Author's Address
624
625 Cyrus Daboo
626 Apple Inc.
627 1 Infinite Loop
628 Cupertino, CA 95014
629 USA
630
631 EMail: cyrus@daboo.name
632 URI: http://www.apple.com/
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674Daboo Standards Track [Page 12]
675
676