1251881Speter/**
2251881Speter * @copyright
3251881Speter * ====================================================================
4251881Speter *    Licensed to the Apache Software Foundation (ASF) under one
5251881Speter *    or more contributor license agreements.  See the NOTICE file
6251881Speter *    distributed with this work for additional information
7251881Speter *    regarding copyright ownership.  The ASF licenses this file
8251881Speter *    to you under the Apache License, Version 2.0 (the
9251881Speter *    "License"); you may not use this file except in compliance
10251881Speter *    with the License.  You may obtain a copy of the License at
11251881Speter *
12251881Speter *      http://www.apache.org/licenses/LICENSE-2.0
13251881Speter *
14251881Speter *    Unless required by applicable law or agreed to in writing,
15251881Speter *    software distributed under the License is distributed on an
16251881Speter *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17251881Speter *    KIND, either express or implied.  See the License for the
18251881Speter *    specific language governing permissions and limitations
19251881Speter *    under the License.
20251881Speter * ====================================================================
21251881Speter * @endcopyright
22251881Speter *
23251881Speter * @file svn_dav.h
24251881Speter * @brief Code related to WebDAV/DeltaV usage in Subversion.
25251881Speter */
26251881Speter
27251881Speter
28251881Speter
29251881Speter
30251881Speter#ifndef SVN_DAV_H
31251881Speter#define SVN_DAV_H
32251881Speter
33251881Speter
34251881Speter#ifdef __cplusplus
35251881Speterextern "C" {
36251881Speter#endif /* __cplusplus */
37251881Speter
38251881Speter
39251881Speter/** This is the MIME type that Subversion uses for its "svndiff" format.
40251881Speter *
41251881Speter * This is an application type, for the "svn" vendor. The specific subtype
42251881Speter * is "svndiff".
43251881Speter */
44251881Speter#define SVN_SVNDIFF_MIME_TYPE "application/vnd.svn-svndiff"
45251881Speter
46251881Speter/** This is the MIME type that Subversion users for its "skel" format.
47251881Speter *
48251881Speter * This is an application type, for the "svn" vendor. The specific subtype
49251881Speter * is "skel".
50251881Speter * @since New in 1.7.
51251881Speter */
52251881Speter#define SVN_SKEL_MIME_TYPE "application/vnd.svn-skel"
53251881Speter
54251881Speter/** This header is *TEMPORARILY* used to transmit the delta base to the
55251881Speter * server. It contains a version resource URL for what is on the client.
56251881Speter *
57251881Speter * @note The HTTP delta draft recommends an If-None-Match header
58251881Speter * holding an entity tag corresponding to the base copy that the
59251881Speter * client has.  In Subversion, it is much more natural to use a version
60251881Speter * URL to specify that base.  We'd like, then, to use the If: header
61251881Speter * to specify the URL.  Unfortunately, mod_dav sees all "State-token"
62251881Speter * items as lock tokens.  So we'll use this custom header until mod_dav
63251881Speter * and other backend APIs are taught to be less rigid, at which time
64251881Speter * we can switch to using an If: header to report our base version.
65251881Speter */
66251881Speter#define SVN_DAV_DELTA_BASE_HEADER "X-SVN-VR-Base"
67251881Speter
68251881Speter/** This header is used when an svn client wants to trigger specific
69251881Speter * svn server behaviors.  Normal WebDAV or DeltaV clients won't use it.
70251881Speter */
71251881Speter#define SVN_DAV_OPTIONS_HEADER "X-SVN-Options"
72251881Speter
73251881Speter/**
74251881Speter * @name options-header defines
75251881Speter * Specific options that can appear in the options-header:
76251881Speter * @{
77251881Speter */
78251881Speter#define SVN_DAV_OPTION_NO_MERGE_RESPONSE "no-merge-response"
79251881Speter#define SVN_DAV_OPTION_LOCK_BREAK        "lock-break"
80251881Speter#define SVN_DAV_OPTION_LOCK_STEAL        "lock-steal"
81251881Speter#define SVN_DAV_OPTION_RELEASE_LOCKS     "release-locks"
82251881Speter#define SVN_DAV_OPTION_KEEP_LOCKS        "keep-locks"
83251881Speter/** @} */
84251881Speter
85251881Speter/** This header is used when an svn client wants to tell mod_dav_svn
86251881Speter * exactly what revision of a resource it thinks it's operating on.
87251881Speter * (For example, an svn server can use it to validate a DELETE request.)
88251881Speter * Normal WebDAV or DeltaV clients won't use it.
89251881Speter */
90251881Speter#define SVN_DAV_VERSION_NAME_HEADER "X-SVN-Version-Name"
91251881Speter
92251881Speter/** A header generated by mod_dav_svn whenever it responds
93251881Speter    successfully to a LOCK request.  Only svn clients will notice it,
94251881Speter    and use it to fill in svn_lock_t->creation_date.   */
95251881Speter#define SVN_DAV_CREATIONDATE_HEADER "X-SVN-Creation-Date"
96251881Speter
97251881Speter/** A header generated by mod_dav_svn whenever it responds
98251881Speter    successfully to a PROPFIND for the 'DAV:lockdiscovery' property.
99251881Speter    Only svn clients will notice it, and use it to fill in
100251881Speter    svn_lock_t->owner.  (Remember that the DAV:owner field maps to
101251881Speter    svn_lock_t->comment, and that there is no analogue in the DAV
102251881Speter    universe of svn_lock_t->owner.)  */
103251881Speter#define SVN_DAV_LOCK_OWNER_HEADER "X-SVN-Lock-Owner"
104251881Speter
105251881Speter/** Assuming the OPTIONS was performed against a resource within a
106251881Speter * Subversion repository, then this header indicates the youngest
107251881Speter * revision in the repository.
108251881Speter * @since New in 1.7.  */
109251881Speter#define SVN_DAV_YOUNGEST_REV_HEADER "SVN-Youngest-Rev"
110251881Speter
111251881Speter/** Assuming the OPTIONS was performed against a resource within a
112251881Speter * Subversion repository, then this header indicates the UUID of the
113251881Speter * repository.
114251881Speter * @since New in 1.7.  */
115251881Speter#define SVN_DAV_REPOS_UUID_HEADER "SVN-Repository-UUID"
116251881Speter
117251881Speter/** Presence of this in a DAV header in an OPTIONS response indicates
118251881Speter * that the server speaks HTTP protocol v2.  This header provides an
119251881Speter * opaque URI that the client should send all custom REPORT requests
120251881Speter * against.
121251881Speter * @since New in 1.7.  */
122251881Speter#define SVN_DAV_ME_RESOURCE_HEADER "SVN-Me-Resource"
123251881Speter
124251881Speter/** This header provides the repository root URI, suitable for use in
125251881Speter * calculating the relative paths of other public URIs for this
126251881Speter * repository into .  (HTTP protocol v2 only)
127251881Speter * @since New in 1.7.  */
128251881Speter#define SVN_DAV_ROOT_URI_HEADER "SVN-Repository-Root"
129251881Speter
130251881Speter/** This header provides an opaque URI that the client can append a
131251881Speter * revision to, to construct a 'revision URL'.  This allows direct
132251881Speter * read/write access to revprops via PROPFIND or PROPPATCH, and is
133251881Speter * similar to libsvn_fs's revision objects (as distinct from "revision
134251881Speter * roots").  (HTTP protocol v2 only)
135251881Speter * @since New in 1.7.  */
136251881Speter#define SVN_DAV_REV_STUB_HEADER "SVN-Rev-Stub"
137251881Speter
138251881Speter/** This header provides an opaque URI that the client can append
139251881Speter * PEGREV/PATH to, in order to construct URIs of pegged objects in the
140251881Speter * repository, similar to the use of a "revision root" in the
141251881Speter * libsvn_fs API.  (HTTP protocol v2 only)
142251881Speter * @since New in 1.7.  */
143251881Speter#define SVN_DAV_REV_ROOT_STUB_HEADER "SVN-Rev-Root-Stub"
144251881Speter
145251881Speter/** This header provides an opaque URI which represents a Subversion
146251881Speter * transaction (revision-in-progress) object.  It is suitable for use
147251881Speter * in fetching and modifying transaction properties as part of a
148251881Speter * commit process, similar to the svn_fs_txn_t object (as distinct
149251881Speter * from a "txn root").  (HTTP protocol v2 only)
150251881Speter * @since New in 1.7.  */
151251881Speter#define SVN_DAV_TXN_STUB_HEADER "SVN-Txn-Stub"
152251881Speter
153251881Speter/** Companion to @c SVN_DAV_TXN_STUB_HEADER, used when a POST request
154251881Speter *  returns @c SVN_DAV_VTXN_NAME_HEADER in response to a client
155251881Speter *  supplied name.  (HTTP protocol v2 only)
156251881Speter * @since New in 1.7.  */
157251881Speter#define SVN_DAV_VTXN_STUB_HEADER "SVN-VTxn-Stub"
158251881Speter
159251881Speter/** This header provides an opaque URI which represents the root
160251881Speter * directory of a Subversion transaction (revision-in-progress),
161251881Speter * similar to the concept of a "txn root" in the libsvn_fs API.  The
162251881Speter * client can append additional path segments to it to access items
163251881Speter * deeper in the transaction tree as part of a commit process.  (HTTP
164251881Speter * protocol v2 only)
165251881Speter * @since New in 1.7.  */
166251881Speter#define SVN_DAV_TXN_ROOT_STUB_HEADER "SVN-Txn-Root-Stub"
167251881Speter
168251881Speter/** Companion to @c SVN_DAV_TXN_ROOT_STUB_HEADER, used when a POST
169251881Speter *  request returns @c SVN_DAV_VTXN_NAME_HEADER in response to a
170251881Speter *  client supplied name.  (HTTP protocol v2 only)
171251881Speter * @since New in 1.7.  */
172251881Speter#define SVN_DAV_VTXN_ROOT_STUB_HEADER "SVN-VTxn-Root-Stub"
173251881Speter
174251881Speter/** This header is used in the POST response to tell the client the
175251881Speter * name of the Subversion transaction created by the request.  It can
176251881Speter * then be appended to the transaction stub and transaction root stub
177251881Speter * for access to the properties and paths, respectively, of the named
178251881Speter * transaction.  (HTTP protocol v2 only)
179251881Speter * @since New in 1.7.  */
180251881Speter#define SVN_DAV_TXN_NAME_HEADER "SVN-Txn-Name"
181251881Speter
182251881Speter/** This header is used in the POST request, to pass a client supplied
183251881Speter * alternative transaction name to the server, and in the POST
184251881Speter * response, to tell the client that the alternative transaction
185251881Speter * resource names should be used.  (HTTP protocol v2 only)
186251881Speter * @since New in 1.7.  */
187251881Speter#define SVN_DAV_VTXN_NAME_HEADER "SVN-VTxn-Name"
188251881Speter
189251881Speter/** This header is used in the OPTIONS response to identify named
190251881Speter * skel-based POST request types which the server is prepared to
191251881Speter * handle.  (HTTP protocol v2 only)
192251881Speter * @since New in 1.8.   */
193251881Speter#define SVN_DAV_SUPPORTED_POSTS_HEADER "SVN-Supported-Posts"
194251881Speter
195251881Speter/** This header is used in the OPTIONS response to indicate if the server
196251881Speter * wants bulk update requests (Prefer) or only accepts skelta requests (Off).
197251881Speter * If this value is On both options are allowed.
198251881Speter * @since New in 1.8.   */
199251881Speter#define SVN_DAV_ALLOW_BULK_UPDATES "SVN-Allow-Bulk-Updates"
200251881Speter
201251881Speter/** Assuming the request target is a Subversion repository resource,
202251881Speter * this header is returned in the OPTIONS response to indicate whether
203251881Speter * the repository supports the merge tracking feature ("yes") or not
204251881Speter * ("no").
205251881Speter * @since New in 1.8.  */
206251881Speter#define SVN_DAV_REPOSITORY_MERGEINFO "SVN-Repository-MergeInfo"
207251881Speter
208251881Speter/**
209251881Speter * @name Fulltext MD5 headers
210251881Speter *
211251881Speter * These headers are for client and server to verify that the base
212251881Speter * and the result of a change transmission are the same on both
213251881Speter * sides, regardless of what transformations (svndiff deltification,
214251881Speter * gzipping, etc) the data may have gone through in between.
215251881Speter *
216251881Speter * The result md5 is always used whenever file contents are
217251881Speter * transferred, because every transmission has a resulting text.
218251881Speter *
219251881Speter * The base md5 is used to verify the base text against which svndiff
220251881Speter * data is being applied.  Note that even for svndiff transmissions,
221251881Speter * base verification is not strictly necessary (and may therefore be
222251881Speter * unimplemented), as any error will be caught by the verification of
223251881Speter * the final result.  However, if the problem is that the base text is
224251881Speter * corrupt, the error will be caught earlier if the base md5 is used.
225251881Speter *
226251881Speter * Normal WebDAV or DeltaV clients don't use these.
227251881Speter * @{
228251881Speter */
229251881Speter#define SVN_DAV_BASE_FULLTEXT_MD5_HEADER "X-SVN-Base-Fulltext-MD5"
230251881Speter#define SVN_DAV_RESULT_FULLTEXT_MD5_HEADER "X-SVN-Result-Fulltext-MD5"
231251881Speter/** @} */
232251881Speter
233251881Speter/* ### should add strings for the various XML elements in the reports
234251881Speter   ### and things. also the custom prop names. etc.
235251881Speter*/
236251881Speter
237251881Speter/** The svn-specific object that is placed within a <D:error> response.
238251881Speter *
239251881Speter * @defgroup svn_dav_error Errors in svn_dav
240251881Speter * @{ */
241251881Speter
242251881Speter/** The error object's namespace */
243251881Speter#define SVN_DAV_ERROR_NAMESPACE "svn:"
244251881Speter
245251881Speter/** The error object's tag */
246251881Speter#define SVN_DAV_ERROR_TAG       "error"
247251881Speter
248251881Speter/** @} */
249251881Speter
250251881Speter
251251881Speter/** General property (xml) namespaces that will be used by both ra_dav
252251881Speter * and mod_dav_svn for marshalling properties.
253251881Speter *
254251881Speter * @defgroup svn_dav_property_xml_namespaces DAV property namespaces
255251881Speter * @{
256251881Speter */
257251881Speter
258251881Speter/** A property stored in the fs and wc, begins with 'svn:', and is
259251881Speter * interpreted either by client or server.
260251881Speter */
261251881Speter#define SVN_DAV_PROP_NS_SVN "http://subversion.tigris.org/xmlns/svn/"
262251881Speter
263251881Speter/** A property stored in the fs and wc, but totally ignored by svn
264251881Speter * client and server.
265251881Speter *
266251881Speter * A property simply invented by the users.
267251881Speter */
268251881Speter#define SVN_DAV_PROP_NS_CUSTOM "http://subversion.tigris.org/xmlns/custom/"
269251881Speter
270251881Speter/** A property purely generated and consumed by the network layer, not
271251881Speter * seen by either fs or wc.
272251881Speter */
273251881Speter#define SVN_DAV_PROP_NS_DAV "http://subversion.tigris.org/xmlns/dav/"
274251881Speter
275251881Speter
276251881Speter/**
277251881Speter * @name Custom (extension) values for the DAV header.
278251881Speter * Note that although these share the SVN_DAV_PROP_NS_DAV namespace
279251881Speter * prefix, they are not properties; they are header values.
280251881Speter * @{
281251881Speter */
282251881Speter
283251881Speter/* ##################################################################
284251881Speter *
285251881Speter *    WARNING:  At least some versions of Microsoft's Web Folders
286251881Speter *              WebDAV client implementation are unable to handle
287251881Speter *              DAV: headers with values longer than 63 characters,
288251881Speter *              so please keep these strings within that limit.
289251881Speter *
290251881Speter * ##################################################################
291251881Speter */
292251881Speter
293251881Speter
294251881Speter/** Presence of this in a DAV header in an OPTIONS request or response
295251881Speter * indicates that the transmitter supports @c svn_depth_t.
296251881Speter *
297251881Speter * @since New in 1.5.
298251881Speter */
299251881Speter#define SVN_DAV_NS_DAV_SVN_DEPTH\
300251881Speter            SVN_DAV_PROP_NS_DAV "svn/depth"
301251881Speter
302251881Speter/** Presence of this in a DAV header in an OPTIONS request or response
303251881Speter * indicates that the server knows how to handle merge-tracking
304251881Speter * information.
305251881Speter *
306251881Speter * Note that this says nothing about whether the repository can handle
307251881Speter * mergeinfo, only whether the server does.  For more information, see
308251881Speter * mod_dav_svn/version.c:get_vsn_options().
309251881Speter *
310251881Speter * @since New in 1.5.
311251881Speter */
312251881Speter#define SVN_DAV_NS_DAV_SVN_MERGEINFO\
313251881Speter            SVN_DAV_PROP_NS_DAV "svn/mergeinfo"
314251881Speter
315251881Speter/** Presence of this in a DAV header in an OPTIONS response indicates
316251881Speter * that the transmitter (in this case, the server) knows how to send
317251881Speter * custom revprops in log responses.
318251881Speter *
319251881Speter * @since New in 1.5.
320251881Speter */
321251881Speter#define SVN_DAV_NS_DAV_SVN_LOG_REVPROPS\
322251881Speter            SVN_DAV_PROP_NS_DAV "svn/log-revprops"
323251881Speter
324251881Speter/** Presence of this in a DAV header in an OPTIONS response indicates
325251881Speter * that the transmitter (in this case, the server) knows how to handle
326251881Speter * a replay of a directory in the repository (not root).
327251881Speter *
328251881Speter * @since New in 1.5.
329251881Speter */
330251881Speter#define SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY\
331251881Speter            SVN_DAV_PROP_NS_DAV "svn/partial-replay"
332251881Speter
333251881Speter/** Presence of this in a DAV header in an OPTIONS response indicates
334251881Speter * that the transmitter (in this case, the server) knows how to enforce
335251881Speter * old-value atomicity in PROPPATCH (for editing revprops).
336251881Speter *
337251881Speter * @since New in 1.7.
338251881Speter */
339251881Speter#define SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS\
340251881Speter            SVN_DAV_PROP_NS_DAV "svn/atomic-revprops"
341251881Speter
342251881Speter/** Presence of this in a DAV header in an OPTIONS response indicates
343251881Speter * that the transmitter (in this case, the server) knows how to get
344251881Speter * inherited properties.
345251881Speter *
346251881Speter * @since New in 1.8.
347251881Speter */
348251881Speter#define SVN_DAV_NS_DAV_SVN_INHERITED_PROPS\
349251881Speter            SVN_DAV_PROP_NS_DAV "svn/inherited-props"
350251881Speter
351251881Speter/** Presence of this in a DAV header in an OPTIONS response indicates
352251881Speter * that the transmitter (in this case, the server) knows how to
353251881Speter * properly handle ephemeral (that is, deleted-just-before-commit) FS
354251881Speter * transaction properties.
355251881Speter *
356251881Speter * @since New in 1.8.
357251881Speter */
358251881Speter#define SVN_DAV_NS_DAV_SVN_EPHEMERAL_TXNPROPS\
359251881Speter            SVN_DAV_PROP_NS_DAV "svn/ephemeral-txnprops"
360251881Speter
361251881Speter/** Presence of this in a DAV header in an OPTIONS response indicates
362251881Speter * that the transmitter (in this case, the server) supports serving
363251881Speter * properties inline in update editor when 'send-all' is 'false'.
364251881Speter *
365251881Speter * @since New in 1.8.
366251881Speter */
367251881Speter#define SVN_DAV_NS_DAV_SVN_INLINE_PROPS\
368251881Speter            SVN_DAV_PROP_NS_DAV "svn/inline-props"
369251881Speter
370251881Speter/** Presence of this in a DAV header in an OPTIONS response indicates
371251881Speter * that the transmitter (in this case, the server) knows how to handle
372251881Speter * a replay of a revision resource.  Transmitters must be
373251881Speter * HTTP-v2-enabled to support this feature.
374251881Speter *
375251881Speter * @since New in 1.8.
376251881Speter */
377251881Speter#define SVN_DAV_NS_DAV_SVN_REPLAY_REV_RESOURCE\
378251881Speter            SVN_DAV_PROP_NS_DAV "svn/replay-rev-resource"
379251881Speter
380251881Speter/** Presence of this in a DAV header in an OPTIONS response indicates
381251881Speter * that the transmitter (in this case, the server) knows how to handle
382251881Speter * a reversed fetch of file versions.
383251881Speter *
384251881Speter * @since New in 1.8.
385251881Speter */
386251881Speter#define SVN_DAV_NS_DAV_SVN_REVERSE_FILE_REVS\
387251881Speter            SVN_DAV_PROP_NS_DAV "svn/reverse-file-revs"
388251881Speter
389362181Sdim/** Presence of this in a DAV header in an OPTIONS response indicates
390362181Sdim * that the transmitter (in this case, the server) knows how to handle
391362181Sdim * svndiff1 format encoding.
392362181Sdim *
393362181Sdim * @since New in 1.10.
394362181Sdim */
395362181Sdim#define SVN_DAV_NS_DAV_SVN_SVNDIFF1\
396362181Sdim            SVN_DAV_PROP_NS_DAV "svn/svndiff1"
397251881Speter
398362181Sdim/** Presence of this in a DAV header in an OPTIONS response indicates
399362181Sdim * that the transmitter (in this case, the server) knows how to handle
400362181Sdim * 'list' requests.
401362181Sdim *
402362181Sdim * @since New in 1.10.
403362181Sdim */
404362181Sdim#define SVN_DAV_NS_DAV_SVN_LIST\
405362181Sdim            SVN_DAV_PROP_NS_DAV "svn/list"
406362181Sdim
407362181Sdim/** Presence of this in a DAV header in an OPTIONS response indicates
408362181Sdim * that the transmitter (in this case, the server) knows how to handle
409362181Sdim * svndiff2 format encoding.
410362181Sdim *
411362181Sdim * @since New in 1.10.
412362181Sdim */
413362181Sdim#define SVN_DAV_NS_DAV_SVN_SVNDIFF2\
414362181Sdim            SVN_DAV_PROP_NS_DAV "svn/svndiff2"
415362181Sdim
416362181Sdim/** Presence of this in a DAV header in an OPTIONS response indicates
417362181Sdim * that the transmitter (in this case, the server) sends the result
418362181Sdim * checksum in the response to a successful PUT request.
419362181Sdim *
420362181Sdim * @since New in 1.10.
421362181Sdim */
422362181Sdim#define SVN_DAV_NS_DAV_SVN_PUT_RESULT_CHECKSUM\
423362181Sdim            SVN_DAV_PROP_NS_DAV "svn/put-result-checksum"
424362181Sdim
425251881Speter/** @} */
426251881Speter
427251881Speter/** @} */
428251881Speter
429251881Speter#ifdef __cplusplus
430251881Speter}
431251881Speter#endif /* __cplusplus */
432251881Speter
433251881Speter#endif  /* SVN_DAV_H */
434