00001 /** 00002 * @copyright 00003 * ==================================================================== 00004 * Licensed to the Apache Software Foundation (ASF) under one 00005 * or more contributor license agreements. See the NOTICE file 00006 * distributed with this work for additional information 00007 * regarding copyright ownership. The ASF licenses this file 00008 * to you under the Apache License, Version 2.0 (the 00009 * "License"); you may not use this file except in compliance 00010 * with the License. You may obtain a copy of the License at 00011 * 00012 * http://www.apache.org/licenses/LICENSE-2.0 00013 * 00014 * Unless required by applicable law or agreed to in writing, 00015 * software distributed under the License is distributed on an 00016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 00017 * KIND, either express or implied. See the License for the 00018 * specific language governing permissions and limitations 00019 * under the License. 00020 * ==================================================================== 00021 * @endcopyright 00022 * 00023 * @file svn_dav.h 00024 * @brief Code related to WebDAV/DeltaV usage in Subversion. 00025 */ 00026 00027 00028 00029 00030 #ifndef SVN_DAV_H 00031 #define SVN_DAV_H 00032 00033 00034 #ifdef __cplusplus 00035 extern "C" { 00036 #endif /* __cplusplus */ 00037 00038 00039 /** This is the MIME type that Subversion uses for its "svndiff" format. 00040 * 00041 * This is an application type, for the "svn" vendor. The specific subtype 00042 * is "svndiff". 00043 */ 00044 #define SVN_SVNDIFF_MIME_TYPE "application/vnd.svn-svndiff" 00045 00046 /** This is the MIME type that Subversion users for its "skel" format. 00047 * 00048 * This is an application type, for the "svn" vendor. The specific subtype 00049 * is "skel". 00050 * @since New in 1.7. 00051 */ 00052 #define SVN_SKEL_MIME_TYPE "application/vnd.svn-skel" 00053 00054 /** This header is *TEMPORARILY* used to transmit the delta base to the 00055 * server. It contains a version resource URL for what is on the client. 00056 * 00057 * @note The HTTP delta draft recommends an If-None-Match header 00058 * holding an entity tag corresponding to the base copy that the 00059 * client has. In Subversion, it is much more natural to use a version 00060 * URL to specify that base. We'd like, then, to use the If: header 00061 * to specify the URL. Unfortunately, mod_dav sees all "State-token" 00062 * items as lock tokens. So we'll use this custom header until mod_dav 00063 * and other backend APIs are taught to be less rigid, at which time 00064 * we can switch to using an If: header to report our base version. 00065 */ 00066 #define SVN_DAV_DELTA_BASE_HEADER "X-SVN-VR-Base" 00067 00068 /** This header is used when an svn client wants to trigger specific 00069 * svn server behaviors. Normal WebDAV or DeltaV clients won't use it. 00070 */ 00071 #define SVN_DAV_OPTIONS_HEADER "X-SVN-Options" 00072 00073 /** 00074 * @name options-header defines 00075 * Specific options that can appear in the options-header: 00076 * @{ 00077 */ 00078 #define SVN_DAV_OPTION_NO_MERGE_RESPONSE "no-merge-response" 00079 #define SVN_DAV_OPTION_LOCK_BREAK "lock-break" 00080 #define SVN_DAV_OPTION_LOCK_STEAL "lock-steal" 00081 #define SVN_DAV_OPTION_RELEASE_LOCKS "release-locks" 00082 #define SVN_DAV_OPTION_KEEP_LOCKS "keep-locks" 00083 /** @} */ 00084 00085 /** This header is used when an svn client wants to tell mod_dav_svn 00086 * exactly what revision of a resource it thinks it's operating on. 00087 * (For example, an svn server can use it to validate a DELETE request.) 00088 * Normal WebDAV or DeltaV clients won't use it. 00089 */ 00090 #define SVN_DAV_VERSION_NAME_HEADER "X-SVN-Version-Name" 00091 00092 /** A header generated by mod_dav_svn whenever it responds 00093 successfully to a LOCK request. Only svn clients will notice it, 00094 and use it to fill in svn_lock_t->creation_date. */ 00095 #define SVN_DAV_CREATIONDATE_HEADER "X-SVN-Creation-Date" 00096 00097 /** A header generated by mod_dav_svn whenever it responds 00098 successfully to a PROPFIND for the 'DAV:lockdiscovery' property. 00099 Only svn clients will notice it, and use it to fill in 00100 svn_lock_t->owner. (Remember that the DAV:owner field maps to 00101 svn_lock_t->comment, and that there is no analogue in the DAV 00102 universe of svn_lock_t->owner.) */ 00103 #define SVN_DAV_LOCK_OWNER_HEADER "X-SVN-Lock-Owner" 00104 00105 /** Assuming the OPTIONS was performed against a resource within a 00106 * Subversion repository, then this header indicates the youngest 00107 * revision in the repository. 00108 * @since New in 1.7. */ 00109 #define SVN_DAV_YOUNGEST_REV_HEADER "SVN-Youngest-Rev" 00110 00111 /** Assuming the OPTIONS was performed against a resource within a 00112 * Subversion repository, then this header indicates the UUID of the 00113 * repository. 00114 * @since New in 1.7. */ 00115 #define SVN_DAV_REPOS_UUID_HEADER "SVN-Repository-UUID" 00116 00117 /** Presence of this in a DAV header in an OPTIONS response indicates 00118 * that the server speaks HTTP protocol v2. This header provides an 00119 * opaque URI that the client should send all custom REPORT requests 00120 * against. 00121 * @since New in 1.7. */ 00122 #define SVN_DAV_ME_RESOURCE_HEADER "SVN-Me-Resource" 00123 00124 /** This header provides the repository root URI, suitable for use in 00125 * calculating the relative paths of other public URIs for this 00126 * repository into . (HTTP protocol v2 only) 00127 * @since New in 1.7. */ 00128 #define SVN_DAV_ROOT_URI_HEADER "SVN-Repository-Root" 00129 00130 /** This header provides an opaque URI that the client can append a 00131 * revision to, to construct a 'revision URL'. This allows direct 00132 * read/write access to revprops via PROPFIND or PROPPATCH, and is 00133 * similar to libsvn_fs's revision objects (as distinct from "revision 00134 * roots"). (HTTP protocol v2 only) 00135 * @since New in 1.7. */ 00136 #define SVN_DAV_REV_STUB_HEADER "SVN-Rev-Stub" 00137 00138 /** This header provides an opaque URI that the client can append 00139 * PEGREV/PATH to, in order to construct URIs of pegged objects in the 00140 * repository, similar to the use of a "revision root" in the 00141 * libsvn_fs API. (HTTP protocol v2 only) 00142 * @since New in 1.7. */ 00143 #define SVN_DAV_REV_ROOT_STUB_HEADER "SVN-Rev-Root-Stub" 00144 00145 /** This header provides an opaque URI which represents a Subversion 00146 * transaction (revision-in-progress) object. It is suitable for use 00147 * in fetching and modifying transaction properties as part of a 00148 * commit process, similar to the svn_fs_txn_t object (as distinct 00149 * from a "txn root"). (HTTP protocol v2 only) 00150 * @since New in 1.7. */ 00151 #define SVN_DAV_TXN_STUB_HEADER "SVN-Txn-Stub" 00152 00153 /** Companion to @c SVN_DAV_TXN_STUB_HEADER, used when a POST request 00154 * returns @c SVN_DAV_VTXN_NAME_HEADER in response to a client 00155 * supplied name. (HTTP protocol v2 only) 00156 * @since New in 1.7. */ 00157 #define SVN_DAV_VTXN_STUB_HEADER "SVN-VTxn-Stub" 00158 00159 /** This header provides an opaque URI which represents the root 00160 * directory of a Subversion transaction (revision-in-progress), 00161 * similar to the concept of a "txn root" in the libsvn_fs API. The 00162 * client can append additional path segments to it to access items 00163 * deeper in the transaction tree as part of a commit process. (HTTP 00164 * protocol v2 only) 00165 * @since New in 1.7. */ 00166 #define SVN_DAV_TXN_ROOT_STUB_HEADER "SVN-Txn-Root-Stub" 00167 00168 /** Companion to @c SVN_DAV_TXN_ROOT_STUB_HEADER, used when a POST 00169 * request returns @c SVN_DAV_VTXN_NAME_HEADER in response to a 00170 * client supplied name. (HTTP protocol v2 only) 00171 * @since New in 1.7. */ 00172 #define SVN_DAV_VTXN_ROOT_STUB_HEADER "SVN-VTxn-Root-Stub" 00173 00174 /** This header is used in the POST response to tell the client the 00175 * name of the Subversion transaction created by the request. It can 00176 * then be appended to the transaction stub and transaction root stub 00177 * for access to the properties and paths, respectively, of the named 00178 * transaction. (HTTP protocol v2 only) 00179 * @since New in 1.7. */ 00180 #define SVN_DAV_TXN_NAME_HEADER "SVN-Txn-Name" 00181 00182 /** This header is used in the POST request, to pass a client supplied 00183 * alternative transaction name to the server, and in the POST 00184 * response, to tell the client that the alternative transaction 00185 * resource names should be used. (HTTP protocol v2 only) 00186 * @since New in 1.7. */ 00187 #define SVN_DAV_VTXN_NAME_HEADER "SVN-VTxn-Name" 00188 00189 /** This header is used in the OPTIONS response to identify named 00190 * skel-based POST request types which the server is prepared to 00191 * handle. (HTTP protocol v2 only) 00192 * @since New in 1.8. */ 00193 #define SVN_DAV_SUPPORTED_POSTS_HEADER "SVN-Supported-Posts" 00194 00195 /** This header is used in the OPTIONS response to indicate if the server 00196 * wants bulk update requests (Prefer) or only accepts skelta requests (Off). 00197 * If this value is On both options are allowed. 00198 * @since New in 1.8. */ 00199 #define SVN_DAV_ALLOW_BULK_UPDATES "SVN-Allow-Bulk-Updates" 00200 00201 /** Assuming the request target is a Subversion repository resource, 00202 * this header is returned in the OPTIONS response to indicate whether 00203 * the repository supports the merge tracking feature ("yes") or not 00204 * ("no"). 00205 * @since New in 1.8. */ 00206 #define SVN_DAV_REPOSITORY_MERGEINFO "SVN-Repository-MergeInfo" 00207 00208 /** 00209 * @name Fulltext MD5 headers 00210 * 00211 * These headers are for client and server to verify that the base 00212 * and the result of a change transmission are the same on both 00213 * sides, regardless of what transformations (svndiff deltification, 00214 * gzipping, etc) the data may have gone through in between. 00215 * 00216 * The result md5 is always used whenever file contents are 00217 * transferred, because every transmission has a resulting text. 00218 * 00219 * The base md5 is used to verify the base text against which svndiff 00220 * data is being applied. Note that even for svndiff transmissions, 00221 * base verification is not strictly necessary (and may therefore be 00222 * unimplemented), as any error will be caught by the verification of 00223 * the final result. However, if the problem is that the base text is 00224 * corrupt, the error will be caught earlier if the base md5 is used. 00225 * 00226 * Normal WebDAV or DeltaV clients don't use these. 00227 * @{ 00228 */ 00229 #define SVN_DAV_BASE_FULLTEXT_MD5_HEADER "X-SVN-Base-Fulltext-MD5" 00230 #define SVN_DAV_RESULT_FULLTEXT_MD5_HEADER "X-SVN-Result-Fulltext-MD5" 00231 /** @} */ 00232 00233 /* ### should add strings for the various XML elements in the reports 00234 ### and things. also the custom prop names. etc. 00235 */ 00236 00237 /** The svn-specific object that is placed within a <D:error> response. 00238 * 00239 * @defgroup svn_dav_error Errors in svn_dav 00240 * @{ */ 00241 00242 /** The error object's namespace */ 00243 #define SVN_DAV_ERROR_NAMESPACE "svn:" 00244 00245 /** The error object's tag */ 00246 #define SVN_DAV_ERROR_TAG "error" 00247 00248 /** @} */ 00249 00250 00251 /** General property (xml) namespaces that will be used by both ra_dav 00252 * and mod_dav_svn for marshalling properties. 00253 * 00254 * @defgroup svn_dav_property_xml_namespaces DAV property namespaces 00255 * @{ 00256 */ 00257 00258 /** A property stored in the fs and wc, begins with 'svn:', and is 00259 * interpreted either by client or server. 00260 */ 00261 #define SVN_DAV_PROP_NS_SVN "http://subversion.tigris.org/xmlns/svn/" 00262 00263 /** A property stored in the fs and wc, but totally ignored by svn 00264 * client and server. 00265 * 00266 * A property simply invented by the users. 00267 */ 00268 #define SVN_DAV_PROP_NS_CUSTOM "http://subversion.tigris.org/xmlns/custom/" 00269 00270 /** A property purely generated and consumed by the network layer, not 00271 * seen by either fs or wc. 00272 */ 00273 #define SVN_DAV_PROP_NS_DAV "http://subversion.tigris.org/xmlns/dav/" 00274 00275 00276 /** 00277 * @name Custom (extension) values for the DAV header. 00278 * Note that although these share the SVN_DAV_PROP_NS_DAV namespace 00279 * prefix, they are not properties; they are header values. 00280 * @{ 00281 */ 00282 00283 /* ################################################################## 00284 * 00285 * WARNING: At least some versions of Microsoft's Web Folders 00286 * WebDAV client implementation are unable to handle 00287 * DAV: headers with values longer than 63 characters, 00288 * so please keep these strings within that limit. 00289 * 00290 * ################################################################## 00291 */ 00292 00293 00294 /** Presence of this in a DAV header in an OPTIONS request or response 00295 * indicates that the transmitter supports @c svn_depth_t. 00296 * 00297 * @since New in 1.5. 00298 */ 00299 #define SVN_DAV_NS_DAV_SVN_DEPTH\ 00300 SVN_DAV_PROP_NS_DAV "svn/depth" 00301 00302 /** Presence of this in a DAV header in an OPTIONS request or response 00303 * indicates that the server knows how to handle merge-tracking 00304 * information. 00305 * 00306 * Note that this says nothing about whether the repository can handle 00307 * mergeinfo, only whether the server does. For more information, see 00308 * mod_dav_svn/version.c:get_vsn_options(). 00309 * 00310 * @since New in 1.5. 00311 */ 00312 #define SVN_DAV_NS_DAV_SVN_MERGEINFO\ 00313 SVN_DAV_PROP_NS_DAV "svn/mergeinfo" 00314 00315 /** Presence of this in a DAV header in an OPTIONS response indicates 00316 * that the transmitter (in this case, the server) knows how to send 00317 * custom revprops in log responses. 00318 * 00319 * @since New in 1.5. 00320 */ 00321 #define SVN_DAV_NS_DAV_SVN_LOG_REVPROPS\ 00322 SVN_DAV_PROP_NS_DAV "svn/log-revprops" 00323 00324 /** Presence of this in a DAV header in an OPTIONS response indicates 00325 * that the transmitter (in this case, the server) knows how to handle 00326 * a replay of a directory in the repository (not root). 00327 * 00328 * @since New in 1.5. 00329 */ 00330 #define SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY\ 00331 SVN_DAV_PROP_NS_DAV "svn/partial-replay" 00332 00333 /** Presence of this in a DAV header in an OPTIONS response indicates 00334 * that the transmitter (in this case, the server) knows how to enforce 00335 * old-value atomicity in PROPPATCH (for editing revprops). 00336 * 00337 * @since New in 1.7. 00338 */ 00339 #define SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS\ 00340 SVN_DAV_PROP_NS_DAV "svn/atomic-revprops" 00341 00342 /** Presence of this in a DAV header in an OPTIONS response indicates 00343 * that the transmitter (in this case, the server) knows how to get 00344 * inherited properties. 00345 * 00346 * @since New in 1.8. 00347 */ 00348 #define SVN_DAV_NS_DAV_SVN_INHERITED_PROPS\ 00349 SVN_DAV_PROP_NS_DAV "svn/inherited-props" 00350 00351 /** Presence of this in a DAV header in an OPTIONS response indicates 00352 * that the transmitter (in this case, the server) knows how to 00353 * properly handle ephemeral (that is, deleted-just-before-commit) FS 00354 * transaction properties. 00355 * 00356 * @since New in 1.8. 00357 */ 00358 #define SVN_DAV_NS_DAV_SVN_EPHEMERAL_TXNPROPS\ 00359 SVN_DAV_PROP_NS_DAV "svn/ephemeral-txnprops" 00360 00361 /** Presence of this in a DAV header in an OPTIONS response indicates 00362 * that the transmitter (in this case, the server) supports serving 00363 * properties inline in update editor when 'send-all' is 'false'. 00364 * 00365 * @since New in 1.8. 00366 */ 00367 #define SVN_DAV_NS_DAV_SVN_INLINE_PROPS\ 00368 SVN_DAV_PROP_NS_DAV "svn/inline-props" 00369 00370 /** Presence of this in a DAV header in an OPTIONS response indicates 00371 * that the transmitter (in this case, the server) knows how to handle 00372 * a replay of a revision resource. Transmitters must be 00373 * HTTP-v2-enabled to support this feature. 00374 * 00375 * @since New in 1.8. 00376 */ 00377 #define SVN_DAV_NS_DAV_SVN_REPLAY_REV_RESOURCE\ 00378 SVN_DAV_PROP_NS_DAV "svn/replay-rev-resource" 00379 00380 /** Presence of this in a DAV header in an OPTIONS response indicates 00381 * that the transmitter (in this case, the server) knows how to handle 00382 * a reversed fetch of file versions. 00383 * 00384 * @since New in 1.8. 00385 */ 00386 #define SVN_DAV_NS_DAV_SVN_REVERSE_FILE_REVS\ 00387 SVN_DAV_PROP_NS_DAV "svn/reverse-file-revs" 00388 00389 00390 /** @} */ 00391 00392 /** @} */ 00393 00394 #ifdef __cplusplus 00395 } 00396 #endif /* __cplusplus */ 00397 00398 #endif /* SVN_DAV_H */