WEBDAV Working Group J. Slein, Xerox INTERNET DRAFT E.J. Whitehead Jr., UC Irvine <draft-ietf-webdav-redirectref-protocol-02.txt> J. Davis, CourseNet G. Clemm, Rational C. Fay, FileNet J. Crawford, IBM December 17, 1999 Expires June 17, 2000 WebDAV Redirect Reference Resources Status of this Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. 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". The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. Distribution of this document is unlimited. Please send comments to the Distributed Authoring and Versioning (WebDAV) working group at <w3c- dist-auth@w3.org>, which may be joined by sending a message with subject "subscribe" to <w3c-dist-auth-request@w3.org>. Discussions of the WEBDAV working group are archived at URL: <http://lists.w3.org/Archives/Public/w3c-dist-auth/>. Abstract This is one of a pair of specifications that extend the WebDAV Distributed Authoring Protocol to enable clients to create new access paths to existing resources. The two protocol extensions have very different characteristics that make them useful for different sorts of applications. The present specification defines redirect reference resources. A redirect reference resource is a resource whose default response is an HTTP/1.1 302 (Found) status code, redirecting the client to a different resource, the target resource. A redirect reference makes it possible to access the target resource indirectly, through any URI mapped to the redirect reference resource. There are no integrity guarantees associated with redirect reference resources. The related specification, RFC xxxx, defines bindings, and the BIND method for creating them. Creating a new binding to a resource indirectly creates one or more new URIs mapped to that resource, which can then be used to access it. Servers are required to insure the integrity of any bindings that they allow to be created. Slein et al. Page 1 Internet-Draft WebDAV Redirect Reference Resources December 1999 Table of Contents 1 Notational Conventions........................................3 2 Introduction..................................................3 3 Terminology...................................................4 4 Overview of Redirect Reference Resources......................5 5 Creating a Redirect Reference Resource........................6 5.1 MKRESOURCE....................................................6 5.2 Example: Creating a Redirect Reference Resource with MKRESOURCE....................................................7 6 Operations on Redirect Reference Resources....................8 6.1 Example: GET on a Redirect Reference Resource.................9 6.2 Example: PUT on a Redirect Reference Resource with Apply-To- Redirect-Ref..................................................9 6.3 Example: PROPPATCH on a Redirect Reference Resource..........10 7 Operations on Collections That Contain Redirect Reference Resources....................................................10 7.1 MOVE and DELETE on Collections That Contain Redirect References...................................................11 7.2 LOCK on a Collection That Contains Redirect References.......11 7.3 Example: PROPFIND on a Collection with Redirect Reference Resources....................................................12 7.4 Example: PROPFIND with Apply-To-Redirect-Ref on a Collection with Redirect Reference Resources............................13 7.5 Example: COPY on a Collection That Contains a Redirect Reference Resource...........................................15 7.6 Example: LOCK on a Collection That Contains a Redirect Reference Resource...........................................15 8 Operations on Targets of Redirect Reference Resources........17 9 Relative URIs in DAV:reftarget...............................17 9.1 Example: Resolving a Relative URI in a MKRESOURCE Request....17 9.2 Example: Resolving a Relative URI in a Multi-Status Response.18 10 Redirect References to Collections...........................19 11 Headers......................................................20 11.1 Redirect-Ref Response Header.................................20 11.2 Apply-To-Redirect-Ref Request Header.........................20 12 Properties...................................................20 12.1 reftarget Property...........................................20 12.2 location Pseudo-Property.....................................20 13 XML Elements.................................................21 13.1 redirectref XML Element......................................21 14 Extensions to the DAV:response XML Element for Multi-Status Responses....................................................21 15 Capability Discovery.........................................21 15.1 Example: Discovery of Support for Redirect Reference Resources....................................................22 16 Security Considerations......................................22 16.1 Privacy Concerns.............................................22 16.2 Redirect Loops...............................................22 16.3 Redirect Reference Resources and Denial of Service...........23 16.4 Private Locations May Be Revealed............................23 17 Internationalization Considerations..........................23 18 IANA Considerations..........................................24 19 Copyright....................................................24 20 Intellectual Property........................................24 Slein et al. Page 2 Internet-Draft WebDAV Redirect Reference Resources December 1999 21 Acknowledgements.............................................24 22 References...................................................24 23 Authors' Addresses...........................................25 24 Appendices...................................................25 24.1 Appendix 1: Extensions to the WebDAV Document Type Definition...................................................25 1 Notational Conventions Since this document describes a set of extensions to the WebDAV Distributed Authoring Protocol [WebDAV], itself an extension to the HTTP/1.1 protocol, the augmented BNF used here to describe protocol elements is exactly the same as described in Section 2.1 of [HTTP]. Since this augmented BNF uses the basic production rules provided in Section 2.2 of [HTTP], these rules apply to this document as well. 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]. 2 Introduction This is one of a pair of specifications that extend the WebDAV Distributed Authoring Protocol 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, but also provides access to some resources at other universities. For many reasons, it may be undesirable to make physical copies of the shared resources on the local server: to conserve disk space, to respect copyright constraints, or to make any changes in the shared resources visible automatically. Being able to create new access paths to existing resources in other collections or even on other servers is useful for this sort of case. The redirect reference resources defined here provide a mechanism for creating alternative access paths to existing resources. A redirect Slein et al. Page 3 Internet-Draft WebDAV Redirect Reference Resources December 1999 reference resource is a resource in one collection whose purpose is to forward requests to another resource (its target), usually in a different collection. In this way, it allows clients to submit requests to the target resource from another collection. It redirects most requests to the target resource using the HTTP 302 (Found) status code, thereby providing a form of mediated access to the target resource. The companion specification, RFC xxxx, defines the BIND method, a different mechanism for allowing clients to create alternative access paths to existing WebDAV-compliant resources. The BIND method lets clients associate a new URI with an existing WebDAV resource. This URI can then be used to submit requests to the resource. Since URIs of WebDAV-compliant 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. Redirect references and bindings have very different characteristics: A redirect reference is a resource, and so can have properties and a body of its own. Properties of a redirect reference resource can contain such information as who created the reference, when, and why. Since redirect reference resources are implemented using HTTP 302 responses, it generally takes two round trips to submit a request to the intended resource. Servers are not required to enforce the integrity of redirect references. Redirect references work equally well for local resources and for resources that reside on a different server from the reference. By contrast, a BIND request does not create a new resource, but simply makes available a new URI for submitting requests to an existing resource. The new URI is indistinguishable from any other URI when submitting a request to a resource. Only one round trip is needed to submit a request to the intended target. Servers are required to enforce the integrity of the relationships between the new URIs and the resources associated with them. Consequently, it may be very costly for servers to support BIND requests that cross server boundaries. The remainder of this document is structured as follows: Section 3 defines terms that will be used throughout the specification. Section 4 provides an overview of redirect reference resources. Section 5 discusses how to create a redirect reference resource. Section 6 defines the semantics of existing methods when applied to redirect reference resources, and Section 7 discusses their semantics when applied to collections that contain redirect reference resources. Sections 8 through 10 discuss several other issues raised by the existence of redirect reference resources. Sections 11 through 14 define the new headers, properties, and XML elements required to support redirect reference resources. Section 15 discusses capability discovery. Sections 16 through 18 present the security, internationalization, and IANA concerns raised by this specification. The remaining sections provide a variety of supporting information. 3 Terminology Slein et al. Page 4 Internet-Draft WebDAV Redirect Reference Resources December 1999 The terminology used here follows and extends that in the WebDAV Distributed Authoring Protocol specification [WebDAV]. Definitions of the terms resource, Uniform Resource Identifier (URI), and Uniform Resource Locator (URL) are provided in [URI]. Reference Resource A resource whose purpose is to forward requests to another resource. Reference resources are an alternative mechanism to bindings (defined in [B]) for allowing clients to create multiple URIs that can be used to submit requests to the same resource. Redirect Reference Resource A resource that allows clients to forward requests to another resource using the HTTP 1.1 302 (Found) response mechanism. The client is aware that this type of reference resource is mediating between it and the target resource. Direct Reference Resource Direct Reference Resources are out of scope for this specification, but are defined here for contrast with redirect reference resources. A direct reference resource automatically forwards requests to another resource, in a way that is transparent to the client. Non-Reference Resource A resource that is not a reference to another resource. Target Resource The resource to which requests are forwarded by a reference resource. 4 Overview of Redirect Reference Resources For all operations submitted to a redirect reference resource, the default response is a 302 (Found), accompanied by the Redirect-Ref header (defined in Section 11.1 below) and the Location header set to the URI of the target resource. With this information, the client can resubmit the request to the URI of the target resource. A redirect reference resource never automatically forwards requests to its target resource. It is this characteristic that distinguishes redirect reference resource from direct reference resources and from bindings. It is also what insures that redirect reference resources will be simple to implement and that cross-server references will be possible. If the redirect reference resource were required to forward requests automatically, the server would need proxy capabilities in order to support cross-server references. If the client is aware that it is operating on a redirect reference resource, it can resolve the reference by retrieving the reference resource's DAV:reftarget property (defined in Section 12.1 below), whose value contains the URI of the target resource. It can then submit requests to the target resource. A redirect reference resource is a new type of resource. To distinguish Slein et al. Page 5 Internet-Draft WebDAV Redirect Reference Resources December 1999 redirect reference resources from non-reference resources, a new value of the DAV:resourcetype property (defined in [WebDAV]), DAV:redirectref, is defined in Section 13.1 below. Since a redirect reference resource is a resource, it can have its own properties and body, and methods can be applied to the reference resource as well as to its target resource. The Apply-To-Redirect-Ref request header (defined in Section 11.2 below) is provided so that referencing-aware clients can control whether an operation is applied to the redirect reference resource or to its target resource. The Apply- To-Redirect-Ref header can be used with most requests to redirect reference resources. This header is particularly useful with PROPFIND, to retrieve the reference resource's own properties. 5 Creating a Redirect Reference Resource The MKRESOURCE method is used to create new redirect reference resources. As defined in Section 5.1, MKRESOURCE can be used to create a resource of any type other than standard data containers and collections. In order to create a redirect reference resource using MKRESOURCE, the values of two properties must be set in the body of the MKRESOURCE request. The value of DAV:resourcetype MUST be set to DAV:redirectref, a new value of DAV:resourcetype defined in Section 13.1. The value of DAV:reftarget MUST be set to the URI of the target resource. Used in this way, the MKRESOURCE method creates a redirect reference resource whose target is identified by the DAV:reftarget property. It creates a new binding between the new redirect reference resource and the last path segment of the Request-URI. The new binding is added to its parent collection, identified by the Request-URI minus its trailing slash (if present) and final segment. 5.1 MKRESOURCE The MKRESOURCE method requests the creation of a resource and initialization of its properties. It allows resources other than standard data containers and collections to be created and their properties initialized in one atomic operation. Preconditions: A resource MUST NOT exist at the Request-URI. Request Marshalling: The location of the new resource to be created is specified by the Request-URI. The request body of the MKRESOURCE method MUST consist of the DAV:propertyupdate XML element defined in Section 12.13 of [WebDAV]. Postconditions: If the response status code is 201, a new resource exists at the Slein et al. Page 6 Internet-Draft WebDAV Redirect Reference Resources December 1999 Request-URI. The body of the new resource is empty. The properties of the new resource are as specified by the DAV:propertyupdate request body, using PROPPATCH semantics. If the DAV:propertyupdate does not specify a DAV:resourcetype, the resource will be a standard data container. If the response status code is not 201, then a new resource is not created at the Request-URI, and any existing resource at the Request-URI is unaffected. Response Marshalling: Responses from a MKRESOURCE request SHOULD NOT be cached, as MKRESOURCE has non-idempotent semantics. The following status codes can be expected in responses to MKRESOURCE: 201 (Created): The new resource was successfully created. 207 (Multi-Status): This response is generated if an error was encountered while initializing the properties of the resource, in which case the response is as defined in Section 8.2.1 of [WebDAV]. 403 (Forbidden): The server does not allow the creation of the requested resource type at the requested location, or the parent collection of the Request-URI exists but cannot accept members. 409 (Conflict): A resource cannot be created at the Request-URI because the parent collection for the resource does not exist, or because there is already a resource at that request-URL. 423 (Locked): The Request-URI is locked, and the lock token was not passed with the request. 507 (Insufficient Storage): The server does not have sufficient space to record the state of the resource. 5.2 Example: Creating a Redirect Reference Resource with MKRESOURCE >> Request: MKRESOURCE /~whitehead/dav/spec08.ref HTTP/1.1 Host: www.ics.uci.edu Content-Type: text/xml; charset="utf-8" Content-Length: xxx <?xml version="1.0" encoding="utf-8" ?> <D:propertyupdate xmlns:D="DAV:"> <D:set> <D:prop> <D:resourcetype><D:redirectref/></D:resourcetype> <D:reftarget> Slein et al. Page 7 Internet-Draft WebDAV Redirect Reference Resources December 1999 <D:href>/i-d/draft-webdav-protocol-08.txt</D:href> </D:reftarget> </D:prop> </D:set> </D:propertyupdate> >> Response: HTTP/1.1 201 Created This request resulted in the creation of a new redirect reference resource at www.ics.uci.edu/~whitehead/dav/spec08.ref, which points to the resource identified by the DAV:reftarget property. In this example, the target resource is identified by the URI http://www.ics.uci.edu/i- d/draft-webdav-protocol-08.txt. The redirect reference resource's DAV:resourcetype property is set to DAV:redirectref. 6 Operations on Redirect Reference Resources Although non-referencing-aware clients cannot create reference resources, they should be able to submit requests through the reference resources created by reference-aware WebDAV clients. They should be able to follow any references to their targets. To make this possible, a server that receives any request made via a redirect reference resource MUST return a 302 (Found) status code, unless the request includes an Apply-To-Redirect-Ref header. The client and server MUST follow [HTTP] Section 10.3.3 "302 Found," but with these additional rules: o The Location response header MUST contain an absolute URI that identifies the target of the reference resource. o The response MUST include the Redirect-Ref header. This header allows reference-aware WebDAV clients to recognize the resource as a reference resource and understand the reason for the redirection. A reference-aware WebDAV client can act on this response in one of two ways. It can, like a non-referencing client, resubmit the request to the URI in the Location header in order to operate on the target resource. Alternatively, it can resubmit the request to the URI of the redirect reference resource with the Apply-To-Redirect-Ref header in order to operate on the reference resource itself. If the Apply-To- Redirect-Ref header is present, the request MUST be applied to the reference resource itself, and a 302 response MUST NOT be returned. A reference-aware client may know before submitting its request that the Request-URI identifies a redirect reference resource. In this case, if the client wants to apply the method to the reference resource, it can save the round trip caused by the 302 response by using an Apply-To- Redirect-Ref header in its initial request to the URI. A few methods need additional explanation: The Apply-To-Redirect-Ref header can be used with GET or HEAD to retrieve the entity headers of a redirect reference resource. When Slein et al. Page 8 Internet-Draft WebDAV Redirect Reference Resources December 1999 Apply-To-Redirect-Ref is used with GET or HEAD, the Redirect-Ref entity header MUST be returned, along with all HTTP headers that make sense for reference resources (for example, Cache-Control, Age, ETag, Expires, and Last-Modified). A redirect reference resource MAY have a body, though none is defined for it in this specification. The PUT method can be used, with Apply- To-Redirect-Ref, to create or replace the body of a redirect reference resource. Since MKCOL and MKRESOURCE fail when applied to existing resources, if the client attempts to resubmit the request to the target resource, the request MUST fail (unless the reference resource is a dangling reference). Similarly, if the client attempts to resubmit the request to the reference resource with an Apply-To-Redirect-Ref header, the request MUST fail. Since ORDERPATCH applies only to collections, an ORDERPATCH request with an Apply-To-Redirect-Ref header on a redirect reference resource MUST fail. 6.1 Example: GET on a Redirect Reference Resource >> Request: GET /bar.html HTTP/1.1 Host: www.foo.com >> Response: HTTP/1.1 302 Found Location: http://www.svr.com/Internet/xxspec08.html Redirect-Ref: Since /bar.html is a redirect reference resource and the Apply-To- Redirect-Ref header is not included in the request, the response is a 302 (Found). The Redirect-Ref header informs a reference-aware client that this is not an ordinary HTTP 1.1 redirect, but is a redirect reference resource. The URI of the target resource is provided in the Location header so that the client can resubmit the request to the target resource. 6.2 Example: PUT on a Redirect Reference Resource with Apply-To- Redirect-Ref >> Request: PUT /bar.html HTTP/1.1 Host: www.foo.com Apply-To-Redirect-Ref: Content-Type: text/xml; charset="utf-8" Content-Length: xxxx . . . some content . . . Slein et al. Page 9 Internet-Draft WebDAV Redirect Reference Resources December 1999 >> Response: HTTP/1.1 200 OK Although /bar.html is a redirect reference resource, the presence of the Apply-To-Redirect-Ref header prevents a 302 response, and instead causes the request to be applied to the reference resource. The result in this case is that the reference resource is replaced by a non-reference resource having the content submitted with the request. 6.3 Example: PROPPATCH on a Redirect Reference Resource Request: PROPPATCH /bar.html HTTP/1.1 Host: www.foo.com Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:propertyupdate xmlns:D="DAV:" xmlns:Z="http://www.w3.com/standards/z39.50/"> <D:set> <D:prop> <Z:authors> <Z:Author>Jim Whitehead</Z:Author> <Z:Author>Roy Fielding</Z:Author> </Z:authors> </D:prop> </D:set> <D:remove> <D:prop><Z:Copyright-Owner/></D:prop> </D:remove> </D:propertyupdate> Response: HTTP/1.1 302 Found Location: http://www.svr.com/Internet/xxspec08.html Redirect-Ref: Since /bar.html is a redirect reference resource and the Apply-To- Redirect-Ref header is not included in the request, the response is a 302 (Found). The Redirect-Ref header informs a reference-aware client that this is not an ordinary HTTP 1.1 redirect, but is a redirect reference resource. The URI of the target resource is provided in the Location header so that the client can resubmit the request to the target resource. 7 Operations on Collections That Contain Redirect Reference Resources A URI of a redirect reference resource can be an internal member URI of a collection just as the URI of a non-reference resource can. Any operation on a collection with Depth: 1 or Depth: infinity applies to redirect reference resources in the collection just as it applies to any Slein et al. Page 10 Internet-Draft WebDAV Redirect Reference Resources December 1999 other resources in the collection. The methods that can accept a Depth header are PROPFIND, COPY, MOVE, DELETE, and LOCK. Consistent with the rules in Section 6, the response for each redirect reference encountered while processing a collection MUST be a 302 (Found) unless a Apply-To-Redirect-Ref header is included with the request. The overall response will therefore be a 207 (Multi-Status). Since a Location header and Redirect-Ref header cannot be returned for each redirect reference encountered, the same information is provided using properties in the response elements for those resources. The DAV:location pseudo-property and the DAV:resourcetype property MUST be included with the 302 status code. This necessitates an extension to the syntax of the DAV:response element that was defined in [WebDAV]. The extension is defined in Section 14 below. A referencing-aware client can tell from the DAV:resourcetype property that the collection contains a redirect reference resource. The DAV:location pseudo-property contains the absolute URI of the target resource. A referencing-aware client can either use the URI value of the DAV:location pseudo-property to resubmit its request to the target resource, or it can submit the request to the redirect reference resource with Apply-To-Redirect-Ref. It is recommended that future editors of [WebDAV] define the DAV:location pseudo-property in [WebDAV], so that non-referencing clients will also be able to use the response to operate on the target resource. (This will also enable clients to operate on traditional HTTP/1.1 302 responses in Multi-Status responses.) Until then, non- referencing clients will not be able to process 302 responses from redirect reference resources encountered while processing a collection. The Apply-To-Redirect-Ref header (defined in Section 11.2) MAY be used with any request on a collection. If present, it will be applied to all redirect reference resources encountered while processing the collection. 7.1 MOVE and DELETE on Collections That Contain Redirect References DELETE removes the binding that corresponds to the Request-URI. MOVE removes that binding and creates a new binding to the same resource. In cases where DELETE and MOVE are applied to a collection, these operations affect all the descendents of the collection, but they do so indirectly. There is no need to visit each descendent in order to process the request. Consequently, even if there are redirect reference resources in a tree that is being deleted or moved, there will be no 302 responses from the redirect reference resources. 7.2 LOCK on a Collection That Contains Redirect References LOCK poses special problems because it is atomic. An attempt to lock (with Depth: infinity) a collection that contains redirect references will always fail. The Multi-Status response will contain a 302 response for each redirect reference. Reference-aware clients can lock the collection by using Apply-To- Slein et al. Page 11 Internet-Draft WebDAV Redirect Reference Resources December 1999 Redirect-Ref, and, if desired, lock the targets of the redirect references individually. Non-referencing clients must resort to locking each resource individually. 7.3 Example: PROPFIND on a Collection with Redirect Reference Resources Suppose a PROPFIND request with Depth = infinity is submitted to the following collection, with the members shown here: http://www.svr.com/MyCollection/ (non-reference resource) diary.html (redirect reference resource) nunavut >> Request: PROPFIND /MyCollection/ HTTP/1.1 Host: www.svr.com Depth: infinity Content-Type: text/xml Content-Length: xxxx <?xml version="1.0" ?> <D:propfind xmlns:D="DAV: "> <D:prop xmlns:J="http://www.svr.com/jsprops/"> <D:resourcetype/> <J:keywords/> </D:prop> </D:propfind> >> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: xxxx <?xml version="1.0" ?> <D:multistatus xmlns:D="DAV:" xmlns:J="http://www.svr.com/jsprops/"> <D:response> <D:href>http://www.svr.com/MyCollection/</D:href> <D:propstat> <D:prop> <D:resourcetype><D:collection/></D:resourcetype> <J:keywords>diary, interests, hobbies</J:keywords> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> </D:response> <D:response> <D:href>http://www.svr.com/MyCollection/diary.html</D:href> <D:propstat> <D:prop> <D:resourcetype/> Slein et al. Page 12 Internet-Draft WebDAV Redirect Reference Resources December 1999 <J:keywords>diary, travel, family, history</J:keywords> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> </D:response> <D:response> <D:href>http://www.svr.com/MyCollection/nunavut</D:href> <D:status>HTTP/1.1 302 Found</D:status> <D:prop> <D:location> <D:href>http://www.inac.gc.ca/art/inuit/</D:href> </D:location> <D:resourcetype><D:redirectref/></D:resourcetype> </D:prop> </D:response> </D:multistatus> In this example the Depth header is set to infinity, and the Apply-To- Redirect-Ref header is not used. The collection contains one URI that identifies a redirect reference resource. The response element for the redirect reference resource has a status of 302 (Found), and includes a DAV:prop element with the DAV:location pseudo-property and the DAV:resourcetype property to allow clients to retrieve the properties of its target resource. (The response element for the redirect reference resource does not include the requested properties. The client can submit another PROPFIND request to the URI in the DAV:location pseudo- property to retrieve those properties.) 7.4 Example: PROPFIND with Apply-To-Redirect-Ref on a Collection with Redirect Reference Resources Suppose a PROPFIND request with Apply-To-Redirect-Ref and Depth = infinity is submitted to the following collection, with the members shown here: /MyCollection/ (non-reference resource) diary.html (redirect reference resource) nunavut >> Request: PROPFIND /MyCollection/ HTTP/1.1 Host: www.svr.com Depth: infinity Apply-To-Redirect-Ref: Content-Type: text/xml Content-Length: xxxx <?xml version="1.0" ?> <D:propfind xmlns:D="DAV:"> <D:prop> <D:resourcetype/> <D:reftarget/> </D:prop> </D:propfind> Slein et al. Page 13 Internet-Draft WebDAV Redirect Reference Resources December 1999 >> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: xxxx <?xml version="1.0" ?> <D:multistatus xmlns:D="DAV:"> <D:response> <D:href>http://www.svr.com/MyCollection/</D:href> <D:propstat> <D:prop> <D:resourcetype><D:collection/></D:resourcetype> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> <D:propstat> <D:prop> <D:reftarget/> </D:prop> <D:status>HTTP/1.1 404 Not Found</D:status> </D:propstat> </D:response> <D:response> <D:href>http://www.svr.com/MyCollection/diary.html</D:href> <D:propstat> <D:prop> <D:resourcetype/> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> <D:propstat> <D:prop> <D:reftarget/> </D:prop> <D:status>HTTP/1.1 404 Not Found</D:status> </D:propstat> </D:response> <D:response> <D:href>http://www.svr.com/MyCollection/nunavut</D:href> <D:propstat> <D:prop> <D:resourcetype><D:redirectref/></D:resourcetype> <D:reftarget> <D:href>http://www.inac.gc.ca/art/inuit/</D:href> </D:reftarget> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> </D:response> </D:multistatus> Since the Apply-To-Redirect-Ref header is present, the response shows the properties of the redirect reference resource in the collection rather than the properties of its target. The Apply-To-Redirect-Ref header also prevents a 302 response from being returned for the redirect reference resource. Slein et al. Page 14 Internet-Draft WebDAV Redirect Reference Resources December 1999 7.5 Example: COPY on a Collection That Contains a Redirect Reference Resource Suppose a COPY request is submitted to the following collection, with the members shown: /MyCollection/ (non-reference resource) diary.html (redirect reference resource) nunavut with target /Someplace/nunavut.map >> Request: COPY /MyCollection/ HTTP/1.1 Host: www.svr.com Depth: infinity Destination: http://www.svr.com/OtherCollection/ >> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxx <?xml version="1.0" encoding="utf-8" ?> <D:multistatus xmlns:D="DAV:"> <D:response> <D:href>http://www.svr.com/MyCollection/nunavut</D:href> <D:status>HTTP/1.1 302 Found</D:status> <D:prop> <D:location> <D:href> http://www.svr.com//Someplace/nunavut.map </D:href> </D:location> <D:resourcetype><D:redirectref/></D:resourcetype> </D:prop> </D:response> </D:multistatus> In this case, since /MyCollection/nunavut is a redirect reference resource, the COPY operation was only a partial success. The redirect reference resource was not copied, but a 302 response was returned for it. So the resulting collection is as follows: /OtherCollection/ (non-reference resource) diary.html 7.6 Example: LOCK on a Collection That Contains a Redirect Reference Resource Suppose a LOCK request is submitted to the following collection, with the members shown: /MyCollection/ Slein et al. Page 15 Internet-Draft WebDAV Redirect Reference Resources December 1999 (non-reference resource) diary.html (redirect reference resource) nunavut >> Request: LOCK /MyCollection/ HTTP/1.1 Host: www.svr.com Content-Type: text/xml Content-Length: nnnn Authorizaton: Digest username="jas", realm=jas@webdav.sb.aol.com, nonce=". . . ", uri="/MyCollection/tuva", response=". . . ", opaque=". . . " <?xml version="1.0" ?> <D:lockinfo xmlns:D="DAV:"> <D:lockscope><D:exclusive/></D:lockscope> <D:locktype><D:write/></D:locktype> <D:owner> <D:href>http://www.svr.com/~jas/contact.html</D:href> </D:owner> </D:lockinfo> >> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: nnnn <?xml version="1.0" ?> <D:multistatus xmlns:D="Dav:"> <D:response> <D:href>http://www.svr.com/MyCollection/</D:href> <D:propstat> <D:prop><D:lockdiscovery/></D:prop> <D:status>HTTP/1.1 424 Failed Dependency</D:status> </D:propstat> </D:response> <D:response> <D:href>http://www.svr.com/MyCollection/diary.html</D:href> <D:status>HTTP/1.1 424 Failed Dependency</D:status> </D:response> <D:response> <D:href>http://www.svr.com/MyCollection/nunavut</D:href> <D:status>HTTP/1.1 302 Found</D:status> <D:prop> <D:location> <D:href>http://www.inac.gc.ca/art/inuit/</D:href> </D:location> <D:resourcetype><D:redirectref/></D:resourcetype> </D:prop> </D:response> </D:multistatus> The server returns a 302 response code for the redirect reference Slein et al. Page 16 Internet-Draft WebDAV Redirect Reference Resources December 1999 resource in the collection. Consequently, neither the collection nor any of the resources identified by its internal member URIs were locked. A referencing-aware client can submit a separate LOCK request to the URI in the DAV:location pseudo-property returned for the redirect reference resource, and can resubmit the LOCK request with the Apply-To-Redirect- Ref header to the collection. At that point both the reference resource and its target resource will be locked (as well as the collection and all the resources identified by its other members). 8 Operations on Targets of Redirect Reference Resources Operations on targets of redirect reference resources have no effect on the reference resource. 9 Relative URIs in DAV:reftarget The URI in the href in a DAV:reftarget property MAY be a relative URI. In this case, the base URI to be used for resolving the relative URI to absolute form is the URI used in the HTTP message to identify the redirect reference resource to which the DAV:reftarget property belongs. When DAV:reftarget occurs in the body of a MKRESOURCE request, the base URI is constructed as follows: Its scheme component is "http", its authority component is the value of the Host header in the request, and its path component is the Request-URI in the request. See Section 5 of [URI] for a discussion of relative URI references and how to resolve them. When DAV:reftarget appears in the context of a Multi-Status response, it is in a DAV:response element that contains a single DAV:href element. The value of this DAV:href element serves as the base URI for resolving a relative URI in DAV:reftarget. The value of DAV:href may itself be relative, in which case it must be resolved first in order to serve as the base URI for the relative URI in DAV:reftarget. If the DAV:href element is relative, its base URI is constructed from the scheme component "http", the value of the Host header in the request, and the request-URI. 9.1 Example: Resolving a Relative URI in a MKRESOURCE Request >> Request: MKRESOURCE /north/inuvik HTTP/1.1 Host: www.somehost.edu Content-Type: text/xml; charset="utf-8" Content-Length: xxx <?xml version="1.0" encoding="utf-8" ?> <D:propertyupdate xmlns:D="DAV:"> <D:set> <D:prop> <D:resourcetype><D:redirectref/></D:resourcetype> <D:reftarget> <D:href>mapcollection/inuvik.gif</D:href> </D:reftarget> Slein et al. Page 17 Internet-Draft WebDAV Redirect Reference Resources December 1999 </D:prop> </D:set> </D:propertyupdate> >> Response: HTTP/1.1 201 Created In this example, the base URI is http://www.somehost.edu/north/inuvik. Then, following the rules in [URI] Section 5, the relative URI in DAV:reftarget resolves to the absolute URI http://www.somehost.edu/north/mapcollection/inuvik.gif. 9.2 Example: Resolving a Relative URI in a Multi-Status Response >> Request: PROPFIND /geog/ HTTP/1.1 Host: www.xxsvr.com Apply-To-Redirect-Ref: Depth: 1 Content-Type: text/xml Content-Length: nnn <?xml version="1.0" ?> <D:propfind xmlns:D="DAV:"> <D:prop> <D:resourcetype/> <D:reftarget/> </D:prop> </D:propfind> >> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: nnn <?xml version="1/0" ?> <D:multistatus xmlns:D="DAV:"> <D:response> <D:href>/geog/</D:href> <D:propstat> <D:prop> <D:resourcetype><D:collection/></D:resourcetype> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> <D:propstat> <D:prop><D:reftarget/></D:prop> <D:status>HTTP/1.1 404 Not Found</D:status> </D:propstat> </D:response> <D:response> <D:href>/geog/stats.html</D:href> Slein et al. Page 18 Internet-Draft WebDAV Redirect Reference Resources December 1999 <D:propstat> <D:prop> <D:resourcetype><D:redirectref/></D:resourcetype> <D:reftarget><D:href>statistics/population/1997.html </D:href></D:reftarget> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> </D:response> </D:multistatus> In this example, the relative URI statistics/population/1997.html is returned as the value of reftarget for the reference resource identified by href /geog/stats.html. The href is itself a relative URI, which resolves to http://www.xxsrv.com/geog/stats.html. This is the base URI for resolving the relative URI in reftarget. The absolute URI of reftarget is http://www.xxsrv.com/geog/statistics/population/1997.html. 10 Redirect References to Collections In a Request-URI /segment1/segment2/segment3, any of the three segments may identify a redirect reference resource. (See [URI], Section 3.3, for definitions of "path" and "segment".) If any segment in a Request- URI identifies a redirect reference resource, the response is a 302. The value of the Location header in the 302 response is as follows: The leftmost path segment of the request-URI that identifies a redirect reference resource, together with all path segments and separators to the left of it, is replaced by the value of the redirect reference resource's DAV:reftarget property (resolved to an absolute URI). The remainder of the request-URI is concatenated to this path. Note: If the DAV:reftarget property ends with a "/" and the remainder of the Request-URI is non-empty (and therefore must begin with a "/"), the final "/" in the DAV:reftarget property is dropped before the remainder of the Request-URI is appended. Consider Request-URI /x/y/z.html. Suppose that /x/ is a redirect reference resource whose target resource is collection /a/, which contains redirect reference resource y whose target resource is collection /b/, which contains redirect reference resource z.html whose target resource is /c/d.html. /x/ -----> /a/ /a/y/ -----> /b/ /b/z.html -----> /c/d.html In this case the client must follow up three separate 302 responses before finally reaching the target resource. The server responds to the initial request with a 302 with Location: /a/y/z.html, and the client resubmits the request to /a/y/z.html. The server responds to this request with a 302 with Location: /b/z.html, and the client resubmits the request to /b/z.html. The server responds to this request with a 302 with Location: /c/d.html, and the client resubmits the request to /c/d.html. This final request succeeds. Slein et al. Page 19 Internet-Draft WebDAV Redirect Reference Resources December 1999 11 Headers 11.1 Redirect-Ref Response Header Redirect-Ref = "Redirect-Ref:" The Redirect-Ref header is used in all 302 responses from redirect reference resources. Its presence informs reference-aware clients that the response is not a plain HTTP/1.1 redirect, but is a response from a redirect reference resource. 11.2 Apply-To-Redirect-Ref Request Header Apply-To-Redirect-Ref = "Apply-To-Redirect-Ref" ":" The optional Apply-To-Redirect-Ref header can be used on any request to a redirect reference resource. When it is used, the request MUST be applied to the reference resource itself, and a 302 response MUST NOT be returned. If the Apply-To-Redirect-Ref header is used on a request to any other sort of resource besides a redirect reference resource, the server SHOULD ignore it. 12 Properties 12.1 reftarget Property Name: reftarget Namespace: DAV: Purpose: A property of redirect reference resources that provides an efficient way for clients to discover the URI of the target resource. This is a read-only property after its initial creation. Its value can only be set in a MKRESOURCE request. Value: href containing the URI of the target resource. This value MAY be a relative URI. The reftarget property can occur in the entity bodies of MKRESOURCE requests and of responses to PROPFIND requests. <!ELEMENT reftarget href > 12.2 location Pseudo-Property Name: location Namespace: DAV: Purpose: For use with 302 (Found) response codes in Multi-Status responses. It contains the absolute URI of the temporary location of the resource. In the context of redirect reference resources, this value is the absolute URI of the target resource. It is analogous to the Location header in HTTP 302 responses defined in [HTTP] Section 10.3.3 "302 Found." Including the location pseudo-property in a Multi- Status response requires an extension to the syntax of the DAV:response element defined in [WebDAV], which is defined Slein et al. Page 20 Internet-Draft WebDAV Redirect Reference Resources December 1999 in Section 14 below. This pseudo-property is not expected to be stored on the reference resource. It is modeled as a property only so that it can be returned inside a DAV:prop element in a Multi-Status response. Value: href containing the absolute URI of the target resource. <!ELEMENT location href > 13 XML Elements 13.1 redirectref XML Element Name: redirectref Namespace: DAV: Purpose: Used as the value of the DAV:resourcetype property to specify that the resource type is a redirect reference resource. <!ELEMENT redirectref EMPTY > 14 Extensions to the DAV:response XML Element for Multi-Status Responses As described in Section 7, the DAV:location pseudo-property and the DAV:resourcetype property may be returned in the DAV:response element of a 207 Multi-Status response, to allow clients to resubmit their requests to the target resource of a redirect reference resource. Whenever these properties are included in a Multi-Status response, they are placed in a DAV:prop element associated with the href to which they apply. This structure provides a framework for future extensions by other standards that may need to include additional properties in their responses. Consequently, the definition of the DAV:response XML element changes to the following: <!ELEMENT response (href, ((href*, status, prop?) | (propstat+)), responsedescription?) > 15 Capability Discovery Sections 9.1 and 15 of [WebDAV] describe the use of compliance classes with the DAV header in responses to OPTIONS, to indicate which parts of the WebDAV Distributed Authoring protocols the resource supports. This specification defines an OPTIONAL extension to [WebDAV]. It defines a new compliance class, called redirectrefs, for use with the DAV header in responses to OPTIONS requests. If a resource does support redirect references, its response to an OPTIONS request may indicate that it does, by listing the new redirectrefs compliance class in the DAV headerand by listing the MKRESOURCE method as one it supports. When responding to an OPTIONS request, any type of resource can include redirectrefs in the value of the DAV header. Doing so indicates that the server permits a redirect reference resource at the request URI. Slein et al. Page 21 Internet-Draft WebDAV Redirect Reference Resources December 1999 15.1 Example: Discovery of Support for Redirect Reference Resources >> Request: OPTIONS /somecollection/someresource HTTP/1.1 HOST: somehost.org >> Response: HTTP/1.1 200 OK Date: Tue, 20 Jan 1998 20:52:29 GMT Connection: close Accept-Ranges: none Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, MKRESOURCE Public: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, BIND, MKRESOURCE, ORDERPATCH DAV: 1, 2, redirectrefs The DAV header in the response indicates that the resource /somecollection/someresource is level 1 and level 2 compliant, as defined in [WebDAV]. In addition, /somecollection/someresource supports redirect reference resources. The Allow header indicates that MKRESOURCE requests can be submitted to /somecollection/someresource. The Public header shows that other Request-URIs on the server support additional methods. 16 Security Considerations This section is provided to make WebDAV applications aware of the security implications of this protocol. All of the security considerations of HTTP/1.1 and the WebDAV Distributed Authoring Protocol specification also apply to this protocol specification. In addition, redirect reference resources introduce several new security concerns and increase the risk of some existing threats. These issues are detailed below. 16.1 Privacy Concerns By creating redirect reference resources on a trusted server, it is possible for a hostile agent to induce users to send private information to a target on a different server. This risk is mitigated somewhat, since clients are required to notify the user of the redirection for any request other than GET or HEAD. (See [HTTP], Section 10.3.3 302 Found.) 16.2 Redirect Loops Although redirect loops were already possible in HTTP 1.1, the introduction of the MKRESOURCE method creates a new avenue for clients to create loops accidentally or maliciously. If the reference resource and its target are on the same server, the server may be able to detect MKRESOURCE requests that would create loops. See also [HTTP], Section 10.3 "Redirection 3xx." Slein et al. Page 22 Internet-Draft WebDAV Redirect Reference Resources December 1999 16.3 Redirect Reference Resources and Denial of Service Denial of service attacks were already possible by posting URLs that were intended for limited use at heavily used Web sites. The introduction of MKRESOURCE creates a new avenue for similar denial of service attacks. Clients can now create redirect reference resources at heavily used sites to target locations that were not designed for heavy usage. 16.4 Private Locations May Be Revealed There are several ways that redirect reference resources may reveal information about directory structures. First, the DAV:reftarget property of every redirect reference resource contains the URI of the target resource. Anyone who has access to the reference resource can discover the directory path that leads to the target resource. The owner of the target resource may have wanted to limit knowledge of this directory structure. Sufficiently powerful access control mechanisms can control this risk to some extent. Property-level access control could prevent users from examining the DAV:reftarget property. (The Location header returned in responses to requests on redirect reference resources reveals the same information, however.) In some environments, the owner of a resource might be able to use access control to prevent others from creating references to that resource. This risk is no greater than the similar risk posed by HTML links. 17 Internationalization Considerations This specification follows the practices of [WebDAV] in encoding all human-readable content using XML [XML] and in the treatment of names. Consequently, this specification complies with the IETF Character Set Policy [RFC2277]. WebDAV applications MUST support the character set tagging, character set encoding, and the language tagging functionality of the XML specification. This constraint ensures that the human-readable content of this specification complies with [RFC2277]. As in [WebDAV}, names in this specification fall into three categories: names of protocol elements such as methods and headers, names of XML elements, and names of properties. Naming of protocol elements follows the precedent of HTTP, using English names encoded in USASCII for methods and headers. The names of XML elements used in this specification are English names encoded in UTF-8. For error reporting, [WebDAV] follows the convention of HTTP/1.1 status codes, including with each status code a short, English description of the code (e.g., 423 Locked). Internationalized applications will ignore this message, and display an appropriate message in the user's language and character set. This specification introduces no new strings that are displayed to users Slein et al. Page 23 Internet-Draft WebDAV Redirect Reference Resources December 1999 as part of normal, error-free operation of the protocol. For rationales for these decisions and advice for application implementors, see [WebDAV]. 18 IANA Considerations This document uses the namespaces defined by [WebDAV] for properties and XML elements. All other IANA considerations mentioned in [WebDAV] also apply to this document. 19 Copyright To be supplied by the RFC Editor. 20 Intellectual Property To be supplied by the RFC Editor. 21 Acknowledgements This draft has benefited from thoughtful discussion by Jim Amsden, Peter Carlson, Steve Carter, Tyson Chihaya, Ken Coar, Ellis Cohen, Bruce Cragun, Spencer Dawkins, Mark Day, Rajiv Dulepet, David Durand, Roy Fielding, Yaron Goland, Fred Hitt, Alex Hopmann, James Hunt, Marcus Jager, Chris Kaler, Manoj Kasichainula, Rohit Khare, Daniel LaLiberte, Steve Martin, Larry Masinter, Jeff McAffer, Surendra Koduru Reddy, Max Rible, Sam Ruby, Bradley Sergeant, Nick Shelness, John Stracke, John Tigue, John Turner, Kevin Wiggen, and others. 22 References [RFC2277] H.T. Alvestrand, "IETF Policy on Character Sets and Languages." RFC 2277, BCP 18. Uninett. January, 1998. [URI] T. Berners-Lee, R. Fielding, L. Masinter, "Uniform Resource Identifiers (URI): Generic Syntax." RFC 2396. MIT/LCS, U.C. Irvine, Xerox. August, 1998. [RFC2119] S. Bradner, "Key words for use in RFCs to Indicate Requirement Levels." RFC 2119, BCP 14. Harvard University. March, 1997. [XML] T. Bray, J. Paoli, C.M. Sperberg-McQueen, "Extensible Markup Language (XML)." World Wide Web Consortium Recommendation REC-xml- 19980210. http://www.w3.org/TR/1998/REC-xml-19980210. [HTTP] R. Fielding, J. Gettys, J. Mogul, H. Frystyk, L. Masinter, P. Leach, T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1." RFC 2616. UC Irvine, Compaq, W3C, Xerox, Microsoft. June, 1999. [WebDAV] Y. Y. Goland, E. J. Whitehead, Jr., A. Faizi, S. R. Carter, D. Jensen, "HTTP Extensions for Distributed Authoring - WebDAV." RFC 2518. Microsoft, U.C. Irvine, Netscape, Novell. February, 1999. [B] J. Slein, E.J. Whitehead Jr., J. Davis, G. Clemm, C. Fay, J. Slein et al. Page 24 Internet-Draft WebDAV Redirect Reference Resources December 1999 Crawford, "WebDAV Bindings." Internet Draft (work in progress) draft- ietf-webdav-binding-protocol-02. Xerox, UC Irvine, CourseNet, Rational, FileNet, IBM. December, 1999. 23 Authors' Addresses J. Slein Xerox Corporation 800 Phillips Road, 105-50C Webster, NY 14580 Email: jslein@crt.xerox.com E. J. Whitehead, Jr. Dept. of Information and Computer Science University of California, Irvine Irvine, CA 92697-3425 Email: ejw@ics.uci.edu J. Davis CourseNet Systems 170 Capp Street San Francisco, CA 94110 Email: jrd3@alum.mit.edu G. Clemm Rational Software Corporation 20 Maguire Road Lexington, MA 02173-3104 Email: gclemm@rational.com C. Fay FileNet Corporation 3565 Harbor Boulevard Costa Mesa, CA 92626-1420 Email: cfay@filenet.com J. Crawford IBM Research P.O. Box 704 Yorktown Heights, NY 10598 Email: ccjason@us.ibm.com 24 Appendices 24.1 Appendix 1: Extensions to the WebDAV Document Type Definition <!--============= XML Elements from Section 13 ================--> <!ELEMENT redirectref EMPTY > <!--============= Property Elements from Section 12 ===========--> <!ELEMENT reftarget href> <!ELEMENT location href> <!--====== Changes to the DAV:response Element from Section 14 ====--> <!ELEMENT response (href, ((href*, status, prop?) | (propstat+)), responsedescription?) > Slein et al. Page 25 Internet-Draft WebDAV Redirect Reference Resources December 1999 Expires June 17, 2000 Slein et al. Page 26