From a557eeaec9983f91d3cf70ed4d253e8517208c42 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Mon, 12 Aug 2013 19:07:38 +0300 Subject: [PATCH] docs: add documentation for configuration keys --- include/gsignond/gsignond-config-db.h | 28 +++++++++++++ include/gsignond/gsignond-config-dbus.h | 42 ++++++++++++++++++- include/gsignond/gsignond-config-general.h | 66 ++++++++++++++++++++++++++++++ src/common/gsignond-config.c | 8 ++-- 4 files changed, 139 insertions(+), 5 deletions(-) diff --git a/include/gsignond/gsignond-config-db.h b/include/gsignond/gsignond-config-db.h index 28ae6b9..555a711 100644 --- a/include/gsignond/gsignond-config-db.h +++ b/include/gsignond/gsignond-config-db.h @@ -26,9 +26,37 @@ #ifndef __GSIGNOND_CONFIG_DB_H_ #define __GSIGNOND_CONFIG_DB_H_ +/** + * SECTION:gsignond-config-db + * @title: Database configuration + * @short_description: gSSO database configuration keys + * @include: gsignond/gsignond-config.h + * + * Database configuration keys are defined below. See #GSignondConfig for how to use them. + */ + +/** + * GSIGNOND_CONFIG_DB_SSO: + * + * A prefix for database keys. Should be used only when defining new keys. + */ #define GSIGNOND_CONFIG_DB_SSO "Storage" +/** + * GSIGNOND_CONFIG_DB_SECRET_DB_FILENAME: + * + * The filename of the credentials database. + * + * Default value: "secret.db". + */ #define GSIGNOND_CONFIG_DB_SECRET_DB_FILENAME GSIGNOND_CONFIG_DB_SSO \ "/SecretDBFilename" +/** + * GSIGNOND_CONFIG_DB_METADATA_DB_FILENAME: + * + * The filename of the metadata database. + * + * Default value: "metadata.db". + */ #define GSIGNOND_CONFIG_DB_METADATA_DB_FILENAME GSIGNOND_CONFIG_DB_SSO \ "/MetadataDBFilename" diff --git a/include/gsignond/gsignond-config-dbus.h b/include/gsignond/gsignond-config-dbus.h index 2423b4d..a9cc13c 100644 --- a/include/gsignond/gsignond-config-dbus.h +++ b/include/gsignond/gsignond-config-dbus.h @@ -26,12 +26,52 @@ #ifndef __GSIGNOND_CONFIG_DBUS_H_ #define __GSIGNOND_CONFIG_DBUS_H_ -#define GSIGNOND_CONFIG_DBUS_TIMEOUTS "ObjectTimeouts" +/** + * SECTION:gsignond-config-dbus + * @title: DBus configuration + * @short_description: gSSO dbus configuration keys + * @include: gsignond/gsignond-config.h + * + * DBus configuration keys are defined below. See #GSignondConfig for how to use them. + */ +/** + * GSIGNOND_CONFIG_DBUS_TIMEOUTS: + * + * A prefix for dbus timeout keys. Should be used only when defining new keys. + */ +#define GSIGNOND_CONFIG_DBUS_TIMEOUTS "ObjectTimeouts" +/** + * GSIGNOND_CONFIG_DBUS_DAEMON_TIMEOUT: + * + * A timeout in seconds, after which the gSSO daemon will exit. If not set, + * the daemon will not exit. Has no effect if P2P DBus is in use. + * + * Can be overriden in debug + * builds by setting SSO_DAEMON_TIMEOUT environment variable. + */ #define GSIGNOND_CONFIG_DBUS_DAEMON_TIMEOUT GSIGNOND_CONFIG_DBUS_TIMEOUTS \ "/DaemonTimeout" +/** + * GSIGNOND_CONFIG_DBUS_IDENTITY_TIMEOUT: + * + * A timeout in seconds, after which inactive identity dbus objects will be removed. + * If not set, the dbus objects will persist. + * + * Can be overriden in debug + * builds by setting SSO_IDENTITY_TIMEOUT environment variable. + */ #define GSIGNOND_CONFIG_DBUS_IDENTITY_TIMEOUT GSIGNOND_CONFIG_DBUS_TIMEOUTS \ "/IdentityTimeout" +/** + * GSIGNOND_CONFIG_DBUS_AUTH_SESSION_TIMEOUT: + * + * A timeout in seconds, after which inactive authentication session dbus objects will be removed. + * If not set, the dbus objects will persist. + * + * Can be overriden in debug + * builds by setting SSO_AUTH_SESSION_TIMEOUT environment variable. + */ #define GSIGNOND_CONFIG_DBUS_AUTH_SESSION_TIMEOUT GSIGNOND_CONFIG_DBUS_TIMEOUTS \ "/AuthSessionTimeout" #endif /* __GSIGNOND_CONFIG_DBUS_H_ */ diff --git a/include/gsignond/gsignond-config-general.h b/include/gsignond/gsignond-config-general.h index 040b013..aca0b48 100644 --- a/include/gsignond/gsignond-config-general.h +++ b/include/gsignond/gsignond-config-general.h @@ -28,25 +28,91 @@ /** * SECTION:gsignond-config-general + * @title: General configuration * @short_description: gSSO general configuration keys * @include: gsignond/gsignond-config.h * * General configuration keys are defined below. See #GSignondConfig for how to use them. */ +/** + * GSIGNOND_CONFIG_GENERAL: + * + * A prefix for general keys. Should be used only when defining new keys. + */ #define GSIGNOND_CONFIG_GENERAL "General" +/** + * GSIGNOND_CONFIG_GENERAL_STORAGE_PATH: + * + * The path where gSSO is storing its metadata database. + * + * Default value: g_get_user_data_dir ()/gsignond, can be overriden in debug + * builds by setting SSO_STORAGE_PATH environment variable. + */ #define GSIGNOND_CONFIG_GENERAL_STORAGE_PATH GSIGNOND_CONFIG_GENERAL \ "/StoragePath" +/** + * GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR: + * + * The path where gSSO is looking for available extension modules. + * + * Default value: $(pkglibdir)/extensions, can be overriden in debug + * builds by setting SSO_EXTENSIONS_DIR environment variable. + */ #define GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR GSIGNOND_CONFIG_GENERAL \ "/ExtensionsDir" +/** + * GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR: + * + * The path where gSSO is looking for available plugins. + * + * Default value: $(pkglibdir)/plugins, can be overriden in debug + * builds by setting SSO_PLUGINS_DIR environment variable. + */ #define GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR GSIGNOND_CONFIG_GENERAL \ "/PluginsDir" +/** + * GSIGNOND_CONFIG_GENERAL_BIN_DIR: + * + * The path where gSSO is looking for the gsignond-plugind binary when it needs + * to start a plugin process. Can be used for finding other supplementary binaries in + * the future. + * + * Default value: $(bindir), can be overriden in debug + * builds by setting SSO_BIN_DIR environment variable. + */ #define GSIGNOND_CONFIG_GENERAL_BIN_DIR GSIGNOND_CONFIG_GENERAL \ "/BinDir" +/** + * GSIGNOND_CONFIG_GENERAL_EXTENSION: + * + * The name of the gSSO extension to use. If not specified, the default + * implementation is used (see #GSignondExtension). + * + * Can be overriden in debug + * builds by setting SSO_EXTENSION environment variable. + */ #define GSIGNOND_CONFIG_GENERAL_EXTENSION GSIGNOND_CONFIG_GENERAL \ "/Extension" +/** + * GSIGNOND_CONFIG_GENERAL_SECURE_DIR: + * + * The path where gSSO is storing its credentials database. + * + * Default value: g_get_user_data_dir ()/gsignond, can be overriden in debug + * builds by setting SSO_SECRET_PATH environment variable. + */ #define GSIGNOND_CONFIG_GENERAL_SECURE_DIR GSIGNOND_CONFIG_GENERAL \ "/SecureDir" +/** + * GSIGNOND_CONFIG_PLUGIN_TIMEOUT: + * + * A timeout in seconds, after which inactive plugin objects and processes are removed. + * If not set, the plugin objects will persist for possible reuse. + * + * Can be overriden in debug + * builds by setting SSO_PLUGIN_TIMEOUT environment variable. + */ #define GSIGNOND_CONFIG_PLUGIN_TIMEOUT GSIGNOND_CONFIG_GENERAL \ "/PluginTimeout" diff --git a/src/common/gsignond-config.c b/src/common/gsignond-config.c index 4ccd175..b5705db 100644 --- a/src/common/gsignond-config.c +++ b/src/common/gsignond-config.c @@ -44,9 +44,9 @@ * * #GSignondConfig holds configuration information as a set of keys and values * (integer or strings). The key names are defined in - * general config keys, - * database config keys, and - * DBus config keys. + * general config keys, + * database config keys, and + * DBus config keys. * * The configuration is discovered from these sources, in decreasing order of * priority: @@ -243,7 +243,7 @@ _load_environment (GSignondConfig *self) GSIGNOND_CONFIG_DBUS_IDENTITY_TIMEOUT, e_val); - e_val = g_getenv ("SSO_AUTHSESSION_TIMEOUT"); + e_val = g_getenv ("SSO_AUTH_SESSION_TIMEOUT"); if (e_val && (timeout = atoi(e_val))) gsignond_config_set_string (self, GSIGNOND_CONFIG_DBUS_AUTH_SESSION_TIMEOUT, -- 2.7.4