svn_dav.h revision 362181
1227730Sraj/**
2227730Sraj * @copyright
3227730Sraj * ====================================================================
4227730Sraj *    Licensed to the Apache Software Foundation (ASF) under one
5227730Sraj *    or more contributor license agreements.  See the NOTICE file
6227730Sraj *    distributed with this work for additional information
7227730Sraj *    regarding copyright ownership.  The ASF licenses this file
8227730Sraj *    to you under the Apache License, Version 2.0 (the
9227730Sraj *    "License"); you may not use this file except in compliance
10227730Sraj *    with the License.  You may obtain a copy of the License at
11227730Sraj *
12227730Sraj *      http://www.apache.org/licenses/LICENSE-2.0
13227730Sraj *
14227730Sraj *    Unless required by applicable law or agreed to in writing,
15227730Sraj *    software distributed under the License is distributed on an
16227730Sraj *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17227730Sraj *    KIND, either express or implied.  See the License for the
18227730Sraj *    specific language governing permissions and limitations
19227730Sraj *    under the License.
20227730Sraj * ====================================================================
21227730Sraj * @endcopyright
22227730Sraj *
23227730Sraj * @file svn_dav.h
24227730Sraj * @brief Code related to WebDAV/DeltaV usage in Subversion.
25227730Sraj */
26227730Sraj
27227730Sraj
28227730Sraj
29227730Sraj
30227730Sraj#ifndef SVN_DAV_H
31227730Sraj#define SVN_DAV_H
32227730Sraj
33227730Sraj
34227730Sraj#ifdef __cplusplus
35227730Srajextern "C" {
36227730Sraj#endif /* __cplusplus */
37227730Sraj
38227730Sraj
39227730Sraj/** This is the MIME type that Subversion uses for its "svndiff" format.
40227730Sraj *
41227730Sraj * This is an application type, for the "svn" vendor. The specific subtype
42227730Sraj * is "svndiff".
43227730Sraj */
44227730Sraj#define SVN_SVNDIFF_MIME_TYPE "application/vnd.svn-svndiff"
45227730Sraj
46227730Sraj/** This is the MIME type that Subversion users for its "skel" format.
47227730Sraj *
48227730Sraj * This is an application type, for the "svn" vendor. The specific subtype
49227730Sraj * is "skel".
50227730Sraj * @since New in 1.7.
51227730Sraj */
52227730Sraj#define SVN_SKEL_MIME_TYPE "application/vnd.svn-skel"
53227730Sraj
54227730Sraj/** This header is *TEMPORARILY* used to transmit the delta base to the
55227730Sraj * server. It contains a version resource URL for what is on the client.
56227730Sraj *
57227730Sraj * @note The HTTP delta draft recommends an If-None-Match header
58227730Sraj * holding an entity tag corresponding to the base copy that the
59227730Sraj * client has.  In Subversion, it is much more natural to use a version
60227730Sraj * URL to specify that base.  We'd like, then, to use the If: header
61227730Sraj * to specify the URL.  Unfortunately, mod_dav sees all "State-token"
62227730Sraj * items as lock tokens.  So we'll use this custom header until mod_dav
63227730Sraj * and other backend APIs are taught to be less rigid, at which time
64227730Sraj * we can switch to using an If: header to report our base version.
65227730Sraj */
66227730Sraj#define SVN_DAV_DELTA_BASE_HEADER "X-SVN-VR-Base"
67227730Sraj
68227730Sraj/** This header is used when an svn client wants to trigger specific
69227730Sraj * svn server behaviors.  Normal WebDAV or DeltaV clients won't use it.
70227730Sraj */
71227730Sraj#define SVN_DAV_OPTIONS_HEADER "X-SVN-Options"
72227730Sraj
73227730Sraj/**
74227730Sraj * @name options-header defines
75227730Sraj * Specific options that can appear in the options-header:
76227730Sraj * @{
77227730Sraj */
78227730Sraj#define SVN_DAV_OPTION_NO_MERGE_RESPONSE "no-merge-response"
79227730Sraj#define SVN_DAV_OPTION_LOCK_BREAK        "lock-break"
80227730Sraj#define SVN_DAV_OPTION_LOCK_STEAL        "lock-steal"
81250291Sgber#define SVN_DAV_OPTION_RELEASE_LOCKS     "release-locks"
82227730Sraj#define SVN_DAV_OPTION_KEEP_LOCKS        "keep-locks"
83227730Sraj/** @} */
84227730Sraj
85227730Sraj/** This header is used when an svn client wants to tell mod_dav_svn
86227730Sraj * exactly what revision of a resource it thinks it's operating on.
87227730Sraj * (For example, an svn server can use it to validate a DELETE request.)
88227730Sraj * Normal WebDAV or DeltaV clients won't use it.
89227730Sraj */
90227730Sraj#define SVN_DAV_VERSION_NAME_HEADER "X-SVN-Version-Name"
91227730Sraj
92227730Sraj/** A header generated by mod_dav_svn whenever it responds
93227730Sraj    successfully to a LOCK request.  Only svn clients will notice it,
94227730Sraj    and use it to fill in svn_lock_t->creation_date.   */
95227730Sraj#define SVN_DAV_CREATIONDATE_HEADER "X-SVN-Creation-Date"
96227730Sraj
97227730Sraj/** A header generated by mod_dav_svn whenever it responds
98227730Sraj    successfully to a PROPFIND for the 'DAV:lockdiscovery' property.
99227730Sraj    Only svn clients will notice it, and use it to fill in
100227843Smarius    svn_lock_t->owner.  (Remember that the DAV:owner field maps to
101227730Sraj    svn_lock_t->comment, and that there is no analogue in the DAV
102227730Sraj    universe of svn_lock_t->owner.)  */
103227730Sraj#define SVN_DAV_LOCK_OWNER_HEADER "X-SVN-Lock-Owner"
104227730Sraj
105227730Sraj/** Assuming the OPTIONS was performed against a resource within a
106227730Sraj * Subversion repository, then this header indicates the youngest
107227730Sraj * revision in the repository.
108227730Sraj * @since New in 1.7.  */
109227730Sraj#define SVN_DAV_YOUNGEST_REV_HEADER "SVN-Youngest-Rev"
110227730Sraj
111227730Sraj/** Assuming the OPTIONS was performed against a resource within a
112227730Sraj * Subversion repository, then this header indicates the UUID of the
113227730Sraj * repository.
114227730Sraj * @since New in 1.7.  */
115227730Sraj#define SVN_DAV_REPOS_UUID_HEADER "SVN-Repository-UUID"
116227730Sraj
117227730Sraj/** Presence of this in a DAV header in an OPTIONS response indicates
118227730Sraj * that the server speaks HTTP protocol v2.  This header provides an
119227730Sraj * opaque URI that the client should send all custom REPORT requests
120227730Sraj * against.
121227730Sraj * @since New in 1.7.  */
122227730Sraj#define SVN_DAV_ME_RESOURCE_HEADER "SVN-Me-Resource"
123227730Sraj
124227730Sraj/** This header provides the repository root URI, suitable for use in
125227730Sraj * calculating the relative paths of other public URIs for this
126227730Sraj * repository into .  (HTTP protocol v2 only)
127227730Sraj * @since New in 1.7.  */
128227730Sraj#define SVN_DAV_ROOT_URI_HEADER "SVN-Repository-Root"
129227730Sraj
130227730Sraj/** This header provides an opaque URI that the client can append a
131227730Sraj * revision to, to construct a 'revision URL'.  This allows direct
132227730Sraj * read/write access to revprops via PROPFIND or PROPPATCH, and is
133227730Sraj * similar to libsvn_fs's revision objects (as distinct from "revision
134227730Sraj * roots").  (HTTP protocol v2 only)
135227730Sraj * @since New in 1.7.  */
136227730Sraj#define SVN_DAV_REV_STUB_HEADER "SVN-Rev-Stub"
137227730Sraj
138227730Sraj/** This header provides an opaque URI that the client can append
139227730Sraj * PEGREV/PATH to, in order to construct URIs of pegged objects in the
140227730Sraj * repository, similar to the use of a "revision root" in the
141227730Sraj * libsvn_fs API.  (HTTP protocol v2 only)
142227730Sraj * @since New in 1.7.  */
143227730Sraj#define SVN_DAV_REV_ROOT_STUB_HEADER "SVN-Rev-Root-Stub"
144227730Sraj
145227730Sraj/** This header provides an opaque URI which represents a Subversion
146227730Sraj * transaction (revision-in-progress) object.  It is suitable for use
147227730Sraj * in fetching and modifying transaction properties as part of a
148227730Sraj * commit process, similar to the svn_fs_txn_t object (as distinct
149227730Sraj * from a "txn root").  (HTTP protocol v2 only)
150227730Sraj * @since New in 1.7.  */
151227730Sraj#define SVN_DAV_TXN_STUB_HEADER "SVN-Txn-Stub"
152227730Sraj
153227730Sraj/** Companion to @c SVN_DAV_TXN_STUB_HEADER, used when a POST request
154227730Sraj *  returns @c SVN_DAV_VTXN_NAME_HEADER in response to a client
155227730Sraj *  supplied name.  (HTTP protocol v2 only)
156227730Sraj * @since New in 1.7.  */
157227730Sraj#define SVN_DAV_VTXN_STUB_HEADER "SVN-VTxn-Stub"
158227730Sraj
159232883Sscottl/** This header provides an opaque URI which represents the root
160227730Sraj * directory of a Subversion transaction (revision-in-progress),
161227730Sraj * similar to the concept of a "txn root" in the libsvn_fs API.  The
162227730Sraj * client can append additional path segments to it to access items
163227730Sraj * deeper in the transaction tree as part of a commit process.  (HTTP
164227730Sraj * protocol v2 only)
165227730Sraj * @since New in 1.7.  */
166227730Sraj#define SVN_DAV_TXN_ROOT_STUB_HEADER "SVN-Txn-Root-Stub"
167227730Sraj
168227730Sraj/** Companion to @c SVN_DAV_TXN_ROOT_STUB_HEADER, used when a POST
169227730Sraj *  request returns @c SVN_DAV_VTXN_NAME_HEADER in response to a
170227730Sraj *  client supplied name.  (HTTP protocol v2 only)
171227730Sraj * @since New in 1.7.  */
172227730Sraj#define SVN_DAV_VTXN_ROOT_STUB_HEADER "SVN-VTxn-Root-Stub"
173227730Sraj
174227730Sraj/** This header is used in the POST response to tell the client the
175227730Sraj * name of the Subversion transaction created by the request.  It can
176227730Sraj * then be appended to the transaction stub and transaction root stub
177227730Sraj * for access to the properties and paths, respectively, of the named
178227730Sraj * transaction.  (HTTP protocol v2 only)
179227730Sraj * @since New in 1.7.  */
180227730Sraj#define SVN_DAV_TXN_NAME_HEADER "SVN-Txn-Name"
181227730Sraj
182227730Sraj/** This header is used in the POST request, to pass a client supplied
183227730Sraj * alternative transaction name to the server, and in the POST
184227730Sraj * response, to tell the client that the alternative transaction
185227730Sraj * resource names should be used.  (HTTP protocol v2 only)
186227730Sraj * @since New in 1.7.  */
187227730Sraj#define SVN_DAV_VTXN_NAME_HEADER "SVN-VTxn-Name"
188227730Sraj
189227730Sraj/** This header is used in the OPTIONS response to identify named
190227730Sraj * skel-based POST request types which the server is prepared to
191227730Sraj * handle.  (HTTP protocol v2 only)
192227730Sraj * @since New in 1.8.   */
193227730Sraj#define SVN_DAV_SUPPORTED_POSTS_HEADER "SVN-Supported-Posts"
194227730Sraj
195227730Sraj/** This header is used in the OPTIONS response to indicate if the server
196227730Sraj * wants bulk update requests (Prefer) or only accepts skelta requests (Off).
197227730Sraj * If this value is On both options are allowed.
198227730Sraj * @since New in 1.8.   */
199227730Sraj#define SVN_DAV_ALLOW_BULK_UPDATES "SVN-Allow-Bulk-Updates"
200227730Sraj
201227730Sraj/** Assuming the request target is a Subversion repository resource,
202227730Sraj * this header is returned in the OPTIONS response to indicate whether
203227730Sraj * the repository supports the merge tracking feature ("yes") or not
204227730Sraj * ("no").
205227730Sraj * @since New in 1.8.  */
206227730Sraj#define SVN_DAV_REPOSITORY_MERGEINFO "SVN-Repository-MergeInfo"
207227730Sraj
208227730Sraj/**
209227730Sraj * @name Fulltext MD5 headers
210227730Sraj *
211227730Sraj * These headers are for client and server to verify that the base
212227730Sraj * and the result of a change transmission are the same on both
213227730Sraj * sides, regardless of what transformations (svndiff deltification,
214227730Sraj * gzipping, etc) the data may have gone through in between.
215227730Sraj *
216227730Sraj * The result md5 is always used whenever file contents are
217227730Sraj * transferred, because every transmission has a resulting text.
218227730Sraj *
219227730Sraj * The base md5 is used to verify the base text against which svndiff
220227730Sraj * data is being applied.  Note that even for svndiff transmissions,
221227730Sraj * base verification is not strictly necessary (and may therefore be
222227730Sraj * unimplemented), as any error will be caught by the verification of
223227730Sraj * the final result.  However, if the problem is that the base text is
224227730Sraj * corrupt, the error will be caught earlier if the base md5 is used.
225227730Sraj *
226227730Sraj * Normal WebDAV or DeltaV clients don't use these.
227227730Sraj * @{
228227730Sraj */
229227730Sraj#define SVN_DAV_BASE_FULLTEXT_MD5_HEADER "X-SVN-Base-Fulltext-MD5"
230227730Sraj#define SVN_DAV_RESULT_FULLTEXT_MD5_HEADER "X-SVN-Result-Fulltext-MD5"
231227730Sraj/** @} */
232227730Sraj
233227730Sraj/* ### should add strings for the various XML elements in the reports
234227730Sraj   ### and things. also the custom prop names. etc.
235227730Sraj*/
236227730Sraj
237227730Sraj/** The svn-specific object that is placed within a <D:error> response.
238227730Sraj *
239227730Sraj * @defgroup svn_dav_error Errors in svn_dav
240227730Sraj * @{ */
241227730Sraj
242227730Sraj/** The error object's namespace */
243227730Sraj#define SVN_DAV_ERROR_NAMESPACE "svn:"
244227730Sraj
245227730Sraj/** The error object's tag */
246227730Sraj#define SVN_DAV_ERROR_TAG       "error"
247227730Sraj
248227730Sraj/** @} */
249227730Sraj
250227730Sraj
251227730Sraj/** General property (xml) namespaces that will be used by both ra_dav
252227730Sraj * and mod_dav_svn for marshalling properties.
253227730Sraj *
254227730Sraj * @defgroup svn_dav_property_xml_namespaces DAV property namespaces
255227730Sraj * @{
256227730Sraj */
257227730Sraj
258227730Sraj/** A property stored in the fs and wc, begins with 'svn:', and is
259227730Sraj * interpreted either by client or server.
260227730Sraj */
261227730Sraj#define SVN_DAV_PROP_NS_SVN "http://subversion.tigris.org/xmlns/svn/"
262227730Sraj
263227730Sraj/** A property stored in the fs and wc, but totally ignored by svn
264227730Sraj * client and server.
265227730Sraj *
266227730Sraj * A property simply invented by the users.
267227730Sraj */
268227730Sraj#define SVN_DAV_PROP_NS_CUSTOM "http://subversion.tigris.org/xmlns/custom/"
269227730Sraj
270227730Sraj/** A property purely generated and consumed by the network layer, not
271227730Sraj * seen by either fs or wc.
272227730Sraj */
273227730Sraj#define SVN_DAV_PROP_NS_DAV "http://subversion.tigris.org/xmlns/dav/"
274227730Sraj
275227730Sraj
276227730Sraj/**
277227730Sraj * @name Custom (extension) values for the DAV header.
278227730Sraj * Note that although these share the SVN_DAV_PROP_NS_DAV namespace
279227730Sraj * prefix, they are not properties; they are header values.
280227730Sraj * @{
281227730Sraj */
282227730Sraj
283227730Sraj/* ##################################################################
284227730Sraj *
285227730Sraj *    WARNING:  At least some versions of Microsoft's Web Folders
286227730Sraj *              WebDAV client implementation are unable to handle
287227730Sraj *              DAV: headers with values longer than 63 characters,
288227730Sraj *              so please keep these strings within that limit.
289227730Sraj *
290227730Sraj * ##################################################################
291227730Sraj */
292227730Sraj
293227730Sraj
294227730Sraj/** Presence of this in a DAV header in an OPTIONS request or response
295227730Sraj * indicates that the transmitter supports @c svn_depth_t.
296227730Sraj *
297227730Sraj * @since New in 1.5.
298227730Sraj */
299227730Sraj#define SVN_DAV_NS_DAV_SVN_DEPTH\
300227730Sraj            SVN_DAV_PROP_NS_DAV "svn/depth"
301227730Sraj
302227730Sraj/** Presence of this in a DAV header in an OPTIONS request or response
303227730Sraj * indicates that the server knows how to handle merge-tracking
304227730Sraj * information.
305227730Sraj *
306227730Sraj * Note that this says nothing about whether the repository can handle
307227730Sraj * mergeinfo, only whether the server does.  For more information, see
308227730Sraj * mod_dav_svn/version.c:get_vsn_options().
309227730Sraj *
310227730Sraj * @since New in 1.5.
311227730Sraj */
312227730Sraj#define SVN_DAV_NS_DAV_SVN_MERGEINFO\
313227730Sraj            SVN_DAV_PROP_NS_DAV "svn/mergeinfo"
314227730Sraj
315227730Sraj/** Presence of this in a DAV header in an OPTIONS response indicates
316227730Sraj * that the transmitter (in this case, the server) knows how to send
317227730Sraj * custom revprops in log responses.
318227730Sraj *
319227730Sraj * @since New in 1.5.
320227730Sraj */
321227730Sraj#define SVN_DAV_NS_DAV_SVN_LOG_REVPROPS\
322227730Sraj            SVN_DAV_PROP_NS_DAV "svn/log-revprops"
323227730Sraj
324227730Sraj/** Presence of this in a DAV header in an OPTIONS response indicates
325227730Sraj * that the transmitter (in this case, the server) knows how to handle
326227730Sraj * a replay of a directory in the repository (not root).
327227730Sraj *
328227730Sraj * @since New in 1.5.
329227730Sraj */
330227730Sraj#define SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY\
331227730Sraj            SVN_DAV_PROP_NS_DAV "svn/partial-replay"
332227730Sraj
333227730Sraj/** Presence of this in a DAV header in an OPTIONS response indicates
334227730Sraj * that the transmitter (in this case, the server) knows how to enforce
335227730Sraj * old-value atomicity in PROPPATCH (for editing revprops).
336227730Sraj *
337227730Sraj * @since New in 1.7.
338227730Sraj */
339227730Sraj#define SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS\
340227730Sraj            SVN_DAV_PROP_NS_DAV "svn/atomic-revprops"
341227730Sraj
342227730Sraj/** Presence of this in a DAV header in an OPTIONS response indicates
343227730Sraj * that the transmitter (in this case, the server) knows how to get
344227730Sraj * inherited properties.
345227730Sraj *
346227730Sraj * @since New in 1.8.
347227730Sraj */
348227730Sraj#define SVN_DAV_NS_DAV_SVN_INHERITED_PROPS\
349227730Sraj            SVN_DAV_PROP_NS_DAV "svn/inherited-props"
350227730Sraj
351227730Sraj/** Presence of this in a DAV header in an OPTIONS response indicates
352227730Sraj * that the transmitter (in this case, the server) knows how to
353227730Sraj * properly handle ephemeral (that is, deleted-just-before-commit) FS
354227730Sraj * transaction properties.
355227730Sraj *
356227730Sraj * @since New in 1.8.
357227730Sraj */
358227730Sraj#define SVN_DAV_NS_DAV_SVN_EPHEMERAL_TXNPROPS\
359227730Sraj            SVN_DAV_PROP_NS_DAV "svn/ephemeral-txnprops"
360227730Sraj
361227730Sraj/** Presence of this in a DAV header in an OPTIONS response indicates
362227730Sraj * that the transmitter (in this case, the server) supports serving
363227730Sraj * properties inline in update editor when 'send-all' is 'false'.
364227730Sraj *
365227730Sraj * @since New in 1.8.
366227730Sraj */
367227730Sraj#define SVN_DAV_NS_DAV_SVN_INLINE_PROPS\
368227730Sraj            SVN_DAV_PROP_NS_DAV "svn/inline-props"
369227730Sraj
370227730Sraj/** Presence of this in a DAV header in an OPTIONS response indicates
371227730Sraj * that the transmitter (in this case, the server) knows how to handle
372227730Sraj * a replay of a revision resource.  Transmitters must be
373227730Sraj * HTTP-v2-enabled to support this feature.
374227730Sraj *
375227730Sraj * @since New in 1.8.
376227730Sraj */
377227730Sraj#define SVN_DAV_NS_DAV_SVN_REPLAY_REV_RESOURCE\
378227730Sraj            SVN_DAV_PROP_NS_DAV "svn/replay-rev-resource"
379227730Sraj
380227730Sraj/** Presence of this in a DAV header in an OPTIONS response indicates
381227730Sraj * that the transmitter (in this case, the server) knows how to handle
382227730Sraj * a reversed fetch of file versions.
383227730Sraj *
384227730Sraj * @since New in 1.8.
385227730Sraj */
386227730Sraj#define SVN_DAV_NS_DAV_SVN_REVERSE_FILE_REVS\
387227730Sraj            SVN_DAV_PROP_NS_DAV "svn/reverse-file-revs"
388227730Sraj
389227730Sraj/** Presence of this in a DAV header in an OPTIONS response indicates
390227730Sraj * that the transmitter (in this case, the server) knows how to handle
391227730Sraj * svndiff1 format encoding.
392227730Sraj *
393227730Sraj * @since New in 1.10.
394227730Sraj */
395227730Sraj#define SVN_DAV_NS_DAV_SVN_SVNDIFF1\
396227730Sraj            SVN_DAV_PROP_NS_DAV "svn/svndiff1"
397227730Sraj
398227730Sraj/** Presence of this in a DAV header in an OPTIONS response indicates
399227730Sraj * that the transmitter (in this case, the server) knows how to handle
400227730Sraj * 'list' requests.
401227730Sraj *
402227730Sraj * @since New in 1.10.
403227730Sraj */
404227730Sraj#define SVN_DAV_NS_DAV_SVN_LIST\
405227730Sraj            SVN_DAV_PROP_NS_DAV "svn/list"
406227730Sraj
407227730Sraj/** Presence of this in a DAV header in an OPTIONS response indicates
408227730Sraj * that the transmitter (in this case, the server) knows how to handle
409227730Sraj * svndiff2 format encoding.
410227730Sraj *
411227730Sraj * @since New in 1.10.
412227730Sraj */
413227730Sraj#define SVN_DAV_NS_DAV_SVN_SVNDIFF2\
414227730Sraj            SVN_DAV_PROP_NS_DAV "svn/svndiff2"
415227730Sraj
416227730Sraj/** Presence of this in a DAV header in an OPTIONS response indicates
417227730Sraj * that the transmitter (in this case, the server) sends the result
418227730Sraj * checksum in the response to a successful PUT request.
419227730Sraj *
420227730Sraj * @since New in 1.10.
421227730Sraj */
422227730Sraj#define SVN_DAV_NS_DAV_SVN_PUT_RESULT_CHECKSUM\
423227730Sraj            SVN_DAV_PROP_NS_DAV "svn/put-result-checksum"
424227730Sraj
425227730Sraj/** @} */
426227730Sraj
427227730Sraj/** @} */
428227730Sraj
429227730Sraj#ifdef __cplusplus
430227730Sraj}
431227730Sraj#endif /* __cplusplus */
432227730Sraj
433227730Sraj#endif  /* SVN_DAV_H */
434227730Sraj