WEBDAV Working Group J. Slein, Xerox INTERNET DRAFT E.J. Whitehead Jr., UC Irvine J. Davis, CourseNet G. Clemm, Rational C. Fay, FileNet J. Crawford, IBM T. Chihaya, DataChannel October 15, 1999 Expires April 15, 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 , which may be joined by sending a message with subject "subscribe" to . Discussions of the WEBDAV working group are archived at URL: . Abstract The WebDAV Distributed Authoring Protocol provides basic support for collections, offering the ability to create and list unordered collections. This specification is one of a group of three specifications that supplement the WebDAV Distributed Authoring Protocol to increase the power of WebDAV collections. This specification defines redirect reference resources, one mechanism for allowing a single resource to appear in more than one collection. A redirect reference resource is a resource in one collection that responds to most requests by redirecting the request (using an HTTP 1.1 302 Found response) to a different resource, possibly in a different collection. "WebDAV Bindings"[B] defines bindings, another approach to allowing a single resource to be accessed from multiple collections. "WebDAV Ordered Collections Protocol"[OC] provides ordered collections. Table of Contents 1 Notational Conventions.......................................3 Slein et al. Page 1 Internet-Draft WebDAV Redirect References October 1999 2 Introduction.................................................3 3 Terminology..................................................5 4 Overview of Redirect Reference Resources.....................5 5 Creating a Redirect Reference Resource.......................6 5.1 MKRESOURCE...................................................6 5.2 Status Codes.................................................8 5.3 Example: Creating a Redirect Reference Resource with MKRESOURCE...................................................8 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 "Passthrough: F"............................................10 6.3 Example: PROPPATCH on a Redirect Reference Resource.........10 7 Operations on Collections That Contain Redirect Reference Resources...................................................11 7.1 MOVE and DELETE on Collections That Contain Redirect References..................................................12 7.2 LOCK on a Collection That Contains Redirect References......12 7.3 Example: PROPFIND on a Collection with Redirect Reference Resources...................................................12 7.4 Example: PROPFIND with Passthrough: F 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, with Passthrough: T.....................16 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...18 9.2 Example: Resolving a Relative URI in a Multi-Status Response.18 10 Redirect References to Collections..........................19 11 Status Codes................................................20 11.1 509 Dangling References Forbidden...........................20 12 Headers.....................................................20 12.1 Redirect-Ref Response Header................................20 12.2 Passthrough Request Header..................................20 13 Properties..................................................21 13.1 reftarget Property..........................................21 13.2 location Pseudo-Property....................................21 14 XML Elements................................................21 14.1 redirectref XML Element.....................................21 15 Extensions to the DAV:response XML Element for Multi-Status Responses...................................................22 16 Capability Discovery........................................22 16.1 Example: Discovery of Support for Redirect Reference Resources...................................................22 17 Security Considerations.....................................23 17.1 Privacy Concerns............................................23 17.2 Redirect Loops..............................................23 17.3 Redirect Reference Resources and Denial of Service..........23 17.4 Private Locations May Be Revealed...........................23 18 Internationalization Considerations.........................24 19 IANA Considerations.........................................24 20 Copyright...................................................24 21 Intellectual Property.......................................24 Slein et al. Page 2 Internet-Draft WebDAV Redirect References October 1999 22 Acknowledgements............................................25 23 References..................................................25 24 Authors' Addresses..........................................25 25 Appendices..................................................26 25.1 Appendix 1: Extensions to the WebDAV Document Type Definition..................................................26 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 The simple collections that the WebDAV Distributed Authoring Protocol specification supports are powerful enough to be widely useful. They provide for the hierarchical organization of resources, with mechanisms for creating and deleting collections, copying and moving them, locking them, adding members to them and removing members from them, and getting listings of their members. Delete, copy, move, list, and lock operations can be applied recursively, so that a client can operate on whole hierarchies with a single request. This specification is one of a family of three specifications that build on the infrastructure defined in [HTTP] and [WebDAV] to extend the capabilities of collections. The companion specification "WebDAV Ordered Collections Protocol"[OC] defines protocol extensions to support ordered collections. The present specification and the companion specification "WebDAV Bindings"[B] define mechanisms for allowing the same resource to appear in multiple collections. This capability is useful for several reasons: Organizing resources into hierarchies places them into smaller groupings, known as collections, which are more easily browsed and manipulated than a flat namespace. 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. 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 Slein et al. Page 3 Internet-Draft WebDAV Redirect References October 1999 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. The BIND method defined in [B] provides one mechanism for allowing a single resource to appear in multiple collections. It lets clients associate a new URI with an existing resource. This URI can then be used to submit requests to the resource. Since URIs in WebDAV 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. The redirect reference resources defined here are a different mechanism for allowing a single resource to appear in multiple collections. A redirect 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. These two approaches to allowing clients to add a single resource to multiple collections have very different characteristics: A redirect reference is a resource, and so can have properties of its own. Such information as who created the reference, when, and why can be stored on the redirect reference resource. Since redirect references 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 can be used like any other URI to submit 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 clients create and the resources associated with them. Consequently, it is unlikely that servers will 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 15 define the new status codes, headers, properties, and XML elements Slein et al. Page 4 Internet-Draft WebDAV Redirect References October 1999 required to support redirect reference resources. Section 16 discusses capability discovery. Sections 17 through 19 present the security, internationalization, and IANA concerns raised by this specification. The remaining sections provide a variety of supporting information. 3 Terminology 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 12.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. Slein et al. Page 5 Internet-Draft WebDAV Redirect References October 1999 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 13.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 redirect reference resources from non-reference resources, a new value of the DAV:resourcetype property (defined in [WebDAV]), DAV:redirectref, is defined in Section 14.1 below. Since a redirect reference resource is a resource, it is possible to apply methods to the reference resource rather than to its target resource. The Passthrough request header (defined in Section 12.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 Passthrough 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. 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 14.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: If the Overwrite header is not present or is set to 'F', a resource MUST NOT exist at the Request-URI. Marshalling: The location of the new resource to be created is specified by the Request-URI. The Overwrite header MAY be specified. The request body of the MKRESOURCE method is the same as the request body for PROPPATCH, that is, it MUST contain the DAV:propertyupdate XML element defined in Section 12.13 of [WebDAV]. Slein et al. Page 6 Internet-Draft WebDAV Redirect References October 1999 Semantics: Creation of the resource and initialization of its properties MUST both occur, or neither occurs. Property initialization is carried out using PROPPATCH semantics. The type of resource to create is specified by the DAV:resourcetype property. If the DAV:resourcetype property is not specified, the resource created will be a standard data container. If the Overwrite header is set to 'T' and MKRESOURCE is applied to an existing resource, the existing resource is deleted using DELETE semantics prior to MKRESOURCE processing. If deletion or resource creation cannot be completed, the entire operation fails and the existing resource MUST be left unaffected. Since existing resources are deleted, MKRESOURCE cannot be used to change the DAV:resourcetype of a resource. Postconditions: After the successful execution of MKRESOURCE, a new resource exists. The body of the new resource is empty, while the initial values of the properties of the new resource are those specified in the property update directives in the request body. Response Marshalling: Results 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 (1) the deletion of a resource other than the one identified by the Request-URI could not be completed, in which case the response is as defined in Section 8.6.2 of [WebDAV], or (2) 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 until one or more intermediate collections have been created. 412 (Precondition Failed): The Overwrite header is not present or is set to 'F', and a resource exists at the Request-URI. 423 (Locked): A locked resource exists at the Request-URI and the lock token was not passed in with the request. 507 (Insufficient Storage): The server does not have sufficient space to record the state of the resource. Slein et al. Page 7 Internet-Draft WebDAV Redirect References October 1999 5.2 Status Codes In addition to the common status codes returned by MKRESOURCE, the following special case can arise when creating a redirect reference resource: 509 (Dangling References Forbidden): Some servers may have a policy that forbids dangling references. These servers will respond with 509 if there is no resource at the location specified in the DAV:reftarget property. 5.3 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 /i-d/draft-webdav-protocol-08.txt >> 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 a Passthrough header with a value of "F". The client and server MUST follow [HTTP] Section 10.3.3 "302 Found," but with these additional rules: Slein et al. Page 8 Internet-Draft WebDAV Redirect References October 1999 o The Location response header MUST contain the absolute target URI 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 Passthrough header set to "F" in order to operate on the reference resource itself. If the Passthrough header is present with a value of "F", 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 "Passthrough: F" in its initial request to the URI. A few methods need additional explanation: "Passthrough: F" can be used with GET or HEAD to retrieve the entity headers of a redirect reference resource. When "Passthrough: F" 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). "Passthrough: F" can be used with PUT to replace the redirect reference resource with a non-reference resource. Clients MUST NOT use "Passthrough: F" with POST. Since a reference resource cannot accept another entity as its subordinate, an attempt to POST to a reference resource with "Passthrough: F" will also fail. If a server receives a POST request with "Passthrough: F" on a redirect reference resource, it MUST fail the request with a 400 (Bad Request) status code. 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 "Passthrough: F", the request MUST fail. Since ORDERPATCH applies only to collections, an ORDERPATCH request with a Passthrough header with the value "F" on a redirect reference resource MUST fail. 6.1 Example: GET on a Redirect Reference Resource >> Request: Slein et al. Page 9 Internet-Draft WebDAV Redirect References October 1999 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 Passthrough 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 "Passthrough: F" >> Request: PUT /bar.html HTTP/1.1 Host: www.foo.com Passthrough: F Content-Type: text/xml; charset="utf-8" Content-Length: xxxx . . . some content . . . >> Response: HTTP/1.1 200 OK Although /bar.html is a redirect reference resource, the presence of the "Passthrough: F" 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 Jim Whitehead Roy Fielding Slein et al. Page 10 Internet-Draft WebDAV Redirect References October 1999 >> 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 Passthrough 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 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 Passthrough header with the value "F" 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 must be 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 15 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 "Passthrough: F". 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- Slein et al. Page 11 Internet-Draft WebDAV Redirect References October 1999 referencing clients will not be able to process 302 responses from redirect reference resources encountered while processing a collection. The Passthrough header (defined in Section 12.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 Passthrough: F, 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 Slein et al. Page 12 Internet-Draft WebDAV Redirect References October 1999 >> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: xxxx http://www.svr.com/MyCollection/ diary, interests, hobbies HTTP/1.1 200 OK http://www.svr.com/MyCollection/diary.html diary, travel, family, history HTTP/1.1 200 OK http://www.svr.com/MyCollection/nunavut HTTP/1.1 302 Found http://www.inac.gc.ca/art/inuit/ In this example the Depth header is set to infinity, and the Passthrough 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 Passthrough: F on a Collection with Redirect Slein et al. Page 13 Internet-Draft WebDAV Redirect References October 1999 Reference Resources Suppose a PROPFIND request with Passthrough = F 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 Passthrough: F Content-Type: text/xml Content-Length: xxxx >> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: xxxx http://www.svr.com/MyCollection/ HTTP/1.1 200 OK HTTP/1.1 404 Not Found http://www.svr.com/MyCollection/diary.html HTTP/1.1 200 OK Slein et al. Page 14 Internet-Draft WebDAV Redirect References October 1999 HTTP/1.1 404 Not Found http://www.svr.com/MyCollection/nunavut http://www.inac.gc.ca/art/inuit/ HTTP/1.1 200 OK Since the Passthrough header has the value "F", the response shows the properties of the redirect reference resource in the collection rather than the properties of its target. The value of the Passthrough header also prevents a 302 response from being returned for the redirect reference resource. 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 Destination: http://www.svr.com/OtherCollection/ >> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxx http://www.svr.com/MyCollection/nunavut HTTP/1.1 302 Found Slein et al. Page 15 Internet-Draft WebDAV Redirect References October 1999 http://www.svr.com//Someplace/nunavut.map 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, with Passthrough: T Suppose a LOCK request is submitted to the following collection, with the members shown: /MyCollection/ (non-reference resource) diary.html (redirect reference resource) nunavut >> Request: LOCK /MyCollection/ HTTP/1.1 Host: www.svr.com Passthrough: T Content-Type: text/xml Content-Length: nnnn Authorizaton: Digest username="jas", realm=jas@webdav.sb.aol.com, nonce=". . . ", uri="/MyCollection/tuva", response=". . . ", opaque=". . . " http://www.svr.com/~jas/contact.html >> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: nnnn Slein et al. Page 16 Internet-Draft WebDAV Redirect References October 1999 http://www.svr.com/MyCollection/ HTTP/1.1 424 Failed Dependency http://www.svr.com/MyCollection/diary.html HTTP/1.1 424 Failed Dependency http://www.svr.com/MyCollection/nunavut HTTP/1.1 302 Found http://www.inac.gc.ca/art/inuit/ The "Passthrough: T" header caused the server to return a 302 response code for the redirect reference 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 "Passthrough: F" 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 Slein et al. Page 17 Internet-Draft WebDAV Redirect References October 1999 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 mapcollection/inuvik.gif >> 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 Passthrough: F Depth: 1 Content-Type: text/xml Content-Length: nnn Slein et al. Page 18 Internet-Draft WebDAV Redirect References October 1999 >> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: nnn /geog/ HTTP/1.1 200 OK HTTP/1.1 404 Not Found /geog/stats.html statistics/population/1997.html HTTP/1.1 200 OK 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 Slein et al. Page 19 Internet-Draft WebDAV Redirect References October 1999 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. 11 Status Codes 11.1 509 Dangling References Forbidden The server has a policy forbidding dangling references, and the request would have created a dangling reference. For example, if there is no resource at the location specified by the DAV:reftarget property of a MKRESOURCE request, the request would create a dangling reference. 12 Headers 12.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. 12.2 Passthrough Request Header Passthrough = "Passthrough" ":" ("T" | "F") The optional Passthrough header can be used on any request to a redirect reference resource. If the Passthrough header has the value "F", the request MUST be applied to the reference resource itself, and a 302 response MUST NOT be returned. If the Passthrough header has the value Slein et al. Page 20 Internet-Draft WebDAV Redirect References October 1999 "T", a 302 response MUST be returned, with the URI of the target resource in the Location header and the Redirect-Ref header. If the Passthrough header is used on a request to any other sort of resource besides a reference resource, the server SHOULD ignore it. If the Passthrough header with the value "F" appears in a POST or ORDERPATCH request to a reference resource, the server MUST respond with a 400 (Bad Request). 13 Properties 13.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. 13.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 in Section 15 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. 14 XML Elements 14.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 Slein et al. Page 21 Internet-Draft WebDAV Redirect References October 1999 resource. 15 Extensions to the DAV:response XML Element for Multi-Status Responses As described in Sections 7 and 0, the DAV:location pseudo-property and the DAV:reftype 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: 16 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 Web 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 MUST indicate that it does, by listing the new redirectrefs compliance class in the DAV header. It MUST also list 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. 16.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, Slein et al. Page 22 Internet-Draft WebDAV Redirect References October 1999 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. 17 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. 17.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.) 17.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." 17.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. 17.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 Slein et al. Page 23 Internet-Draft WebDAV Redirect References October 1999 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. 18 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 [Alvestrand]. 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 [Alvestrand]. 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. For rationales for these decisions and advice for application implementors, see [WebDAV]. 19 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. In addition, this document defines a new HTTP/1.1 status code, 509 (Dangling References Forbidden) defined in Section 11.1. 20 Copyright To be supplied by the RFC Editor. 21 Intellectual Property To be supplied by the RFC Editor. Slein et al. Page 24 Internet-Draft WebDAV Redirect References October 1999 22 Acknowledgements This draft has benefited from thoughtful discussion by Jim Amsden, Steve Carter, Ken Coar, Ellis Cohen, Bruce Cragun, Spencer Dawkins, Mark Day, Rajiv Dulepet, David Durand, Roy Fielding, Yaron Goland, Fred Hitt, Alex Hopmann, 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, and others. 23 References [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. Crawford, T. Chihaya, "WebDAV Bindings." Internet Draft (work in progress) draft-ietf-webdav-binding-protocol-00. Xerox, UC Irvine, CourseNet, Rational, FileNet, IBM, DataChannel. August, 1999. [OC] J. Slein, E.J. Whitehead Jr., J. Davis, G. Clemm, C. Fay, J. Crawford, T. Chihaya, "WebDAV Ordered Collections." Internet Draft (work in progress) draft-ietf-webdav-ordering-protocol-00. Xerox, UC Irvine, CourseNet, Rational, FileNet, IBM, DataChannel. August, 1999. 24 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 Slein et al. Page 25 Internet-Draft WebDAV Redirect References October 1999 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 Email: ccjason@us.ibm.com T. Chihaya DataChannel, Inc. 155 108th Ave. N.E., Suite 400 Bellevue, WA 98004 Email: Tyson@DataChannel.com 25 Appendices 25.1 Appendix 1: Extensions to the WebDAV Document Type Definition Expires April 15, 2000 Slein et al. Page 26