Remove no-longer-used svn_*_get_mergeinfo_for_tree APIs.
[svn.git] / subversion / svnserve / server.h
blobb008201de960ab873f630ff166e2aaa6fdb3aeea
1 /*
2 * svn_server.h : declarations for the svn server
4 * ====================================================================
5 * Copyright (c) 2000-2006 CollabNet. All rights reserved.
7 * This software is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at http://subversion.tigris.org/license-1.html.
10 * If newer versions of this license are posted there, you may use a
11 * newer version instead, at your option.
13 * This software consists of voluntary contributions made by many
14 * individuals. For exact contribution history, see the revision
15 * history and logs, available at http://subversion.tigris.org/.
16 * ====================================================================
21 #ifndef SERVER_H
22 #define SERVER_H
24 #include <apr_network_io.h>
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
30 #include "svn_repos.h"
32 typedef struct server_baton_t {
33 svn_repos_t *repos;
34 svn_fs_t *fs; /* For convenience; same as svn_repos_fs(repos) */
35 svn_config_t *cfg; /* Parsed repository svnserve.conf */
36 svn_config_t *pwdb; /* Parsed password database */
37 svn_authz_t *authzdb; /* Parsed authz rules */
38 const char *authz_repos_name; /* The name of the repository */
39 const char *realm; /* Authentication realm */
40 const char *repos_url; /* URL to base of repository */
41 svn_stringbuf_t *fs_path;/* Decoded base in-repos path (w/ leading slash) */
42 const char *user;
43 svn_boolean_t tunnel; /* Tunneled through login agent */
44 const char *tunnel_user; /* Allow EXTERNAL to authenticate as this */
45 svn_boolean_t read_only; /* Disallow write access (global flag) */
46 #ifdef SVN_HAVE_SASL
47 svn_boolean_t use_sasl; /* Use Cyrus SASL for authentication */
48 #endif
49 apr_pool_t *pool;
50 } server_baton_t;
52 enum authn_type { UNAUTHENTICATED, AUTHENTICATED };
53 enum access_type { NO_ACCESS, READ_ACCESS, WRITE_ACCESS };
55 enum access_type get_access(server_baton_t *b, enum authn_type auth);
57 typedef struct serve_params_t {
58 /* The virtual root of the repositories to serve. The client URL
59 path is interpreted relative to this root and is not allowed to
60 escape it. */
61 const char *root;
63 /* True if the connection is tunneled over an ssh-like transport,
64 such that the client may use EXTERNAL to authenticate as the
65 current uid's username. */
66 svn_boolean_t tunnel;
68 /* If tunnel is true, overrides the current uid's username as the
69 identity EXTERNAL authenticates as. */
70 const char *tunnel_user;
72 /* True if the read-only flag was specified on the command-line,
73 which forces all connections to be read-only. */
74 svn_boolean_t read_only;
76 /* A parsed repository svnserve configuration file, ala
77 svnserve.conf. If this is NULL, then no configuration file was
78 specified on the command line. If this is non-NULL, then
79 per-repository svnserve.conf are not read. */
80 svn_config_t *cfg;
82 /* A parsed repository password database. If this is NULL, then
83 either no svnserve configuration file was specified on the
84 command line, or it was specified and it did not refer to a
85 password database. */
86 svn_config_t *pwdb;
88 /* A parsed repository authorization database. If this is NULL,
89 then either no svnserve configuration file was specified on the
90 command line, or it was specified and it did not refer to a
91 authorization database. */
92 svn_authz_t *authzdb;
93 } serve_params_t;
95 /* Serve the connection CONN according to the parameters PARAMS. */
96 svn_error_t *serve(svn_ra_svn_conn_t *conn, serve_params_t *params,
97 apr_pool_t *pool);
99 /* Load a svnserve configuration file located at FILENAME into CFG,
100 any referenced password database into PWDB and any referenced
101 authorization database into AUTHZDB. If MUST_EXIST is true and
102 FILENAME does not exist, then this returns an error. BASE may be
103 specified as the base path to any referenced password and
104 authorization files found in FILENAME. */
105 svn_error_t *load_configs(svn_config_t **cfg,
106 svn_config_t **pwdb,
107 svn_authz_t **authzdb,
108 const char *filename,
109 svn_boolean_t must_exist,
110 const char *base,
111 apr_pool_t *pool);
113 /* Initialize the Cyrus SASL library. POOL is used for allocations. */
114 svn_error_t *cyrus_init(apr_pool_t *pool);
116 /* Authenticate using Cyrus SASL. */
117 svn_error_t *cyrus_auth_request(svn_ra_svn_conn_t *conn,
118 apr_pool_t *pool,
119 server_baton_t *b,
120 enum access_type required,
121 svn_boolean_t needs_username);
123 #ifdef __cplusplus
125 #endif /* __cplusplus */
127 #endif /* SERVER_H */