Subversion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 #define SVN_DAV_DELTA_BASE_HEADER "X-SVN-VR-Base"
58 
59 /** This header is used when an svn client wants to trigger specific
60  * svn server behaviors. Normal WebDAV or DeltaV clients won't use it.
61  */
62 #define SVN_DAV_OPTIONS_HEADER "X-SVN-Options"
63 
64 /**
65  * @name options-header defines
66  * Specific options that can appear in the options-header:
67  * @{
68  */
69 #define SVN_DAV_OPTION_NO_MERGE_RESPONSE "no-merge-response"
70 #define SVN_DAV_OPTION_LOCK_BREAK "lock-break"
71 #define SVN_DAV_OPTION_LOCK_STEAL "lock-steal"
72 #define SVN_DAV_OPTION_RELEASE_LOCKS "release-locks"
73 #define SVN_DAV_OPTION_KEEP_LOCKS "keep-locks"
74 /** @} */
75 
76 /** This header is used when an svn client wants to tell mod_dav_svn
77  * exactly what revision of a resource it thinks it's operating on.
78  * (For example, an svn server can use it to validate a DELETE request.)
79  * Normal WebDAV or DeltaV clients won't use it.
80  */
81 #define SVN_DAV_VERSION_NAME_HEADER "X-SVN-Version-Name"
82 
83 /** A header generated by mod_dav_svn whenever it responds
84  successfully to a LOCK request. Only svn clients will notice it,
85  and use it to fill in svn_lock_t->creation_date. */
86 #define SVN_DAV_CREATIONDATE_HEADER "X-SVN-Creation-Date"
87 
88 /** A header generated by mod_dav_svn whenever it responds
89  successfully to a PROPFIND for the 'DAV:lockdiscovery' property.
90  Only svn clients will notice it, and use it to fill in
91  svn_lock_t->owner. (Remember that the DAV:owner field maps to
92  svn_lock_t->comment, and that there is no analogue in the DAV
93  universe of svn_lock_t->owner.) */
94 #define SVN_DAV_LOCK_OWNER_HEADER "X-SVN-Lock-Owner"
95 
96 /** Assuming the OPTIONS was performed against a resource within a
97  * Subversion repository, then this header indicates the youngest
98  * revision in the repository.
99  * @since New in 1.7. */
100 #define SVN_DAV_YOUNGEST_REV_HEADER "SVN-Youngest-Rev"
101 
102 /** Assuming the OPTIONS was performed against a resource within a
103  * Subversion repository, then this header indicates the UUID of the
104  * repository.
105  * @since New in 1.7. */
106 #define SVN_DAV_REPOS_UUID_HEADER "SVN-Repository-UUID"
107 
108 /** Presence of this in a DAV header in an OPTIONS response indicates
109  * that the server speaks HTTP protocol v2. This header provides an
110  * opaque URI that the client should send all custom REPORT requests
111  * against.
112  * @since New in 1.7. */
113 #define SVN_DAV_ME_RESOURCE_HEADER "SVN-Me-Resource"
114 
115 /** This header provides the repository root URI, suitable for use in
116  * calculating the relative paths of other public URIs for this
117  * repository into . (HTTP protocol v2 only)
118  * @since New in 1.7. */
119 #define SVN_DAV_ROOT_URI_HEADER "SVN-Repository-Root"
120 
121 /** This header provides an opaque URI that the client can append a
122  * revision to, to construct a 'revision URL'. This allows direct
123  * read/write access to revprops via PROPFIND or PROPPATCH, and is
124  * similar to libsvn_fs's revision objects (as distinct from "revision
125  * roots"). (HTTP protocol v2 only)
126  * @since New in 1.7. */
127 #define SVN_DAV_REV_STUB_HEADER "SVN-Rev-Stub"
128 
129 /** This header provides an opaque URI that the client can append
130  * PEGREV/PATH to, in order to construct URIs of pegged objects in the
131  * repository, similar to the use of a "revision root" in the
132  * libsvn_fs API. (HTTP protocol v2 only)
133  * @since New in 1.7. */
134 #define SVN_DAV_REV_ROOT_STUB_HEADER "SVN-Rev-Root-Stub"
135 
136 /** This header provides an opaque URI which represents a Subversion
137  * transaction (revision-in-progress) object. It is suitable for use
138  * in fetching and modifying transaction properties as part of a
139  * commit process, similar to the svn_fs_txn_t object (as distinct
140  * from a "txn root"). (HTTP protocol v2 only)
141  * @since New in 1.7. */
142 #define SVN_DAV_TXN_STUB_HEADER "SVN-Txn-Stub"
143 
144 /** Companion to @c SVN_DAV_TXN_STUB_HEADER, used when a POST request
145  * returns @c SVN_DAV_VTXN_NAME_HEADER in response to a client
146  * supplied name. (HTTP protocol v2 only)
147  * @since New in 1.7. */
148 #define SVN_DAV_VTXN_STUB_HEADER "SVN-VTxn-Stub"
149 
150 /** This header provides an opaque URI which represents the root
151  * directory of a Subversion transaction (revision-in-progress),
152  * similar to the concept of a "txn root" in the libsvn_fs API. The
153  * client can append additional path segments to it to access items
154  * deeper in the transaction tree as part of a commit process. (HTTP
155  * protocol v2 only)
156  * @since New in 1.7. */
157 #define SVN_DAV_TXN_ROOT_STUB_HEADER "SVN-Txn-Root-Stub"
158 
159 /** Companion to @c SVN_DAV_TXN_ROOT_STUB_HEADER, used when a POST
160  * request returns @c SVN_DAV_VTXN_NAME_HEADER in response to a
161  * client supplied name. (HTTP protocol v2 only)
162  * @since New in 1.7. */
163 #define SVN_DAV_VTXN_ROOT_STUB_HEADER "SVN-VTxn-Root-Stub"
164 
165 /** This header is used in the POST response to tell the client the
166  * name of the Subversion transaction created by the request. It can
167  * then be appended to the transaction stub and transaction root stub
168  * for access to the properties and paths, respectively, of the named
169  * transaction. (HTTP protocol v2 only)
170  * @since New in 1.7. */
171 #define SVN_DAV_TXN_NAME_HEADER "SVN-Txn-Name"
172 
173 /** This header is used in the POST request, to pass a client supplied
174  * alternative transaction name to the server, and in the the POST
175  * response, to tell the client that the alternative transaction
176  * resource names should be used. (HTTP protocol v2 only)
177  * @since New in 1.7. */
178 #define SVN_DAV_VTXN_NAME_HEADER "SVN-VTxn-Name"
179 
180 /**
181  * @name Fulltext MD5 headers
182  *
183  * These headers are for client and server to verify that the base
184  * and the result of a change transmission are the same on both
185  * sides, regardless of what transformations (svndiff deltification,
186  * gzipping, etc) the data may have gone through in between.
187  *
188  * The result md5 is always used whenever file contents are
189  * transferred, because every transmission has a resulting text.
190  *
191  * The base md5 is used to verify the base text against which svndiff
192  * data is being applied. Note that even for svndiff transmissions,
193  * base verification is not strictly necessary (and may therefore be
194  * unimplemented), as any error will be caught by the verification of
195  * the final result. However, if the problem is that the base text is
196  * corrupt, the error will be caught earlier if the base md5 is used.
197  *
198  * Normal WebDAV or DeltaV clients don't use these.
199  * @{
200  */
201 #define SVN_DAV_BASE_FULLTEXT_MD5_HEADER "X-SVN-Base-Fulltext-MD5"
202 #define SVN_DAV_RESULT_FULLTEXT_MD5_HEADER "X-SVN-Result-Fulltext-MD5"
203 /** @} */
204 
205 /* ### should add strings for the various XML elements in the reports
206  ### and things. also the custom prop names. etc.
207 */
208 
209 /** The svn-specific object that is placed within a <D:error> response.
210  *
211  * @defgroup svn_dav_error Errors in svn_dav
212  * @{ */
213 
214 /** The error object's namespace */
215 #define SVN_DAV_ERROR_NAMESPACE "svn:"
216 
217 /** The error object's tag */
218 #define SVN_DAV_ERROR_TAG "error"
219 
220 /** @} */
221 
222 
223 /** General property (xml) namespaces that will be used by both ra_dav
224  * and mod_dav_svn for marshalling properties.
225  *
226  * @defgroup svn_dav_property_xml_namespaces DAV property namespaces
227  * @{
228  */
229 
230 /** A property stored in the fs and wc, begins with 'svn:', and is
231  * interpreted either by client or server.
232  */
233 #define SVN_DAV_PROP_NS_SVN "http://subversion.tigris.org/xmlns/svn/"
234 
235 /** A property stored in the fs and wc, but totally ignored by svn
236  * client and server.
237  *
238  * A property simply invented by the users.
239  */
240 #define SVN_DAV_PROP_NS_CUSTOM "http://subversion.tigris.org/xmlns/custom/"
241 
242 /** A property purely generated and consumed by the network layer, not
243  * seen by either fs or wc.
244  */
245 #define SVN_DAV_PROP_NS_DAV "http://subversion.tigris.org/xmlns/dav/"
246 
247 
248 /**
249  * @name Custom (extension) values for the DAV header.
250  * Note that although these share the SVN_DAV_PROP_NS_DAV namespace
251  * prefix, they are not properties; they are header values.
252  *
253  * @{ **/
254 
255 /** Presence of this in a DAV header in an OPTIONS request or response
256  * indicates that the transmitter supports @c svn_depth_t. */
257 #define SVN_DAV_NS_DAV_SVN_DEPTH SVN_DAV_PROP_NS_DAV "svn/depth"
258 
259 /** Presence of this in a DAV header in an OPTIONS request or response
260  * indicates that the server knows how to handle merge-tracking
261  * information.
262  *
263  * Note that this says nothing about whether the repository can handle
264  * mergeinfo, only whether the server does. For more information, see
265  * mod_dav_svn/version.c:get_vsn_options().
266  */
267 #define SVN_DAV_NS_DAV_SVN_MERGEINFO SVN_DAV_PROP_NS_DAV "svn/mergeinfo"
268 
269 /** Presence of this in a DAV header in an OPTIONS response indicates
270  * that the transmitter (in this case, the server) knows how to send
271  * custom revprops in log responses. */
272 #define SVN_DAV_NS_DAV_SVN_LOG_REVPROPS SVN_DAV_PROP_NS_DAV "svn/log-revprops"
273 
274 /** Presence of this in a DAV header in an OPTIONS response indicates
275  * that the transmitter (in this case, the server) knows how to enforce
276  * old-value atomicity in PROPPATCH (for editing revprops). */
277 #define SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS\
278  SVN_DAV_PROP_NS_DAV "svn/atomic-revprops"
279 
280 /** Presence of this in a DAV header in an OPTIONS response indicates
281  * that the transmitter (in this case, the server) knows how to handle
282  * a replay of a directory in the repository (not root). */
283 #define SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY\
284  SVN_DAV_PROP_NS_DAV "svn/partial-replay"
285 
286 /** @} */
287 
288 /** @} */
289 
290 #ifdef __cplusplus
291 }
292 #endif /* __cplusplus */
293 
294 #endif /* SVN_DAV_H */