Subversion
svn_dav.h
Go to the documentation of this file.
1 /**
2  * @copyright
3  * ====================================================================
4  * Licensed to the Apache Software Foundation (ASF) under one
5  * or more contributor license agreements. See the NOTICE file
6  * distributed with this work for additional information
7  * regarding copyright ownership. The ASF licenses this file
8  * to you under the Apache License, Version 2.0 (the
9  * "License"); you may not use this file except in compliance
10  * with the License. You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  * KIND, either express or implied. See the License for the
18  * specific language governing permissions and limitations
19  * under the License.
20  * ====================================================================
21  * @endcopyright
22  *
23  * @file svn_dav.h
24  * @brief Code related to WebDAV/DeltaV usage in Subversion.
25  */
26 
27 
28 
29 
30 #ifndef SVN_DAV_H
31 #define SVN_DAV_H
32 
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif /* __cplusplus */
37 
38 
39 /** This is the MIME type that Subversion uses for its "svndiff" format.
40  *
41  * This is an application type, for the "svn" vendor. The specific subtype
42  * is "svndiff".
43  */
44 #define SVN_SVNDIFF_MIME_TYPE "application/vnd.svn-svndiff"
45 
46 /** This is the MIME type that Subversion users for its "skel" format.
47  *
48  * This is an application type, for the "svn" vendor. The specific subtype
49  * is "skel".
50  * @since New in 1.7.
51  */
52 #define SVN_SKEL_MIME_TYPE "application/vnd.svn-skel"
53 
54 /** This header is *TEMPORARILY* used to transmit the delta base to the
55  * server. It contains a version resource URL for what is on the client.
56  *
57  * @note The HTTP delta draft recommends an If-None-Match header
58  * holding an entity tag corresponding to the base copy that the
59  * client has. In Subversion, it is much more natural to use a version
60  * URL to specify that base. We'd like, then, to use the If: header
61  * to specify the URL. Unfortunately, mod_dav sees all "State-token"
62  * items as lock tokens. So we'll use this custom header until mod_dav
63  * and other backend APIs are taught to be less rigid, at which time
64  * we can switch to using an If: header to report our base version.
65  */
66 #define SVN_DAV_DELTA_BASE_HEADER "X-SVN-VR-Base"
67 
68 /** This header is used when an svn client wants to trigger specific
69  * svn server behaviors. Normal WebDAV or DeltaV clients won't use it.
70  */
71 #define SVN_DAV_OPTIONS_HEADER "X-SVN-Options"
72 
73 /**
74  * @name options-header defines
75  * Specific options that can appear in the options-header:
76  * @{
77  */
78 #define SVN_DAV_OPTION_NO_MERGE_RESPONSE "no-merge-response"
79 #define SVN_DAV_OPTION_LOCK_BREAK "lock-break"
80 #define SVN_DAV_OPTION_LOCK_STEAL "lock-steal"
81 #define SVN_DAV_OPTION_RELEASE_LOCKS "release-locks"
82 #define SVN_DAV_OPTION_KEEP_LOCKS "keep-locks"
83 /** @} */
84 
85 /** This header is used when an svn client wants to tell mod_dav_svn
86  * exactly what revision of a resource it thinks it's operating on.
87  * (For example, an svn server can use it to validate a DELETE request.)
88  * Normal WebDAV or DeltaV clients won't use it.
89  */
90 #define SVN_DAV_VERSION_NAME_HEADER "X-SVN-Version-Name"
91 
92 /** A header generated by mod_dav_svn whenever it responds
93  successfully to a LOCK request. Only svn clients will notice it,
94  and use it to fill in svn_lock_t->creation_date. */
95 #define SVN_DAV_CREATIONDATE_HEADER "X-SVN-Creation-Date"
96 
97 /** A header generated by mod_dav_svn whenever it responds
98  successfully to a PROPFIND for the 'DAV:lockdiscovery' property.
99  Only svn clients will notice it, and use it to fill in
100  svn_lock_t->owner. (Remember that the DAV:owner field maps to
101  svn_lock_t->comment, and that there is no analogue in the DAV
102  universe of svn_lock_t->owner.) */
103 #define SVN_DAV_LOCK_OWNER_HEADER "X-SVN-Lock-Owner"
104 
105 /** Assuming the OPTIONS was performed against a resource within a
106  * Subversion repository, then this header indicates the youngest
107  * revision in the repository.
108  * @since New in 1.7. */
109 #define SVN_DAV_YOUNGEST_REV_HEADER "SVN-Youngest-Rev"
110 
111 /** Assuming the OPTIONS was performed against a resource within a
112  * Subversion repository, then this header indicates the UUID of the
113  * repository.
114  * @since New in 1.7. */
115 #define SVN_DAV_REPOS_UUID_HEADER "SVN-Repository-UUID"
116 
117 /** Presence of this in a DAV header in an OPTIONS response indicates
118  * that the server speaks HTTP protocol v2. This header provides an
119  * opaque URI that the client should send all custom REPORT requests
120  * against.
121  * @since New in 1.7. */
122 #define SVN_DAV_ME_RESOURCE_HEADER "SVN-Me-Resource"
123 
124 /** This header provides the repository root URI, suitable for use in
125  * calculating the relative paths of other public URIs for this
126  * repository into . (HTTP protocol v2 only)
127  * @since New in 1.7. */
128 #define SVN_DAV_ROOT_URI_HEADER "SVN-Repository-Root"
129 
130 /** This header provides an opaque URI that the client can append a
131  * revision to, to construct a 'revision URL'. This allows direct
132  * read/write access to revprops via PROPFIND or PROPPATCH, and is
133  * similar to libsvn_fs's revision objects (as distinct from "revision
134  * roots"). (HTTP protocol v2 only)
135  * @since New in 1.7. */
136 #define SVN_DAV_REV_STUB_HEADER "SVN-Rev-Stub"
137 
138 /** This header provides an opaque URI that the client can append
139  * PEGREV/PATH to, in order to construct URIs of pegged objects in the
140  * repository, similar to the use of a "revision root" in the
141  * libsvn_fs API. (HTTP protocol v2 only)
142  * @since New in 1.7. */
143 #define SVN_DAV_REV_ROOT_STUB_HEADER "SVN-Rev-Root-Stub"
144 
145 /** This header provides an opaque URI which represents a Subversion
146  * transaction (revision-in-progress) object. It is suitable for use
147  * in fetching and modifying transaction properties as part of a
148  * commit process, similar to the svn_fs_txn_t object (as distinct
149  * from a "txn root"). (HTTP protocol v2 only)
150  * @since New in 1.7. */
151 #define SVN_DAV_TXN_STUB_HEADER "SVN-Txn-Stub"
152 
153 /** Companion to @c SVN_DAV_TXN_STUB_HEADER, used when a POST request
154  * returns @c SVN_DAV_VTXN_NAME_HEADER in response to a client
155  * supplied name. (HTTP protocol v2 only)
156  * @since New in 1.7. */
157 #define SVN_DAV_VTXN_STUB_HEADER "SVN-VTxn-Stub"
158 
159 /** This header provides an opaque URI which represents the root
160  * directory of a Subversion transaction (revision-in-progress),
161  * similar to the concept of a "txn root" in the libsvn_fs API. The
162  * client can append additional path segments to it to access items
163  * deeper in the transaction tree as part of a commit process. (HTTP
164  * protocol v2 only)
165  * @since New in 1.7. */
166 #define SVN_DAV_TXN_ROOT_STUB_HEADER "SVN-Txn-Root-Stub"
167 
168 /** Companion to @c SVN_DAV_TXN_ROOT_STUB_HEADER, used when a POST
169  * request returns @c SVN_DAV_VTXN_NAME_HEADER in response to a
170  * client supplied name. (HTTP protocol v2 only)
171  * @since New in 1.7. */
172 #define SVN_DAV_VTXN_ROOT_STUB_HEADER "SVN-VTxn-Root-Stub"
173 
174 /** This header is used in the POST response to tell the client the
175  * name of the Subversion transaction created by the request. It can
176  * then be appended to the transaction stub and transaction root stub
177  * for access to the properties and paths, respectively, of the named
178  * transaction. (HTTP protocol v2 only)
179  * @since New in 1.7. */
180 #define SVN_DAV_TXN_NAME_HEADER "SVN-Txn-Name"
181 
182 /** This header is used in the POST request, to pass a client supplied
183  * alternative transaction name to the server, and in the POST
184  * response, to tell the client that the alternative transaction
185  * resource names should be used. (HTTP protocol v2 only)
186  * @since New in 1.7. */
187 #define SVN_DAV_VTXN_NAME_HEADER "SVN-VTxn-Name"
188 
189 /** This header is used in the OPTIONS response to identify named
190  * skel-based POST request types which the server is prepared to
191  * handle. (HTTP protocol v2 only)
192  * @since New in 1.8. */
193 #define SVN_DAV_SUPPORTED_POSTS_HEADER "SVN-Supported-Posts"
194 
195 /** This header is used in the OPTIONS response to indicate if the server
196  * wants bulk update requests (Prefer) or only accepts skelta requests (Off).
197  * If this value is On both options are allowed.
198  * @since New in 1.8. */
199 #define SVN_DAV_ALLOW_BULK_UPDATES "SVN-Allow-Bulk-Updates"
200 
201 /** Assuming the request target is a Subversion repository resource,
202  * this header is returned in the OPTIONS response to indicate whether
203  * the repository supports the merge tracking feature ("yes") or not
204  * ("no").
205  * @since New in 1.8. */
206 #define SVN_DAV_REPOSITORY_MERGEINFO "SVN-Repository-MergeInfo"
207 
208 /**
209  * @name Fulltext MD5 headers
210  *
211  * These headers are for client and server to verify that the base
212  * and the result of a change transmission are the same on both
213  * sides, regardless of what transformations (svndiff deltification,
214  * gzipping, etc) the data may have gone through in between.
215  *
216  * The result md5 is always used whenever file contents are
217  * transferred, because every transmission has a resulting text.
218  *
219  * The base md5 is used to verify the base text against which svndiff
220  * data is being applied. Note that even for svndiff transmissions,
221  * base verification is not strictly necessary (and may therefore be
222  * unimplemented), as any error will be caught by the verification of
223  * the final result. However, if the problem is that the base text is
224  * corrupt, the error will be caught earlier if the base md5 is used.
225  *
226  * Normal WebDAV or DeltaV clients don't use these.
227  * @{
228  */
229 #define SVN_DAV_BASE_FULLTEXT_MD5_HEADER "X-SVN-Base-Fulltext-MD5"
230 #define SVN_DAV_RESULT_FULLTEXT_MD5_HEADER "X-SVN-Result-Fulltext-MD5"
231 /** @} */
232 
233 /* ### should add strings for the various XML elements in the reports
234  ### and things. also the custom prop names. etc.
235 */
236 
237 /** The svn-specific object that is placed within a <D:error> response.
238  *
239  * @defgroup svn_dav_error Errors in svn_dav
240  * @{ */
241 
242 /** The error object's namespace */
243 #define SVN_DAV_ERROR_NAMESPACE "svn:"
244 
245 /** The error object's tag */
246 #define SVN_DAV_ERROR_TAG "error"
247 
248 /** @} */
249 
250 
251 /** General property (xml) namespaces that will be used by both ra_dav
252  * and mod_dav_svn for marshalling properties.
253  *
254  * @defgroup svn_dav_property_xml_namespaces DAV property namespaces
255  * @{
256  */
257 
258 /** A property stored in the fs and wc, begins with 'svn:', and is
259  * interpreted either by client or server.
260  */
261 #define SVN_DAV_PROP_NS_SVN "http://subversion.tigris.org/xmlns/svn/"
262 
263 /** A property stored in the fs and wc, but totally ignored by svn
264  * client and server.
265  *
266  * A property simply invented by the users.
267  */
268 #define SVN_DAV_PROP_NS_CUSTOM "http://subversion.tigris.org/xmlns/custom/"
269 
270 /** A property purely generated and consumed by the network layer, not
271  * seen by either fs or wc.
272  */
273 #define SVN_DAV_PROP_NS_DAV "http://subversion.tigris.org/xmlns/dav/"
274 
275 
276 /**
277  * @name Custom (extension) values for the DAV header.
278  * Note that although these share the SVN_DAV_PROP_NS_DAV namespace
279  * prefix, they are not properties; they are header values.
280  * @{
281  */
282 
283 /* ##################################################################
284  *
285  * WARNING: At least some versions of Microsoft's Web Folders
286  * WebDAV client implementation are unable to handle
287  * DAV: headers with values longer than 63 characters,
288  * so please keep these strings within that limit.
289  *
290  * ##################################################################
291  */
292 
293 
294 /** Presence of this in a DAV header in an OPTIONS request or response
295  * indicates that the transmitter supports @c svn_depth_t.
296  *
297  * @since New in 1.5.
298  */
299 #define SVN_DAV_NS_DAV_SVN_DEPTH\
300  SVN_DAV_PROP_NS_DAV "svn/depth"
301 
302 /** Presence of this in a DAV header in an OPTIONS request or response
303  * indicates that the server knows how to handle merge-tracking
304  * information.
305  *
306  * Note that this says nothing about whether the repository can handle
307  * mergeinfo, only whether the server does. For more information, see
308  * mod_dav_svn/version.c:get_vsn_options().
309  *
310  * @since New in 1.5.
311  */
312 #define SVN_DAV_NS_DAV_SVN_MERGEINFO\
313  SVN_DAV_PROP_NS_DAV "svn/mergeinfo"
314 
315 /** Presence of this in a DAV header in an OPTIONS response indicates
316  * that the transmitter (in this case, the server) knows how to send
317  * custom revprops in log responses.
318  *
319  * @since New in 1.5.
320  */
321 #define SVN_DAV_NS_DAV_SVN_LOG_REVPROPS\
322  SVN_DAV_PROP_NS_DAV "svn/log-revprops"
323 
324 /** Presence of this in a DAV header in an OPTIONS response indicates
325  * that the transmitter (in this case, the server) knows how to handle
326  * a replay of a directory in the repository (not root).
327  *
328  * @since New in 1.5.
329  */
330 #define SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY\
331  SVN_DAV_PROP_NS_DAV "svn/partial-replay"
332 
333 /** Presence of this in a DAV header in an OPTIONS response indicates
334  * that the transmitter (in this case, the server) knows how to enforce
335  * old-value atomicity in PROPPATCH (for editing revprops).
336  *
337  * @since New in 1.7.
338  */
339 #define SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS\
340  SVN_DAV_PROP_NS_DAV "svn/atomic-revprops"
341 
342 /** Presence of this in a DAV header in an OPTIONS response indicates
343  * that the transmitter (in this case, the server) knows how to get
344  * inherited properties.
345  *
346  * @since New in 1.8.
347  */
348 #define SVN_DAV_NS_DAV_SVN_INHERITED_PROPS\
349  SVN_DAV_PROP_NS_DAV "svn/inherited-props"
350 
351 /** Presence of this in a DAV header in an OPTIONS response indicates
352  * that the transmitter (in this case, the server) knows how to
353  * properly handle ephemeral (that is, deleted-just-before-commit) FS
354  * transaction properties.
355  *
356  * @since New in 1.8.
357  */
358 #define SVN_DAV_NS_DAV_SVN_EPHEMERAL_TXNPROPS\
359  SVN_DAV_PROP_NS_DAV "svn/ephemeral-txnprops"
360 
361 /** Presence of this in a DAV header in an OPTIONS response indicates
362  * that the transmitter (in this case, the server) supports serving
363  * properties inline in update editor when 'send-all' is 'false'.
364  *
365  * @since New in 1.8.
366  */
367 #define SVN_DAV_NS_DAV_SVN_INLINE_PROPS\
368  SVN_DAV_PROP_NS_DAV "svn/inline-props"
369 
370 /** Presence of this in a DAV header in an OPTIONS response indicates
371  * that the transmitter (in this case, the server) knows how to handle
372  * a replay of a revision resource. Transmitters must be
373  * HTTP-v2-enabled to support this feature.
374  *
375  * @since New in 1.8.
376  */
377 #define SVN_DAV_NS_DAV_SVN_REPLAY_REV_RESOURCE\
378  SVN_DAV_PROP_NS_DAV "svn/replay-rev-resource"
379 
380 /** Presence of this in a DAV header in an OPTIONS response indicates
381  * that the transmitter (in this case, the server) knows how to handle
382  * a reversed fetch of file versions.
383  *
384  * @since New in 1.8.
385  */
386 #define SVN_DAV_NS_DAV_SVN_REVERSE_FILE_REVS\
387  SVN_DAV_PROP_NS_DAV "svn/reverse-file-revs"
388 
389 /** Presence of this in a DAV header in an OPTIONS response indicates
390  * that the transmitter (in this case, the server) knows how to handle
391  * svndiff1 format encoding.
392  *
393  * @since New in 1.10.
394  */
395 #define SVN_DAV_NS_DAV_SVN_SVNDIFF1\
396  SVN_DAV_PROP_NS_DAV "svn/svndiff1"
397 
398 /** Presence of this in a DAV header in an OPTIONS response indicates
399  * that the transmitter (in this case, the server) knows how to handle
400  * 'list' requests.
401  *
402  * @since New in 1.10.
403  */
404 #define SVN_DAV_NS_DAV_SVN_LIST\
405  SVN_DAV_PROP_NS_DAV "svn/list"
406 
407 /** Presence of this in a DAV header in an OPTIONS response indicates
408  * that the transmitter (in this case, the server) knows how to handle
409  * svndiff2 format encoding.
410  *
411  * @since New in 1.10.
412  */
413 #define SVN_DAV_NS_DAV_SVN_SVNDIFF2\
414  SVN_DAV_PROP_NS_DAV "svn/svndiff2"
415 
416 /** Presence of this in a DAV header in an OPTIONS response indicates
417  * that the transmitter (in this case, the server) sends the result
418  * checksum in the response to a successful PUT request.
419  *
420  * @since New in 1.10.
421  */
422 #define SVN_DAV_NS_DAV_SVN_PUT_RESULT_CHECKSUM\
423  SVN_DAV_PROP_NS_DAV "svn/put-result-checksum"
424 
425 /** @} */
426 
427 /** @} */
428 
429 #ifdef __cplusplus
430 }
431 #endif /* __cplusplus */
432 
433 #endif /* SVN_DAV_H */