WEBDAV Working Group Y. Y. Goland, Microsoft
INTERNET-DRAFT E. J. Whitehead, Jr., U.C. Irvine
<draft-ietf-webdav-protocol-04> A. Faizi, Netscape
S. R Carter, Novell
D. Jensen, Novell
Expires April 20, 1998 October 12, 1997
To learn the current status of any Internet-Draft, please check the "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast).
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://www.w3.org/pub/WWW/Archives/Public/w3c-dist-auth>.
Abstract
This Document specifies a set of methods and content-types ancillary to HTTP/1.1 for the management of resource properties, simple name space manipulation, simple resource locking (collision avoidance) and resource version control.
Table of Contents
Abstract
1 Terminology
2 Data Model and Methods for DAV Properties
2.1 Introduction
2.1.1 The DAV Property
2.1.2 Existing Metadata Proposals
2.1.3 Properties and HTTP Headers
2.2 A Property Model for HTTP Resources
2.2.1 Overview
2.2.2 Property Namespace
2.3 Schemas
2.3.1 PropSchema XML Element
2.3.2 DTD XML Element
2.3.3 DefinedProps XML Element
2.3.4 PropEntries XML Element
2.3.5 Live XML Element
2.4 DAV Schema
2.4.1 DAV Property
2.4.2 Level XML Element
2.4.3 Prop XML element
2.4.4 PropLoc XML Attribute
2.4.5 Example
2.5 Property Identifiers
2.5.1 Problem Definition
2.6 Link XML Element
2.6.1 Problem Description
2.6.2 Solution Requirements
2.6.3 Link XML Element
2.6.4 Src XML Element
2.6.5 Dst XML Element
2.6.6 Example
2.7 Multi-Status Response
2.7.1 Problem Definition
2.7.2 Solution Requirements
2.7.3 Multi-Status Response
2.8 Properties and Methods
2.8.1 DELETE
2.8.2 GET
2.8.3 PROPPATCH
2.8.4 PUT
2.8.5 PROPFIND
3 A Proposal for Collections of Web Resources and Name Space
Operations
3.1 Observations on the HTTP Object Model
3.1.1 Collection Resources
3.1.2 Creation and Retrieval of Collection
Resources
3.1.3 Source Resources and Output Resources
3.2 MKCOL Method
3.2.1 Problem Description
3.2.2 Solution Requirements
3.2.3 Request
3.2.4 Response
3.2.5 Example
3.3 Standard DAV Properties
3.3.1 IsCollection Property
3.3.2 DisplayName Property
3.3.3 CreationDate Property
3.3.4 GETentity Property
3.3.5 INDEXentity Property
3.3.6 Content-Type XML Element
3.3.7 Content-Length XML Element
3.3.8 Content-Language XML Element
3.3.9 Last-Modified XML Element
3.3.10 Etag XML Element
3.4 INDEX Method
3.4.1 Problem Description
3.4.2 Solution Requirements
3.4.3 The Request
3.4.4 The Response
3.4.5 ResInfo XML Element
3.4.6 Members XML Element
3.4.7 Href XML Element
3.4.8 Example
3.5 Behavior of RFC 2068 Methods on Collections
3.5.1 GET, HEAD for Collections
3.5.2 POST for Collections
3.5.3 PUT for Collections
3.5.4 DELETE for Collections
3.5.5 DELETE Method for Non-Collection
Resources
3.6 COPY Method
3.6.1 Problem Description
3.6.2 Solution Requirements
3.6.3 The Request
3.6.4 The Response
3.6.5 Examples
3.7 MOVE Method
3.7.1 Problem Description
3.7.2 Solution Requirements
3.7.3 The Request
3.7.4 The Response
3.7.5 Examples
3.8 ADDREF Method
3.8.1 Problem Definition
3.8.2 Solution Requirements
3.8.3 The Request
3.8.4 Example
3.9 DELREF Method
3.9.1 Problem Definition
3.9.2 Solution Requirements
3.9.3 The Request
3.9.4 Example
3.10 PATCH Method
3.10.1 Problem Definition
3.10.2 Solution Requirements
3.10.3 The Request
3.10.4 text/xml elements for PATCH
3.10.5 The Response
3.10.6 Examples
3.11 Headers
3.11.1 Destination Header
3.11.2 Enforce-Live-Properties Header
3.11.3 Overwrite Header
3.11.4 Destroy Header
3.11.5 Collection-Member Header
3.12 Links
3.12.1 Source Link Property Type
4 State Tokens
4.1 Overview
4.1.1 Problem Description
4.1.2 Solution Requirements
4.2 State Token Syntax
4.3 State Token Conditional Headers
4.3.1 If-State-Match
4.3.2 If-None-State-Match
4.4 State Token Header
4.5 E-Tag
5 Locking
5.1 Locking: Introduction
5.1.1 Exclusive Vs. Shared Locks
5.1.2 Required Support
5.2 LOCK Method
5.2.1 Operation
5.2.2 The Effect of Locks on Properties and
Containers
5.2.3 Locking Replicated Resources
5.2.4 Locking Multiple Resources
5.2.5 Interaction with other Methods
5.2.6 Lock Compatibility Table
5.2.7 Status Codes
5.2.8 Lock-Info Request Header
5.2.9 Owner Request Header
5.2.10 Time-Out Header
5.2.11 Lock Response
5.2.12 Example - Simple Lock Request
5.2.13 Example - Multi-Resource Lock Request
5.3 Write Lock
5.3.1 Methods Restricted by Write Locks
5.3.2 Write Locks and Properties
5.3.3 Write Locks and Null Resources
5.3.4 Write Locks and Collections
5.3.5 Write Locks and COPY/MOVE
5.3.6 Re-issuing Write Locks
5.3.7 Write Locks and The State-Token Header
5.4 Lock Tokens
5.4.1 Problem Description
5.4.2 Lock Token Introduction
5.4.3 Generic Lock Tokens
5.4.4 OpaqueLockToken Lock Token
5.5 UNLOCK Method
5.5.1 Problem Definition
5.5.2 Example
5.6 Discovery Mechanisms
5.6.1 Lock Capability Discovery
5.6.2 Active Lock Discovery
6 Version Control
7 Internationalization Support
8 Security Considerations
9 Copyright
10 Acknowledgements
11 References
12 Authors' Addresses
Member Resource - a resource referred to by a collection. There are two types of member resources: external and internal.
Internal Member Resource - the name given to a member resource of a collection whose URI is relative to the URI of the collection.
External Member Resource - a member resource with an absolute URI that is not relative to its parent's URI.
Properties - A set of name/value pairs that contain descriptive information about a resource.
Live Properties - Properties whose semantics and syntax are enforced by the server. For example, a live "read-only" property that is enforced by the server would disallow PUTs to the associated resource.
Dead properties - Properties whose semantics and syntax are not enforced by the server. A dead "read-only" property would not be enforced by the server and thus would not be used by the server as a reason to disallow a PUT on the associated resource.
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 RFC 2119 [Bradner, 1997].
Properties are used within distributed authoring environments to provide for efficient discovery and management of resources. For example, a 'subject' property might allow for the indexing of all resources by their subject, and an 'author' property might allow for the discovery of what authors have written which documents.
Some proposals come from a digital library perspective. These include the Dublin Core [Weibel et al., 1995] metadata set and the Warwick Framework [Lagoze, 1996], a container architecture for different metadata schemas. The literature includes many examples of metadata, including MARC [MARC, 1994], a bibliographic metadata format, RFC 1807 [Lasher, Cohen, 1995], a technical report bibliographic format employed by the Dienst system, and the proceedings from the first IEEE Metadata conference describe many community-specific metadata sets.
Participants of the 1996 Metadata II Workshop in Warwick, UK [Lagoze, 1996], noted that, "new metadata sets will develop as the networked infrastructure matures" and "different communities will propose, design, and be responsible for different types of metadata." These observations can be corroborated by noting that many community-specific sets of metadata already exist, and there is significant motivation for the development of new forms of metadata as many communities increasingly make their data available in digital form, requiring a metadata format to assist data location and cataloging.
It would seem best to implement a flat property namespace, inducing a natural isomorphism between DAV and most native file systems. Adopting such a model will not restrict RDBS from taking full advantage of their search facilities.
However, it seems that future trends might be toward hierarchical properties. Therefore, DAV requirements [Slein et al.] stipulate that the design of the flat property system MUST be such that it will be possible to add true hierarchical properties later without breaking downlevel clients. Specifically, a flat client MUST be able to speak to a hierarchical server and a hierarchical client MUST be able to speak to a flat server. Worst case either way MUST be that the request fails.
The URI framework provides a mechanism to prevent namespace collision and for varying degrees of administrative control. Rather than reinvent these desirable features, DAV properties make use of them by requiring that all DAV property names MUST be URIs. Since a property is also an XML element, the name of the XML element is a URI.
The property namespace is flat, that is, it is not possible to string together a series of property names in order to refer to a hierarchy of properties. Thus it is possible to refer to a property B but not a property A/B, where A is also a property defined on the resource.
Finally, it is not possible to define the same property twice as this would cause a collision in the resource's property namespace.
Schema discovery is used to determine if a system supports a group of properties or XML elements. A property does not necessarily contain sufficient information to identify any schema(s) to which it may belong.
As with property names, schemas MUST use URIs as their names.
A resource declares its support for a schema by defining a property whose name is the same as the schema's. The property SHOULD contain the PropSchema XML element.
<?XML:Namespace href="http://www.ietf.org/standards/dav/" AS="D"/>
<?XML:Namespace href="AIIM:Dublin:" AS="A"/> <D:Prop>
<A:Author D:PropLoc="http://www.foo.com/resource/props/Author">
Larry Masinter
</A:Author>
</D:Prop>
The previous specifies that the property author exists on some
unspecified resource and that the property can be directly
referenced at http://www.foo.com/resource/props/Author. The
resource upon which the property is defined must be determined
from context.
A server is free to assign whatever URI it chooses to identify an instance of a property defined on a resource. In fact, a server is free not to reveal the URI of an instance of a particular resource and instead require that the client access the property through PROPFIND and PROPPATCH. However, many servers will want to allow clients to directly manipulate properties. On these servers, a client can discover the URI of an instance of a property by performing a PROPFIND and examining the PropLoc attribute, if returned, of each property.
<?XML:Namespace
href = "http://www.ietf.org/standards/dav/" AS = "D"/>
<?XML:Namespace
href = "http://www.foocorp.com/Project/" AS = "F"/>
<D:Prop>
<Source>
<Link>
<F:ProjFiles>Source</F:ProjFiles>
<src>http://foo.bar/program</src>
<dst>http://foo.bar/src/main.c</dst>
</Link>
<Link>
<F:ProjFiles>Library</F:ProjFiles>
<src>http://foo.bar/program</src>
<dst>http://foo.bar/src/main.lib</dst>
</Link>
<Link>
<F:ProjFiles>Makefile</F:ProjFiles>
<src>http://foo.bar/program</src>
<dst>http://foo.bar/src/makefile</dst>
<Link>
</Source>
</D:Prop>
In this example the resource http://foo.bar/program has a source
property defined which contains three links. Each link contains
three elements, two of which, src and dst, are part of the DAV
schema defined in this document, and one which is defined by the
schema http://www.foocorp.com/project/ (Source, Library, and
Makefile). A client which only implements the elements in the DAV
spec will not understand the foocorp elements and will ignore
them, thus seeing the expected source and destination links. An
enhanced client may know about the foocorp elements and be able
to present the user with additional information about the links.
GET /bar.html;prop=z39.50_authors HTTP/1.1 Host: foo.com
HTTP/1.1 200 OK Content-Type: text/xml Content-Length: xxxx E-tag: "1234" Last-Modified: xxxx
<?XML:Namespace href = "http://www.ietf.org/standards/dav/" AS = "D"/>
<?XML:Namespace href = "http://www.w3.com/standards/z39.50/"AS = "Z"/>
<D:prop>
<Z:Authors>
<Z:Author>Jane Doe</Z:Author>
<Z:Author>Joe Doe</Z:Author>
<Z:Author>Lots o'Doe</Z:Author>
</Z:Authors>
</D:prop>
All DAV compliant servers MUST process instructions which are specified using the PropertyUpdate, Create, and Remove XML elements of the DAV schema. The request message body MUST contain at least one PropertyUpdate XML element. Instruction processing MUST occur in the order instructions are received (i.e., from top to bottom), and MUST be performed atomically.
PROPPATCH /bar.html HTTP/1.1 Host: www.foo.com Content-Type: text/xml Content-Length: xxxx
<?XML:Namespace href = "http://www.ietf.org/standards/dav/" AS = "D"/>
<?XML:Namespace href = "http://www.w3.com/standards/z39.50/" AS = "Z"/>
<D:PropertyUpdate>
<Create>
<prop>
<Z:authors>
<Z:Author>Jim Whitehead</Z:Author>
<Z:Author>Roy Fielding</Z:Author>
</Z:authors>
</Prop>
</Create>
<Remove>
<prop><Z:Copyright-Owner/></prop>
</Remove>
</D:PropertyUpdate>
HTTP/1.1 405 Conflict
Content-Type: text/xml
Content-Length: xxxxx
<?XML:Namespace href="http://www.ietf.org/standards/dav/" AS = "D"/>
<?XML:Namespace href="http://www.w3.com/standards/z39.50/" AS = "Z"/>
<D:MultiResponse>
<ResponseDescription> Copyright Owner can not be deleted or
altered.</ResponseDescription>
<Response>
<Prop><Z:authors/></Prop>
<Status>HTTP/1.1 418 Atomicity Failure</Status>
</Response>
<Response>
<Prop><Z:Copyright-Owner/></Prop>
<Status>HTTP/1.1 405 Conflict</Status>
</Response>
</D:MultiResponse>
The response is a text/xml message body that contains a Multiresponse XML element which describes the results of the attempts to retrieve the various properties. If a property was successfully retrieved then its value MUST be returned in the Prop XML element. In the case of Allprop and Findprop, if a principal does not have the right to know if a particular property exists, an error MUST NOT be returned. The results of this method SHOULD NOT be cached.
PROPFIND /container/ HTTP/1.1 Host: www.foo.bar Content-Length: xxxx Content-Type: text/xml
<?XML:Namespace href =
"http://www.ietf.org/standards/dav/" AS = "G"/>
<?XML:Namespace href =
"http://www.foo.bar/boxschema/" AS = "B"/>
<G:PROPFIND>
<prop>
<B:bigbox>
<B:author>
<B:DingALing>
<B:Random>
</prop>
</G:PROPFIND>
HTTP/1.1 207 Multi-Response Content-Type: text/xml Content-Length: xxxxx
<?XML:Namespace href ="http://www.ietf.org/standards/dav/" AS = "S">
<?XML:Namespace href = "http://www.foo.bar/boxschema" AS = R">
<D:MultiResponse>
<ResponseDescription> There has been an access violation
error. </ResponseDescription>
<Response>
<Prop>
<R:bigbox D:Proploc="http://prop.com/BoxType">
<BoxType>Box type A</BoxType>
</R:bigbox>
<R:author D:Proploc="http://prop.com/Author">
<Name>J.J. Dingleheimerschmidt</Name>
</R:author>
</Prop>
<Status>HTTP/1.1 200 Success</Status>
</Response>
<Response>
<Prop><R:DingALing/><R:Random/></>
<Status>HTTP/1.1 403 Forbidden</Status>
<ResponseDescription> The user does not have access to
the DingALink property. </ResponseDescription>
</Response>
</D:MultiResponse>
The result will return all properties on the container. In this
case only two properties were found. The principal did not have
sufficient access rights to see the third and fourth properties
so an error was returned.
PROPFIND /container/ HTTP/1.1 Host: www.foo.bar Content-Length: xxxx Content-Type: text/xml
<?XML:Namespace href =
"http://www.ietf.org/standards/dav/" AS = "G"/>
<G:PROPFIND>
<Allprop/>
</G:PROPFIND>
HTTP/1.1 200 Success Content-Type: text/xml Content-Length: xxxxx
<?XML:Namespace href =
"http://www.ietf.org/standards/dav/" As = "S">
<?XML:Namespace href = "http://www.foo.bar/boxschema" AS = R">
<S:MultiResponse>
<Prop>
<R:bigbox D:Proploc="http://prop.com/BigBox">
<BoxType>Box type A</BoxType>
</R:bigbox>
<R:author D:Proploc="http://prop.com/Author">
<Name>Hadrian</Name>
</R:author>
</Prop>
<Status>HTTP/1.1 200 Success</Status>
</S:MultiResponse>
This particular client only had the right to see two properties,
BoxType and Author. No error is returned for the remaining
properties, as the client does not even have sufficient rights to
know they exist. If the client did have the right to know they
existed but did not have the right to see their value, a 207
multi-response with a multiresponse, as used in the previous
example, would have been returned.
PROPFIND /container/ HTTP/1.1 Host: www.foo.bar Content-Length: xxxx Content-Type: text/xml
<?XML:Namespace href = "http://www.ietf.org/standards/dav/" AS = "G"/>
<G:PROPFIND>
<Propname/>
</G:PROPFIND>
HTTP/1.1 200 Success
Content-Type: text/xml
Content-Length: xxxxx
<?XML:Namespace href = "http://www.ietf.org/standards/dav/" As = "S">
<?XML:Namespace href = "http://www.foo.bar/boxschema" AS = "R">
<S:MultiResponse>
<Prop>
<R:bigbox D:Proploc="http://prop.com/BigBox"/>
<R:author D:Proploc="http://prop.com/Author"/>
<R:DingALing/>
<R:Random/>
</Prop>
<Status>HTTP/1.1 200 Success</Status>
</S:MultiResponse>
In this case only two of the properties have direct URLs
available, while the other two properties can only be referenced
via PROPFIND and PROPPATCH.
The purpose of a collection resource is to model collection-like objects (e.g., a filesystem directory) within a server's namespace. Once these objects have been modeled with collections, a client may perform an INDEX, add and remove external members using ADDREF and DELREF, and perform recursive operations, such as a full hierarchy copy.
To support methods which operate on collections, a server SHOULD model its collection-like objects with collection resources. For example, a server which is implemented on top of a filesystem SHOULD treat all filesystem directories exposed by the server as collection resources.
In HTTP/1.1, the PUT method is defined to store the request body at the location specified by Request-URI. While a description format for a collection can readily be constructed that could be used with PUT, the implications of sending such a description to the server are undesirable. For example, if a description of a collection that omitted some existing resources were PUT to a server, this might be interpreted as a command to remove those members. This would extend PUT to perform DELETE functionality, which is undesirable since it changes the semantics of PUT, and makes it difficult to control DELETE functionality with an access control scheme based on methods.
While the POST method is sufficiently open-ended that a "create a collection" POST command could be constructed, this is undesirable because it would be difficult to separate access control for collection creation from other uses of POST if they both use the same method.
While it might seem desirable to have GET return a listing of the members of a collection, this is foiled by the existence of the "index.html" de-facto standard namespace redirection, in which a GET request on a collection is automatically redirected to the index.html resource.
The exact definition of the behavior of GET and PUT on collections is defined later in this document.
If http://foo/bar/b/d is created with a MKCOL and http://foo/bar/b/d/e was created then a DELETE on d would fail because d is a collection with an internal member. However the existence of the collection d is something of an illusion. If a DELETE was executed on http://foo/bar then everything would be deleted, even though http://foo/bar/b/d was created with a MKCOL.
Thus the effect of a MKCOL within a composite resource's namespace is felt on its children, not its ancestors. The children of d MUST be treated as members of a collection when a method is executed on d. But a method executed on b or a is treated as if there only existed a non-collection resource.
However, the server can sometimes process HTML resources before they are transmitted as a return entity body. For example, server-side-include directives within an HTML file instruct a server to replace the directive with another value, such as the current date. In this case, what is returned by GET (HTML plus date) differs from the persistent state of the resource (HTML plus directive). Typically there is no way to access the HTML resource containing the unprocessed directive.
Sometimes the entity returned by GET is the output of a data-producing process that is described by one or more source resources (that may not even have a location in the URL namespace). A single data-producing process may dynamically generate the state of a potentially large number of output resources. An example of this is a CGI script that describes a "finger" gateway process that maps part of the namespace of a server into finger requests, such as http://www.foo.bar.org/finger_gateway/user@host.
In the absence of distributed authoring capability, it is acceptable to have no mapping of source resource(s) to the URI namespace, and in fact has desirable security benefits. However, if remote editing of the source resource(s) is desired, the source resource(s) should be given a location in the URI namespace. This source location should not be one of the locations at which the generated output is retrievable, since in general it is impossible for the server to differentiate requests for source resources from requests for process output resources. There is often a many-to-many relationship between source resources and output resources.
For DAV compliant servers all output resources which have a single source resource (and that source resource has a URI), the URI of the source resource SHOULD be stored in a single link on the output resource with type http://www.ietf.org/standards/dav/source. Note that by storing the source URI in links on the output resources, the burden of discovering the source is placed on the authoring client.
MKCOL /webdisc/xfiles/ HTTP/1.1
Host: www.server.org
HTTP/1.1 201 Created
For a collection, INDEX MUST return a list of its members. All WebDAV compliant resources MUST support the text/xml response entity described below. The INDEX result for a collection MAY also return a list of the members of child collections, to any depth.
Collections that respond to an INDEX method with a text/xml entity MUST contain only one ResInfo element. This ResInfo element contains an Href element, which gives the identifier(s) of the resource, a Prop element, which gives selected properties of the resource, and a Members element, which contains a ResInfo element for each member of the collection. The Prop element MUST contain at least the following properties, if they are defined and available: DisplayName, IsCollection, CreationDate, GETentity, and INDEXentity.
The response from INDEX is cacheable, and SHOULD be accompanied by an ETag header (see section 13.3.4 of RFC 2068). If GET and INDEX return different entities for the same resource state, they MUST return different entity tags.
INDEX /user/yarong/dav_drafts/ HTTP/1.1
Host: www.microsoft.com
HTTP/1.1 200 OK
Content-Type: text/xml
Content-Length: xxx
Last-Modified: Thu, 11 Sep 1997 23:45:12 GMT
ETag: "fooyyybar"
<?XML:Namespace href = "http://www.ietf.org/standards/dav/" as = "D"/>
<D:ResInfo>
<XML:Href>
http://www.microsoft.com/user/yarong/dav_drafts/
</XML:Href>
<Prop>
<DisplayName>
WebDAV working drafts directory
</DisplayName>
<IsCollection>true</IsCollection>
<CreationDate>19970418T070304Z</CreationDate>
<GETentity>
<Content-Type>text/html</Content-Type>
<Content-Length>2754</Content-Length>
<Content-Language>en</Content-Language>
<Last-Modified>
Fri, 22 Aug 1997 10:11:26 GMT
</Last-Modified>
<Etag>"8675309"</Etag>
</GETentity>
<INDEXentity>
<Content-Type>text/xml</Content-Type>
<Content-Length>xxx</Content-Length>
<Last-Modified>
Thu, 11 Sep 1997 23:45:12 GMT
</Last-Modified>
<Etag>"fooyyybar"</Etag>
</INDEXentity>
</Prop>
<Members>
<ResInfo>
<XML:Href>
http://www.microsoft.com/user/yarong/dav_drafts/base
</XML:Href>
<Prop>
<IsCollection
D:PropLoc="http://www.microsoft.com/user/yarong/dav_drafts/b
ase;props=IsCollection">
False
</IsCollection>
<DisplayName>
WebDAV Name Space Operations Draft
</DisplayName>
<Creation-Date>19970320T230525Z</Creation-Date>
<GETentity>
<Content-Type>application/msword</Content-Type>
<Content-Length>1400</Content-Length>
<Content-Language>en</Content-Language>
<Last-Modified>
Fri, 22 Aug 1997 18:22:56 GMT
</Last-Modified>
<Etag>"8675309"</Etag>
</GETentity>
</Prop>
</ResInfo>
</Members>
</D:ResInfo>
This example shows the result of the INDEX method applied to the
collection resource
http://www.microsoft.com/user/yarong/dav_drafts/. It returns a
response body in XML format, which gives information about the
container and its sole member,
http://www.microsoft.com/user/yarong/dav_drafts/base. The entry
on the collection confirms that the resource the INDEX was
executed on is a collection. The result also contains the URI of
the IsCollection property on the member resource.
Similarly, since the definition of HEAD is a GET without a response message body, the semantics of HEAD are unmodified when applied to collection resources.
When the PUT operation creates a new non-collection resource all ancestors MUST already exist. If all ancestors do not exist, the method MUST fail with a 409 Conflict status code. For example, if resource /a/b/c/d.html is to be created and /a/b/c/ does not exist, then the request MUST fail.
This is problematic because of the network traffic involved in making a copy, and because there is often no way to fully express a resource as an entity without a loss of fidelity.
All properties on the source resource MUST be duplicated on the destination resource, subject to modifying headers, following the definition for copying properties.
If a property on the source already exists on the resource and the overwrite header is set to TRUE then the property at the destination MUST be overwritten with the property from the source. If the overwrite header is false and the previous situation exists then the COPY MUST fail with a 409 Conflict.
If the destination resource identifies a collection and the Overwrite header is "true," prior to performing the copy, the server MUST perform a DELETE operation on the collection.
COPY /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html HTTP/1.1 200 OK
COPY /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html Overwrite: "false" HTTP/1.1 412 Precondition Failed
With a WEBDAV server, a principal may accomplish this task by issuing a COPY and then DELETE. Network load decreases, but the server load may still be significant because the server must create a duplicate resource. Were a server to know beforehand that a principal intended to perform COPY and DELETE operations in succession, it could avoid the creation of a duplicate resource.
MOVE /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html HTTP/1.1 200 OK Content-Location: http://www.ics.uci.edu/users/f/fielding/index.html
It is not an error if the URI specified in the Collection-Member header already exists as an external member of the collection, however, after processing ADDREF there MUST be only one instance of the URI in the collection. If the URI specified in the Collection-Member header already exists as an internal member of the collection, the ADDREF method MUST fail with a 412 Precondition Failed status code.
ADDREF /~whitehead/dav/ HTTP/1.1 HOST: www.ics.udi.edu Collection-Member: http://www.ietf.org/standards/dav/ HTTP/1.1 200 OK
DELREF /~whitehead/dav/ HTTP/1.1 Host: www.ics.udi.edu Collection-Member: http://www.ietf.org/standards/dav/ HTTP/1.1 200 OK
If the request appears (at least initially) to be acceptable, the server MUST transmit an interim 100 response message after receiving the empty line terminating the request headers and continue processing the request. Since the semantics of PATCH are non-idempotent, responses to this method are not cacheable.
While server support for PATCH is optional, if a server does support PATCH, it MUST support at least the text/xml diff format defined below. Support for the VTML difference format [VTML] is recommended, but not required.
The changes specified by the resourceupdate XML element MUST be executed atomically.
Please note that in order to protect the white space contained in this XML element the following attribute/value MUST be included in the element: XML-SPACE = "PRESERVE".
Please note that in order to protect the white space contained in this XML element the following attribute/value MUST be included in the element: XML-SPACE = "PRESERVE".
<HTML>
<HEAD>
<TITLE>Hello world HTML page</TITLE>
</HEAD>
<BODY>
<P>Hello, world!</P>
</BODY>
</HTML>
PATCH Request: Response:
PATCH hello.html HTTP/1.1
Host: www.example.org
Content-Type: text/xml
Content-Length: xxx
HTTP/1.1 100 Continue
<?XML:Namespace href =
Shttp://www.ietf.org/standards/dav/patch/" AS = "D"/>
<D:ResourceUpdate>
<Replace XML-SPACE = "PRESERVE">
<octet-range>14</octet-range>
&003CTITLE&003ENew Title&003C/TITLE&003E
</Replace>
<Delete><octet-range>38-50</Delete>
<Insert XML-SPACE = "PRESERVE"><octet-range>86</>&
003CP&003ENew paragraph&003C/P&003E</Insert>
</D:ResourceUpdate>
HTTP/1.1 200 OK
After:
<HTML>
<HEAD>
<TITLE>New Title</TITLE>
</HEAD>
<BODY>
<P>Hello, world!</P>
<P>New paragraph</P>
</BODY>
</HTML>
Destination= "Destination" ":" URI
EnforceLiveProperties = "Enforce-Live-Properties" ":" ("*" |
"Omit" | 1#(Property-Name))
Property-Name = "<" URI ">"
Overwrite = "Overwrite" ":" ("true" | "false")
If there is a conflict and the Overwrite header equals "true", or
is absent and thus defaults to "true", then the method MUST fail
with a 409 Conflict.
The NoUndelete token requests that the resource MUST NOT be left in a state such that it can be undeleted.
The VersionDestroy token includes the functionality of the NoUndelete token and extends it to include having the server remove all versioning references to the resource that it has control over.
DestroyHeader = "Destroy" ":" #ChoicesChoices = "VersionDestroy" | "NoUndelete" | "Undelete" | token |"<" URI ">" ; a token extension MUST NOT be used unless it is specified in a RFC16, otherwise a URI MUST be used for extensions.
CollectionMember = "Collection-Member" ":" URI
The fundamental issue with entity tags is that they can only be generated by a resource. However there are times when a client will want to be able to share state tokens between resources, potentially on different servers, as well as be able to generate certain types of lock tokens without first having to communicate with a server.
For example, a principal may wish to require that resource B have a certain state in order for a method to successfully execute on resource A. If the client submits an e-tag from resource B to resource A, then A has no way of knowing that the e-tag is meant to describe resource B.
Another example occurs when a principal wishes to predicate the successful completion of a method on the absence of any locks on a resource. It is not sufficient to submit an "If-None-Match: *" as this refers to the existence of an entity, not of a lock.
This draft defines the term "state token" as an identifier for a state of a resource. The sections below define requirements for state tokens and provide a state token syntax, along with two new headers which can accept the new state token syntax.
This self-describing nature allows servers to accept tokens from other servers and potentially be able to coordinate state information cross resource and cross site through standardized protocols. For example, the execution of a request on resource A can be predicated on the state of resource B, where A and B are potentially on different servers.
Client Generable. The state token syntax must allow, when appropriate, for clients to generate a state token without having first communicated with a server.
One drawback of entity tags is that they are set by the server, and there is no interoperable algorithm for calculating an entity tag. Consequently, a client cannot generate an entity tag from a particular state of a resource. However, a state token which encodes an MD5 state hash could be calculated by a client based on a client-held state of a resource, and then submitted to a server in a conditional method invocation.
Another potential use for client generable state tokens is for a client to generate lock tokens with wild card fields, and hence be able to express conditionals such as: "only execute this GET if there are no write locks on this resource."
State-Token = "StateToken:" Type ":" Resources ":" State-Info Type = "Type" "=" Caret-encoded-URL Resources = "Res" "=" Caret-encoded-URL Caret-encoded-URL = "^" Resource "^" Resource = <A URI where all "^" characters are escaped> State-Info = *(uchar | reserved) ; uchar, reserved defined section 3.2.1 of RFC 2068
This proposal has created a new URL scheme for state tokens because a state token names a network resource using its normal name, which is typically state-invariant, along with additional information that specifies a particular state of the resource. Encoding the state information into the native URL scheme of the network resource was not felt to be safe, since freedom from name space collisions could not be guaranteed. If this proposal is accepted, the StateToken URL scheme will need to be defined and registered with IANA.
State Token URLs begin with the URL scheme name "StateToken" rather than the name of the particular state token type they represent in order to make the URL self describing. Thus it is possible to examine the URL and know, at a minimum, that it is a state token.
Labeled name/value pairs are used within the token to allow new fields to be added. Processors of state tokens MUST be prepared to accept the fields in whatever order they are present and MUST ignore any fields they do not understand. The "Type" field specifies the type of the state information encoded in the state token. A URL is used in order to avoid namespace collisions.
The "Res" field identifies the resource for which the state token specifies a particular state. Since commas and spaces are acceptable URL characters, a caret is used to delimit a URL. Since a caret is an acceptable URL character, any instances of it must be escaped using the % escape convention.
The State-Info production is expanded upon in descriptions of specific state token types, and is intended to contain the state description information for a particular state token.
If-State-Match = "If-State-Match" ":" ("AND" | "OR") 1#("<" State-Token ">")
The If-State-Match header is intended to have similar functionality to the If-Match header defined in section 14.25 of RFC 2068.
If the AND keyword is used and all of the state tokens identify the state of the resource, then the server MAY perform the requested method. If the OR keyword is used and any of the state tokens identifies the current state of the resource, then server MAY perform the requested method. If neither of the keyword requirements is met, the server MUST NOT perform the requested method, and MUST return a 412 (Precondition Failed) response.
If-None-State-Match = "If-None-State-Match" ":" 1#("<" State-Token ">")
The If-None-State-Match header is intended to have similar
functionality to the If-None-Match header defined in section
14.26 of RFC 2068.
If any of the state tokens identifies the current state of the resource, the server MUST NOT perform the requested method. Instead, if the request method was GET, HEAD, INDEX, or GETMETA, the server SHOULD respond with a 304 (Not Modified) response, including the cache-related entity-header fields (particularly ETag) of the current state of the resource. For all other request methods, the server MUST respond with a status of 412 (Precondition Failed).
If none of the state tokens identifies the current state of the resource, the server MAY perform the requested method.
Note that the "AND" and "OR" keywords specified with the If-State-Match header are intentionally not defined for If-None-State-Match, because this functionality is not required.
State-Token-Header = "State-Token" ":" 1#("<" State-Token ">")
The State Token header is intended to have similar functionality
to the etag header defined in section 14.20 of RFC 2068. The
purpose of the tag is to return state tokens defined on a
resource in a response. The contents of the state-token are not
guaranteed to be exhaustive and are generally used to return a
new state token that has been defined as the result of a method.
For example, if a LOCK method were successfully executed on a
resource the response would include a state token header with the
lock state token included.
This specification allows locks to vary over two parameters, the number of principals involved and the type of access to be granted. Furthermore, this document only provides the definition of locking for one access type, write. However, the syntax is extensible, and allows the specification of other access types.
However, there are times when the goal of a lock is not to exclude others from exercising an access right but rather to provide a mechanism for principals to indicate that they intend to exercise their access right. Shared locks are provided for this case. A shared lock allows multiple principals to receive a lock, hence any principal with appropriate access can get the lock.
With shared locks there are two trust sets that affect a resource. The first trust set is created by access permissions. Principals who are trusted, for example, may have permission to write the resource, those who are not, don't. Among those who have access permission to write the resource, the set of principals who have taken out a shared lock also must trust each other, creating a (typically) smaller trust set within the access permission write set.
Starting with every possible principal on the Internet, in most situations the vast majority of these principals will not have write access to a given resource. Of the small number who do have write access, some principals may decide to guarantee their edits are free from overwrite conflicts by using exclusive write locks. Others may decide they trust their collaborators (the potential set of collaborators being the set of principals who have write permission) and use a shared lock, which informs their collaborators that a principal is potentially working on the resource.
The WebDAV extensions to HTTP do not need to provide all of the communications paths necessary for principals to coordinate their activities. When using shared locks, principals may use any out of band communication channel to coordinate their work (e.g., face-to-face interaction, written notes, post-it notes on the screen, telephone conversation, email, etc.) The intent of a shared lock is to let collaborators know who else is potentially working on a resource.
Shared locks are included because experience from web distributed authoring systems has indicated that exclusive write locks are often too rigid. An exclusive write lock is used to enforce a particular editing process: take out exclusive write lock, read the resource, perform edits, write the resource, release the lock. What happens if the lock isn't released? While the time-out mechanism provides one solution, if you need to force the release of a lock immediately, it doesn't help much. Granted, an administrator can release the lock for you, but this could become a significant burden for large sites. In addition there is the problem that an administrator may not be immediately available.
Despite their potential problems, exclusive write locks are extremely useful, since often a guarantee of freedom from overwrite conflicts is what is needed. The tradeoff described in this specification is to provide exclusive write locks, but also to provide a less strict mechanism in the form of shared locks which can be used by a set of people who trust each other and who have access to a communications channel external to HTTP which can be used to negotiate writing to the resource.
The reason for this flexibility is that server implementers have said that they are willing to accept minimum requirements on all services but locking. Locking policy strikes to the very heart of their resource management and versioning systems and they require control over what sort of locking will be made available. For example, some systems only support shared write locks while others only provide support for exclusive write locks while yet others use no locking at all. As each system is sufficiently different to merit exclusion of certain locking features, the authors are proposing that locking be allowed as the sole axis of negotiation within WebDAV.
A successful response to a lock invocation MUST include Lock-Token and Time-Out headers.
For containers, a lock also affects the ability to add or remove members. The nature of the effect depends upon the type of access control involved.
The Lock-Tree option of the lock request specifies that the resource and all its internal children (including internal collections, and their internal members) are to be locked. This is another mechanism by which a request for a lock on multiple resources can be specified.
Currently existing locks can not be extended to cover more or less resources, and any request to expand or contract the number of resources in a lock MUST fail with a 409 Conflict status code. So, for example, if resource A is exclusively write locked and then the same principal asked to exclusively write lock resources A, B, and C, the request would fail as A is already locked and the lock can not be extended.
A successful result will return a single lock token which represents all the resources that have been locked. If an UNLOCK is executed on this token, all associated resources are unlocked.
If the lock can not be granted to all resources, a 406 Conflict status code MUST be returned with a response entity body containing a multiresponse XML element describing which resource(s) prevented the lock from being granted.
| Lock request Current lock state | Shared Lock | Exclusive Lock |
|---|---|---|
| None | True | True |
| Shared Lock | True | False |
| Exclusive Lock | False | False* |
Legend: True = lock MAY be granted. False = lock MUST NOT be granted. *=if the principal requesting the lock is the owner of the lock, the lock MAY be regranted.
The current lock state of a resource is given in the leftmost column, and lock requests are listed in the first row. The intersection of a row and column gives the result of a lock request. For example, if a shared lock is held on a resource, and an exclusive lock is requested, the table entry is "false", indicating the lock must not be granted.
If an exclusive or shared lock is re-requested by the principal who owns the lock, the lock MUST be regranted. If the lock is regranted, the same lock token that was previously issued MUST be returned.
LockInfo = "Lock-Info" ":" DAVLockType SP DAVLockScope [SP
AdditionalLocks] [SP Lock-Tree]
DAVLockType = "LockType" "=" DAVLockTypeValue
DAVLockTypeValue = ("Write" | *(uchar | reserved))
DAVLockScope = "LockScope" "=" DAVLockScopeValue
DAVLockScopeValue = ("Exclusive" |"Shared" | *(uchar | reserved))
AdditionalLocks = "AddLocks" "=" 1*("<" URI ">")
Lock-Tree = "Lock-Tree" "=" ("True" | "False")
The LockType field specifies the access type of the lock. At
present, this specification only defines one lock type, the
"Write" lock. The LockScope field specifies whether the lock is
an exclusive lock, or a shared lock. The AddLocks field
specifies additional URIs, beyond the Request-URI, to which the
lock request applies. The LockTree field is used to specify
recursive locks. If the LockTree field is "true", the lock
request applies to the hierarchy traversal of the internal
members resources of the Request-URI, and the AddLocks URIs,
inclusive of the Request-URI and the AddLocks URIs. It is not an
error if LockTree is true, and the Request-URI or the AddLocks
URIs have no internal member resources. By default, the value of
LockTree is "false", and this field MAY be omitted when its value
is false.
The From header (defined in RFC 2068), which contains only an email mailbox, is not sufficient for the purposes of quick identification. When desperately looking for someone to remove a lock, e-mail is often not sufficient. A telephone number (cell number, pager number, etc.) would be better. Furthermore, the email address in the From header only optionally includes the owners name and that name is often set to an alias anyway. Therefore a header more flexible than From is required.
The value also needs to be such that both man and machine can place values in it and later retrieve those values.
Owner = "Owner" ":" (Coded-XML | quoted-string) Coded-XML = field-content ; XML where any character which is not legal in field-content (see section 4.2 of [Fielding et al., 1997]) is XML encodedThe XML SHOULD provide information sufficient for either directly contacting the principal (such as a telephone number or e-mail URI), or for discovering the principal (such as the URL of a homepage) who owns the lock. The quoted string SHOULD provide a means for directly contacting the principal who owns the lock, such as a name and telephone number.
User-agents MUST assume that locks may arbitrarily disappear at any time. If their actions require confirmation of the existence of a lock then the If-State headers are available.
TimeOut = "Time-Out" ":" 1#TimeType
TimeType = ("Second-" DAVTimeOutVal | "Infinite" | Extend)
DAVTimeOutVal = 1*digit
Extend = RFC-Reg | URL "-" Token ; The URL format is used for
unregistered TimeTypes
RFC-Req = Token ; This is a TimeType that has been published as an RFC
Clients MAY include TimeOut headers in their LOCK requests.
However the server is not required to honor or even consider the
request. Clients MUST NOT submit a Time-Out request header with
any method other than a LOCK method.
A Time-Out request header MUST contain at least one TimeType and MAY contain multiple TimeType entries. The purpose of listing multiple TimeType is to indicate multiple different values and value types that are acceptable to the client. The client lists the TimeType entries in order of preference.
The Time-Out response header MUST use a Second value, Infinite, or a TimeType the client has indicated familiarity with. The server MAY assume a client is familiar with any TimeType submitted in a Time-Out header.
The "Second" TimeType specifies the number of seconds that MUST elapse between granting of the lock at the server, and the automatic removal of the lock. A server MUST not generate a time out value for "Second" greater than 2^32-1.
The time out counter is restarted any time the client sends a method to any member of the lock, including unsupported methods, or methods which are unsuccessful. It is recommended that the HEAD method be used when the goal is simply to restart the time out counter.
If the timeout expires then the lock is lost. Specifically the server SHOULD act as if an UNLOCK method was executed by the server on the resource using the lock token of the timed-out lock, performed with its override authority. Thus logs, notifications, and other mechanisms that act as side effects to the granting and removal of a lock will be properly informed as to the disposition of the lock.
Servers are advised to pay close attention to the values submitted by clients, as they will be indicative of the type of activity the client intends to perform. For example, an applet running in a browser may need to lock a resource, but because of the instability of the environment within which the applet is running, the applet may be turned off without warning. As a result, the applet is likely to ask for a relatively small time-out value so that if the applet dies, the lock can be quickly harvested. However a document management system is likely to ask for an extremely long time-out because its user may be planning on going off-line.
Lock-Token = "Lock-Token" ":" URI
LOCK /workspace/webdav/proposal.doc HTTP/1.1 Host: webdav.sb.aol.com Lock-Info: LockType=Write LockScope=Exclusive Time-Out: Infinite; Second-4100000000 Owner: <?XML:Namespace href="http://www.ietf.org/standards/dav/" AS = "D"/> <D:HREF>http://www.ics.uci.edu/~ejw/contact.html</D:HREF>
HTTP/1.1 200 OK Lock-Token: OpaqueLockToken:xyz122393481230912asdfa09s8df09s7df08 sd0f98a098sda Time-Out: Second-604800 Content-Type: text/xml Content-Length: xxxxx
<?XML:Namespace href ="http://www.ietf.org/standards/dav/" AS = "D"/>
<D:Prop>
<lockdiscovery>
<activelock>
<locktype>write</locktype>
<lockscope>exclusive</lockscope>
<addlocks/>
<owner>
<HREF>http://www.ics.uci.edu/~ejw/contact.html</HREF>
</owner>
<timeout>Second-604800</timeout>
<locktoken>
<HREF>
OpaqueLockToken:xyz122393481230912asdfa09s8df09s7d
f08sd0f98a098sda
</HREF>
</locktoken>
</activelock>
</lockdiscovery>
</D:Prop>
This example shows the successful creation of an exclusive write
lock on resource
http://webdav.sb.aol.com/workspace/webdav/proposal.doc. The
resource http://www.ics.uci.edu/~ejw/contact.html contains
contact information for the owner of the lock. The server has an
activity-based timeout policy in place on this resource, which
causes the lock to automatically be removed after 1 week (604800
seconds). The response has a Lock-Token header that gives the
state token URL for the lock token generated by this lock
request.
LOCK /workspace/webdav/proposal.doc HTTP/1.1 Host: webdav.sb.aol.com Lock-Info: LockType=Write LockScope=Exclusive Addlocks=<http://webdav.sb.aol.com/workspace/><http://foo.bar/blah> Time-Out: Infinite, Second-4100000000 Owner: <http://www.ics.uci.edu/~ejw/contact.html>
HTTP/1.1 409 Conflict Content-Type: text/xml Content-Length: xxxxx
<?XML:Namespace href =
"http://www.ietf.org/standards/dav/" As = "D"/>
<D:MultiResponse>
<Response>
<HREF>
http://webdav.sb.aol.com/workspace/webdav/proposal.doc
</HREF>
<HREF>
http://webdav.sb.aol.com/workspace/webdav/
</HREF>
<Status>HTTP/1.1 202 Accepted</Status>
</Response>
<Response>
<HREF>http://foo.bar/blah</HREF>
<Status>HTTP/1.1 403 Forbidden</Status>
</Response>
</D:MultiResponse>
This example shows a request for an exclusive write lock on three
resources,
http://webdav.sb.aol.com/workspace/webdav/proposal.doc,
http://webdav.sb.aol.com/workspace/, and http://foo.bar/blah. In
this request, the client has specified that it desires an
infinite length lock, if available, otherwise a timeout of 4.1
billion seconds, if available. The Owner header field specifies
the web address for contact information for the principal taking
out the lock.
This lock request has failed, because the server rejected the lock request for http://foo.bar/blah. The 409 Conflict status code indicates that the server was unable to satisfy the request because there is a conflict between the state of the resources and the operation named in the request. Within the multiresponse, the 202 Accepted status code indicates that the lock method was accepted by the resources, and would have been completed if all resources named in the request were able to be locked. The 403 Forbidden status code indicates that the server does not allow lock requests on this resource.
Note, however, that as new methods are created it will be necessary to specify how they interact with a write lock.
If a property is write locked then a LOCK request on the associated resource MUST fail with a 409 "Conflict". Note that a write lock on a property MAY be extended to include the associated resource without the principal having explicitly requested the extension.
However, if a write lock request is issued to a collection containing internal member resources that are currently locked, the request MUST fail with a 409 Conflict status code.
A COPY method invocation MUST NOT duplicate any write locks active on the source.
The solution must not require that clients guess what sorts of locks might be used and use if-state-match headers with wildcards to prevent collisions. The problem with trying to "guess" which locks are being used is that new lock types might be introduced, and the program would not know to "guess them". So, for example, a client might put in an if-state-match header with a wildcard specifying that if any write lock is outstanding then the operation should fail. However a new read/write lock could be introduced which the client would not know to put in the header.
If the following conditions are met: 1. a user-agent has authenticated itself as a principal, 2. the user-agent is submitting a method request to a resource on which the principal owns a write lock, 3. the method is restricted by a write lock, as defined in the section "Methods Restricted by a Write Lock", then the method request MUST include a State-Token header with the lock token of the write lock, or the method fails with a 409 Conflict status code. If multiple resources are involved with a method, such as a COPY or MOVE method, then the lock tokens, if any, for all involved resources, MUST be included in the State-Token request header.
For example, Program A, used by user A, takes out a write lock on a resource. Program A then makes a number of PUT requests on the locked resource, all the requests contain a State-Token header which includes the write lock state token. Program B, also run by User A, then proceeds to perform a PUT to the locked resource. However program B was not aware of the existence of the lock and so does not include the appropriate state-token header. The method is rejected even though principal A is authorized to perform the PUT. Program B can, if it so chooses, now perform lock discovery and obtain the lock token. Note that program A and B can perform GETs without using the state-token header because the ability to perform a GET is not affected by a write lock.
Having a lock state token provides no special access rights. Anyone can find out anyone else's lock state token by performing lock discovery. Locks are to be enforced based upon whatever authentication mechanism is used by the server, not based on the secrecy of the token values.
COPY /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html State-Token: <OpaqueLockToken:123AbcEfg1284h23h2> <OpaqueLockToken:AAAASDFcalkjfdas12312> HTTP/1.1 200 OKIn this example, both the source and destination are locked so two lock tokens must be submitted. If only one of the two resources was locked, then only one token would have to be submitted.
There are two types of lock tokens, a generic lock token, which is unique only for a particular resource, and an opaque lock token, which is unique across all resources for all time.
Uniqueness for a particular resource prevents problems with long held outstanding lock tokens being confused with newer tokens. This uniqueness requirement is the same as for e-tags. Uniqueness across all resources for all time allows for tokens to be submitted across resources and servers without fear of confusion.
Generic lock tokens, because of their relaxed uniqueness requirements, are faster to generate than opaque lock tokens.
All resources MUST recognize the opaquelocktoken scheme and be able to, at minimum, recognize that the lock token was not generated by the resource. Note, however, that resources are not required to generate opaquelocktokens.
In order to guarantee uniqueness across all resources for all time the opaquelocktoken requires the use of the GUID mechanism.
Opaquelocktoken generators however have a choice of how they create these tokens. They can either generate a new GUID for every lock token they create, which is potentially very expensive, or they can create a single GUID and then add extension characters. If the second method is selected then the program generating the extensions MUST guarantee that the same extension will never be used twice with the associated GUID.
Opaque-Lock-Token = "OpaqueLockToken" ":" GUID [Extension] GUID = ; As defined in [LEACH] Extension = *urlc ;urlc is defined in [Berners-Lee et al., 1997] (draft-fielding-url-syntax-07.txt)
UNLOCK /workspace/webdav/info.doc HTTP/1.1 Host: webdav.sb.aol.com State-Token: OpaqueLockToken:123AbcEfg1284h23h2 HTTP/1.1 200 OKIn this example, the lock identified by the lock token "OpaqueLockToken:123AbcEfg1284h23h2" is successfully removed from the resource http://webdav.sb.aol.com/workspace/webdav/info.doc. If this lock included more than just one resource, the lock is removed from those resources as well.
PROPFIND /container/ HTTP/1.1 Host: www.foo.bar Content-Length: xxxx Content-Type: text/xml
<?XML:Namespace href =
"http://www.ietf.org/standards/dav/" AS = "D"/>
<D:PROPFIND>
<prop><SupportedLock/></prop>
</D:PROPFIND>
HTTP/1.1 207 Multi-Response
Content-Type: text/xml
Content-Length: xxxxx
<?XML:Namespace href ="http://www.ietf.org/standards/dav/" AS = "D"/>
<D:MultiResponse>
<Response>
<Prop>
<SupportedLock>
<LockEntry>
<LockType>Write</LockType>
<LockScope>Exclusive</LockScope>
</LockEntry>
<LockEntry>
<LockType>Write</LockType>
<LockScope>Shared</LockScope>
</LockEntry>
</SupportedLock>
</Prop>
<Status>HTTP/1.1 200 Success</Status>
</Response>
</D:MultiResponse>
Description: The LOCKDISCOVERY property returns a listing of who has a lock, what type of lock they have, the time out type and the time remaining on the time out, and the associated lock token. The server is free to withhold any or all of this information if the requesting principal does not have sufficient access rights to see the requested data. A server which supports locks MUST provide the LOCKDISCOVERY property on any resource with locks on it.
PROPFIND /container/ HTTP/1.1 Host: www.foo.bar Content-Length: xxxx Content-Type: text/xml
<?XML:Namespace href =
"http://www.ietf.org/standards/dav/" AS = "D"/>
<D:PROPFIND>
<prop><lockdiscovery/></prop>
</D:PROPFIND>
HTTP/1.1 207 Multi-Response
Content-Type: text/xml
Content-Length: xxxxx
<?XML:Namespace href ="http://www.ietf.org/standards/dav/" AS = "D"/>
<D:MultiResponse>
<Response>
<Prop>
<lockdiscovery>
<activelock>
<locktype>write</locktype>
<lockscope>exclusive</lockscope>
<addlocks>
<HREF>http://foo.com/doc/</HREF>
</addlocks>
<owner>Jane Smith</owner>
<timeout>Infinite</timeout>
<locktoken>
<HREF>iamuri:unique!!!!!</HREF>
</locktoken>
</activelock>
</lockdiscovery>
</Prop>
<Status>HTTP/1.1 200 Success</Status>
</Response>
</D:MultiResponse>
This resource has a single exclusive write lock on it, with an
infinite time out. This same lock also covers the resource
http://foo.com/doc/.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assignees.
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
[Berners-Lee, 1997] T. Berners-Lee, "Metadata Architecture." Unpublished white paper, January 1997. http://www.w3.org/pub/WWW/DesignIssues/Metadata.html.
[Bradner, 1997] S. Bradner, "Key words for use in RFCs to Indicate Requirement Levels." RFC 2119, BCP 14. Harvard University. March, 1997.
[Bray, Sperberg-McQueen, 1997] T. Bray, C. M. Sperberg-McQueen, "Extensible Markup Language (XML): Part I. Syntax", WD-xml-lang.html, http://www.w3.org/pub/WWW/TR/WD-xml-lang.html.
[Connolly et al, 1997] D. Connolly, R. Khare, H.F. Nielsen, "PEP - an Extension Mechanism for HTTP", Internet draft, work-in-progress. draft-ietf-http-pep-04.txt, ftp://ds.internic.net/internet-drafts/draft-ietf-http-pep-04.txt.
[Fielding et al., 1997] R. Fielding, J. Gettys, J. Mogul, H. Frystyk, T. Berners-Lee, "Hypertext Transfer Protocol --HTTP/1.1." RFC 2068. U.C. Irvine, DEC, MIT/LCS. January, 1997. ftp://ds.internic.net/rfc/rfc2068.txt
[Lasher, Cohen, 1995] R. Lasher, D. Cohen, "A Format for Bibliographic Records," RFC 1807. Stanford, Myricom. June, 1995. ftp://ds.internic.net/rfc/rfc1807.txt
[Maloney, 1996] M. Maloney, "Hypertext Links in HTML." Internet draft (expired), work-in-progress, January, 1996.
[MARC, 1994] Network Development and MARC Standards, Office, ed. 1994. "USMARC Format for Bibliographic Data", 1994. Washington, DC: Cataloging Distribution Service, Library of Congress.
[Miller et al., 1996] J. Miller, T. Krauskopf, P. Resnick, W. Treese, "PICS Label Distribution Label Syntax and Communication Protocols" Version 1.1, W3C Recommendation REC-PICS-labels-961031. http://www.w3.org/pub/WWW/TR/REC-PICS-labels-961031.html.
[Slein et al., 1997] J. A. Slein, F. Vitali, E. J. Whitehead, Jr., D. Durand, "Requirements for Distributed Authoring and Versioning on the World Wide Web." Internet-draft, work-in-progress, draft-ietf-webdav-requirements-04.txt, ftp://ds.internic.net/internet-drafts/draft-ietf-webdav-requirements-04.txt.
[WebDAV, 1997] WEBDAV Design Team. "A Proposal for Web Metadata Operations." Unpublished manuscript. http://www.ics.uci.edu/~ejw/authoring/proposals/metadata.html
[Weibel et al., 1995] S. Weibel, J. Godby, E. Miller, R. Daniel, "OCLC/NCSA Metadata Workshop Report." http://purl.oclc.org/metadata/dublin_core_report.
[Yergeau, 1997] F. Yergeau, "UTF-8, a transformation format of Unicode and ISO 10646", Internet Draft, work-in-progress, draft-yergeau-utf8-rev-00.txt, http://www.internic.net/internet-drafts/draft-yergeau-utf8-rev-00.txt.
Y. Y. Goland Microsoft Corporation One Microsoft Way Redmond, WA 98052-6399 Email yarong@microsoft.com E. J. Whitehead, Jr. Dept. Of Information and Computer Science University of California, Irvine Irvine, CA 92697-3425 Email: ejw@ics.uci.edu A. Faizi Netscape 685 East Middlefield Road Mountain View, CA 94043 Email: asad@netscape.com S. R Carter Novell 1555 N. Technology Way M/S ORM F111 Orem, UT 84097-2399 Email srcarter@novell.com D. Jensen Novell 1555 N. Technology Way M/S ORM F111 Orem, UT 84097-2399 Email dcjensen@novell.com