Log Message: |
Finish issue #4346 ("svn_auth_cleanup_walk() API and friends needs a
rethink").
Reenvision the svn_auth_cleanup_walk() function and plumbing as a
generic config-based credential walker that includes the ability to
trigger a deletion. This seems better match for the extent and
limitations of the implementation, which is but a mere convenience
wrapper around the management of Subversion's config-based auth store
and was never remotely related to "providers" or even "the auth
subsystem" in a meaningful way. Morever, by associating this logic
with a specific auth store (our config-based stuff), we can introduce
new auth stores (e.g., an encrypted store) without being tied to this
API.
(Don't hate me, rhuijben.)
* subversion/include/svn_auth.h
(svn_auth_cleanup_func_t, svn_auth_cleanup_walk): Removed.
(svn_auth_forget_credentials): New function.
* subversion/include/svn_config.h
(svn_config_auth_walk_func_t): Was svn_auth_cleanup_func_t(),
but trades the disinteresting 'provider' parameter for a 'hash'
parameter.
(svn_config_walk_auth_data): Was svn_auth.h:svn_auth_cleanup_walk(),
but drops the 'auth_baton' parameter in favor of 'config_dir' to
avoid the pretense that the auth_baton's registered providers even
matter. Also, provides all auth data via the callback now (which
is not strictly "cleanup" focused.
* subversion/libsvn_subr/config_auth.c
(svn_config_walk_auth_data): New function, a merge of
svn_auth_cleanup_walk() and svn_auth__simple_cleanup_walk(), but
which accepts a 'config_dir' instead of an 'auth_baton'.
* subversion/libsvn_subr/simple_providers.c
(svn_auth__simple_cleanup_walk): Merged into svn_config_cleanup_auth_data().
* subversion/libsvn_subr/auth.h
(svn_auth__simple_cleanup_walk): Removed unused prototype.
* subversion/libsvn_subr/auth.c
(make_cache_key): New helper.
(svn_auth_first_credentials): Use make_cache_key().
(svn_auth_forget_credentials): New function.
(svn_auth_cleanup_walk): Merged into svn_config_cleanup_auth_data().
* subversion/tests/libsvn_subr/auth-test.c
(cleanup_callback): Adjust to new prototype. Call
svn_auth_forget_credentials(), too.
(test_auth_clear): Add some comments, and track API changes.
|