Subversion 1.6.16
Defines | Functions

Cached authentication data

Accessing cached authentication data in the user config area. More...

Defines

#define SVN_CONFIG_REALMSTRING_KEY   "svn:realmstring"
 A hash-key pointing to a realmstring.

Functions

svn_error_tsvn_config_read_auth_data (apr_hash_t **hash, const char *cred_kind, const char *realmstring, const char *config_dir, apr_pool_t *pool)
 Use cred_kind and realmstring to locate a file within the ~/.subversion/auth/ area.
svn_error_tsvn_config_write_auth_data (apr_hash_t *hash, const char *cred_kind, const char *realmstring, const char *config_dir, apr_pool_t *pool)
 Use cred_kind and realmstring to create or overwrite a file within the ~/.subversion/auth/ area.
svn_error_tsvn_config_get_user_config_path (const char **path, const char *config_dir, const char *fname, apr_pool_t *pool)
 Put the absolute path to the user's configuration directory, or to a file within that directory, into *path.

Detailed Description

Accessing cached authentication data in the user config area.


Define Documentation

#define SVN_CONFIG_REALMSTRING_KEY   "svn:realmstring"

A hash-key pointing to a realmstring.

Every file containing authentication data should have this key.

Definition at line 492 of file svn_config.h.


Function Documentation

svn_error_t* svn_config_get_user_config_path ( const char **  path,
const char *  config_dir,
const char *  fname,
apr_pool_t *  pool 
)

Put the absolute path to the user's configuration directory, or to a file within that directory, into *path.

If config_dir is not NULL, it must point to an alternative config directory location. If it is NULL, the default location is used. If fname is not NULL, it must specify the last component of the path to be returned. This can be used to create a path to any file in the configuration directory.

Do all allocations in pool.

Hint: To get the user configuration file, pass SVN_CONFIG_CATEGORY_CONFIG for fname. To get the servers configuration file, pass SVN_CONFIG_CATEGORY_SERVERS for fname.

Since:
New in 1.6.
svn_error_t* svn_config_read_auth_data ( apr_hash_t **  hash,
const char *  cred_kind,
const char *  realmstring,
const char *  config_dir,
apr_pool_t *  pool 
)

Use cred_kind and realmstring to locate a file within the ~/.subversion/auth/ area.

If the file exists, initialize *hash and load the file contents into the hash, using pool. If the file doesn't exist, set *hash to NULL.

If config_dir is not NULL it specifies a directory from which to read the config overriding all other sources.

Besides containing the original credential fields, the hash will also contain SVN_CONFIG_REALMSTRING_KEY. The caller can examine this value as a sanity-check that the correct file was loaded.

The hashtable will contain const char * keys and svn_string_t * values.

svn_error_t* svn_config_write_auth_data ( apr_hash_t *  hash,
const char *  cred_kind,
const char *  realmstring,
const char *  config_dir,
apr_pool_t *  pool 
)

Use cred_kind and realmstring to create or overwrite a file within the ~/.subversion/auth/ area.

Write the contents of hash into the file. If config_dir is not NULL it specifies a directory to read the config overriding all other sources.

Also, add realmstring to the file, with key SVN_CONFIG_REALMSTRING_KEY. This allows programs (or users) to verify exactly which set credentials live within the file.

The hashtable must contain const char * keys and svn_string_t * values.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines