[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Configuring encrypted password caching: API proposal

From: David James <james82_at_gmail.com>
Date: Thu, 16 Oct 2008 09:17:38 -0700

Right now, our API for configuring encrypted password caching is
rather difficult to use. Right now, user applications which want to
use encrypted password stores must configure their application to load
different libraries and call different functions depending on what
password stores are available. I think that we should simplify our API
so that users can use encrypted password stores without writing their
own code to dynamically load the appropriate libraries.

The simplest possible API for loading encrypted password stores would
be an API that simply allowed users to specify the type of the
provider they want, and then we would return the provider if it is

/* Set *PROVIDER according to PROVIDER_TYPE,
 * allocating it in POOL. If no such provider is available,
 * set *PROVIDER to NULL.
svn_error_t *
svn_get_auth_provider(svn_auth_provider_object_t **provider,
                                 svn_auth_provider_type_t provider_type,
                                 apr_pool_t *pool)

svn_auth_provider_type_t might be an enum. Users who want to load a
bunch of providers can simply put all the providers they want in an
array and call svn_get_auth_provider for each provider. If a provider
is not available, the user will notice this and can act appropriately.

Once the svn_get_auth_provider API is available, users won't need to
access our platform-specific functions directly any more, so they
won't need to worry about conditionally linking in the appropriate
libraries or functions. This makes things much easier from a user
point of view.

From an implementation point of view, the necessary code for writing
svn_get_auth_provider has mostly already been written. Inside
libsvn_subr/cmdline.c, there is currently a static function called
get_auth_provider which implements most of the logic we need for the
svn_get_auth_provider API.

For sake of ease of use, the svn_get_auth_provider function should
support all auth providers, so that users don't need to use any of our
old auth provider functions anymore. These old functions can therefore
be deprecated for external use -- they will from now on only be used
internally by the svn_get_auth_provider API.




To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-10-16 18:17:55 CEST

This is an archived mail posted to the Subversion Dev mailing list.