Network Working Group | G. Clemm |
Internet-Draft | IBM |
Intended status: Experimental | J. Crawford |
Expires: October 2010 | IBM Research |
J. Reschke, Editor | |
greenbytes | |
J. Whitehead | |
U.C. Santa Cruz | |
April 2010 |
Note: a later version of this document has been published as RFC 5842.
This specification defines bindings, and the BIND method for creating multiple bindings to the same resource. Creating a new binding to a resource causes at least one new URI to be mapped to that resource. Servers are required to ensure the integrity of any bindings that they allow to be created.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work in progress”.¶
This Internet-Draft will expire in October 2010.¶
Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.¶
This specification extends the WebDAV Distributed Authoring Protocol ([RFC4918]) to enable clients to create new access paths to existing resources. This capability is useful for several reasons:¶
URIs of WebDAV-compliant resources are hierarchical and correspond to a hierarchy of collections in resource space. The WebDAV Distributed Authoring Protocol makes it possible to organize these resources into hierarchies, placing them into groupings, known as collections, which are more easily browsed and manipulated than a single flat collection. However, hierarchies require categorization decisions that locate resources at a single location in the hierarchy, a drawback when a resource has multiple valid categories. For example, in a hierarchy of vehicle descriptions containing collections for cars and boats, a description of a combination car/boat vehicle could belong in either collection. Ideally, the description should be accessible from both. Allowing clients to create new URIs that access the existing resource lets them put that resource into multiple collections.¶
Hierarchies also make resource sharing more difficult, since resources that have utility across many collections are still forced into a single collection. For example, the mathematics department at one university might create a collection of information on fractals that contains bindings to some local resources<ed:replace>,</ed:del>:</ed:del><ed:ins>, for example,</ed:ins>
The BIND method<ed:replace>
BIND lets clients associate a new URI with an existing WebDAV resource, and this URI can then be used to submit requests to the resource. Since URIs of WebDAV resources are hierarchical, and correspond to a hierarchy of collections in resource space, the BIND method also has the effect of adding the resource to a collection. As new URIs are associated with the resource, it appears in additional collections.¶
A BIND request does not create a new resource, but simply makes <ed:replace>available</ed:del>
This specification is organized as follows. Section 1.1 defines terminology used in the rest of the specification, while Section 2 overviews bindings. Section 3 defines the new properties needed to support multiple bindings to the same resource. Section 4 specifies the BIND method, used to create multiple bindings to the same resource. Section 5 specifies the UNBIND method, used to remove a binding to a resource. Section 6 specifies the REBIND method, used to move a binding to another collection.¶
The terminology used here follows and extends that in the WebDAV Distributed Authoring Protocol specification [RFC4918].¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].¶
This document uses XML DTD fragments ([XML]) as a notational convention, using the rules defined in Section 17 of [RFC4918].¶
URI Mapping ¶
Path Segment ¶
Binding ¶
Collection ¶
Internal Member URI ¶
Binding Integrity ¶
See Section 16 of [RFC4918] for the definitions of "precondition" and "postcondition".¶
Bindings are part of the state of a collection. They define the internal members of the collection<ed:replace>,</ed:del>
Bindings are added and removed by a variety of existing HTTP methods. A method that creates a new resource, such as PUT, COPY, and MKCOL, adds a binding. A method that deletes a resource, such as DELETE, removes a binding. A method that moves a resource (e.g.<ed:replace>,</ed:del>
It would be very undesirable if one binding could be destroyed as a side effect of operating on the resource through a different binding. In particular, the removal of one binding to a resource (e.g.<ed:replace>
Creating a new binding to a collection makes each resource associated with a binding in that collection accessible via a new URI, and thus creates new URI mappings to those resources but no new bindings.¶
For example, suppose a new binding CollY is created for collection C1 in the figure below. It immediately becomes possible to access resource R1 using the URI /CollY/x.gif and to access resource R2 using the URI /CollY/y.jpg, but no new bindings for these child resources were created. This is because bindings are part of the state of a collection, and <ed:replace>
┌─────────────────────────┐ │ Root Collection │ │ bindings: │ │ CollX CollY │ └─────────────────────────┘ | / | / | / ┌──────────────────┐ │ Collection C1 │ │ bindings: │ │ x.gif y.jpg │ └──────────────────┘ | \ | \ | \ ┌─────────────┐ ┌─────────────┐ │ Resource R1 │ │ Resource R2 │ └─────────────┘ └─────────────┘
Bindings to collections can result in loops ("cycles"), which servers MUST detect when processing "Depth: infinity" requests. It is sometimes possible to complete an operation in spite of the presence of a loop. For instance, a PROPFIND can still succeed if the server uses the new status code 208 (Already Reported) defined in Section 7.1.¶
However, the <ed:replace>506</ed:del><ed:ins>508</ed:ins>
Suppose a binding from "Binding-Name" to resource R is to be added to a collection, C. Then if C-MAP is the set of URIs that were mapped to C before the BIND request, then for each URI "C-URI" in C-MAP, the URI "C-URI/Binding-Name" is mapped to resource R following the BIND request.¶
For example, if a binding from "foo.html" to R is added to a collection C, and if the following URIs are mapped to C:
http://www.example.com/A/1/ http://example.com/A/one/
then the following new mappings to R are introduced:
http://www.example.com/A/1/foo.html http://example.com/A/one/foo.html
Note that if R is a collection, additional URI mappings are created to the descendents of R. Also, note that if a binding is made in collection C to C itself (or to a parent of C), an infinite number of mappings are introduced.¶
For example, if a binding from "myself" to C is then added to C, the following infinite number of additional mappings to C are introduced:
http://www.example.com/A/1/myself http://www.example.com/A/1/myself/myself ...
and the following infinite number of additional mappings to R are introduced:
http://www.example.com/A/1/myself/foo.html http://www.example.com/A/1/myself/myself/foo.html ...
As defined in Section 9.8 of [RFC4918], COPY causes the resource identified by the Request-URI to be duplicated<ed:replace>,</ed:del>,</ed:del>
The following figure shows an example: <ed:replace>S</ed:del><ed:ins>s</ed:ins>which</ed:del><ed:ins>that</ed:ins>
URI-1 URI-2 URI-3 URI-X | | | | | | | <---- URI Mappings ----> | | | | | ┌─────────────────────┐ ┌────────────────────────┐ │ Resource R │ │ Resource R' │ └─────────────────────┘ └────────────────────────┘
It might be thought that a COPY request with "Depth: 0" on a collection would duplicate its bindings, since bindings are part of the collection's state. This is not the case, however. The definition of Depth in [RFC4918] makes it clear that a "Depth: 0" request does not apply to a collection's members. Consequently, a COPY with "Depth: 0" does not duplicate the bindings contained by the collection.¶
If a COPY request causes an existing resource to be updated, the bindings to that resource MUST be unaffected by the COPY request. Using the preceding example, suppose that a COPY request is issued to URI-X for resource R', with the Destination header set to URI-2. The content and dead properties of resource R would be updated to be a copy of those of resource R', but the mappings from URI-1, URI-2, and URI-3 to resource R remain unaffected. If<ed:replace>
If a COPY request would cause a new resource to be created as a copy of an existing resource, and that COPY request has already created a copy of that existing resource, the COPY request instead creates another binding to the previous copy, instead of creating a new resource (see Section 2.3.3 for an example).¶
As an example of how COPY with <ed:replace>Depth infinity</ed:del><ed:ins>"Depth: infinity"</ed:ins>
┌──────────────────┐ │ Root Collection │ │ bindings: │ │ CollX │ └──────────────────┘ | | ┌───────────────────────────────┐ │ Collection C1 │<-------+ │ bindings: │ | │ x.gif CollY │ | └───────────────────────────────┘ | | \ (creates loop) | | \ | ┌─────────────┐ ┌──────────────────┐ | │ Resource R1 │ │ Collection C2 │ | └─────────────┘ │ bindings: │ | │ y.gif CollZ │ | └──────────────────┘ | | | | | +--------+ | ┌─────────────┐ │ Resource R2 │ └─────────────┘
If a COPY<ed:replace>Depth infinity</ed:del><ed:ins>"Depth: infinity"</ed:ins>
┌──────────────────┐ │ Root Collection │ │ bindings: │ │ CollX CollA │ └──────────────────┘ | | | +---------------------------+ | | ┌───────────────────┐ | │ Collection C1 │<------------------+ | │ bindings: │ | | │ x.gif CollY │ | | └───────────────────┘ | | | \ (creates loop) | | | \ | | ┌─────────────┐ ┌─────────────────┐ | | │ Resource R1 │ │ Collection C2 │ | | └─────────────┘ │ bindings: │ | | │ y.gif CollZ │ | | └─────────────────┘ | | | | | | | +-------+ | | | ┌─────────────┐ | │ Resource R2 │ | └─────────────┘ | | +-------------------------------+ | ┌───────────────────┐ │ Collection C3 │<------------------+ │ bindings: │ | │ x.gif CollY │ | └───────────────────┘ | | \ (creates loop) | | \ | ┌─────────────┐ ┌─────────────────┐ | │ Resource R3 │ │ Collection C4 │ | └─────────────┘ │ bindings: │ | │ y.gif CollZ │ | └─────────────────┘ | | | | | +-------+ | ┌─────────────┐ │ Resource R4 │ └─────────────┘
Note that the same would apply for more complex loops.¶
Given the following collection hierarchy:
┌──────────────────┐ │ Root Collection │ │ bindings: │ │ CollX CollY │ └──────────────────┘ / \ / \ / \ ┌──────────────────────────┐ ┌─────────────────┐ │ Collection C1 │ │ Collection C2 │ │ bindings: │ │ bindings: │ │ x.gif y.gif │ │ x.gif y.gif │ └──────────────────────────┘ └─────────────────┘ | | | | | | | | ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ Resource R1 │ │ Resource R2 │ │ Resource R3 │ └─────────────┘ └─────────────┘ └─────────────┘
A COPY of /CollX with <ed:replace>Depth infinity</ed:del><ed:ins>"Depth: infinity"</ed:ins>
Given the following collection hierarchy:
┌──────────────────┐ │ Root Collection │ │ bindings: │ │ CollX │ └──────────────────┘ | | | ┌────────────────┐ │ Collection C1 │ │ bindings: │ │ x.gif y.gif │ └────────────────┘ | | | | ┌─────────────┐ │ Resource R1 │ └─────────────┘
A COPY of /CollX with <ed:replace>Depth infinity</ed:del><ed:ins>"Depth: infinity"</ed:ins>
┌──────────────────┐ │ Root Collection │ │ bindings: │ │ CollX CollY │ └──────────────────┘ | \ | \ | \ ┌────────────────┐ ┌─────────────────┐ │ Collection C1 │ │ Collection C2 │ │ bindings: │ │ bindings: │ │ x.gif y.gif │ │ x.gif y.gif │ └────────────────┘ └─────────────────┘ | | | | | | | | ┌─────────────┐ ┌─────────────┐ │ Resource R1 │ │ Resource R2 │ └─────────────┘ └─────────────┘
When there are multiple bindings to a resource, a DELETE applied to that resource MUST NOT remove any bindings to that resource other than the one identified by the Request-URI. For example, suppose the collection identified by the URI "/a" has a binding named "x" to a resource R, and another collection identified by "/b" has a binding named "y" to the same resource R. Then<ed:replace>
When DELETE is applied to a collection, it MUST NOT modify the membership of any other collection that is not itself a member of the collection being deleted. For example, if both "/a/.../x" and "/b/.../y" identify the same collection, C, then applying DELETE to "/a" must not delete an internal member from C or from any other collection that is a member of C, because that would modify the membership of "/b".¶
If a collection supports the UNBIND method (see Section 5), a DELETE of an internal member of a collection MAY be implemented as an UNBIND request. In this case, applying DELETE to a Request-URI has the effect of removing the binding identified by the final segment of the Request-URI from the collection identified by the Request-URI minus its final segment. Although [RFC4918] allows a DELETE to be a non-atomic operation, when the DELETE operation is implemented as an UNBIND, the operation is atomic. In particular, a DELETE on a hierarchy of resources is simply the removal of a binding to the collection identified by the Request-URI.¶
When MOVE is applied to a resource, the other bindings to that resource MUST be unaffected<ed:replace>,</ed:del><ed:ins>;</ed:ins>
If the destination collection of a MOVE request supports the REBIND method (see Section 6), a MOVE of a resource into that collection MAY be implemented as a REBIND request. Although [RFC4918] allows a MOVE to be a non-atomic operation, when the MOVE operation is implemented as a REBIND, the operation is atomic. In particular, applying a MOVE to a Request-URI and a Destination URI has the effect of removing a binding to a resource (at the Request-URI)<ed:replace>,</ed:del>
As an example, suppose that a MOVE is issued to URI-3 for resource R below (which is also mapped to URI-1 and URI-2), with the Destination header set to URI-X. After successful completion of the MOVE operation, a new binding has been created <ed:replace>which</ed:del><ed:ins>that</ed:ins></ed:del><ed:ins>-</ed:ins></ed:del><ed:ins>-</ed:ins>
>> Before Request:
URI-1 URI-2 URI-3 | | | | | | <---- URI Mappings | | | ┌─────────────────────┐ │ Resource R │ └─────────────────────┘
>> After Request:
URI-1 URI-2 URI-X | | | | | | <---- URI Mappings | | | ┌─────────────────────┐ │ Resource R │ └─────────────────────┘
Note that in the presence of collection bindings, a MOVE request can cause the <ed:replace>creating</ed:del><ed:ins>creation</ed:ins>
Consider <ed:replace>a</ed:del></ed:del><ed:ins>-</ed:ins>
┌──────────────────┐ │ Root Collection │ │ bindings: │ │ CollW CollX │ └──────────────────┘ | | | | ┌──────────────────┐ | │ Collection C1 │ | │ bindings: │ | │ CollY │ | └──────────────────┘ | | | | | ┌──────────────────┐ │ Collection C2 │ │ │ │ │ └──────────────────┘
In this case, the MOVE request below would cause a bind loop:¶
>> Request:
MOVE /CollW HTTP/1.1 Host: example.com Destination: /CollX/CollZ
If the request succeeded, the resulting state would be:
┌──────────────────┐ │ Root Collection │ │ bindings: │ │ CollX │ └──────────────────┘ | | ┌──────────────────┐ | │ Collection C1 │ | +----> │ bindings: │ | | │ CollY │ | | └──────────────────┘ | | | | | | | | ┌──────────────────┐ | │ Collection C2 │ | │ bindings: │ | │ CollZ │ | └──────────────────┘ | | | | +-------------------+
Consistent with [RFC4918], the value of a dead property MUST be independent of the number of bindings to its host resource or of the path submitted to PROPFIND. On the other hand, the behavior for each live property depends on its individual definition (for example, see [RFC3744], Section 5, <ed:replace>p</ed:del><ed:ins>P</ed:ins>
It is useful to have some way of determining whether two bindings are to the same resource. Two resources might have identical contents and properties, but not be the same resource (e.g.<ed:replace>
The REQUIRED DAV:resource-id property defined in Section 3.1 is a resource identifier, which MUST be unique across all resources for all time. If the values of DAV:resource-id returned by PROPFIND requests through two bindings are identical character by character, the client can be assured that the two bindings are to the same resource.¶
The DAV:resource-id property is created, and its value assigned, when the resource is created. The value of DAV:resource-id MUST NOT be changed. Even after the resource is no longer accessible through any URI, that value MUST NOT be reassigned to another resource's DAV:resource-id property.¶
Any method that creates a new resource MUST assign a new, unique value to its DAV:resource-id property. For example, a PUT applied to a null resource, COPY (when not overwriting an existing target) and CHECKIN (see [RFC3253], Section 4.4) must assign a new, unique value to the DAV:resource-id property of the new resource they create.¶
On the other hand, any method that affects an existing resource must not change the value of its DAV:resource-id property. Specifically, a PUT or a COPY that updates an existing resource must not change the value of its DAV:resource-id property. A REBIND, since it does not create a new resource, but only changes the location of an existing resource, must not change the value of the DAV:resource-id property.¶
An OPTIONAL DAV:parent-set property on a resource provides a list of the bindings that associate a collection and a URI segment with that resource. If the DAV:parent-set property exists on a given resource, it MUST contain a complete list of all bindings to that resource that the client is authorized to see. When deciding whether to support the DAV:parent-set property, server implementers / administrators should balance the benefits it provides against the cost of maintaining the property and the security risks enumerated in Sections 12.4 and 12.5.¶
The bind feature introduces the properties defined below.¶
A DAV:allprop PROPFIND request SHOULD NOT return any of the properties defined by this document. This allows a binding server to perform efficiently when a naive client, which does not understand the cost of asking a server to compute all possible live properties, issues a DAV:allprop PROPFIND request.¶
The DAV:resource-id property is a REQUIRED property that enables clients to determine whether two bindings are to the same resource. The value of DAV:resource-id is a URI, and may use any registered URI scheme that guarantees the uniqueness of the value across all resources for all time (e.g.<ed:replace>
<!ELEMENT resource-id (href)>
The DAV:parent-set property is an OPTIONAL property that enables clients to discover what collections contain a binding to this resource (i.e.<ed:replace>
A given collection MUST appear only once in the DAV:parent-set for any given binding, even if there are multiple URI mappings to that collection.¶
<!ELEMENT parent-set (parent)*> <!ELEMENT parent (href, segment)> <!ELEMENT segment (#PCDATA)> <!-- PCDATA value: segment, as defined in Section 3.3 of [RFC3986] -->
For example, if collection C1 is mapped to both /CollX and /CollY, and C1 contains a binding named "x.gif" to a resource R1, then either [/CollX, x.gif] or [/CollY, x.gif] can appear in the DAV:parent-set of R1, but not both. But if C1 also had a binding named "y.gif" to R1, then there would be two entries for C1 in the DAV:parent-set of R1 (i.e.<ed:replace>
┌─────────────────────────┐ │ Root Collection │ │ bindings: │ │ CollX CollY │ └─────────────────────────┘ | / | / | / ┌─────────────────┐ │ Collection C1 │ │ bindings: │ │ x.gif y.gif │ └─────────────────┘ | | | | | | ┌─────────────┐ │ Resource R1 │ └─────────────┘
In this case, one possible value for <ed:replace>
<parent-set xmlns="DAV:"> <parent> <href>/CollX</href> <segment>x.gif</segment> </parent> <parent> <href>/CollX</href> <segment>y.gif</segment> </parent> </parent-set>
The BIND method modifies the collection identified by the Request-URI, by adding a new binding from the segment specified in the BIND body to the resource identified in the BIND body.¶
If a server cannot guarantee the integrity of the binding, the BIND request MUST fail. Note that it is especially difficult to maintain the integrity of cross-server bindings. Unless the server where the resource resides knows about all bindings on all servers to that resource, it may unwittingly destroy the resource or make it inaccessible without notifying another server that manages a binding to the resource. For example, if server A permits<ed:replace>
By default, if there already is a binding for the specified segment in the collection, the new binding replaces the existing binding. This default binding replacement behavior can be overridden using the Overwrite header defined in Section 10.6 of [RFC4918].¶
If a BIND request fails, the server state preceding the request MUST be restored. This method is unsafe and idempotent (see [RFC2616], Section 9.1).¶
Marshalling: ¶
<!ELEMENT bind (segment, href)>
<!ELEMENT bind-response ANY>
Preconditions: ¶
Postconditions: ¶
>> Request:
BIND /CollY HTTP/1.1
Host: www.example.com
Content-Type: application/xml; charset="utf-8"
Content-Length: 172
<?xml version="1.0" encoding="utf-8" ?>
<D:bind xmlns:D="DAV:">
<D:segment>bar.html</D:segment>
<D:href>http://www.example.com/CollX/foo.html</D:href>
</D:bind>
>> Response:
HTTP/1.1 201 Created Location: http://www.example.com/CollY/bar.html
The server added a new binding to the collection, "http://www.example.com/CollY", associating "bar.html" with the resource identified by the URI "http://www.example.com/CollX/foo.html". Clients can now use the URI "http://www.example.com/CollY/bar.html" to submit requests to that resource.¶
The UNBIND method modifies the collection identified by the Request-URI<ed:replace>,</ed:del>
Once a resource is unreachable by any URI mapping, the server MAY reclaim system resources associated with that resource. If UNBIND removes a binding to a resource, but there remain URI mappings to that resource, the server MUST NOT reclaim system resources associated with the resource.¶
If an UNBIND request fails, the server state preceding the request MUST be restored. This method is unsafe and idempotent (see [RFC2616], Section 9.1).¶
Marshalling: ¶
<!ELEMENT unbind (segment)>
<!ELEMENT unbind-response ANY>
Preconditions: ¶
Postconditions: ¶
>> Request:
UNBIND /CollX HTTP/1.1
Host: www.example.com
Content-Type: application/xml; charset="utf-8"
Content-Length: 117
<?xml version="1.0" encoding="utf-8" ?>
<D:unbind xmlns:D="DAV:">
<D:segment>foo.html</D:segment>
</D:unbind>
>> Response:
HTTP/1.1 200 OK
The server removed the binding named "foo.html" from the collection, "http://www.example.com/CollX". A request to the resource named "http://www.example.com/CollX/foo.html" will return a 404 (Not Found) response.¶
The REBIND method removes a binding to a resource from a collection, and adds a binding to that resource into the collection identified by the Request-URI. The request body specifies the binding to be added (segment) and the old binding to be removed (href). It is effectively an atomic form of a MOVE request, and MUST be treated the same way as MOVE for the purpose of determining access permissions.¶
If a REBIND request fails, the server state preceding the request MUST be restored. This method is unsafe and idempotent (see [RFC2616], Section 9.1).¶
Marshalling: ¶
<!ELEMENT rebind (segment, href)>
<!ELEMENT rebind-response ANY>
Preconditions: ¶
Postconditions: ¶
>> Request:
REBIND /CollX HTTP/1.1
Host: www.example.com
Content-Type: application/xml; charset="utf-8"
Content-Length: 176
<?xml version="1.0" encoding="utf-8" ?>
<D:rebind xmlns:D="DAV:">
<D:segment>foo.html</D:segment>
<D:href>http://www.example.com/CollY/bar.html</D:href>
</D:rebind>
>> Response:
HTTP/1.1 200 OK
The server added a new binding to the collection, "http://www.example.com/CollX", associating "foo.html" with the resource identified by the URI "http://www.example.com/CollY/bar.html"<ed:replace>,</ed:del>
To illustrate the effects of locks and bind loops on a REBIND operation, consider the following collection:
┌──────────────────┐ │ Root Collection │ │ bindings: │ │ CollW │ └──────────────────┘ | | | ┌───────────────────────────────┐ │ Collection C1 │<--------+ │ LOCKED infinity │ | │ (lock token L1) │ | │ bindings: │ | │ CollX CollY │ | └───────────────────────────────┘ | | | | | | (creates loop) | | | | ┌─────────────────┐ ┌──────────────────┐ | │ Collection C2 │ │ Collection C3 │ | │ (inherit lock) │ │ (inherit lock) │ | │ (lock token L1) │ │ (lock token L1) │ | │ bindings: │ │ bindings: │ | │ {none} │ │ y.gif CollZ │ | └─────────────────┘ └──────────────────┘ | | | | | +-----+ | ┌───────────────────────────┐ │ Resource R2 │ │ (lock inherited from C1) │ │ (lock token L1) │ └───────────────────────────┘
(where L1 is "urn:uuid:f92d4fae-7012-11ab-a765-00c0ca1f6bf9").
Note that the binding between CollZ and C1 creates a loop in the containment hierarchy. Servers are not required to support such loops, though the server in this example does.¶
The REBIND request below will remove the segment "CollZ" from C3 and add a new binding from "CollA" to the collection C2.
REBIND /CollW/CollX HTTP/1.1
Host: www.example.com
If: (<urn:uuid:f92d4fae-7012-11ab-a765-00c0ca1f6bf9>)
Content-Type: application/xml; charset="utf-8"
Content-Length: 152
<?xml version="1.0" encoding="utf-8" ?>
<D:rebind xmlns:D="DAV:">
<D:segment>CollA</D:segment>
<D:href>/CollW/CollY/CollZ</D:href>
</D:rebind>
The outcome of the REBIND operation is:
┌──────────────────┐ │ Root Collection │ │ bindings: │ │ CollW │ └──────────────────┘ | | | ┌───────────────────────────────┐ │ Collection C1 │ │ LOCKED infinity │ │ (lock token L1) │ │ bindings: │ │ CollX CollY │ └───────────────────────────────┘ | ^ | | | | ┌─────────────────┐ | ┌──────────────────┐ │ Collection C2 │ | │ Collection C3 │ │(inherited lock) │ | │ (inherited lock) │ │(lock token L1) │ | │ (lock token L1) │ │ bindings: │ | │ bindings: │ │ CollA │ | │ y.gif │ └─────────────────┘ | └──────────────────┘ | | | +---------------+ | (creates loop) | ┌───────────────────────────┐ │ Resource R2 │ │ (inherited lock from C1) │ │ (lock token L1) │ └───────────────────────────┘
The 208 (Already Reported) status code can be used inside a DAV:propstat response element to avoid enumerating the internal members of multiple bindings to the same collection repeatedly. For each binding to a collection inside the request's scope, only one will be reported with a 200 status, while subsequent DAV:response elements for all other bindings will use the 208 status, and no DAV:response elements for their descendants are included.¶
Note that the 208 status will only occur for "Depth: infinity" requests, and that it is of particular importance when the multiple collection bindings cause a bind loop as discussed in Section 2.2.¶
A client can request the DAV:resource-id property in a PROPFIND request to guarantee that they can accurately reconstruct the binding structure of a collection with multiple bindings to a single resource.¶
For backward compatibility with clients not aware of the 208 status code appearing in multistatus response bodies, it SHOULD NOT be used unless the client has signa<ed:replace>l</ed:del>506</ed:del><ed:ins>508</ed:ins>506</ed:del><ed:ins>508</ed:ins></ed:del><ed:ins>-</ed:ins>
For example, consider a PROPFIND request on /Coll (bound to collection C), where the members of /Coll are /Coll/Foo (bound to resource R) and /Coll/Bar (bound to collection C).¶
>> Request:
PROPFIND /Coll/ HTTP/1.1
Host: www.example.com
Depth: infinity
DAV: bind
Content-Type: application/xml; charset="utf-8"
Content-Length: 152
<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:displayname/>
<D:resource-id/>
</D:prop>
</D:propfind>
>> Response:
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset="utf-8"
Content-Length: 1241
<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>http://www.example.com/Coll/</D:href>
<D:propstat>
<D:prop>
<D:displayname>Loop Demo</D:displayname>
<D:resource-id>
<D:href
>urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf8</D:href>
</D:resource-id>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
<D:response>
<D:href>http://www.example.com/Coll/Foo</D:href>
<D:propstat>
<D:prop>
<D:displayname>Bird Inventory</D:displayname>
<D:resource-id>
<D:href
>urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf9</D:href>
</D:resource-id>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
<D:response>
<D:href>http://www.example.com/Coll/Bar</D:href>
<D:propstat>
<D:prop>
<D:displayname>Loop Demo</D:displayname>
<D:resource-id>
<D:href
>urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf8</D:href>
</D:resource-id>
</D:prop>
<D:status>HTTP/1.1 208 Already Reported</D:status>
</D:propstat>
</D:response>
</D:multistatus>
In this example, the client isn't aware of the 208 status code introduced by this specification. As the "Depth: infinity" PROPFIND request would cause a loop condition, the whole request is rejected with a <ed:replace>506</ed:del><ed:ins>508</ed:ins>
>> Request:
PROPFIND /Coll/ HTTP/1.1
Host: www.example.com
Depth: infinity
Content-Type: application/xml; charset="utf-8"
Content-Length: 125
<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop> <D:displayname/> </D:prop>
</D:propfind>
>> Response:
HTTP/1.1 <ed:replace>2010-01-25<ed:del> </ed:replace> Loop Detected506</ed:del><ed:ins>508</ed:ins>
The <ed:replace>506</ed:del><ed:ins>508</ed:ins>Loop Detected</ed:del>
If the server supports bindings, it MUST return the compliance class name "bind" as a field in the "DAV" response header (see [RFC4918], Section 10.1) from an OPTIONS request on any resource implemented by that server. A value of "bind" in the "DAV" header MUST indicate that the server supports all MUST<ed:replace></ed:del><ed:ins>-</ed:ins>
Clients SHOULD signal support for all MUST<ed:replace></ed:del><ed:ins>-</ed:ins>
Locking is an optional feature of WebDAV ([RFC4918]). The base WebDAV specification and this protocol extension have been designed in parallel, making sure that all features of WebDAV can be implemented on a server that implements this protocol as well.¶
Unfortunately, WebDAV uses the term "lock-root" inconsistently. It is introduced in Section 6.1 of [RFC4918], point 2, as:¶
2. A resource becomes directly locked when a LOCK request to a URL of that resource creates a new lock. The "lock-root" of the new lock is that URL. If at the time of the request, the URL is not mapped to a resource, a new empty resource is created and directly locked.¶
On the other hand, [RFC4918], Section 9.10.1 states:¶
A LOCK request to an existing resource will create a lock on the resource identified by the Request-URI, provided the resource is not already locked with a conflicting lock. The resource identified in the Request-URI becomes the root of the lock.¶
Servers that implement both WebDAV locking and support for multiple bindings MUST use the first interpretation: the lock-root is the URI through which the lock was created, not a resource. This URI, and potential aliases of this URI ([RFC4918], Section 5), are said to be "protected" by the lock.¶
As defined in the introduction to Section 7 of [RFC4918], write operations that modify the state of a locked resource require that the lock token is submitted with the request. Consistent with WebDAV, the state of the resource consists of the content ("any variant"), dead properties, lockable live properties (item 1), plus, for a collection, all its bindings (item 2). Note that this, by definition, does not depend on the <ed:replace>request URI</ed:del><ed:ins>Request-URI</ed:ins>
However, the lock<ed:replace></ed:del><ed:ins>-</ed:ins>
Consider a root collection "/", containing the two collections C1 and C2, named "/CollX" and "/CollY", and a child resource R, bound to C1 as "/CollX/test" and bound to C2 as "/CollY/test":¶
┌─────────────────────────┐ │ Root Collection │ │ bindings: │ │ CollX CollY │ └─────────────────────────┘ | | | | | | ┌───────────────┐ ┌───────────────┐ │ Collection C1 │ │ Collection C2 │ │ bindings: │ │ bindings: │ │ test │ │ test │ └───────────────┘ └───────────────┘ | | | | | | ┌──────────────────┐ │ Resource R │ └──────────────────┘
Given a host name of "www.example.com", applying a depth-zero write lock to "/CollX/test" will lock the resource R, and the lock-root of this lock will be "http://www.example.com/CollX/test".¶
Thus<ed:replace>
The following operations will not require submission of the lock token: ¶
Note that despite the lock<ed:replace></ed:del><ed:ins>-</ed:ins>request URI</ed:del><ed:ins>Request-URI</ed:ins>
Note that the WebDAV Access Control Protocol has been designed for compatibility with systems that allow multiple URIs to map to the same resource (see [RFC3744], Section 5):¶
<ed:replace>
2010-02-27<ed:del> </ed:replace>Access control properties (especially DAV:acl and DAV:inherited-acl-set) are defined on the resource identified by the Request-URI of a PROPFIND request. A direct consequence is that if the resource is accessible via multiple URI, the value of access control properties is the same across these URI.<ed:replace>...</ed:del>2010-02-27<ed:del> </ed:replace> ¶...</ed:del>
Furthermore, note that BIND and REBIND behave the same as MOVE with respect to the DAV:acl property (see [RFC3744], Section 7.3).¶
Servers that implement Workspaces ([RFC3253], Section 6) and Version<ed:replace></ed:del><ed:ins>-</ed:ins>
Consider a workspace "/ws1/", containing the version-controlled, checked-out collections C1 and C2, named "/ws1/CollX" and "/ws1/CollY", and a version-controlled resource R, bound to C1 as "/ws1/CollX/test":¶
┌─────────────────────────┐ │ Workspace │ │ bindings: │ │ CollX CollY │ └─────────────────────────┘ | | | | | | ┌───────────────┐ ┌───────────────┐ │ Collection C1 │ │ Collection C2 │ │ bindings: │ │ │ │ test │ │ │ └───────────────┘ └───────────────┘ | | | ┌──────────────────┐ │ Resource R │ └──────────────────┘
Moving "/ws1/CollX/test" into "/ws1/CollY", checking in C2, but undoing the checkout on C1 will undo part of the MOVE request, thus restoring the binding from C1 to R, but keeping the new binding from C2 to R:¶
>> Request:
MOVE /ws1/CollX/test HTTP/1.1 Host: www.example.com Destination: /ws1/CollY/test
>> Response:
HTTP/1.1 204 No Content
>> Request:
CHECKIN /ws1/CollY/ HTTP/1.1 Host: www.example.com
>> Response:
HTTP/1.1 201 Created Cache-Control: no-cache Location: http://repo.example.com/his/17/ver/42
>> Request:
UNCHECKOUT /ws1/CollX/ HTTP/1.1 Host: www.example.com
>> Response:
HTTP/1.1 200 OK Cache-Control: no-cache
As a result, both C1 and C2 would have a binding to R:¶
┌─────────────────────────┐ │ Workspace │ │ bindings: │ │ CollX CollY │ └─────────────────────────┘ | | | | | | ┌───────────────┐ ┌───────────────┐ │ Collection C1 │ │ Collection C2 │ │ bindings: │ │ bindings: │ │ test │ │ test │ └───────────────┘ └───────────────┘ | | | | | | ┌──────────────────┐ │ Resource R │ └──────────────────┘
The MOVE semantics defined in Section 3.15 of [RFC3253] already require that "/ws1/CollX/test" and "/ws1/CollY/test" will have the same version history (as exposed in the DAV:version-history property). Furthermore, the UNCHECKOUT semantics (which in this case is similar to UPDATE, see Section 14.11 of [RFC3253]) require:¶
<ed:replace>
2010-02-27<ed:del> </ed:replace>If a new version-controlled member is in a workspace that already has a version-controlled resource for that version history, then the new version-controlled member MUST be just a binding (i.e., another name for) that existing version-controlled resource.<ed:replace>...</ed:del>2010-02-27<ed:del> </ed:replace> ¶..</ed:del>
Thus, "/ws1/CollX/test" and "/ws1/CollY/test" will be bindings to the same resource R, and have identical DAV:resource-id properties.¶
This section is provided to make WebDAV implement<ed:replace>o</ed:del><ed:ins>e</ed:ins>
All of the security considerations of HTTP/1.1 ([RFC2616], Section 15) and the WebDAV Distributed Authoring Protocol specification ([RFC4918], Section 20) also apply to this protocol specification. In addition, bindings introduce several new security concerns and increase the risk of some existing threats. These issues are detailed below.¶
In a context where cross-server bindings are supported, creating bindings on a trusted server may make it possible for a hostile agent to induce users to send private information to a target on a different server.¶
Although bind loops were already possible in HTTP 1.1, the introduction of the BIND method creates a new avenue for clients to create loops accidentally or maliciously. If the binding and its target are on the same server, the server may be able to detect BIND requests that would create loops. Servers are required to detect loops that are caused by bindings to collections during the processing of any requests with "Depth: infinity".¶
<ed:replace>Denial of service</ed:del><ed:ins>Denial-of-service</ed:ins>denial of service</ed:del><ed:ins>denial-of-service</ed:ins>
If the DAV:parent-set property is maintained on a resource, the owners of the bindings risk revealing private locations. The directory structures where bindings are located are available to anyone who has access to the DAV:parent-set property on the resource. Moving a binding may reveal its new location to anyone with access to DAV:parent-set on its resource.¶
If the server maintains the DAV:parent-set property in response to bindings created in other administrative domains, it is exposed to hostile attempts to make it devote resources to adding bindings to the list.¶
All internationalization considerations mentioned in Section 19 of [RFC4918] also apply to this document.¶
Section 7 defines the HTTP status codes 208 (Already Reported) and <ed:replace>506</ed:del><ed:ins>508</ed:ins>to be</ed:del><ed:ins>which have been</ed:ins>registry at <http://www.iana.org/assignments/http-status-codes></ed:del><ed:ins>HTTP Status Code Registry</ed:ins>
This document is the collaborative product of the authors and Tyson Chihaya, Jim Davis, Chuck Fay and Judith Slein. It has benefited from thoughtful discussion by Jim Amsden, Peter Carlson, Steve Carter, Ken Coar, Ellis Cohen, Dan Connolly, Bruce Cragun, Cyrus Daboo, Spencer Dawkins, Mark Day, Werner Donne, Rajiv Dulepet, David Durand, Lisa Dusseault, Stefan Eissing, Roy Fielding, Yaron Goland, Joe Hildebrand, Fred Hitt, Alex Hopmann, James Hunt, Marcus Jager, Chris Kaler, Manoj Kasichainula, Rohit Khare, Brian Korver, Daniel LaLiberte, Steve Martin, Larry Masinter, Jeff McAffer, Alexey Melnikov, Surendra Koduru Reddy, Max Rible, Sam Ruby, Bradley Sergeant, Nick Shelness, John Stracke, John Tigue, John Turner, Kevin Wiggen, and other members of the concluded WebDAV working group.¶
Add and resolve issues "2.3_COPY_SHARED_BINDINGS" and "2.3_MULTIPLE_COPY". Add issue "5.1_LOOP_STATUS" and proposed resolution, but keep it open. Add issues "ED_references" and "4_507_status". Started work on index. Rename document to "Binding Extensions to Web Distributed Authoring and Versioning (WebDAV)". Rename "References" to "Normative References". Close issue "ED_references". Close issue "4_507_status".¶
Add and close issues "9.2_redirect_loops", "ED_authors" and "ED_updates". Add section about capability discovery (DAV header). Close issues "5.1_LOOP_STATUS". Add and resolve new issue "5.1_506_STATUS_STREAMING". Update XML spec reference. Add issue "locking" and resolve as invalid.¶
Add and close issues "6_precondition_binding_allowed" and "6_lock_behaviour". Add mailing list and issues list pointers to front.¶
Editorial fixes. Add and resolve issues "1.3_error_negotiation", "2.5_language" and "7.1.1_add_resource_id". Add historical issue "4_LOCK_BEHAVIOR" and it's resolution for better tracking.¶
Rewrite Editorial Note. Open and resolve issues "2.6_identical", "specify_safeness_and_idempotence" and "ED_rfc2026_ref".¶
Add more index items (no change tracking). Add and resolve issues "2.3_copy_to_same", "bind_properties", "bind_vs_ACL", "6_rebind_intro" and "rfc2396bis" (actually an action item). Fix XML DTD fragment in section 3.3. Make spelling of "Request-URI" consistent.¶
Resolved editorial issues raised by Jim Whitehead in <http://lists.w3.org/Archives/Public/w3c-dist-auth/2004OctDec/0129.html>. Add and resolve issues "atomicity", "2_allow_destroy", "2.1_separate_loop_discussion", "2.1.1_bind_loops_vs_locks", "2.3_copy_depth_infinity", "2.3_copy_example", "2.3_copy_vs_loops", "2.6_resource-id_vs_versions", "3.2_example" and "6_rebind_premissions". Add issue "2.6_when_do_ids_change". Re-open and resolve "6_rebind_intro".¶
Add and resolve issue "6.1_rebind_vs_locks", adding proposed example text. Add action item "3.1_uuids". Close issue "2.6_when_do_ids_change". Add and resolve issues "2.6_bindings_vs_properties" and "uri_draft_ref".¶
Resolve action item "3.1_uuids". Add and resolve issue "2.7_unlock_vs_bindings". Revisit issue "2.6_bindings_vs_properties", and remove the part of the sentence that speaks about live properties. Update "rfc2396bis" references to "RFC3986". Add issue "9_ns_op_and_acl" and add potential resolution. Align artwork where applicable (new xml2rfc1.29rc2 feature).¶
Updated [draft-mealling-uuid-urn] to [RFC4122]. Add statement about live properties in Section 2.6.¶
Updated Author's address. Uppercase "Section" when referring to other documents.¶
Updating from RFC2518 to RFC2518bis: ¶
Update [draft-ietf-webdav-rfc2518-bis] to draft 14. Update one incorrect section reference. Remove Section "Rationale for Distinguishing Bindings from URI Mappings" as [draft-ietf-webdav-rfc2518-bis] now uses the proper definition of collection state. Examples use application/xml instead of text/xml MIME type.¶
Fix IANA section (there are no IANA considerations).¶
Update [draft-ietf-webdav-rfc2518-bis] to draft 15. Update [XML] to 4th edition.¶
Markup ASCII art for box recognition (doesn't affect ASCII version).¶
Identify Julian Reschke as Editor.¶
Fix typo in RFC2119 keywords section (sorry!).¶
Update [draft-ietf-webdav-rfc2518-bis] to draft 17.¶
Add and resolve issue "rfc2518bis-lock-root".¶
Add and resolve issue "iana-vs-http-status".¶
Update rfc2518bis reference to draft 18 (note that the bug reported in <http://ietf.osafoundation.org:8080/bugzilla/show_bug.cgi?id=251> is still present).¶
Update: draft-ietf-webdav-rfc2518bis replaced by RFC4918.¶
Add and resolve issues "2.1.1-bind-loops", "2.1.1-cycles", "2.5-move-creating-cycles", "3.1-clarify-resource-id" and "4-precondition-language".¶
Use "urn:uuid:" instead of "opaquelocktoken:" scheme in examples. Replace RFC2518bis issue link by pointer to RFC Errata Page.¶
Add issues "relation-to-deltav" and "status-codes".¶
Resolve issues "relation-to-deltav" and "status-codes".¶
Add correct content length values to examples (no change bars).¶
Set "Intended Status" to "Experimental".¶
Update XML reference to "Extensible Markup Language (XML) 1.0 (Fifth Edition)".¶
Remove surplus white space from one example.¶
Fix typo: "DAV:binding-set" -> "DAV:parent-set".¶
Add and resolve issues "clarify-alternate-uri", "def-integrity", "ex-copy-multiple-update", "ex-copy-graph", and "ex-live-property".¶
Add and resolve issues "clarify-clarify", "sec-cons-references", "should-not-update-4918", "should-update-2616", and "webdav-wg-gone".¶
Add and resolve issue "locking-example".¶
Add and resolve issues "bind-vs-hierarchy", "copying-complex-loops" and "locking2".¶
Add and resolve issue "<ed:issueref>