Subversion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
svn_auth.h
Go to the documentation of this file.
1 /**
2  * @copyright
3  * ====================================================================
4  * Licensed to the Apache Software Foundation (ASF) under one
5  * or more contributor license agreements. See the NOTICE file
6  * distributed with this work for additional information
7  * regarding copyright ownership. The ASF licenses this file
8  * to you under the Apache License, Version 2.0 (the
9  * "License"); you may not use this file except in compliance
10  * with the License. You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  * KIND, either express or implied. See the License for the
18  * specific language governing permissions and limitations
19  * under the License.
20  * ====================================================================
21  * @endcopyright
22  *
23  * @file svn_auth.h
24  * @brief Subversion's authentication system
25  */
26 
27 #ifndef SVN_AUTH_H
28 #define SVN_AUTH_H
29 
30 #include <apr.h>
31 #include <apr_pools.h>
32 #include <apr_hash.h>
33 #include <apr_tables.h>
34 
35 #include "svn_types.h"
36 #include "svn_config.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41 
42 /** Overview of the svn authentication system.
43  *
44  * We define an authentication "provider" as a module that is able to
45  * return a specific set of credentials. (e.g. username/password,
46  * certificate, etc.) Each provider implements a vtable that
47  *
48  * - can fetch initial credentials
49  * - can retry the fetch (or try to fetch something different)
50  * - can store the credentials for future use
51  *
52  * For any given type of credentials, there can exist any number of
53  * separate providers -- each provider has a different method of
54  * fetching. (i.e. from a disk store, by prompting the user, etc.)
55  *
56  * The application begins by creating an auth baton object, and
57  * "registers" some number of providers with the auth baton, in a
58  * specific order. (For example, it may first register a
59  * username/password provider that looks in disk store, then register
60  * a username/password provider that prompts the user.)
61  *
62  * Later on, when any svn library is challenged, it asks the auth
63  * baton for the specific credentials. If the initial credentials
64  * fail to authenticate, the caller keeps requesting new credentials.
65  * Under the hood, libsvn_auth effectively "walks" over each provider
66  * (in order of registry), one at a time, until all the providers have
67  * exhausted all their retry options.
68  *
69  * This system allows an application to flexibly define authentication
70  * behaviors (by changing registration order), and very easily write
71  * new authentication providers.
72  *
73  * An auth_baton also contains an internal hashtable of run-time
74  * parameters; any provider or library layer can set these run-time
75  * parameters at any time, so that the provider has access to the
76  * data. (For example, certain run-time data may not be available
77  * until an authentication challenge is made.) Each credential type
78  * must document the run-time parameters that are made available to
79  * its providers.
80  *
81  * @defgroup auth_fns Authentication functions
82  * @{
83  */
84 
85 
86 /** The type of a Subversion authentication object */
88 
89 /** The type of a Subversion authentication-iteration object */
91 
92 
93 /** The main authentication "provider" vtable. */
94 typedef struct svn_auth_provider_t
95 {
96  /** The kind of credentials this provider knows how to retrieve. */
97  const char *cred_kind;
98 
99  /** Get an initial set of credentials.
100  *
101  * Set @a *credentials to a set of valid credentials within @a
102  * realmstring, or NULL if no credentials are available. Set @a
103  * *iter_baton to context that allows a subsequent call to @c
104  * next_credentials, in case the first credentials fail to
105  * authenticate. @a provider_baton is general context for the
106  * vtable, @a parameters contains any run-time data that the
107  * provider may need, and @a realmstring comes from the
108  * svn_auth_first_credentials() call.
109  */
110  svn_error_t * (*first_credentials)(void **credentials,
111  void **iter_baton,
112  void *provider_baton,
113  apr_hash_t *parameters,
114  const char *realmstring,
115  apr_pool_t *pool);
116 
117  /** Get a different set of credentials.
118  *
119  * Set @a *credentials to another set of valid credentials (using @a
120  * iter_baton as the context from previous call to first_credentials
121  * or next_credentials). If no more credentials are available, set
122  * @a *credentials to NULL. If the provider only has one set of
123  * credentials, this function pointer should simply be NULL. @a
124  * provider_baton is general context for the vtable, @a parameters
125  * contains any run-time data that the provider may need, and @a
126  * realmstring comes from the svn_auth_first_credentials() call.
127  */
128  svn_error_t * (*next_credentials)(void **credentials,
129  void *iter_baton,
130  void *provider_baton,
131  apr_hash_t *parameters,
132  const char *realmstring,
133  apr_pool_t *pool);
134 
135  /** Save credentials.
136  *
137  * Store @a credentials for future use. @a provider_baton is
138  * general context for the vtable, and @a parameters contains any
139  * run-time data the provider may need. Set @a *saved to TRUE if
140  * the save happened, or FALSE if not. The provider is not required
141  * to save; if it refuses or is unable to save for non-fatal
142  * reasons, return FALSE. If the provider never saves data, then
143  * this function pointer should simply be NULL. @a realmstring comes
144  * from the svn_auth_first_credentials() call.
145  */
146  svn_error_t * (*save_credentials)(svn_boolean_t *saved,
147  void *credentials,
148  void *provider_baton,
149  apr_hash_t *parameters,
150  const char *realmstring,
151  apr_pool_t *pool);
152 
154 
155 
156 /** A provider object, ready to be put into an array and given to
157  svn_auth_open(). */
159 {
160  const svn_auth_provider_t *vtable;
161  void *provider_baton;
162 
164 
165 /** The type of function returning authentication provider. */
167  svn_auth_provider_object_t **provider,
168  apr_pool_t *pool);
169 
170 
171 /** Specific types of credentials **/
172 
173 /** Simple username/password pair credential kind.
174  *
175  * The following auth parameters are available to the providers:
176  *
177  * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_CONFIG (@c svn_config_t*)
178  * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS (@c svn_config_t*)
179  *
180  * The following auth parameters may be available to the providers:
181  *
182  * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*)
183  * - @c SVN_AUTH_PARAM_DEFAULT_USERNAME (@c char*)
184  * - @c SVN_AUTH_PARAM_DEFAULT_PASSWORD (@c char*)
185  */
186 #define SVN_AUTH_CRED_SIMPLE "svn.simple"
187 
188 /** @c SVN_AUTH_CRED_SIMPLE credentials. */
190 {
191  /** Username */
192  const char *username;
193  /** Password */
194  const char *password;
195  /** Indicates if the credentials may be saved (to disk). For example, a
196  * GUI prompt implementation with a remember password checkbox shall set
197  * @a may_save to TRUE if the checkbox is checked.
198  */
201 
202 
203 /** Username credential kind.
204  *
205  * The following optional auth parameters are relevant to the providers:
206  *
207  * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*)
208  * - @c SVN_AUTH_PARAM_DEFAULT_USERNAME (@c char*)
209  */
210 #define SVN_AUTH_CRED_USERNAME "svn.username"
211 
212 /** @c SVN_AUTH_CRED_USERNAME credentials. */
214 {
215  /** Username */
216  const char *username;
217  /** Indicates if the credentials may be saved (to disk). For example, a
218  * GUI prompt implementation with a remember username checkbox shall set
219  * @a may_save to TRUE if the checkbox is checked.
220  */
223 
224 
225 /** SSL client certificate credential type.
226  *
227  * The following auth parameters are available to the providers:
228  *
229  * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS (@c svn_config_t*)
230  * - @c SVN_AUTH_PARAM_SERVER_GROUP (@c char*)
231  *
232  * The following optional auth parameters are relevant to the providers:
233  *
234  * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*)
235  */
236 #define SVN_AUTH_CRED_SSL_CLIENT_CERT "svn.ssl.client-cert"
237 
238 /** @c SVN_AUTH_CRED_SSL_CLIENT_CERT credentials. */
240 {
241  /** Absolute path to the certificate file */
242  const char *cert_file;
243  /** Indicates if the credentials may be saved (to disk). For example, a
244  * GUI prompt implementation with a remember certificate checkbox shall
245  * set @a may_save to TRUE if the checkbox is checked.
246  */
249 
250 
251 /** A function returning an SSL client certificate passphrase provider. */
253  svn_auth_provider_object_t **provider,
254  apr_pool_t *pool);
255 
256 /** SSL client certificate passphrase credential type.
257  *
258  * @note The realmstring used with this credential type must be a name that
259  * makes it possible for the user to identify the certificate.
260  *
261  * The following auth parameters are available to the providers:
262  *
263  * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_CONFIG (@c svn_config_t*)
264  * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS (@c svn_config_t*)
265  * - @c SVN_AUTH_PARAM_SERVER_GROUP (@c char*)
266  *
267  * The following optional auth parameters are relevant to the providers:
268  *
269  * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*)
270  */
271 #define SVN_AUTH_CRED_SSL_CLIENT_CERT_PW "svn.ssl.client-passphrase"
272 
273 /** @c SVN_AUTH_CRED_SSL_CLIENT_CERT_PW credentials. */
275 {
276  /** Certificate password */
277  const char *password;
278  /** Indicates if the credentials may be saved (to disk). For example, a
279  * GUI prompt implementation with a remember password checkbox shall set
280  * @a may_save to TRUE if the checkbox is checked.
281  */
284 
285 
286 /** SSL server verification credential type.
287  *
288  * The following auth parameters are available to the providers:
289  *
290  * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS (@c svn_config_t*)
291  * - @c SVN_AUTH_PARAM_SERVER_GROUP (@c char*)
292  * - @c SVN_AUTH_PARAM_SSL_SERVER_FAILURES (@c apr_uint32_t*)
293  * - @c SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO
294  * (@c svn_auth_ssl_server_cert_info_t*)
295  *
296  * The following optional auth parameters are relevant to the providers:
297  *
298  * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*)
299  */
300 #define SVN_AUTH_CRED_SSL_SERVER_TRUST "svn.ssl.server"
301 
302 /** SSL server certificate information used by @c
303  * SVN_AUTH_CRED_SSL_SERVER_TRUST providers.
304  */
306 {
307  /** Primary CN */
308  const char *hostname;
309  /** ASCII fingerprint */
310  const char *fingerprint;
311  /** ASCII date from which the certificate is valid */
312  const char *valid_from;
313  /** ASCII date until which the certificate is valid */
314  const char *valid_until;
315  /** DN of the certificate issuer */
316  const char *issuer_dname;
317  /** Base-64 encoded DER certificate representation */
318  const char *ascii_cert;
320 
321 /**
322  * Return a deep copy of @a info, allocated in @a pool.
323  *
324  * @since New in 1.3.
325  */
328  apr_pool_t *pool);
329 
330 /** @c SVN_AUTH_CRED_SSL_SERVER_TRUST credentials. */
332 {
333  /** Indicates if the credentials may be saved (to disk). For example, a
334  * GUI prompt implementation with a checkbox to accept the certificate
335  * permanently shall set @a may_save to TRUE if the checkbox is checked.
336  */
338  /** Bit mask of the accepted failures */
339  apr_uint32_t accepted_failures;
341 
342 
343 
344 /** Credential-constructing prompt functions. **/
345 
346 /** These exist so that different client applications can use
347  * different prompt mechanisms to supply the same credentials. For
348  * example, if authentication requires a username and password, a
349  * command-line client's prompting function might prompt first for the
350  * username and then for the password, whereas a GUI client's would
351  * present a single dialog box asking for both, and a telepathic
352  * client's would read all the information directly from the user's
353  * mind. All these prompting functions return the same type of
354  * credential, but the information used to construct the credential is
355  * gathered in an interface-specific way in each case.
356  */
357 
358 /** Set @a *cred by prompting the user, allocating @a *cred in @a pool.
359  * @a baton is an implementation-specific closure.
360  *
361  * If @a realm is non-NULL, maybe use it in the prompt string.
362  *
363  * If @a username is non-NULL, then the user might be prompted only
364  * for a password, but @a *cred would still be filled with both
365  * username and password. For example, a typical usage would be to
366  * pass @a username on the first call, but then leave it NULL for
367  * subsequent calls, on the theory that if credentials failed, it's
368  * as likely to be due to incorrect username as incorrect password.
369  *
370  * If @a may_save is FALSE, the auth system does not allow the credentials
371  * to be saved (to disk). A prompt function shall not ask the user if the
372  * credentials shall be saved if @a may_save is FALSE. For example, a GUI
373  * client with a remember password checkbox would grey out the checkbox if
374  * @a may_save is FALSE.
375  */
376 typedef svn_error_t *(*svn_auth_simple_prompt_func_t)(
377  svn_auth_cred_simple_t **cred,
378  void *baton,
379  const char *realm,
380  const char *username,
381  svn_boolean_t may_save,
382  apr_pool_t *pool);
383 
384 
385 /** Set @a *cred by prompting the user, allocating @a *cred in @a pool.
386  * @a baton is an implementation-specific closure.
387  *
388  * If @a realm is non-NULL, maybe use it in the prompt string.
389  *
390  * If @a may_save is FALSE, the auth system does not allow the credentials
391  * to be saved (to disk). A prompt function shall not ask the user if the
392  * credentials shall be saved if @a may_save is FALSE. For example, a GUI
393  * client with a remember username checkbox would grey out the checkbox if
394  * @a may_save is FALSE.
395  */
396 typedef svn_error_t *(*svn_auth_username_prompt_func_t)(
398  void *baton,
399  const char *realm,
400  svn_boolean_t may_save,
401  apr_pool_t *pool);
402 
403 
404 /** @name SSL server certificate failure bits
405  *
406  * @note These values are stored in the on disk auth cache by the SSL
407  * server certificate auth provider, so the meaning of these bits must
408  * not be changed.
409  * @{
410  */
411 /** Certificate is not yet valid. */
412 #define SVN_AUTH_SSL_NOTYETVALID 0x00000001
413 /** Certificate has expired. */
414 #define SVN_AUTH_SSL_EXPIRED 0x00000002
415 /** Certificate's CN (hostname) does not match the remote hostname. */
416 #define SVN_AUTH_SSL_CNMISMATCH 0x00000004
417 /** @brief Certificate authority is unknown (i.e. not trusted) */
418 #define SVN_AUTH_SSL_UNKNOWNCA 0x00000008
419 /** @brief Other failure. This can happen if neon has introduced a new
420  * failure bit that we do not handle yet. */
421 #define SVN_AUTH_SSL_OTHER 0x40000000
422 /** @} */
423 
424 /** Set @a *cred by prompting the user, allocating @a *cred in @a pool.
425  * @a baton is an implementation-specific closure.
426  *
427  * @a cert_info is a structure describing the server cert that was
428  * presented to the client, and @a failures is a bitmask that
429  * describes exactly why the cert could not be automatically validated,
430  * composed from the constants SVN_AUTH_SSL_* (@c SVN_AUTH_SSL_NOTYETVALID
431  * etc.). @a realm is a string that can be used in the prompt string.
432  *
433  * If @a may_save is FALSE, the auth system does not allow the credentials
434  * to be saved (to disk). A prompt function shall not ask the user if the
435  * credentials shall be saved if @a may_save is FALSE. For example, a GUI
436  * client with a trust permanently checkbox would grey out the checkbox if
437  * @a may_save is FALSE.
438  */
439 typedef svn_error_t *(*svn_auth_ssl_server_trust_prompt_func_t)(
441  void *baton,
442  const char *realm,
443  apr_uint32_t failures,
444  const svn_auth_ssl_server_cert_info_t *cert_info,
445  svn_boolean_t may_save,
446  apr_pool_t *pool);
447 
448 
449 /** Set @a *cred by prompting the user, allocating @a *cred in @a pool.
450  * @a baton is an implementation-specific closure. @a realm is a string
451  * that can be used in the prompt string.
452  *
453  * If @a may_save is FALSE, the auth system does not allow the credentials
454  * to be saved (to disk). A prompt function shall not ask the user if the
455  * credentials shall be saved if @a may_save is FALSE. For example, a GUI
456  * client with a remember certificate checkbox would grey out the checkbox
457  * if @a may_save is FALSE.
458  */
459 typedef svn_error_t *(*svn_auth_ssl_client_cert_prompt_func_t)(
461  void *baton,
462  const char *realm,
463  svn_boolean_t may_save,
464  apr_pool_t *pool);
465 
466 
467 /** Set @a *cred by prompting the user, allocating @a *cred in @a pool.
468  * @a baton is an implementation-specific closure. @a realm is a string
469  * identifying the certificate, and can be used in the prompt string.
470  *
471  * If @a may_save is FALSE, the auth system does not allow the credentials
472  * to be saved (to disk). A prompt function shall not ask the user if the
473  * credentials shall be saved if @a may_save is FALSE. For example, a GUI
474  * client with a remember password checkbox would grey out the checkbox if
475  * @a may_save is FALSE.
476  */
477 typedef svn_error_t *(*svn_auth_ssl_client_cert_pw_prompt_func_t)(
479  void *baton,
480  const char *realm,
481  svn_boolean_t may_save,
482  apr_pool_t *pool);
483 
484 /** A type of callback function for asking whether storing a password to
485  * disk in plaintext is allowed.
486  *
487  * In this callback, the client should ask the user whether storing
488  * a password for the realm identified by @a realmstring to disk
489  * in plaintext is allowed.
490  *
491  * The answer is returned in @a *may_save_plaintext.
492  * @a baton is an implementation-specific closure.
493  * All allocations should be done in @a pool.
494  *
495  * @since New in 1.6
496  */
497 typedef svn_error_t *(*svn_auth_plaintext_prompt_func_t)(
498  svn_boolean_t *may_save_plaintext,
499  const char *realmstring,
500  void *baton,
501  apr_pool_t *pool);
502 
503 /** A type of callback function for asking whether storing a passphrase to
504  * disk in plaintext is allowed.
505  *
506  * In this callback, the client should ask the user whether storing
507  * a passphrase for the realm identified by @a realmstring to disk
508  * in plaintext is allowed.
509  *
510  * The answer is returned in @a *may_save_plaintext.
511  * @a baton is an implementation-specific closure.
512  * All allocations should be done in @a pool.
513  *
514  * @since New in 1.6
515  */
516 typedef svn_error_t *(*svn_auth_plaintext_passphrase_prompt_func_t)(
517  svn_boolean_t *may_save_plaintext,
518  const char *realmstring,
519  void *baton,
520  apr_pool_t *pool);
521 
522 
523 /** Initialize an authentication system.
524  *
525  * Return an authentication object in @a *auth_baton (allocated in @a
526  * pool) that represents a particular instance of the svn
527  * authentication system. @a providers is an array of @c
528  * svn_auth_provider_object_t pointers, already allocated in @a pool
529  * and intentionally ordered. These pointers will be stored within @a
530  * *auth_baton, grouped by credential type, and searched in this exact
531  * order.
532  */
533 void
534 svn_auth_open(svn_auth_baton_t **auth_baton,
535  const apr_array_header_t *providers,
536  apr_pool_t *pool);
537 
538 /** Set an authentication run-time parameter.
539  *
540  * Store @a name / @a value pair as a run-time parameter in @a
541  * auth_baton, making the data accessible to all providers. @a name
542  * and @a value will NOT be duplicated into the auth_baton's pool.
543  * To delete a run-time parameter, pass NULL for @a value.
544  */
545 void
547  const char *name,
548  const void *value);
549 
550 /** Get an authentication run-time parameter.
551  *
552  * Return a value for run-time parameter @a name from @a auth_baton.
553  * Return NULL if the parameter doesn't exist.
554  */
555 const void *
557  const char *name);
558 
559 /** Universal run-time parameters, made available to all providers.
560 
561  If you are writing a new provider, then to be a "good citizen",
562  you should notice these global parameters! Note that these
563  run-time params should be treated as read-only by providers; the
564  application is responsible for placing them into the auth_baton
565  hash. */
566 
567 /** The auth-hash prefix indicating that the parameter is global. */
568 #define SVN_AUTH_PARAM_PREFIX "svn:auth:"
569 
570 /**
571  * @name Default credentials defines
572  * Any 'default' credentials that came in through the application itself,
573  * (e.g. --username and --password options). Property values are
574  * const char *.
575  * @{ */
576 #define SVN_AUTH_PARAM_DEFAULT_USERNAME SVN_AUTH_PARAM_PREFIX "username"
577 #define SVN_AUTH_PARAM_DEFAULT_PASSWORD SVN_AUTH_PARAM_PREFIX "password"
578 /** @} */
579 
580 /** @brief The application doesn't want any providers to prompt
581  * users. Property value is irrelevant; only property's existence
582  * matters. */
583 #define SVN_AUTH_PARAM_NON_INTERACTIVE SVN_AUTH_PARAM_PREFIX "non-interactive"
584 
585 /** @brief The application doesn't want any providers to save passwords
586  * to disk. Property value is irrelevant; only property's existence
587  * matters. */
588 #define SVN_AUTH_PARAM_DONT_STORE_PASSWORDS SVN_AUTH_PARAM_PREFIX \
589  "dont-store-passwords"
590 
591 /** @brief Indicates whether providers may save passwords to disk in
592  * plaintext. Property value can be either SVN_CONFIG_TRUE,
593  * SVN_CONFIG_FALSE, or SVN_CONFIG_ASK. */
594 #define SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS SVN_AUTH_PARAM_PREFIX \
595  "store-plaintext-passwords"
596 
597 /** @brief The application doesn't want any providers to save passphrase
598  * to disk. Property value is irrelevant; only property's existence
599  * matters. */
600 #define SVN_AUTH_PARAM_DONT_STORE_SSL_CLIENT_CERT_PP \
601  SVN_AUTH_PARAM_PREFIX "dont-store-ssl-client-cert-pp"
602 
603 /** @brief Indicates whether providers may save passphrase to disk in
604  * plaintext. Property value can be either SVN_CONFIG_TRUE,
605  * SVN_CONFIG_FALSE, or SVN_CONFIG_ASK. */
606 #define SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \
607  SVN_AUTH_PARAM_PREFIX "store-ssl-client-cert-pp-plaintext"
608 
609 /** @brief The application doesn't want any providers to save credentials
610  * to disk. Property value is irrelevant; only property's existence
611  * matters. */
612 #define SVN_AUTH_PARAM_NO_AUTH_CACHE SVN_AUTH_PARAM_PREFIX "no-auth-cache"
613 
614 /** @brief The following property is for SSL server cert providers. This
615  * provides a pointer to an @c apr_uint32_t containing the failures
616  * detected by the certificate validator. */
617 #define SVN_AUTH_PARAM_SSL_SERVER_FAILURES SVN_AUTH_PARAM_PREFIX \
618  "ssl:failures"
619 
620 /** @brief The following property is for SSL server cert providers. This
621  * provides the cert info (svn_auth_ssl_server_cert_info_t). */
622 #define SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO SVN_AUTH_PARAM_PREFIX \
623  "ssl:cert-info"
624 
625 /** Some providers need access to the @c svn_config_t configuration. */
626 #define SVN_AUTH_PARAM_CONFIG_CATEGORY_CONFIG SVN_AUTH_PARAM_PREFIX "config-category-config"
627 #define SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS SVN_AUTH_PARAM_PREFIX "config-category-servers"
628 
629 /** @deprecated Provided for backward compatibility with the 1.5 API. */
630 #define SVN_AUTH_PARAM_CONFIG SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS
631 
632 /** The current server group. */
633 #define SVN_AUTH_PARAM_SERVER_GROUP SVN_AUTH_PARAM_PREFIX "server-group"
634 
635 /** @brief A configuration directory that overrides the default
636  * ~/.subversion. */
637 #define SVN_AUTH_PARAM_CONFIG_DIR SVN_AUTH_PARAM_PREFIX "config-dir"
638 
639 /** Get an initial set of credentials.
640  *
641  * Ask @a auth_baton to set @a *credentials to a set of credentials
642  * defined by @a cred_kind and valid within @a realmstring, or NULL if
643  * no credentials are available. Otherwise, return an iteration state
644  * in @a *state, so that the caller can call
645  * svn_auth_next_credentials(), in case the first set of credentials
646  * fails to authenticate.
647  *
648  * Use @a pool to allocate @a *state, and for temporary allocation.
649  * Note that @a *credentials will be allocated in @a auth_baton's pool.
650  */
651 svn_error_t *
652 svn_auth_first_credentials(void **credentials,
653  svn_auth_iterstate_t **state,
654  const char *cred_kind,
655  const char *realmstring,
656  svn_auth_baton_t *auth_baton,
657  apr_pool_t *pool);
658 
659 /** Get another set of credentials, assuming previous ones failed to
660  * authenticate.
661  *
662  * Use @a state to fetch a different set of @a *credentials, as a
663  * follow-up to svn_auth_first_credentials() or
664  * svn_auth_next_credentials(). If no more credentials are available,
665  * set @a *credentials to NULL.
666  *
667  * Note that @a *credentials will be allocated in @c auth_baton's pool.
668  */
669 svn_error_t *
670 svn_auth_next_credentials(void **credentials,
671  svn_auth_iterstate_t *state,
672  apr_pool_t *pool);
673 
674 /** Save a set of credentials.
675  *
676  * Ask @a state to store the most recently returned credentials,
677  * presumably because they successfully authenticated.
678  * All allocations should be done in @a pool.
679  *
680  * If no credentials were ever returned, do nothing.
681  */
682 svn_error_t *
684  apr_pool_t *pool);
685 
686 /** @} */
687 
688 /** Set @a *provider to an authentication provider of type
689  * svn_auth_cred_simple_t that gets information by prompting the user
690  * with @a prompt_func and @a prompt_baton. Allocate @a *provider in
691  * @a pool.
692  *
693  * If both @c SVN_AUTH_PARAM_DEFAULT_USERNAME and
694  * @c SVN_AUTH_PARAM_DEFAULT_PASSWORD are defined as runtime
695  * parameters in the @c auth_baton, then @a *provider will return the
696  * default arguments when svn_auth_first_credentials() is called. If
697  * svn_auth_first_credentials() fails, then @a *provider will
698  * re-prompt @a retry_limit times (via svn_auth_next_credentials()).
699  * For infinite retries, set @a retry_limit to value less than 0.
700  *
701  * @since New in 1.4.
702  */
703 void
705  svn_auth_simple_prompt_func_t prompt_func,
706  void *prompt_baton,
707  int retry_limit,
708  apr_pool_t *pool);
709 
710 
711 /** Set @a *provider to an authentication provider of type @c
712  * svn_auth_cred_username_t that gets information by prompting the
713  * user with @a prompt_func and @a prompt_baton. Allocate @a *provider
714  * in @a pool.
715  *
716  * If @c SVN_AUTH_PARAM_DEFAULT_USERNAME is defined as a runtime
717  * parameter in the @c auth_baton, then @a *provider will return the
718  * default argument when svn_auth_first_credentials() is called. If
719  * svn_auth_first_credentials() fails, then @a *provider will
720  * re-prompt @a retry_limit times (via svn_auth_next_credentials()).
721  * For infinite retries, set @a retry_limit to value less than 0.
722  *
723  * @since New in 1.4.
724  */
725 void
727  svn_auth_provider_object_t **provider,
729  void *prompt_baton,
730  int retry_limit,
731  apr_pool_t *pool);
732 
733 
734 /** Set @a *provider to an authentication provider of type @c
735  * svn_auth_cred_simple_t that gets/sets information from the user's
736  * ~/.subversion configuration directory.
737  *
738  * If the provider is going to save the password unencrypted, it calls @a
739  * plaintext_prompt_func, passing @a prompt_baton, before saving the
740  * password.
741  *
742  * If @a plaintext_prompt_func is NULL it is not called and the answer is
743  * assumed to be TRUE. This matches the deprecated behaviour of storing
744  * unencrypted passwords by default, and is only done this way for backward
745  * compatibility reasons.
746  * Client developers are highly encouraged to provide this callback
747  * to ensure their users are made aware of the fact that their password
748  * is going to be stored unencrypted. In the future, providers may
749  * default to not storing the password unencrypted if this callback is NULL.
750  *
751  * Clients can however set the callback to NULL and set
752  * SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS to SVN_CONFIG_FALSE or
753  * SVN_CONFIG_TRUE to enforce a certain behaviour.
754  *
755  * Allocate @a *provider in @a pool.
756  *
757  * If a default username or password is available, @a *provider will
758  * honor them as well, and return them when
759  * svn_auth_first_credentials() is called. (see @c
760  * SVN_AUTH_PARAM_DEFAULT_USERNAME and @c
761  * SVN_AUTH_PARAM_DEFAULT_PASSWORD).
762  *
763  * @since New in 1.6.
764  */
765 void
767  svn_auth_provider_object_t **provider,
768  svn_auth_plaintext_prompt_func_t plaintext_prompt_func,
769  void *prompt_baton,
770  apr_pool_t *pool);
771 
772 /** Like svn_auth_get_simple_provider2, but without the ability to
773  * call the svn_auth_plaintext_prompt_func_t callback, and the provider
774  * always assumes that it is allowed to store the password in plaintext.
775  *
776  * @deprecated Provided for backwards compatibility with the 1.5 API.
777  * @since New in 1.4.
778  */
780 void
782  apr_pool_t *pool);
783 
784 /** Set @a *provider to an authentication provider of type @c
785  * svn_auth_provider_object_t, or return @c NULL if the provider is not
786  * available for the requested platform or the requested provider is unknown.
787  *
788  * Valid @a provider_name values are: "gnome_keyring", "keychain", "kwallet"
789  * and "windows".
790  *
791  * Valid @a provider_type values are: "simple", "ssl_client_cert_pw" and
792  * "ssl_server_trust".
793  *
794  * Allocate @a *provider in @a pool.
795  *
796  * What actually happens is we invoke the appropriate provider function to
797  * supply the @a provider, like so:
798  *
799  * svn_auth_get_<name>_<type>_provider(@a provider, @a pool);
800  *
801  * @since New in 1.6.
802  */
803 svn_error_t *
805  svn_auth_provider_object_t **provider,
806  const char *provider_name,
807  const char *provider_type,
808  apr_pool_t *pool);
809 
810 /** Set @a *providers to an array of <tt>svn_auth_provider_object_t *</tt>
811  * objects.
812  * Only client authentication providers available for the current platform are
813  * returned. Order of the platform-specific authentication providers is
814  * determined by the 'password-stores' configuration option which is retrieved
815  * from @a config. @a config can be NULL.
816  *
817  * Create and allocate @a *providers in @a pool.
818  *
819  * Default order of the platform-specific authentication providers:
820  * 1. gnome-keyring
821  * 2. kwallet
822  * 3. keychain
823  * 4. windows-cryptoapi
824  *
825  * @since New in 1.6.
826  */
827 svn_error_t *
829  apr_array_header_t **providers,
830  svn_config_t *config,
831  apr_pool_t *pool);
832 
833 #if (defined(WIN32) && !defined(__MINGW32__)) || defined(DOXYGEN)
834 /**
835  * Set @a *provider to an authentication provider of type @c
836  * svn_auth_cred_simple_t that gets/sets information from the user's
837  * ~/.subversion configuration directory. Allocate @a *provider in
838  * @a pool.
839  *
840  * This is like svn_auth_get_simple_provider(), except that, when
841  * running on Window 2000 or newer (or any other Windows version that
842  * includes the CryptoAPI), the provider encrypts the password before
843  * storing it to disk. On earlier versions of Windows, the provider
844  * does nothing.
845  *
846  * @since New in 1.4.
847  * @note This function is only available on Windows.
848  *
849  * @note An administrative password reset may invalidate the account's
850  * secret key. This function will detect that situation and behave as
851  * if the password were not cached at all.
852  */
853 void
855  apr_pool_t *pool);
856 
857 /**
858  * Set @a *provider to an authentication provider of type @c
859  * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the
860  * user's ~/.subversion configuration directory. Allocate @a *provider in
861  * @a pool.
862  *
863  * This is like svn_auth_get_ssl_client_cert_pw_file_provider(), except that
864  * when running on Window 2000 or newer, the provider encrypts the password
865  * before storing it to disk. On earlier versions of Windows, the provider
866  * does nothing.
867  *
868  * @since New in 1.6
869  * @note This function is only available on Windows.
870  *
871  * @note An administrative password reset may invalidate the account's
872  * secret key. This function will detect that situation and behave as
873  * if the password were not cached at all.
874  */
875 void
877  svn_auth_provider_object_t **provider,
878  apr_pool_t *pool);
879 
880 /**
881  * Set @a *provider to an authentication provider of type @c
882  * svn_auth_cred_ssl_server_trust_t, allocated in @a pool.
883  *
884  * This provider automatically validates ssl server certificates with
885  * the CryptoApi, like Internet Explorer and the Windows network API do.
886  * This allows the rollout of root certificates via Windows Domain
887  * policies, instead of Subversion specific configuration.
888  *
889  * @since New in 1.5.
890  * @note This function is only available on Windows.
891  */
892 void
894  svn_auth_provider_object_t **provider,
895  apr_pool_t *pool);
896 
897 #endif /* WIN32 && !__MINGW32__ || DOXYGEN */
898 
899 #if defined(DARWIN) || defined(DOXYGEN)
900 /**
901  * Set @a *provider to an authentication provider of type @c
902  * svn_auth_cred_simple_t that gets/sets information from the user's
903  * ~/.subversion configuration directory. Allocate @a *provider in
904  * @a pool.
905  *
906  * This is like svn_auth_get_simple_provider(), except that the
907  * password is stored in the Mac OS KeyChain.
908  *
909  * @since New in 1.4
910  * @note This function is only available on Mac OS 10.2 and higher.
911  */
912 void
914  apr_pool_t *pool);
915 
916 /**
917  * Set @a *provider to an authentication provider of type @c
918  * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the
919  * user's ~/.subversion configuration directory. Allocate @a *provider in
920  * @a pool.
921  *
922  * This is like svn_auth_get_ssl_client_cert_pw_file_provider(), except
923  * that the password is stored in the Mac OS KeyChain.
924  *
925  * @since New in 1.6
926  * @note This function is only available on Mac OS 10.2 and higher.
927  */
928 void
930  svn_auth_provider_object_t **provider,
931  apr_pool_t *pool);
932 #endif /* DARWIN || DOXYGEN */
933 
934 #if (!defined(DARWIN) && !defined(WIN32)) || defined(DOXYGEN)
935 /** A type of callback function for obtaining the GNOME Keyring password.
936  *
937  * In this callback, the client should ask the user for default keyring
938  * @a keyring_name password.
939  *
940  * The answer is returned in @a *keyring_password.
941  * @a baton is an implementation-specific closure.
942  * All allocations should be done in @a pool.
943  *
944  * @since New in 1.6
945  */
946 typedef svn_error_t *(*svn_auth_gnome_keyring_unlock_prompt_func_t)(
947  char **keyring_password,
948  const char *keyring_name,
949  void *baton,
950  apr_pool_t *pool);
951 
952 
953 /** libsvn_auth_gnome_keyring-specific run-time parameters. */
954 
955 /** @brief The pointer to function which prompts user for GNOME Keyring
956  * password.
957  * The type of this pointer should be svn_auth_gnome_keyring_unlock_prompt_func_t. */
958 #define SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC "gnome-keyring-unlock-prompt-func"
959 
960 /** @brief The baton which is passed to
961  * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC. */
962 #define SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON "gnome-keyring-unlock-prompt-baton"
963 
964 
965 /**
966  * Get libsvn_auth_gnome_keyring version information.
967  *
968  * @since New in 1.6
969  */
970 const svn_version_t *
972 
973 
974 /**
975  * Set @a *provider to an authentication provider of type @c
976  * svn_auth_cred_simple_t that gets/sets information from the user's
977  * ~/.subversion configuration directory.
978  *
979  * This is like svn_client_get_simple_provider(), except that the
980  * password is stored in GNOME Keyring.
981  *
982  * If the GNOME Keyring is locked the provider calls
983  * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC in order to unlock
984  * the keyring.
985  *
986  * @c SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON is passed to
987  * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC.
988  *
989  * Allocate @a *provider in @a pool.
990  *
991  * @since New in 1.6
992  * @note This function actually works only on systems with
993  * libsvn_auth_gnome_keyring and GNOME Keyring installed.
994  */
995 void
997  svn_auth_provider_object_t **provider,
998  apr_pool_t *pool);
999 
1000 
1001 /**
1002  * Set @a *provider to an authentication provider of type @c
1003  * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the
1004  * user's ~/.subversion configuration directory.
1005  *
1006  * This is like svn_client_get_ssl_client_cert_pw_file_provider(), except
1007  * that the password is stored in GNOME Keyring.
1008  *
1009  * If the GNOME Keyring is locked the provider calls
1010  * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC in order to unlock
1011  * the keyring.
1012  *
1013  * @c SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON is passed to
1014  * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC.
1015  *
1016  * Allocate @a *provider in @a pool.
1017  *
1018  * @since New in 1.6
1019  * @note This function actually works only on systems with
1020  * libsvn_auth_gnome_keyring and GNOME Keyring installed.
1021  */
1022 void
1024  svn_auth_provider_object_t **provider,
1025  apr_pool_t *pool);
1026 
1027 
1028 /**
1029  * Get libsvn_auth_kwallet version information.
1030  *
1031  * @since New in 1.6
1032  */
1033 const svn_version_t *
1035 
1036 
1037 /**
1038  * Set @a *provider to an authentication provider of type @c
1039  * svn_auth_cred_simple_t that gets/sets information from the user's
1040  * ~/.subversion configuration directory. Allocate @a *provider in
1041  * @a pool.
1042  *
1043  * This is like svn_client_get_simple_provider(), except that the
1044  * password is stored in KWallet.
1045  *
1046  * @since New in 1.6
1047  * @note This function actually works only on systems with libsvn_auth_kwallet
1048  * and KWallet installed.
1049  */
1050 void
1052  apr_pool_t *pool);
1053 
1054 
1055 /**
1056  * Set @a *provider to an authentication provider of type @c
1057  * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the
1058  * user's ~/.subversion configuration directory. Allocate @a *provider in
1059  * @a pool.
1060  *
1061  * This is like svn_client_get_ssl_client_cert_pw_file_provider(), except
1062  * that the password is stored in KWallet.
1063  *
1064  * @since New in 1.6
1065  * @note This function actually works only on systems with libsvn_auth_kwallet
1066  * and KWallet installed.
1067  */
1068 void
1070  svn_auth_provider_object_t **provider,
1071  apr_pool_t *pool);
1072 #endif /* (!DARWIN && !WIN32) || DOXYGEN */
1073 
1074 
1075 /** Set @a *provider to an authentication provider of type @c
1076  * svn_auth_cred_username_t that gets/sets information from a user's
1077  * ~/.subversion configuration directory. Allocate @a *provider in
1078  * @a pool.
1079  *
1080  * If a default username is available, @a *provider will honor it,
1081  * and return it when svn_auth_first_credentials() is called. (See
1082  * @c SVN_AUTH_PARAM_DEFAULT_USERNAME.)
1083  *
1084  * @since New in 1.4.
1085  */
1086 void
1088  apr_pool_t *pool);
1089 
1090 
1091 /** Set @a *provider to an authentication provider of type @c
1092  * svn_auth_cred_ssl_server_trust_t, allocated in @a pool.
1093  *
1094  * @a *provider retrieves its credentials from the configuration
1095  * mechanism. The returned credential is used to override SSL
1096  * security on an error.
1097  *
1098  * @since New in 1.4.
1099  */
1100 void
1102  svn_auth_provider_object_t **provider,
1103  apr_pool_t *pool);
1104 
1105 /** Set @a *provider to an authentication provider of type @c
1106  * svn_auth_cred_ssl_client_cert_t, allocated in @a pool.
1107  *
1108  * @a *provider retrieves its credentials from the configuration
1109  * mechanism. The returned credential is used to load the appropriate
1110  * client certificate for authentication when requested by a server.
1111  *
1112  * @since New in 1.4.
1113  */
1114 void
1116  svn_auth_provider_object_t **provider,
1117  apr_pool_t *pool);
1118 
1119 
1120 /** Set @a *provider to an authentication provider of type @c
1121  * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the user's
1122  * ~/.subversion configuration directory.
1123  *
1124  * If the provider is going to save the passphrase unencrypted,
1125  * it calls @a plaintext_passphrase_prompt_func, passing @a
1126  * prompt_baton, before saving the passphrase.
1127  *
1128  * If @a plaintext_passphrase_prompt_func is NULL it is not called
1129  * and the passphrase is not stored in plaintext.
1130  * Client developers are highly encouraged to provide this callback
1131  * to ensure their users are made aware of the fact that their passphrase
1132  * is going to be stored unencrypted.
1133  *
1134  * Clients can however set the callback to NULL and set
1135  * SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT to SVN_CONFIG_FALSE or
1136  * SVN_CONFIG_TRUE to enforce a certain behaviour.
1137  *
1138  * Allocate @a *provider in @a pool.
1139  *
1140  * @since New in 1.6.
1141  */
1142 void
1144  svn_auth_provider_object_t **provider,
1145  svn_auth_plaintext_passphrase_prompt_func_t plaintext_passphrase_prompt_func,
1146  void *prompt_baton,
1147  apr_pool_t *pool);
1148 
1149 /** Like svn_auth_get_ssl_client_cert_pw_file_provider2, but without
1150  * the ability to call the svn_auth_plaintext_passphrase_prompt_func_t
1151  * callback, and the provider always assumes that it is not allowed
1152  * to store the passphrase in plaintext.
1153  *
1154  * @deprecated Provided for backwards compatibility with the 1.5 API.
1155  * @since New in 1.4.
1156  */
1158 void
1160  svn_auth_provider_object_t **provider,
1161  apr_pool_t *pool);
1162 
1163 
1164 /** Set @a *provider to an authentication provider of type @c
1165  * svn_auth_cred_ssl_server_trust_t, allocated in @a pool.
1166  *
1167  * @a *provider retrieves its credentials by using the @a prompt_func
1168  * and @a prompt_baton. The returned credential is used to override
1169  * SSL security on an error.
1170  *
1171  * @since New in 1.4.
1172  */
1173 void
1175  svn_auth_provider_object_t **provider,
1177  void *prompt_baton,
1178  apr_pool_t *pool);
1179 
1180 
1181 /** Set @a *provider to an authentication provider of type @c
1182  * svn_auth_cred_ssl_client_cert_t, allocated in @a pool.
1183  *
1184  * @a *provider retrieves its credentials by using the @a prompt_func
1185  * and @a prompt_baton. The returned credential is used to load the
1186  * appropriate client certificate for authentication when requested by
1187  * a server. The prompt will be retried @a retry_limit times. For
1188  * infinite retries, set @a retry_limit to value less than 0.
1189  *
1190  * @since New in 1.4.
1191  */
1192 void
1194  svn_auth_provider_object_t **provider,
1196  void *prompt_baton,
1197  int retry_limit,
1198  apr_pool_t *pool);
1199 
1200 
1201 /** Set @a *provider to an authentication provider of type @c
1202  * svn_auth_cred_ssl_client_cert_pw_t, allocated in @a pool.
1203  *
1204  * @a *provider retrieves its credentials by using the @a prompt_func
1205  * and @a prompt_baton. The returned credential is used when a loaded
1206  * client certificate is protected by a passphrase. The prompt will
1207  * be retried @a retry_limit times. For infinite retries, set
1208  * @a retry_limit to value less than 0.
1209  *
1210  * @since New in 1.4.
1211  */
1212 void
1214  svn_auth_provider_object_t **provider,
1216  void *prompt_baton,
1217  int retry_limit,
1218  apr_pool_t *pool);
1219 
1220 
1221 #ifdef __cplusplus
1222 }
1223 #endif /* __cplusplus */
1224 
1225 #endif /* SVN_AUTH_H */
svn_boolean_t may_save
Indicates if the credentials may be saved (to disk).
Definition: svn_auth.h:199
const char * password
Password.
Definition: svn_auth.h:194
svn_error_t * svn_auth_get_platform_specific_client_providers(apr_array_header_t **providers, svn_config_t *config, apr_pool_t *pool)
Set *providers to an array of svn_auth_provider_object_t * objects.
void svn_auth_get_windows_ssl_client_cert_pw_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_ssl_client_cert_pw_t that gets/sets...
void svn_auth_get_gnome_keyring_ssl_client_cert_pw_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_ssl_client_cert_pw_t that gets/sets...
const char * valid_until
ASCII date until which the certificate is valid.
Definition: svn_auth.h:314
The main authentication "provider" vtable.
Definition: svn_auth.h:94
svn_error_t *(* svn_auth_ssl_client_cert_pw_prompt_func_t)(svn_auth_cred_ssl_client_cert_pw_t **cred, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool)
Set *cred by prompting the user, allocating *cred in pool.
Definition: svn_auth.h:477
A provider object, ready to be put into an array and given to svn_auth_open().
Definition: svn_auth.h:158
SSL server certificate information used by SVN_AUTH_CRED_SSL_SERVER_TRUST providers.
Definition: svn_auth.h:305
void svn_auth_get_keychain_ssl_client_cert_pw_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_ssl_client_cert_pw_t that gets/sets...
svn_error_t * svn_auth_next_credentials(void **credentials, svn_auth_iterstate_t *state, apr_pool_t *pool)
Get another set of credentials, assuming previous ones failed to authenticate.
const char * cert_file
Absolute path to the certificate file.
Definition: svn_auth.h:242
svn_error_t *(* svn_auth_ssl_client_cert_prompt_func_t)(svn_auth_cred_ssl_client_cert_t **cred, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool)
Set *cred by prompting the user, allocating *cred in pool.
Definition: svn_auth.h:459
const char * cred_kind
The kind of credentials this provider knows how to retrieve.
Definition: svn_auth.h:97
const char * password
Certificate password.
Definition: svn_auth.h:277
void svn_auth_get_username_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_username_t that gets/sets informati...
const svn_version_t * svn_auth_gnome_keyring_version(void)
Get libsvn_auth_gnome_keyring version information.
svn_boolean_t may_save
Indicates if the credentials may be saved (to disk).
Definition: svn_auth.h:247
void svn_auth_get_simple_prompt_provider(svn_auth_provider_object_t **provider, svn_auth_simple_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_simple_t that gets information by p...
svn_error_t *(* svn_auth_plaintext_prompt_func_t)(svn_boolean_t *may_save_plaintext, const char *realmstring, void *baton, apr_pool_t *pool)
A type of callback function for asking whether storing a password to disk in plaintext is allowed...
Definition: svn_auth.h:497
SVN_AUTH_CRED_SSL_CLIENT_CERT credentials.
Definition: svn_auth.h:239
struct svn_auth_cred_ssl_client_cert_t svn_auth_cred_ssl_client_cert_t
SVN_AUTH_CRED_SSL_CLIENT_CERT credentials.
void svn_auth_get_ssl_client_cert_file_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_ssl_client_cert_t, allocated in pool.
void svn_auth_get_gnome_keyring_simple_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_simple_t that gets/sets information...
const char * valid_from
ASCII date from which the certificate is valid.
Definition: svn_auth.h:312
void svn_auth_get_keychain_simple_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_simple_t that gets/sets information...
struct svn_auth_cred_ssl_client_cert_pw_t svn_auth_cred_ssl_client_cert_pw_t
SVN_AUTH_CRED_SSL_CLIENT_CERT_PW credentials.
SVN_AUTH_CRED_SSL_SERVER_TRUST credentials.
Definition: svn_auth.h:331
struct svn_auth_iterstate_t svn_auth_iterstate_t
The type of a Subversion authentication-iteration object.
Definition: svn_auth.h:90
const char * issuer_dname
DN of the certificate issuer.
Definition: svn_auth.h:316
void svn_auth_get_kwallet_ssl_client_cert_pw_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_ssl_client_cert_pw_t that gets/sets...
Subversion error object.
Definition: svn_types.h:90
const char * hostname
Primary CN.
Definition: svn_auth.h:308
struct svn_config_t svn_config_t
Opaque structure describing a set of configuration options.
Definition: svn_config.h:53
SVN_AUTH_CRED_SSL_CLIENT_CERT_PW credentials.
Definition: svn_auth.h:274
struct svn_auth_ssl_server_cert_info_t svn_auth_ssl_server_cert_info_t
SSL server certificate information used by SVN_AUTH_CRED_SSL_SERVER_TRUST providers.
svn_error_t *(* svn_auth_ssl_server_trust_prompt_func_t)(svn_auth_cred_ssl_server_trust_t **cred, void *baton, const char *realm, apr_uint32_t failures, const svn_auth_ssl_server_cert_info_t *cert_info, svn_boolean_t may_save, apr_pool_t *pool)
Set *cred by prompting the user, allocating *cred in pool.
Definition: svn_auth.h:439
void svn_auth_get_ssl_server_trust_prompt_provider(svn_auth_provider_object_t **provider, svn_auth_ssl_server_trust_prompt_func_t prompt_func, void *prompt_baton, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_ssl_server_trust_t, allocated in pool.
svn_error_t * svn_auth_save_credentials(svn_auth_iterstate_t *state, apr_pool_t *pool)
Save a set of credentials.
void svn_auth_get_ssl_client_cert_pw_file_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Like svn_auth_get_ssl_client_cert_pw_file_provider2, but without the ability to call the svn_auth_pla...
void svn_auth_get_ssl_server_trust_file_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_ssl_server_trust_t, allocated in pool.
void(* svn_auth_simple_provider_func_t)(svn_auth_provider_object_t **provider, apr_pool_t *pool)
The type of function returning authentication provider.
Definition: svn_auth.h:166
void svn_auth_get_ssl_client_cert_prompt_provider(svn_auth_provider_object_t **provider, svn_auth_ssl_client_cert_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_ssl_client_cert_t, allocated in pool.
Version information.
Definition: svn_version.h:150
SVN_AUTH_CRED_SIMPLE credentials.
Definition: svn_auth.h:189
svn_error_t * svn_auth_first_credentials(void **credentials, svn_auth_iterstate_t **state, const char *cred_kind, const char *realmstring, svn_auth_baton_t *auth_baton, apr_pool_t *pool)
Get an initial set of credentials.
void(* svn_auth_ssl_client_cert_pw_provider_func_t)(svn_auth_provider_object_t **provider, apr_pool_t *pool)
A function returning an SSL client certificate passphrase provider.
Definition: svn_auth.h:252
struct svn_auth_provider_object_t svn_auth_provider_object_t
A provider object, ready to be put into an array and given to svn_auth_open().
Subversion's data types.
svn_error_t *(* svn_auth_simple_prompt_func_t)(svn_auth_cred_simple_t **cred, void *baton, const char *realm, const char *username, svn_boolean_t may_save, apr_pool_t *pool)
Credential-constructing prompt functions.
Definition: svn_auth.h:376
void svn_auth_set_parameter(svn_auth_baton_t *auth_baton, const char *name, const void *value)
Set an authentication run-time parameter.
struct svn_auth_baton_t svn_auth_baton_t
The type of a Subversion authentication object.
Definition: svn_auth.h:87
void svn_auth_get_ssl_client_cert_pw_prompt_provider(svn_auth_provider_object_t **provider, svn_auth_ssl_client_cert_pw_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_ssl_client_cert_pw_t, allocated in pool.
const char * fingerprint
ASCII fingerprint.
Definition: svn_auth.h:310
struct svn_auth_cred_simple_t svn_auth_cred_simple_t
SVN_AUTH_CRED_SIMPLE credentials.
void svn_auth_open(svn_auth_baton_t **auth_baton, const apr_array_header_t *providers, apr_pool_t *pool)
Initialize an authentication system.
svn_auth_ssl_server_cert_info_t * svn_auth_ssl_server_cert_info_dup(const svn_auth_ssl_server_cert_info_t *info, apr_pool_t *pool)
Return a deep copy of info, allocated in pool.
#define SVN_DEPRECATED
Macro used to mark deprecated functions.
Definition: svn_types.h:58
void svn_auth_get_username_prompt_provider(svn_auth_provider_object_t **provider, svn_auth_username_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_username_t that gets information by...
apr_uint32_t accepted_failures
Bit mask of the accepted failures.
Definition: svn_auth.h:339
const char * username
Username.
Definition: svn_auth.h:216
void svn_auth_get_simple_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Like svn_auth_get_simple_provider2, but without the ability to call the svn_auth_plaintext_prompt_fun...
const void * svn_auth_get_parameter(svn_auth_baton_t *auth_baton, const char *name)
Get an authentication run-time parameter.
struct svn_auth_cred_username_t svn_auth_cred_username_t
SVN_AUTH_CRED_USERNAME credentials.
void svn_auth_get_windows_ssl_server_trust_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_ssl_server_trust_t, allocated in pool.
const svn_version_t * svn_auth_kwallet_version(void)
Get libsvn_auth_kwallet version information.
svn_boolean_t may_save
Indicates if the credentials may be saved (to disk).
Definition: svn_auth.h:337
void svn_auth_get_ssl_client_cert_pw_file_provider2(svn_auth_provider_object_t **provider, svn_auth_plaintext_passphrase_prompt_func_t plaintext_passphrase_prompt_func, void *prompt_baton, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_ssl_client_cert_pw_t that gets/sets...
svn_error_t *(* svn_auth_plaintext_passphrase_prompt_func_t)(svn_boolean_t *may_save_plaintext, const char *realmstring, void *baton, apr_pool_t *pool)
A type of callback function for asking whether storing a passphrase to disk in plaintext is allowed...
Definition: svn_auth.h:516
Accessing SVN configuration files.
void svn_auth_get_windows_simple_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_simple_t that gets/sets information...
svn_error_t *(* svn_auth_username_prompt_func_t)(svn_auth_cred_username_t **cred, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool)
Set *cred by prompting the user, allocating *cred in pool.
Definition: svn_auth.h:396
const char * username
Username.
Definition: svn_auth.h:192
struct svn_auth_provider_t svn_auth_provider_t
The main authentication "provider" vtable.
int svn_boolean_t
YABT: Yet Another Boolean Type.
Definition: svn_types.h:370
svn_boolean_t may_save
Indicates if the credentials may be saved (to disk).
Definition: svn_auth.h:282
const char * ascii_cert
Base-64 encoded DER certificate representation.
Definition: svn_auth.h:318
struct svn_auth_cred_ssl_server_trust_t svn_auth_cred_ssl_server_trust_t
SVN_AUTH_CRED_SSL_SERVER_TRUST credentials.
SVN_AUTH_CRED_USERNAME credentials.
Definition: svn_auth.h:213
svn_error_t * svn_auth_get_platform_specific_provider(svn_auth_provider_object_t **provider, const char *provider_name, const char *provider_type, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_provider_object_t, or return NULL if the...
void svn_auth_get_simple_provider2(svn_auth_provider_object_t **provider, svn_auth_plaintext_prompt_func_t plaintext_prompt_func, void *prompt_baton, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_simple_t that gets/sets information...
void svn_auth_get_kwallet_simple_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool)
Set *provider to an authentication provider of type svn_auth_cred_simple_t that gets/sets information...
svn_boolean_t may_save
Indicates if the credentials may be saved (to disk).
Definition: svn_auth.h:221