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
12 * http://www.apache.org/licenses/LICENSE-2.0
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
20 * ====================================================================
24 * @brief Code related to WebDAV/DeltaV usage in Subversion.
36 #endif /* __cplusplus */
39 /** This is the MIME type that Subversion uses for its "svndiff" format.
41 * This is an application type, for the "svn" vendor. The specific subtype
44 #define SVN_SVNDIFF_MIME_TYPE "application/vnd.svn-svndiff"
46 /** This is the MIME type that Subversion users for its "skel" format.
48 * This is an application type, for the "svn" vendor. The specific subtype
52 #define SVN_SKEL_MIME_TYPE "application/vnd.svn-skel"
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.
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.
66 #define SVN_DAV_DELTA_BASE_HEADER "X-SVN-VR-Base"
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.
71 #define SVN_DAV_OPTIONS_HEADER "X-SVN-Options"
74 * @name options-header defines
75 * Specific options that can appear in the options-header:
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"
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.
90 #define SVN_DAV_VERSION_NAME_HEADER "X-SVN-Version-Name"
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"
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"
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"
111 /** Assuming the OPTIONS was performed against a resource within a
112 * Subversion repository, then this header indicates the UUID of the
114 * @since New in 1.7. */
115 #define SVN_DAV_REPOS_UUID_HEADER "SVN-Repository-UUID"
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
121 * @since New in 1.7. */
122 #define SVN_DAV_ME_RESOURCE_HEADER "SVN-Me-Resource"
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"
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"
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"
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"
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"
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
165 * @since New in 1.7. */
166 #define SVN_DAV_TXN_ROOT_STUB_HEADER "SVN-Txn-Root-Stub"
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"
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"
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"
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"
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"
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
205 * @since New in 1.8. */
206 #define SVN_DAV_REPOSITORY_MERGEINFO "SVN-Repository-MergeInfo"
209 * @name Fulltext MD5 headers
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.
216 * The result md5 is always used whenever file contents are
217 * transferred, because every transmission has a resulting text.
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.
226 * Normal WebDAV or DeltaV clients don't use these.
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"
233 /* ### should add strings for the various XML elements in the reports
234 ### and things. also the custom prop names. etc.
237 /** The svn-specific object that is placed within a <D:error> response.
239 * @defgroup svn_dav_error Errors in svn_dav
242 /** The error object's namespace */
243 #define SVN_DAV_ERROR_NAMESPACE "svn:"
245 /** The error object's tag */
246 #define SVN_DAV_ERROR_TAG "error"
251 /** General property (xml) namespaces that will be used by both ra_dav
252 * and mod_dav_svn for marshalling properties.
254 * @defgroup svn_dav_property_xml_namespaces DAV property namespaces
258 /** A property stored in the fs and wc, begins with 'svn:', and is
259 * interpreted either by client or server.
261 #define SVN_DAV_PROP_NS_SVN "http://subversion.tigris.org/xmlns/svn/"
263 /** A property stored in the fs and wc, but totally ignored by svn
266 * A property simply invented by the users.
268 #define SVN_DAV_PROP_NS_CUSTOM "http://subversion.tigris.org/xmlns/custom/"
270 /** A property purely generated and consumed by the network layer, not
271 * seen by either fs or wc.
273 #define SVN_DAV_PROP_NS_DAV "http://subversion.tigris.org/xmlns/dav/"
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.
283 /* ##################################################################
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.
290 * ##################################################################
294 /** Presence of this in a DAV header in an OPTIONS request or response
295 * indicates that the transmitter supports @c svn_depth_t.
299 #define SVN_DAV_NS_DAV_SVN_DEPTH\
300 SVN_DAV_PROP_NS_DAV "svn/depth"
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
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().
312 #define SVN_DAV_NS_DAV_SVN_MERGEINFO\
313 SVN_DAV_PROP_NS_DAV "svn/mergeinfo"
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.
321 #define SVN_DAV_NS_DAV_SVN_LOG_REVPROPS\
322 SVN_DAV_PROP_NS_DAV "svn/log-revprops"
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).
330 #define SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY\
331 SVN_DAV_PROP_NS_DAV "svn/partial-replay"
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).
339 #define SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS\
340 SVN_DAV_PROP_NS_DAV "svn/atomic-revprops"
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.
348 #define SVN_DAV_NS_DAV_SVN_INHERITED_PROPS\
349 SVN_DAV_PROP_NS_DAV "svn/inherited-props"
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.
358 #define SVN_DAV_NS_DAV_SVN_EPHEMERAL_TXNPROPS\
359 SVN_DAV_PROP_NS_DAV "svn/ephemeral-txnprops"
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'.
367 #define SVN_DAV_NS_DAV_SVN_INLINE_PROPS\
368 SVN_DAV_PROP_NS_DAV "svn/inline-props"
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.
377 #define SVN_DAV_NS_DAV_SVN_REPLAY_REV_RESOURCE\
378 SVN_DAV_PROP_NS_DAV "svn/replay-rev-resource"
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.
386 #define SVN_DAV_NS_DAV_SVN_REVERSE_FILE_REVS\
387 SVN_DAV_PROP_NS_DAV "svn/reverse-file-revs"
396 #endif /* __cplusplus */
398 #endif /* SVN_DAV_H */