Subversion 1.6.16

svn_auth.h

Go to the documentation of this file.
00001 /**
00002  * @copyright
00003  * ====================================================================
00004  * Copyright (c) 2002-2009 CollabNet.  All rights reserved.
00005  *
00006  * This software is licensed as described in the file COPYING, which
00007  * you should have received as part of this distribution.  The terms
00008  * are also available at http://subversion.tigris.org/license-1.html.
00009  * If newer versions of this license are posted there, you may use a
00010  * newer version instead, at your option.
00011  *
00012  * This software consists of voluntary contributions made by many
00013  * individuals.  For exact contribution history, see the revision
00014  * history and logs, available at http://subversion.tigris.org/.
00015  * ====================================================================
00016  * @endcopyright
00017  *
00018  * @file svn_auth.h
00019  * @brief Subversion's authentication system
00020  */
00021 
00022 #ifndef SVN_AUTH_H
00023 #define SVN_AUTH_H
00024 
00025 #include <apr.h>
00026 #include <apr_pools.h>
00027 #include <apr_hash.h>
00028 #include <apr_tables.h>
00029 
00030 #include "svn_types.h"
00031 #include "svn_config.h"
00032 #include "svn_version.h"
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif /* __cplusplus */
00037 
00038 /** Overview of the svn authentication system.
00039  *
00040  * We define an authentication "provider" as a module that is able to
00041  * return a specific set of credentials. (e.g. username/password,
00042  * certificate, etc.)  Each provider implements a vtable that
00043  *
00044  * - can fetch initial credentials
00045  * - can retry the fetch (or try to fetch something different)
00046  * - can store the credentials for future use
00047  *
00048  * For any given type of credentials, there can exist any number of
00049  * separate providers -- each provider has a different method of
00050  * fetching. (i.e. from a disk store, by prompting the user, etc.)
00051  *
00052  * The application begins by creating an auth baton object, and
00053  * "registers" some number of providers with the auth baton, in a
00054  * specific order.  (For example, it may first register a
00055  * username/password provider that looks in disk store, then register
00056  * a username/password provider that prompts the user.)
00057  *
00058  * Later on, when any svn library is challenged, it asks the auth
00059  * baton for the specific credentials.  If the initial credentials
00060  * fail to authenticate, the caller keeps requesting new credentials.
00061  * Under the hood, libsvn_auth effectively "walks" over each provider
00062  * (in order of registry), one at a time, until all the providers have
00063  * exhausted all their retry options.
00064  *
00065  * This system allows an application to flexibly define authentication
00066  * behaviors (by changing registration order), and very easily write
00067  * new authentication providers.
00068  *
00069  * An auth_baton also contains an internal hashtable of run-time
00070  * parameters; any provider or library layer can set these run-time
00071  * parameters at any time, so that the provider has access to the
00072  * data.  (For example, certain run-time data may not be available
00073  * until an authentication challenge is made.)  Each credential type
00074  * must document the run-time parameters that are made available to
00075  * its providers.
00076  *
00077  * @defgroup auth_fns Authentication functions
00078  * @{
00079  */
00080 
00081 
00082 /** The type of a Subversion authentication object */
00083 typedef struct svn_auth_baton_t svn_auth_baton_t;
00084 
00085 /** The type of a Subversion authentication-iteration object */
00086 typedef struct svn_auth_iterstate_t svn_auth_iterstate_t;
00087 
00088 
00089 /** The main authentication "provider" vtable. */
00090 typedef struct svn_auth_provider_t
00091 {
00092   /** The kind of credentials this provider knows how to retrieve. */
00093   const char *cred_kind;
00094 
00095   /** Get an initial set of credentials.
00096    *
00097    * Set @a *credentials to a set of valid credentials within @a
00098    * realmstring, or NULL if no credentials are available.  Set @a
00099    * *iter_baton to context that allows a subsequent call to @c
00100    * next_credentials, in case the first credentials fail to
00101    * authenticate.  @a provider_baton is general context for the
00102    * vtable, @a parameters contains any run-time data that the
00103    * provider may need, and @a realmstring comes from the
00104    * svn_auth_first_credentials() call.
00105    */
00106   svn_error_t * (*first_credentials)(void **credentials,
00107                                      void **iter_baton,
00108                                      void *provider_baton,
00109                                      apr_hash_t *parameters,
00110                                      const char *realmstring,
00111                                      apr_pool_t *pool);
00112 
00113   /** Get a different set of credentials.
00114    *
00115    * Set @a *credentials to another set of valid credentials (using @a
00116    * iter_baton as the context from previous call to first_credentials
00117    * or next_credentials).  If no more credentials are available, set
00118    * @a *credentials to NULL.  If the provider only has one set of
00119    * credentials, this function pointer should simply be NULL. @a
00120    * provider_baton is general context for the vtable, @a parameters
00121    * contains any run-time data that the provider may need, and @a
00122    * realmstring comes from the svn_auth_first_credentials() call.
00123    */
00124   svn_error_t * (*next_credentials)(void **credentials,
00125                                     void *iter_baton,
00126                                     void *provider_baton,
00127                                     apr_hash_t *parameters,
00128                                     const char *realmstring,
00129                                     apr_pool_t *pool);
00130 
00131   /** Save credentials.
00132    *
00133    * Store @a credentials for future use.  @a provider_baton is
00134    * general context for the vtable, and @a parameters contains any
00135    * run-time data the provider may need.  Set @a *saved to TRUE if
00136    * the save happened, or FALSE if not.  The provider is not required
00137    * to save; if it refuses or is unable to save for non-fatal
00138    * reasons, return FALSE.  If the provider never saves data, then
00139    * this function pointer should simply be NULL. @a realmstring comes
00140    * from the svn_auth_first_credentials() call.
00141    */
00142   svn_error_t * (*save_credentials)(svn_boolean_t *saved,
00143                                     void *credentials,
00144                                     void *provider_baton,
00145                                     apr_hash_t *parameters,
00146                                     const char *realmstring,
00147                                     apr_pool_t *pool);
00148 
00149 } svn_auth_provider_t;
00150 
00151 
00152 /** A provider object, ready to be put into an array and given to
00153     svn_auth_open(). */
00154 typedef struct svn_auth_provider_object_t
00155 {
00156   const svn_auth_provider_t *vtable;
00157   void *provider_baton;
00158 
00159 } svn_auth_provider_object_t;
00160 
00161 /** The type of function returning authentication provider. */
00162 typedef void (*svn_auth_simple_provider_func_t)
00163   (svn_auth_provider_object_t **provider,
00164    apr_pool_t *pool);
00165 
00166 
00167 /** Specific types of credentials **/
00168 
00169 /** Simple username/password pair credential kind.
00170  *
00171  * The following auth parameters are available to the providers:
00172  *
00173  * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_CONFIG (@c svn_config_t*)
00174  * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS (@c svn_config_t*)
00175  *
00176  * The following auth parameters may be available to the providers:
00177  *
00178  * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*)
00179  * - @c SVN_AUTH_PARAM_DEFAULT_USERNAME (@c char*)
00180  * - @c SVN_AUTH_PARAM_DEFAULT_PASSWORD (@c char*)
00181  */
00182 #define SVN_AUTH_CRED_SIMPLE "svn.simple"
00183 
00184 /** @c SVN_AUTH_CRED_SIMPLE credentials. */
00185 typedef struct svn_auth_cred_simple_t
00186 {
00187   /** Username */
00188   const char *username;
00189   /** Password */
00190   const char *password;
00191   /** Indicates if the credentials may be saved (to disk). For example, a
00192    * GUI prompt implementation with a remember password checkbox shall set
00193    * @a may_save to TRUE if the checkbox is checked.
00194    */
00195   svn_boolean_t may_save;
00196 } svn_auth_cred_simple_t;
00197 
00198 
00199 /** Username credential kind.
00200  *
00201  * The following optional auth parameters are relevant to the providers:
00202  *
00203  * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*)
00204  * - @c SVN_AUTH_PARAM_DEFAULT_USERNAME (@c char*)
00205  */
00206 #define SVN_AUTH_CRED_USERNAME "svn.username"
00207 
00208 /** @c SVN_AUTH_CRED_USERNAME credentials. */
00209 typedef struct svn_auth_cred_username_t
00210 {
00211   /** Username */
00212   const char *username;
00213   /** Indicates if the credentials may be saved (to disk). For example, a
00214    * GUI prompt implementation with a remember username checkbox shall set
00215    * @a may_save to TRUE if the checkbox is checked.
00216    */
00217   svn_boolean_t may_save;
00218 } svn_auth_cred_username_t;
00219 
00220 
00221 /** SSL client certificate credential type.
00222  *
00223  * The following auth parameters are available to the providers:
00224  *
00225  * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS (@c svn_config_t*)
00226  * - @c SVN_AUTH_PARAM_SERVER_GROUP (@c char*)
00227  *
00228  * The following optional auth parameters are relevant to the providers:
00229  *
00230  * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*)
00231  */
00232 #define SVN_AUTH_CRED_SSL_CLIENT_CERT "svn.ssl.client-cert"
00233 
00234 /** @c SVN_AUTH_CRED_SSL_CLIENT_CERT credentials. */
00235 typedef struct svn_auth_cred_ssl_client_cert_t
00236 {
00237   /** Absolute path to the certificate file */
00238   const char *cert_file;
00239   /** Indicates if the credentials may be saved (to disk). For example, a
00240    * GUI prompt implementation with a remember certificate checkbox shall
00241    * set @a may_save to TRUE if the checkbox is checked.
00242    */
00243   svn_boolean_t may_save;
00244 } svn_auth_cred_ssl_client_cert_t;
00245 
00246 
00247 /** A function returning an SSL client certificate passphrase provider. */
00248 typedef void (*svn_auth_ssl_client_cert_pw_provider_func_t)
00249   (svn_auth_provider_object_t **provider,
00250    apr_pool_t *pool);
00251 
00252 /** SSL client certificate passphrase credential type.
00253  *
00254  * @note The realmstring used with this credential type must be a name that
00255  * makes it possible for the user to identify the certificate.
00256  *
00257  * The following auth parameters are available to the providers:
00258  *
00259  * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_CONFIG (@c svn_config_t*)
00260  * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS (@c svn_config_t*)
00261  * - @c SVN_AUTH_PARAM_SERVER_GROUP (@c char*)
00262  *
00263  * The following optional auth parameters are relevant to the providers:
00264  *
00265  * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*)
00266  */
00267 #define SVN_AUTH_CRED_SSL_CLIENT_CERT_PW "svn.ssl.client-passphrase"
00268 
00269 /** @c SVN_AUTH_CRED_SSL_CLIENT_CERT_PW credentials. */
00270 typedef struct svn_auth_cred_ssl_client_cert_pw_t
00271 {
00272   /** Certificate password */
00273   const char *password;
00274   /** Indicates if the credentials may be saved (to disk). For example, a
00275    * GUI prompt implementation with a remember password checkbox shall set
00276    * @a may_save to TRUE if the checkbox is checked.
00277    */
00278   svn_boolean_t may_save;
00279 } svn_auth_cred_ssl_client_cert_pw_t;
00280 
00281 
00282 /** SSL server verification credential type.
00283  *
00284  * The following auth parameters are available to the providers:
00285  *
00286  * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS (@c svn_config_t*)
00287  * - @c SVN_AUTH_PARAM_SERVER_GROUP (@c char*)
00288  * - @c SVN_AUTH_PARAM_SSL_SERVER_FAILURES (@c apr_uint32_t*)
00289  * - @c SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO
00290  *      (@c svn_auth_ssl_server_cert_info_t*)
00291  *
00292  * The following optional auth parameters are relevant to the providers:
00293  *
00294  * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*)
00295  */
00296 #define SVN_AUTH_CRED_SSL_SERVER_TRUST "svn.ssl.server"
00297 
00298 /** SSL server certificate information used by @c
00299  * SVN_AUTH_CRED_SSL_SERVER_TRUST providers.
00300  */
00301 typedef struct svn_auth_ssl_server_cert_info_t
00302 {
00303   /** Primary CN */
00304   const char *hostname;
00305   /** ASCII fingerprint */
00306   const char *fingerprint;
00307   /** ASCII date from which the certificate is valid */
00308   const char *valid_from;
00309   /** ASCII date until which the certificate is valid */
00310   const char *valid_until;
00311   /** DN of the certificate issuer */
00312   const char *issuer_dname;
00313   /** Base-64 encoded DER certificate representation */
00314   const char *ascii_cert;
00315 } svn_auth_ssl_server_cert_info_t;
00316 
00317 /**
00318  * Return a deep copy of @a info, allocated in @a pool.
00319  *
00320  * @since New in 1.3.
00321  */
00322 svn_auth_ssl_server_cert_info_t *
00323 svn_auth_ssl_server_cert_info_dup(const svn_auth_ssl_server_cert_info_t *info,
00324                                   apr_pool_t *pool);
00325 
00326 /** @c SVN_AUTH_CRED_SSL_SERVER_TRUST credentials. */
00327 typedef struct svn_auth_cred_ssl_server_trust_t
00328 {
00329   /** Indicates if the credentials may be saved (to disk). For example, a
00330    * GUI prompt implementation with a checkbox to accept the certificate
00331    * permanently shall set @a may_save to TRUE if the checkbox is checked.
00332    */
00333   svn_boolean_t may_save;
00334   /** Bit mask of the accepted failures */
00335   apr_uint32_t accepted_failures;
00336 } svn_auth_cred_ssl_server_trust_t;
00337 
00338 
00339 
00340 /** Credential-constructing prompt functions. **/
00341 
00342 /** These exist so that different client applications can use
00343  * different prompt mechanisms to supply the same credentials.  For
00344  * example, if authentication requires a username and password, a
00345  * command-line client's prompting function might prompt first for the
00346  * username and then for the password, whereas a GUI client's would
00347  * present a single dialog box asking for both, and a telepathic
00348  * client's would read all the information directly from the user's
00349  * mind.  All these prompting functions return the same type of
00350  * credential, but the information used to construct the credential is
00351  * gathered in an interface-specific way in each case.
00352  */
00353 
00354 /** Set @a *cred by prompting the user, allocating @a *cred in @a pool.
00355  * @a baton is an implementation-specific closure.
00356  *
00357  * If @a realm is non-NULL, maybe use it in the prompt string.
00358  *
00359  * If @a username is non-NULL, then the user might be prompted only
00360  * for a password, but @a *cred would still be filled with both
00361  * username and password.  For example, a typical usage would be to
00362  * pass @a username on the first call, but then leave it NULL for
00363  * subsequent calls, on the theory that if credentials failed, it's
00364  * as likely to be due to incorrect username as incorrect password.
00365  *
00366  * If @a may_save is FALSE, the auth system does not allow the credentials
00367  * to be saved (to disk). A prompt function shall not ask the user if the
00368  * credentials shall be saved if @a may_save is FALSE. For example, a GUI
00369  * client with a remember password checkbox would grey out the checkbox if
00370  * @a may_save is FALSE.
00371  */
00372 typedef svn_error_t *(*svn_auth_simple_prompt_func_t)
00373   (svn_auth_cred_simple_t **cred,
00374    void *baton,
00375    const char *realm,
00376    const char *username,
00377    svn_boolean_t may_save,
00378    apr_pool_t *pool);
00379 
00380 
00381 /** Set @a *cred by prompting the user, allocating @a *cred in @a pool.
00382  * @a baton is an implementation-specific closure.
00383  *
00384  * If @a realm is non-NULL, maybe use it in the prompt string.
00385  *
00386  * If @a may_save is FALSE, the auth system does not allow the credentials
00387  * to be saved (to disk). A prompt function shall not ask the user if the
00388  * credentials shall be saved if @a may_save is FALSE. For example, a GUI
00389  * client with a remember username checkbox would grey out the checkbox if
00390  * @a may_save is FALSE.
00391  */
00392 typedef svn_error_t *(*svn_auth_username_prompt_func_t)
00393   (svn_auth_cred_username_t **cred,
00394    void *baton,
00395    const char *realm,
00396    svn_boolean_t may_save,
00397    apr_pool_t *pool);
00398 
00399 
00400 /** @name SSL server certificate failure bits
00401  *
00402  * @note These values are stored in the on disk auth cache by the SSL
00403  * server certificate auth provider, so the meaning of these bits must
00404  * not be changed.
00405  * @{
00406  */
00407 /** Certificate is not yet valid. */
00408 #define SVN_AUTH_SSL_NOTYETVALID 0x00000001
00409 /** Certificate has expired. */
00410 #define SVN_AUTH_SSL_EXPIRED     0x00000002
00411 /** Certificate's CN (hostname) does not match the remote hostname. */
00412 #define SVN_AUTH_SSL_CNMISMATCH  0x00000004
00413 /** @brief Certificate authority is unknown (i.e. not trusted) */
00414 #define SVN_AUTH_SSL_UNKNOWNCA   0x00000008
00415 /** @brief Other failure. This can happen if neon has introduced a new
00416  * failure bit that we do not handle yet. */
00417 #define SVN_AUTH_SSL_OTHER       0x40000000
00418 /** @} */
00419 
00420 /** Set @a *cred by prompting the user, allocating @a *cred in @a pool.
00421  * @a baton is an implementation-specific closure.
00422  *
00423  * @a cert_info is a structure describing the server cert that was
00424  * presented to the client, and @a failures is a bitmask that
00425  * describes exactly why the cert could not be automatically validated,
00426  * composed from the constants SVN_AUTH_SSL_* (@c SVN_AUTH_SSL_NOTYETVALID
00427  * etc.).  @a realm is a string that can be used in the prompt string.
00428  *
00429  * If @a may_save is FALSE, the auth system does not allow the credentials
00430  * to be saved (to disk). A prompt function shall not ask the user if the
00431  * credentials shall be saved if @a may_save is FALSE. For example, a GUI
00432  * client with a trust permanently checkbox would grey out the checkbox if
00433  * @a may_save is FALSE.
00434  */
00435 typedef svn_error_t *(*svn_auth_ssl_server_trust_prompt_func_t)
00436   (svn_auth_cred_ssl_server_trust_t **cred,
00437    void *baton,
00438    const char *realm,
00439    apr_uint32_t failures,
00440    const svn_auth_ssl_server_cert_info_t *cert_info,
00441    svn_boolean_t may_save,
00442    apr_pool_t *pool);
00443 
00444 
00445 /** Set @a *cred by prompting the user, allocating @a *cred in @a pool.
00446  * @a baton is an implementation-specific closure.  @a realm is a string
00447  * that can be used in the prompt string.
00448  *
00449  * If @a may_save is FALSE, the auth system does not allow the credentials
00450  * to be saved (to disk). A prompt function shall not ask the user if the
00451  * credentials shall be saved if @a may_save is FALSE. For example, a GUI
00452  * client with a remember certificate checkbox would grey out the checkbox
00453  * if @a may_save is FALSE.
00454  */
00455 typedef svn_error_t *(*svn_auth_ssl_client_cert_prompt_func_t)
00456   (svn_auth_cred_ssl_client_cert_t **cred,
00457    void *baton,
00458    const char *realm,
00459    svn_boolean_t may_save,
00460    apr_pool_t *pool);
00461 
00462 
00463 /** Set @a *cred by prompting the user, allocating @a *cred in @a pool.
00464  * @a baton is an implementation-specific closure.  @a realm is a string
00465  * identifying the certificate, and can be used in the prompt string.
00466  *
00467  * If @a may_save is FALSE, the auth system does not allow the credentials
00468  * to be saved (to disk). A prompt function shall not ask the user if the
00469  * credentials shall be saved if @a may_save is FALSE. For example, a GUI
00470  * client with a remember password checkbox would grey out the checkbox if
00471  * @a may_save is FALSE.
00472  */
00473 typedef svn_error_t *(*svn_auth_ssl_client_cert_pw_prompt_func_t)
00474   (svn_auth_cred_ssl_client_cert_pw_t **cred,
00475    void *baton,
00476    const char *realm,
00477    svn_boolean_t may_save,
00478    apr_pool_t *pool);
00479 
00480 /** A type of callback function for asking whether storing a password to
00481  * disk in plaintext is allowed.
00482  *
00483  * In this callback, the client should ask the user whether storing
00484  * a password for the realm identified by @a realmstring to disk
00485  * in plaintext is allowed.
00486  *
00487  * The answer is returned in @a *may_save_plaintext.
00488  * @a baton is an implementation-specific closure.
00489  * All allocations should be done in @a pool.
00490  *
00491  * @since New in 1.6
00492  */
00493 typedef svn_error_t *(*svn_auth_plaintext_prompt_func_t)
00494   (svn_boolean_t *may_save_plaintext,
00495    const char *realmstring,
00496    void *baton,
00497    apr_pool_t *pool);
00498 
00499 /** A type of callback function for asking whether storing a passphrase to
00500  * disk in plaintext is allowed.
00501  *
00502  * In this callback, the client should ask the user whether storing
00503  * a passphrase for the realm identified by @a realmstring to disk
00504  * in plaintext is allowed.
00505  *
00506  * The answer is returned in @a *may_save_plaintext.
00507  * @a baton is an implementation-specific closure.
00508  * All allocations should be done in @a pool.
00509  *
00510  * @since New in 1.6
00511  */
00512 typedef svn_error_t *(*svn_auth_plaintext_passphrase_prompt_func_t)
00513   (svn_boolean_t *may_save_plaintext,
00514    const char *realmstring,
00515    void *baton,
00516    apr_pool_t *pool);
00517 
00518 
00519 /** Initialize an authentication system.
00520  *
00521  * Return an authentication object in @a *auth_baton (allocated in @a
00522  * pool) that represents a particular instance of the svn
00523  * authentication system.  @a providers is an array of @c
00524  * svn_auth_provider_object_t pointers, already allocated in @a pool
00525  * and intentionally ordered.  These pointers will be stored within @a
00526  * *auth_baton, grouped by credential type, and searched in this exact
00527  * order.
00528  */
00529 void
00530 svn_auth_open(svn_auth_baton_t **auth_baton,
00531               apr_array_header_t *providers,
00532               apr_pool_t *pool);
00533 
00534 /** Set an authentication run-time parameter.
00535  *
00536  * Store @a name / @a value pair as a run-time parameter in @a
00537  * auth_baton, making the data accessible to all providers.  @a name
00538  * and @a value will NOT be duplicated into the auth_baton's pool.
00539  * To delete a run-time parameter, pass NULL for @a value.
00540  */
00541 void
00542 svn_auth_set_parameter(svn_auth_baton_t *auth_baton,
00543                        const char *name,
00544                        const void *value);
00545 
00546 /** Get an authentication run-time parameter.
00547  *
00548  * Return a value for run-time parameter @a name from @a auth_baton.
00549  * Return NULL if the parameter doesn't exist.
00550  */
00551 const void *
00552 svn_auth_get_parameter(svn_auth_baton_t *auth_baton,
00553                        const char *name);
00554 
00555 /** Universal run-time parameters, made available to all providers.
00556 
00557     If you are writing a new provider, then to be a "good citizen",
00558     you should notice these global parameters!  Note that these
00559     run-time params should be treated as read-only by providers; the
00560     application is responsible for placing them into the auth_baton
00561     hash. */
00562 
00563 /** The auth-hash prefix indicating that the parameter is global. */
00564 #define SVN_AUTH_PARAM_PREFIX "svn:auth:"
00565 
00566 /**
00567  * @name Default credentials defines
00568  * Any 'default' credentials that came in through the application itself,
00569  * (e.g. --username and --password options). Property values are
00570  * const char *.
00571  * @{ */
00572 #define SVN_AUTH_PARAM_DEFAULT_USERNAME  SVN_AUTH_PARAM_PREFIX "username"
00573 #define SVN_AUTH_PARAM_DEFAULT_PASSWORD  SVN_AUTH_PARAM_PREFIX "password"
00574 /** @} */
00575 
00576 /** @brief The application doesn't want any providers to prompt
00577  * users. Property value is irrelevant; only property's existence
00578  * matters. */
00579 #define SVN_AUTH_PARAM_NON_INTERACTIVE  SVN_AUTH_PARAM_PREFIX "non-interactive"
00580 
00581 /** @brief The application doesn't want any providers to save passwords
00582  * to disk. Property value is irrelevant; only property's existence
00583  * matters. */
00584 #define SVN_AUTH_PARAM_DONT_STORE_PASSWORDS  SVN_AUTH_PARAM_PREFIX \
00585                                                  "dont-store-passwords"
00586 
00587 /** @brief Indicates whether providers may save passwords to disk in
00588  * plaintext. Property value can be either SVN_CONFIG_TRUE,
00589  * SVN_CONFIG_FALSE, or SVN_CONFIG_ASK. */
00590 #define SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS  SVN_AUTH_PARAM_PREFIX \
00591                                                   "store-plaintext-passwords"
00592 
00593 /** @brief The application doesn't want any providers to save passphrase
00594  * to disk. Property value is irrelevant; only property's existence
00595  * matters. */
00596 #define SVN_AUTH_PARAM_DONT_STORE_SSL_CLIENT_CERT_PP \
00597   SVN_AUTH_PARAM_PREFIX "dont-store-ssl-client-cert-pp"
00598 
00599 /** @brief Indicates whether providers may save passphrase to disk in
00600  * plaintext. Property value can be either SVN_CONFIG_TRUE,
00601  * SVN_CONFIG_FALSE, or SVN_CONFIG_ASK. */
00602 #define SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \
00603   SVN_AUTH_PARAM_PREFIX "store-ssl-client-cert-pp-plaintext"
00604 
00605 /** @brief The application doesn't want any providers to save credentials
00606  * to disk. Property value is irrelevant; only property's existence
00607  * matters. */
00608 #define SVN_AUTH_PARAM_NO_AUTH_CACHE  SVN_AUTH_PARAM_PREFIX "no-auth-cache"
00609 
00610 /** @brief The following property is for SSL server cert providers. This
00611  * provides a pointer to an @c apr_uint32_t containing the failures
00612  * detected by the certificate validator. */
00613 #define SVN_AUTH_PARAM_SSL_SERVER_FAILURES SVN_AUTH_PARAM_PREFIX \
00614   "ssl:failures"
00615 
00616 /** @brief The following property is for SSL server cert providers. This
00617  * provides the cert info (svn_auth_ssl_server_cert_info_t). */
00618 #define SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO SVN_AUTH_PARAM_PREFIX \
00619   "ssl:cert-info"
00620 
00621 /** Some providers need access to the @c svn_config_t configuration. */
00622 #define SVN_AUTH_PARAM_CONFIG_CATEGORY_CONFIG SVN_AUTH_PARAM_PREFIX "config-category-config"
00623 #define SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS SVN_AUTH_PARAM_PREFIX "config-category-servers"
00624 
00625 /** @deprecated Provided for backward compatibility with the 1.5 API. */
00626 #define SVN_AUTH_PARAM_CONFIG SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS
00627 
00628 /** The current server group. */
00629 #define SVN_AUTH_PARAM_SERVER_GROUP SVN_AUTH_PARAM_PREFIX "server-group"
00630 
00631 /** @brief A configuration directory that overrides the default
00632  * ~/.subversion. */
00633 #define SVN_AUTH_PARAM_CONFIG_DIR SVN_AUTH_PARAM_PREFIX "config-dir"
00634 
00635 /** Get an initial set of credentials.
00636  *
00637  * Ask @a auth_baton to set @a *credentials to a set of credentials
00638  * defined by @a cred_kind and valid within @a realmstring, or NULL if
00639  * no credentials are available.  Otherwise, return an iteration state
00640  * in @a *state, so that the caller can call
00641  * svn_auth_next_credentials(), in case the first set of credentials
00642  * fails to authenticate.
00643  *
00644  * Use @a pool to allocate @a *state, and for temporary allocation.
00645  * Note that @a *credentials will be allocated in @a auth_baton's pool.
00646  */
00647 svn_error_t *
00648 svn_auth_first_credentials(void **credentials,
00649                            svn_auth_iterstate_t **state,
00650                            const char *cred_kind,
00651                            const char *realmstring,
00652                            svn_auth_baton_t *auth_baton,
00653                            apr_pool_t *pool);
00654 
00655 /** Get another set of credentials, assuming previous ones failed to
00656  * authenticate.
00657  *
00658  * Use @a state to fetch a different set of @a *credentials, as a
00659  * follow-up to svn_auth_first_credentials() or
00660  * svn_auth_next_credentials().  If no more credentials are available,
00661  * set @a *credentials to NULL.
00662  *
00663  * Note that @a *credentials will be allocated in @c auth_baton's pool.
00664  */
00665 svn_error_t *
00666 svn_auth_next_credentials(void **credentials,
00667                           svn_auth_iterstate_t *state,
00668                           apr_pool_t *pool);
00669 
00670 /** Save a set of credentials.
00671  *
00672  * Ask @a state to store the most recently returned credentials,
00673  * presumably because they successfully authenticated.
00674  * All allocations should be done in @a pool.
00675  *
00676  * If no credentials were ever returned, do nothing.
00677  */
00678 svn_error_t *
00679 svn_auth_save_credentials(svn_auth_iterstate_t *state,
00680                           apr_pool_t *pool);
00681 
00682 /** @} */
00683 
00684 /** Set @a *provider to an authentication provider of type
00685  * svn_auth_cred_simple_t that gets information by prompting the user
00686  * with @a prompt_func and @a prompt_baton.  Allocate @a *provider in
00687  * @a pool.
00688  *
00689  * If both @c SVN_AUTH_PARAM_DEFAULT_USERNAME and
00690  * @c SVN_AUTH_PARAM_DEFAULT_PASSWORD are defined as runtime
00691  * parameters in the @c auth_baton, then @a *provider will return the
00692  * default arguments when svn_auth_first_credentials() is called.  If
00693  * svn_auth_first_credentials() fails, then @a *provider will
00694  * re-prompt @a retry_limit times (via svn_auth_next_credentials()).
00695  * For infinite retries, set @a retry_limit to value less than 0.
00696  *
00697  * @since New in 1.4.
00698  */
00699 void
00700 svn_auth_get_simple_prompt_provider(svn_auth_provider_object_t **provider,
00701                                     svn_auth_simple_prompt_func_t prompt_func,
00702                                     void *prompt_baton,
00703                                     int retry_limit,
00704                                     apr_pool_t *pool);
00705 
00706 
00707 /** Set @a *provider to an authentication provider of type @c
00708  * svn_auth_cred_username_t that gets information by prompting the
00709  * user with @a prompt_func and @a prompt_baton.  Allocate @a *provider
00710  * in @a pool.
00711  *
00712  * If @c SVN_AUTH_PARAM_DEFAULT_USERNAME is defined as a runtime
00713  * parameter in the @c auth_baton, then @a *provider will return the
00714  * default argument when svn_auth_first_credentials() is called.  If
00715  * svn_auth_first_credentials() fails, then @a *provider will
00716  * re-prompt @a retry_limit times (via svn_auth_next_credentials()).
00717  * For infinite retries, set @a retry_limit to value less than 0.
00718  *
00719  * @since New in 1.4.
00720  */
00721 void
00722 svn_auth_get_username_prompt_provider
00723   (svn_auth_provider_object_t **provider,
00724    svn_auth_username_prompt_func_t prompt_func,
00725    void *prompt_baton,
00726    int retry_limit,
00727    apr_pool_t *pool);
00728 
00729 
00730 /** Set @a *provider to an authentication provider of type @c
00731  * svn_auth_cred_simple_t that gets/sets information from the user's
00732  * ~/.subversion configuration directory.
00733  *
00734  * If the provider is going to save the password unencrypted, it calls @a
00735  * plaintext_prompt_func, passing @a prompt_baton, before saving the
00736  * password.
00737  *
00738  * If @a plaintext_prompt_func is NULL it is not called and the answer is
00739  * assumed to be TRUE. This matches the deprecated behaviour of storing
00740  * unencrypted passwords by default, and is only done this way for backward
00741  * compatibility reasons.
00742  * Client developers are highly encouraged to provide this callback
00743  * to ensure their users are made aware of the fact that their password
00744  * is going to be stored unencrypted. In the future, providers may
00745  * default to not storing the password unencrypted if this callback is NULL.
00746  *
00747  * Clients can however set the callback to NULL and set
00748  * SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS to SVN_CONFIG_FALSE or
00749  * SVN_CONFIG_TRUE to enforce a certain behaviour.
00750  *
00751  * Allocate @a *provider in @a pool.
00752  *
00753  * If a default username or password is available, @a *provider will
00754  * honor them as well, and return them when
00755  * svn_auth_first_credentials() is called.  (see @c
00756  * SVN_AUTH_PARAM_DEFAULT_USERNAME and @c
00757  * SVN_AUTH_PARAM_DEFAULT_PASSWORD).
00758  *
00759  * @since New in 1.6.
00760  */
00761 void
00762 svn_auth_get_simple_provider2
00763   (svn_auth_provider_object_t **provider,
00764    svn_auth_plaintext_prompt_func_t plaintext_prompt_func,
00765    void *prompt_baton,
00766    apr_pool_t *pool);
00767 
00768 /** Like svn_auth_get_simple_provider2, but without the ability to
00769  * call the svn_auth_plaintext_prompt_func_t callback, and the provider
00770  * always assumes that it is allowed to store the password in plaintext.
00771  *
00772  * @deprecated Provided for backwards compatibility with the 1.5 API.
00773  * @since New in 1.4.
00774  */
00775 SVN_DEPRECATED
00776 void
00777 svn_auth_get_simple_provider(svn_auth_provider_object_t **provider,
00778                              apr_pool_t *pool);
00779 
00780 /** Set @a *provider to an authentication provider of type @c
00781  * svn_auth_provider_object_t, or return @a NULL if the provider is not
00782  * available for the requested platform or the requested provider is unknown.
00783  *
00784  * Valid @a provider_name values are: "gnome_keyring", "keychain", "kwallet"
00785  * and "windows".
00786  *
00787  * Valid @a provider_type values are: "simple", "ssl_client_cert_pw" and
00788  * "ssl_server_trust".
00789  *
00790  * Allocate @a *provider in @a pool.
00791  *
00792  * What actually happens is we invoke the appropriate provider function to
00793  * supply the @a provider, like so:
00794  *
00795  *    svn_auth_get_<name>_<type>_provider(@a provider, @a pool);
00796  *
00797  * @since New in 1.6.
00798  */
00799 svn_error_t *
00800 svn_auth_get_platform_specific_provider
00801   (svn_auth_provider_object_t **provider,
00802    const char *provider_name,
00803    const char *provider_type,
00804    apr_pool_t *pool);
00805 
00806 /** Set @a *providers to an array of <tt>svn_auth_provider_object_t *</tt>
00807  * objects.
00808  * Only client authentication providers available for the current platform are
00809  * returned. Order of the platform-specific authentication providers is
00810  * determined by the 'password-stores' configuration option which is retrieved
00811  * from @a config. @a config can be NULL.
00812  *
00813  * Create and allocate @a *providers in @a pool.
00814  *
00815  * Default order of the platform-specific authentication providers:
00816  *   1. gnome-keyring
00817  *   2. kwallet
00818  *   3. keychain
00819  *   4. windows-cryptoapi
00820  *
00821  * @since New in 1.6.
00822  */
00823 svn_error_t *
00824 svn_auth_get_platform_specific_client_providers
00825   (apr_array_header_t **providers,
00826    svn_config_t *config,
00827    apr_pool_t *pool);
00828 
00829 #if (defined(WIN32) && !defined(__MINGW32__)) || defined(DOXYGEN)
00830 /**
00831  * Set @a *provider to an authentication provider of type @c
00832  * svn_auth_cred_simple_t that gets/sets information from the user's
00833  * ~/.subversion configuration directory.  Allocate @a *provider in
00834  * @a pool.
00835  *
00836  * This is like svn_auth_get_simple_provider(), except that, when
00837  * running on Window 2000 or newer (or any other Windows version that
00838  * includes the CryptoAPI), the provider encrypts the password before
00839  * storing it to disk. On earlier versions of Windows, the provider
00840  * does nothing.
00841  *
00842  * @since New in 1.4.
00843  * @note This function is only available on Windows.
00844  *
00845  * @note An administrative password reset may invalidate the account's
00846  * secret key. This function will detect that situation and behave as
00847  * if the password were not cached at all.
00848  */
00849 void
00850 svn_auth_get_windows_simple_provider(svn_auth_provider_object_t **provider,
00851                                      apr_pool_t *pool);
00852 
00853 /**
00854  * Set @a *provider to an authentication provider of type @c
00855  * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the
00856  * user's ~/.subversion configuration directory.  Allocate @a *provider in
00857  * @a pool.
00858  *
00859  * This is like svn_auth_get_ssl_client_cert_pw_file_provider(), except that
00860  * when running on Window 2000 or newer, the provider encrypts the password
00861  * before storing it to disk. On earlier versions of Windows, the provider
00862  * does nothing.
00863  *
00864  * @since New in 1.6
00865  * @note This function is only available on Windows.
00866  *
00867  * @note An administrative password reset may invalidate the account's
00868  * secret key. This function will detect that situation and behave as
00869  * if the password were not cached at all.
00870  */
00871 void
00872 svn_auth_get_windows_ssl_client_cert_pw_provider
00873   (svn_auth_provider_object_t **provider,
00874    apr_pool_t *pool);
00875 
00876 /**
00877  * Set @a *provider to an authentication provider of type @c
00878  * svn_auth_cred_ssl_server_trust_t, allocated in @a pool.
00879  *
00880  * This provider automatically validates ssl server certificates with
00881  * the CryptoApi, like Internet Explorer and the Windows network API do.
00882  * This allows the rollout of root certificates via Windows Domain
00883  * policies, instead of Subversion specific configuration.
00884  *
00885  * @since New in 1.5.
00886  * @note This function is only available on Windows.
00887  */
00888 void
00889 svn_auth_get_windows_ssl_server_trust_provider
00890   (svn_auth_provider_object_t **provider,
00891    apr_pool_t *pool);
00892 
00893 #endif /* WIN32 && !__MINGW32__ || DOXYGEN */
00894 
00895 #if defined(DARWIN) || defined(DOXYGEN)
00896 /**
00897  * Set @a *provider to an authentication provider of type @c
00898  * svn_auth_cred_simple_t that gets/sets information from the user's
00899  * ~/.subversion configuration directory.  Allocate @a *provider in
00900  * @a pool.
00901  *
00902  * This is like svn_auth_get_simple_provider(), except that the
00903  * password is stored in the Mac OS KeyChain.
00904  *
00905  * @since New in 1.4
00906  * @note This function is only available on Mac OS 10.2 and higher.
00907  */
00908 void
00909 svn_auth_get_keychain_simple_provider(svn_auth_provider_object_t **provider,
00910                                       apr_pool_t *pool);
00911 
00912 /**
00913  * Set @a *provider to an authentication provider of type @c
00914  * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the
00915  * user's ~/.subversion configuration directory.  Allocate @a *provider in
00916  * @a pool.
00917  *
00918  * This is like svn_auth_get_ssl_client_cert_pw_file_provider(), except
00919  * that the password is stored in the Mac OS KeyChain.
00920  *
00921  * @since New in 1.6
00922  * @note This function is only available on Mac OS 10.2 and higher.
00923  */
00924 void
00925 svn_auth_get_keychain_ssl_client_cert_pw_provider
00926   (svn_auth_provider_object_t **provider,
00927    apr_pool_t *pool);
00928 #endif /* DARWIN || DOXYGEN */
00929 
00930 #if (!defined(DARWIN) && !defined(WIN32)) || defined(DOXYGEN)
00931 /** A type of callback function for obtaining the GNOME Keyring password.
00932  *
00933  * In this callback, the client should ask the user for default keyring
00934  * @a keyring_name password.
00935  *
00936  * The answer is returned in @a *keyring_password.
00937  * @a baton is an implementation-specific closure.
00938  * All allocations should be done in @a pool.
00939  *
00940  * @since New in 1.6
00941  */
00942 typedef svn_error_t *(*svn_auth_gnome_keyring_unlock_prompt_func_t)
00943   (char **keyring_password,
00944    const char *keyring_name,
00945    void *baton,
00946    apr_pool_t *pool);
00947 
00948 
00949 /** libsvn_auth_gnome_keyring-specific run-time parameters. */
00950 
00951 /** @brief The pointer to function which prompts user for GNOME Keyring
00952  * password.
00953  * The type of this pointer should be svn_auth_gnome_keyring_unlock_prompt_func_t. */
00954 #define SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC "gnome-keyring-unlock-prompt-func"
00955 
00956 /** @brief The baton which is passed to
00957  * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC. */
00958 #define SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON "gnome-keyring-unlock-prompt-baton"
00959 
00960 
00961 /**
00962  * Get libsvn_auth_gnome_keyring version information.
00963  *
00964  * @since New in 1.6
00965  */
00966 const svn_version_t *
00967 svn_auth_gnome_keyring_version(void);
00968 
00969 
00970 /**
00971  * Set @a *provider to an authentication provider of type @c
00972  * svn_auth_cred_simple_t that gets/sets information from the user's
00973  * ~/.subversion configuration directory.
00974  *
00975  * This is like svn_client_get_simple_provider(), except that the
00976  * password is stored in GNOME Keyring.
00977  *
00978  * If the GNOME Keyring is locked the provider calls
00979  * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC in order to unlock
00980  * the keyring.
00981  *
00982  * @c SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON is passed to
00983  * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC.
00984  *
00985  * Allocate @a *provider in @a pool.
00986  *
00987  * @since New in 1.6
00988  * @note This function actually works only on systems with
00989  * libsvn_auth_gnome_keyring and GNOME Keyring installed.
00990  */
00991 void
00992 svn_auth_get_gnome_keyring_simple_provider
00993     (svn_auth_provider_object_t **provider,
00994      apr_pool_t *pool);
00995 
00996 
00997 /**
00998  * Set @a *provider to an authentication provider of type @c
00999  * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the
01000  * user's ~/.subversion configuration directory.
01001  *
01002  * This is like svn_client_get_ssl_client_cert_pw_file_provider(), except
01003  * that the password is stored in GNOME Keyring.
01004  *
01005  * If the GNOME Keyring is locked the provider calls
01006  * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC in order to unlock
01007  * the keyring.
01008  *
01009  * @c SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON is passed to
01010  * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC.
01011  *
01012  * Allocate @a *provider in @a pool.
01013  *
01014  * @since New in 1.6
01015  * @note This function actually works only on systems with
01016  * libsvn_auth_gnome_keyring and GNOME Keyring installed.
01017  */
01018 void
01019 svn_auth_get_gnome_keyring_ssl_client_cert_pw_provider
01020   (svn_auth_provider_object_t **provider,
01021    apr_pool_t *pool);
01022 
01023 
01024 /**
01025  * Get libsvn_auth_kwallet version information.
01026  *
01027  * @since New in 1.6
01028  */
01029 const svn_version_t *
01030 svn_auth_kwallet_version(void);
01031 
01032 
01033 /**
01034  * Set @a *provider to an authentication provider of type @c
01035  * svn_auth_cred_simple_t that gets/sets information from the user's
01036  * ~/.subversion configuration directory.  Allocate @a *provider in
01037  * @a pool.
01038  *
01039  * This is like svn_client_get_simple_provider(), except that the
01040  * password is stored in KWallet.
01041  *
01042  * @since New in 1.6
01043  * @note This function actually works only on systems with libsvn_auth_kwallet
01044  * and KWallet installed.
01045  */
01046 void
01047 svn_auth_get_kwallet_simple_provider(svn_auth_provider_object_t **provider,
01048                                      apr_pool_t *pool);
01049 
01050 
01051 /**
01052  * Set @a *provider to an authentication provider of type @c
01053  * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the
01054  * user's ~/.subversion configuration directory.  Allocate @a *provider in
01055  * @a pool.
01056  *
01057  * This is like svn_client_get_ssl_client_cert_pw_file_provider(), except
01058  * that the password is stored in KWallet.
01059  *
01060  * @since New in 1.6
01061  * @note This function actually works only on systems with libsvn_auth_kwallet
01062  * and KWallet installed.
01063  */
01064 void
01065 svn_auth_get_kwallet_ssl_client_cert_pw_provider
01066   (svn_auth_provider_object_t **provider,
01067    apr_pool_t *pool);
01068 #endif /* (!DARWIN && !WIN32) || DOXYGEN */
01069 
01070 
01071 /** Set @a *provider to an authentication provider of type @c
01072  * svn_auth_cred_username_t that gets/sets information from a user's
01073  * ~/.subversion configuration directory.  Allocate @a *provider in
01074  * @a pool.
01075  *
01076  * If a default username is available, @a *provider will honor it,
01077  * and return it when svn_auth_first_credentials() is called.  (See
01078  * @c SVN_AUTH_PARAM_DEFAULT_USERNAME.)
01079  *
01080  * @since New in 1.4.
01081  */
01082 void
01083 svn_auth_get_username_provider(svn_auth_provider_object_t **provider,
01084                                apr_pool_t *pool);
01085 
01086 
01087 /** Set @a *provider to an authentication provider of type @c
01088  * svn_auth_cred_ssl_server_trust_t, allocated in @a pool.
01089  *
01090  * @a *provider retrieves its credentials from the configuration
01091  * mechanism.  The returned credential is used to override SSL
01092  * security on an error.
01093  *
01094  * @since New in 1.4.
01095  */
01096 void
01097 svn_auth_get_ssl_server_trust_file_provider
01098   (svn_auth_provider_object_t **provider,
01099    apr_pool_t *pool);
01100 
01101 /** Set @a *provider to an authentication provider of type @c
01102  * svn_auth_cred_ssl_client_cert_t, allocated in @a pool.
01103  *
01104  * @a *provider retrieves its credentials from the configuration
01105  * mechanism.  The returned credential is used to load the appropriate
01106  * client certificate for authentication when requested by a server.
01107  *
01108  * @since New in 1.4.
01109  */
01110 void
01111 svn_auth_get_ssl_client_cert_file_provider
01112   (svn_auth_provider_object_t **provider,
01113    apr_pool_t *pool);
01114 
01115 
01116 /** Set @a *provider to an authentication provider of type @c
01117  * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the user's
01118  * ~/.subversion configuration directory.
01119  *
01120  * If the provider is going to save the passphrase unencrypted,
01121  * it calls @a plaintext_passphrase_prompt_func, passing @a
01122  * prompt_baton, before saving the passphrase.
01123  *
01124  * If @a plaintext_passphrase_prompt_func is NULL it is not called
01125  * and the passphrase is not stored in plaintext.
01126  * Client developers are highly encouraged to provide this callback
01127  * to ensure their users are made aware of the fact that their passphrase
01128  * is going to be stored unencrypted.
01129  *
01130  * Clients can however set the callback to NULL and set
01131  * SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT to SVN_CONFIG_FALSE or
01132  * SVN_CONFIG_TRUE to enforce a certain behaviour.
01133  *
01134  * Allocate @a *provider in @a pool.
01135  *
01136  * @since New in 1.6.
01137  */
01138 void
01139 svn_auth_get_ssl_client_cert_pw_file_provider2
01140   (svn_auth_provider_object_t **provider,
01141    svn_auth_plaintext_passphrase_prompt_func_t plaintext_passphrase_prompt_func,
01142    void *prompt_baton,
01143    apr_pool_t *pool);
01144 
01145 /** Like svn_auth_get_ssl_client_cert_pw_file_provider2, but without
01146  * the ability to call the svn_auth_plaintext_passphrase_prompt_func_t
01147  * callback, and the provider always assumes that it is not allowed
01148  * to store the passphrase in plaintext.
01149  *
01150  * @deprecated Provided for backwards compatibility with the 1.5 API.
01151  * @since New in 1.4.
01152  */
01153 SVN_DEPRECATED
01154 void
01155 svn_auth_get_ssl_client_cert_pw_file_provider
01156   (svn_auth_provider_object_t **provider,
01157    apr_pool_t *pool);
01158 
01159 
01160 /** Set @a *provider to an authentication provider of type @c
01161  * svn_auth_cred_ssl_server_trust_t, allocated in @a pool.
01162  *
01163  * @a *provider retrieves its credentials by using the @a prompt_func
01164  * and @a prompt_baton.  The returned credential is used to override
01165  * SSL security on an error.
01166  *
01167  * @since New in 1.4.
01168  */
01169 void
01170 svn_auth_get_ssl_server_trust_prompt_provider
01171   (svn_auth_provider_object_t **provider,
01172    svn_auth_ssl_server_trust_prompt_func_t prompt_func,
01173    void *prompt_baton,
01174    apr_pool_t *pool);
01175 
01176 
01177 /** Set @a *provider to an authentication provider of type @c
01178  * svn_auth_cred_ssl_client_cert_t, allocated in @a pool.
01179  *
01180  * @a *provider retrieves its credentials by using the @a prompt_func
01181  * and @a prompt_baton.  The returned credential is used to load the
01182  * appropriate client certificate for authentication when requested by
01183  * a server.  The prompt will be retried @a retry_limit times. For
01184  * infinite retries, set @a retry_limit to value less than 0.
01185  *
01186  * @since New in 1.4.
01187  */
01188 void
01189 svn_auth_get_ssl_client_cert_prompt_provider
01190   (svn_auth_provider_object_t **provider,
01191    svn_auth_ssl_client_cert_prompt_func_t prompt_func,
01192    void *prompt_baton,
01193    int retry_limit,
01194    apr_pool_t *pool);
01195 
01196 
01197 /** Set @a *provider to an authentication provider of type @c
01198  * svn_auth_cred_ssl_client_cert_pw_t, allocated in @a pool.
01199  *
01200  * @a *provider retrieves its credentials by using the @a prompt_func
01201  * and @a prompt_baton.  The returned credential is used when a loaded
01202  * client certificate is protected by a passphrase.  The prompt will
01203  * be retried @a retry_limit times. For infinite retries, set
01204  * @a retry_limit to value less than 0.
01205  *
01206  * @since New in 1.4.
01207  */
01208 void
01209 svn_auth_get_ssl_client_cert_pw_prompt_provider
01210   (svn_auth_provider_object_t **provider,
01211    svn_auth_ssl_client_cert_pw_prompt_func_t prompt_func,
01212    void *prompt_baton,
01213    int retry_limit,
01214    apr_pool_t *pool);
01215 
01216 #ifdef __cplusplus
01217 }
01218 #endif /* __cplusplus */
01219 
01220 #endif /* SVN_AUTH_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines