common: re-do GSignondConfig using GSignondDictionary
authorAlexander Kanavin <alex.kanavin@gmail.com>
Mon, 28 Jan 2013 19:47:47 +0000 (21:47 +0200)
committerAlexander Kanavin <alex.kanavin@gmail.com>
Mon, 28 Jan 2013 19:47:47 +0000 (21:47 +0200)
include/gsignond/gsignond-config.h
src/common/db/gsignond-secret-storage.c
src/common/gsignond-config.c
src/daemon/db/gsignond-db-metadata-database.c
src/daemon/gsignond-daemon.c

index f18cf0a..2b779f6 100644 (file)
@@ -63,31 +63,18 @@ GType gsignond_config_get_type (void) G_GNUC_CONST;
 
 GSignondConfig * gsignond_config_new ();
 
-gboolean gsignond_config_set_plugins_dir (GSignondConfig *config,
-                                          const gchar *dir);
-const gchar * gsignond_config_get_plugins_dir (GSignondConfig *config) G_GNUC_CONST;
-
-gboolean gsignond_config_set_extensions_dir (GSignondConfig *config,
-                                             const gchar *dir);
-const gchar * gsignond_config_get_extensions_dir (GSignondConfig *config) G_GNUC_CONST;
-
-gboolean gsignond_config_set_extension (GSignondConfig *config,
-                                        const gchar *extension);
-const gchar * gsignond_config_get_extension (GSignondConfig *config) G_GNUC_CONST;
-
-gboolean gsignond_config_set_daemon_timeout (GSignondConfig *config,
-                                             guint timeout);
-guint gsignond_config_get_daemon_timeout (GSignondConfig *config) G_GNUC_CONST;
-
-gboolean gsignond_config_set_identity_timeout (GSignondConfig *config,
-                                               guint timeout);
-guint gsignond_config_get_identity_timeout (GSignondConfig *config) G_GNUC_CONST;
-
-gboolean gsignond_config_set_auth_session_timeout (GSignondConfig *config,
-                                                   guint timeout);
-guint gsignond_config_get_auth_session_timeout (GSignondConfig *config) G_GNUC_CONST;
-
-const GHashTable * gsignond_config_get_config_table (GSignondConfig *config);
+gint
+gsignond_config_get_integer (GSignondConfig *config, const gchar *key);
+
+void
+gsignond_config_set_integer (GSignondConfig *config, const gchar *key,
+                             gint value) ;
+const gchar*
+gsignond_config_get_string (GSignondConfig *config, const gchar *key);
+
+void
+gsignond_config_set_string (GSignondConfig *config, const gchar *key,
+                             const gchar *value); 
 
 G_END_DECLS
 
index 7e9a68a..b579aea 100644 (file)
@@ -188,10 +188,7 @@ gsignond_secret_storage_open_db (GSignondSecretStorage *self)
     g_return_val_if_fail (GSIGNOND_IS_SECRET_STORAGE (self), FALSE);
     g_return_val_if_fail (self->config != NULL, FALSE);
 
-    config_table = gsignond_config_get_config_table(self->config);
-    g_return_val_if_fail (config_table != NULL, FALSE);
-
-    dir = (const gchar *) g_hash_table_lookup (config_table,
+    dir = gsignond_config_get_string (self->config,
             GSIGNOND_CONFIG_GENERAL_SECURE_DIR);
     if (!dir) {
         dir = g_get_user_data_dir ();
@@ -200,7 +197,7 @@ gsignond_secret_storage_open_db (GSignondSecretStorage *self)
             return FALSE;
         }
     }
-    filename = (const gchar *) g_hash_table_lookup (config_table,
+    filename = gsignond_config_get_string (self->config,
             GSIGNOND_CONFIG_DB_SECRET_DB_FILENAME);
     if (!filename) {
         filename = GSIGNOND_DB_SECRET_DEFAULT_DB_FILENAME;
index 2650cbb..35d1a29 100644 (file)
 #include "gsignond/gsignond-config-db.h"
 #include "gsignond/gsignond-config-dbus.h"
 #include "gsignond/gsignond-log.h"
-
-enum
-{
-    PROP_0,
-    PROP_CONFIG_TABLE,         /* key-value pair of all config options */
-    PROP_CONFIG_FILE_PATH,     /* configuration file path */
-    PROP_PLUGINS_DIR,          /* plugins direcotry location */
-    PROP_EXTENSIONS_DIR,       /* extensions directory location */
-    PROP_EXTENSION,            /* active extension */
-    PROP_DAEMON_TIMEOUT,       /* daemon dbus timeout */
-    PROP_IDENTITY_TIMEOUT,     /* identities dbus timeout */
-    PROP_AUTH_SESSION_TIMEOUT, /* session dbus timeout */
-    N_PROPERTIES
-};
-static GParamSpec *properties[N_PROPERTIES];
+#include "gsignond/gsignond-dictionary.h"
 
 struct _GSignondConfigPrivate
 {
     gchar *config_file_path;
-    GHashTable *config_table;
+    GSignondDictionary *config_table;
 };
 
 #define GSIGNOND_CONFIG_PRIV(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_CONFIG, GSignondConfigPrivate)
@@ -62,119 +48,51 @@ G_DEFINE_TYPE (GSignondConfig, gsignond_config, G_TYPE_OBJECT);
 static gboolean gsignond_config_load (GSignondConfig *config);
 static gboolean gsignond_config_load_environment (GSignondConfig *config);
 
-static gint
+gint
 gsignond_config_get_integer (GSignondConfig *config, const gchar *key)
 {
-    const gchar *value = g_hash_table_lookup (config->priv->config_table, key);
-    if (!value) return 0;
-
-    return (guint) atoi (value);
+    return (guint) atoi (gsignond_config_get_string(config, key));
 }
 
-static gboolean
+void
 gsignond_config_set_integer (GSignondConfig *config, const gchar *key,
                              gint value) 
 {
     gchar *s_value = 0;
-    g_return_val_if_fail (config && GSIGNOND_IS_CONFIG(config), FALSE);
+    g_return_if_fail (config && GSIGNOND_IS_CONFIG(config));
 
     s_value = g_strdup_printf ("%d", value);
-    if (!s_value) return FALSE;
+    if (!s_value) return;
 
-    g_hash_table_replace (config->priv->config_table,
+    gsignond_config_set_string (config,
                           (gpointer) key,
-                          (gpointer) s_value);
+                          s_value);
 
     g_free (s_value);
 
-    return FALSE;
 }
 
-
-static void
-gsignond_config_get_property (GObject    *object,
-                              guint       property_id,
-                              GValue     *value,
-                              GParamSpec *pspec)
+const gchar*
+gsignond_config_get_string (GSignondConfig *config, const gchar *key)
 {
-    GSignondConfig *self = GSIGNOND_CONFIG (object);
-
-    switch (property_id)
-    {
-        case PROP_CONFIG_TABLE:
-            g_value_set_pointer (value, self->priv->config_table);
-            break;
-        case PROP_CONFIG_FILE_PATH:
-            g_value_set_string (value, self->priv->config_file_path);
-            break;
-        case PROP_PLUGINS_DIR:
-            g_value_set_string (value, gsignond_config_get_plugins_dir (self));
-            break;
-        case PROP_EXTENSIONS_DIR:
-            g_value_set_string (value,
-                                gsignond_config_get_extensions_dir (self));
-            break;
-        case PROP_EXTENSION:
-            g_value_set_string (value,
-                                gsignond_config_get_extension (self));
-            break;
-        case PROP_DAEMON_TIMEOUT:
-            g_value_set_uint (value,
-                              gsignond_config_get_daemon_timeout (self));
-            break;
-        case PROP_IDENTITY_TIMEOUT:
-            g_value_set_uint (value,
-                              gsignond_config_get_identity_timeout (self));
-            break;
-        case PROP_AUTH_SESSION_TIMEOUT:
-            g_value_set_uint (value,
-                              gsignond_config_get_auth_session_timeout (self));
-            break;
-        default:
-            G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-    }
+    g_return_val_if_fail (config && GSIGNOND_IS_CONFIG(config), FALSE);
+
+    GVariant* value = gsignond_dictionary_get (config->priv->config_table, (gpointer)key);
+    if (!value) return NULL;
+
+    return g_variant_get_string(value, NULL);
 }
 
-static void
-gsignond_config_set_property (GObject      *object,
-                              guint         property_id,
-                              const GValue *value,
-                              GParamSpec   *pspec)
+void
+gsignond_config_set_string (GSignondConfig *config, const gchar *key,
+                             const gchar *value) 
 {
-    GSignondConfig *self = GSIGNOND_CONFIG (object);
-
-    switch (property_id)
-    {
-        case PROP_CONFIG_FILE_PATH:
-            self->priv->config_file_path =
-                g_strdup (g_value_get_string (value));
-            gsignond_config_load (self);
-            break;
-        case PROP_PLUGINS_DIR:
-            gsignond_config_set_plugins_dir (self, g_value_get_string (value));
-            break;
-        case PROP_EXTENSIONS_DIR:
-            gsignond_config_set_extensions_dir (self,
-                                                g_value_get_string (value));
-            break;
-        case PROP_EXTENSION:
-            gsignond_config_set_extension (self,
-                                           g_value_get_string (value));
-            break;
-        case PROP_DAEMON_TIMEOUT:
-            gsignond_config_set_daemon_timeout (self, g_value_get_uint (value));
-            break;
-        case PROP_IDENTITY_TIMEOUT:
-            gsignond_config_set_identity_timeout (self,
-                                                  g_value_get_uint (value));
-            break;
-        case PROP_AUTH_SESSION_TIMEOUT:
-            gsignond_config_set_auth_session_timeout (self,
-                                                      g_value_get_uint (value));
-            break;
-        default:
-            G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-    }
+    g_return_if_fail (config && GSIGNOND_IS_CONFIG(config));
+
+    gsignond_dictionary_set (config->priv->config_table,
+                          (gpointer) key,
+                          g_variant_new_string(value));
+
 }
 
 static void
@@ -186,7 +104,7 @@ gsignond_config_dispose (GObject *object)
     self = GSIGNOND_CONFIG (object);
 
     if (self->priv->config_table) {
-        g_hash_table_unref (self->priv->config_table);
+        gsignond_dictionary_free (self->priv->config_table);
         self->priv->config_table = NULL;
     }
 
@@ -215,8 +133,15 @@ gsignond_config_init (GSignondConfig *self)
     self->priv = GSIGNOND_CONFIG_PRIV (self);
 
     self->priv->config_file_path = NULL;
-    self->priv->config_table = g_hash_table_new_full (g_str_hash, g_str_equal,
-                                                      g_free, g_free);
+    self->priv->config_table = gsignond_dictionary_new();
+    
+    gsignond_config_set_string (self,
+                             (GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR),
+                             (GSIGNOND_PLUGINS_DIR));
+    gsignond_config_set_string (self,
+                             (GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR),
+                             (GSIGNOND_EXTENSIONS_DIR));
+    gsignond_config_load (self);
 }
 
 static void
@@ -226,73 +151,9 @@ gsignond_config_class_init (GSignondConfigClass *klass)
 
     g_type_class_add_private (object_class, sizeof (GSignondConfigPrivate));
 
-    object_class->get_property = gsignond_config_get_property;
-    object_class->set_property = gsignond_config_set_property;
     object_class->dispose = gsignond_config_dispose;
     object_class->finalize = gsignond_config_finalize;
 
-    properties[PROP_CONFIG_TABLE] =
-        g_param_spec_pointer ("config-table",
-                              "configuration key-value pairs",
-                              "All configuration options",
-                              G_PARAM_READABLE);
-
-    properties[PROP_CONFIG_FILE_PATH] =
-        g_param_spec_string ("config-file-path",
-                             "Daemon Config Path",
-                             "Daemon configuration file path",
-                             NULL,
-                             G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
-
-    properties[PROP_PLUGINS_DIR] =
-        g_param_spec_string ("plugins-dir",
-                             "Plugins Directory",
-                             "Plugins direcotry",
-                             GSIGNOND_PLUGINS_DIR, 
-                             G_PARAM_READWRITE);
-
-    properties[PROP_EXTENSIONS_DIR] =
-        g_param_spec_string ("extensions-dir",
-                             "Extensions Directroy",
-                             "Extensions directory",
-                             GSIGNOND_EXTENSIONS_DIR, 
-                             G_PARAM_READWRITE);
-
-    properties[PROP_EXTENSION] =
-        g_param_spec_string ("extension",
-                             "Active extension",
-                             "Active extension",
-                             "",
-                             G_PARAM_READWRITE);
-
-    properties[PROP_DAEMON_TIMEOUT] =
-        g_param_spec_uint ("daemon-timeout",
-                           "Daemon Timeout",
-                           "Daemon timeout",
-                           0, /* TODO: replace with minimum timeout */
-                           G_MAXINT, /* TODO: replace with maximum timeout */
-                           0, /* no timeout */
-                           G_PARAM_READWRITE);
-
-    properties[PROP_IDENTITY_TIMEOUT] =
-        g_param_spec_uint ("identity-timeout",
-                           "Identity Timeout",
-                           "Identity timeout",
-                           0, /* TODO: replace with minimum timeout */
-                           G_MAXUINT, /* TODO: replace with maximum timeout */
-                           300, /* 5 minutes */
-                           G_PARAM_READWRITE);
-
-    properties[PROP_AUTH_SESSION_TIMEOUT] =
-        g_param_spec_uint ("auth-session-timeout",
-                           "Auth Session Timeout",
-                           "Authentication session timeout",
-                           0, /* TODO: replace with minimum timeout */
-                           G_MAXUINT, /* TODO: replace with maximum timeout */
-                           300, /* 5 minutes */
-                           G_PARAM_READWRITE);
-
-    g_object_class_install_properties (object_class, N_PROPERTIES, properties);
 }
 
 static gboolean
@@ -307,7 +168,7 @@ gsignond_config_load (GSignondConfig *self)
     GKeyFile *settings = g_key_file_new ();
 
     if (!self->priv->config_file_path) {
-        def_config = g_getenv ("GSIGNOND_CONFIG");
+        def_config = g_strdup(g_getenv ("GSIGNOND_CONFIG"));
         if (!def_config)
             def_config = g_build_filename (g_get_user_config_dir(),
                                            "gsignond/gsignond.conf",
@@ -368,7 +229,7 @@ gsignond_config_load (GSignondConfig *self)
 
             INFO ("found config : '%s/%s' - '%s'", groups[i], keys[j], value);
 
-            g_hash_table_insert (self->priv->config_table, key, value);
+            gsignond_config_set_string (self, key, value);
 
             g_free (key);
             g_free (value);
@@ -398,216 +259,56 @@ gsignond_config_load_environment (GSignondConfig *config)
     
     e_val = g_getenv ("SSO_DAEMON_TIMEOUT");
     if (e_val && (timeout = atoi(e_val)))
-        g_hash_table_insert (config->priv->config_table,
+        gsignond_config_set_string (config,
                              GSIGNOND_CONFIG_DBUS_DAEMON_TIMEOUT,
                              (gpointer) e_val);
 
     e_val = g_getenv ("SSO_IDENTITY_TIMEOUT");
     if (e_val && (timeout = atoi(e_val)))
-        g_hash_table_insert (config->priv->config_table,
+        gsignond_config_set_string (config,
                              GSIGNOND_CONFIG_DBUS_IDENTITY_TIMEOUT,
                              (gpointer) e_val);
 
     e_val = g_getenv ("SSO_AUTHSESSION_TIMEOUT");
     if (e_val && (timeout = atoi(e_val)))
-        g_hash_table_insert (config->priv->config_table,
+        gsignond_config_set_string (config,
                              GSIGNOND_CONFIG_DBUS_AUTH_SESSION_TIMEOUT,
                              (gpointer) e_val);
 
     e_val = g_getenv ("SSO_LOGGING_LEVEL");
     if (e_val && (level = atoi(e_val)))
-        g_hash_table_insert (config->priv->config_table,
+        gsignond_config_set_string (config,
                              GSIGNOND_CONFIG_GENERAL_LOG_LEVEL,
                              (gpointer) e_val);
         //set_logging_level (level);
     
     e_val = g_getenv ("SSO_PLUGINS_DIR");
     if (e_val) 
-        g_hash_table_insert (config->priv->config_table,
+        gsignond_config_set_string (config,
                              GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR,
                              (gpointer) e_val);
 
     e_val = g_getenv ("SSO_EXTENSIONS_DIR");
     if (e_val) 
-        g_hash_table_insert (config->priv->config_table,
+        gsignond_config_set_string (config,
                              GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR,
                              (gpointer) e_val);
 
     e_val = g_getenv ("SSO_EXTENSION");
     if (e_val)
-        g_hash_table_insert (config->priv->config_table,
+        gsignond_config_set_string (config,
                              GSIGNOND_CONFIG_GENERAL_EXTENSION,
                              (gpointer) e_val);
 
     e_val = g_getenv ("SSO_STORAGE_PATH");
     if (e_val) {
-        g_hash_table_insert (config->priv->config_table,
+        gsignond_config_set_string (config,
                              GSIGNOND_CONFIG_GENERAL_STORAGE_PATH,
                              (gpointer) e_val);
         /* cam_config_set_storage_path (e_val); */
     }
 }
 
-gboolean
-gsignond_config_set_plugins_dir (GSignondConfig *config, const gchar *dir)
-{
-    g_return_val_if_fail (config && GSIGNOND_IS_CONFIG (config), FALSE);
-    g_return_val_if_fail (dir, FALSE);
-
-    const gchar *plugins_dir =
-        g_hash_table_lookup (config->priv->config_table,
-                             GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR);
-
-    if (plugins_dir && !g_strcmp0 (plugins_dir, dir)) {
-        return FALSE;
-    }
-
-    g_hash_table_replace (config->priv->config_table,
-                          GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR, (gpointer) dir);
-    g_object_notify_by_pspec (G_OBJECT (config), properties[PROP_PLUGINS_DIR]);
-
-    return TRUE;
-}
-
-const gchar *
-gsignond_config_get_plugins_dir (GSignondConfig *config)
-{
-    g_return_val_if_fail (config && GSIGNOND_IS_CONFIG (config), 0);
-
-    return (const gchar *) g_hash_table_lookup (config->priv->config_table,
-                                           GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR);
-}
-
-gboolean
-gsignond_config_set_extensions_dir (GSignondConfig *config, const gchar *dir)
-{
-    g_return_val_if_fail (config && GSIGNOND_IS_CONFIG (config), FALSE);
-    g_return_val_if_fail (dir, FALSE);
-
-    const gchar *extensions_dir =
-        g_hash_table_lookup (config->priv->config_table,
-                             GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR);
-
-    if (extensions_dir && !g_strcmp0 (extensions_dir, dir)) {
-        return FALSE;
-    }
-
-    g_hash_table_replace (config->priv->config_table,
-                          GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR,
-                          (gpointer) dir);
-    g_object_notify_by_pspec (G_OBJECT (config),
-                              properties[PROP_EXTENSIONS_DIR]);
-
-    return TRUE;
-}
-
-const gchar *
-gsignond_config_get_extensions_dir (GSignondConfig *config)
-{
-    g_return_val_if_fail (config && GSIGNOND_IS_CONFIG (config), 0);
-
-    return (const gchar *) g_hash_table_lookup (config->priv->config_table,
-                                        GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR);
-}
-
-gboolean
-gsignond_config_set_extension (GSignondConfig *config, const gchar *extension)
-{
-    g_return_val_if_fail (config && GSIGNOND_IS_CONFIG (config), FALSE);
-    g_return_val_if_fail (extension, FALSE);
-
-    const gchar *cur_ext =
-        g_hash_table_lookup (config->priv->config_table,
-                             GSIGNOND_CONFIG_GENERAL_EXTENSION);
-
-    if (cur_ext && !g_strcmp0 (cur_ext, extension)) {
-        return FALSE;
-    }
-
-    g_hash_table_replace (config->priv->config_table,
-                          GSIGNOND_CONFIG_GENERAL_EXTENSION,
-                          (gpointer) extension);
-
-    return TRUE;
-}
-
-const gchar *
-gsignond_config_get_extension (GSignondConfig *config)
-{
-    g_return_val_if_fail (config && GSIGNOND_IS_CONFIG (config), 0);
-
-    return (const gchar *) g_hash_table_lookup (config->priv->config_table,
-                                             GSIGNOND_CONFIG_GENERAL_EXTENSION);}
-
-gboolean
-gsignond_config_set_daemon_timeout (GSignondConfig *config, guint timeout)
-{
-    gboolean res =
-        gsignond_config_set_integer (config,
-                                     GSIGNOND_CONFIG_DBUS_DAEMON_TIMEOUT,
-                                     timeout);
-    
-    if (res) g_object_notify_by_pspec (G_OBJECT (config),
-                                       properties[PROP_DAEMON_TIMEOUT]);
-
-    return res;
-}
-
-guint
-gsignond_config_get_daemon_timeout (GSignondConfig *config)
-{
-    return gsignond_config_get_integer (config,
-                                        GSIGNOND_CONFIG_DBUS_DAEMON_TIMEOUT);
-}
-
-gboolean
-gsignond_config_set_identity_timeout (GSignondConfig *config, guint timeout)
-{
-    gboolean res =
-        gsignond_config_set_integer (config,
-                                     GSIGNOND_CONFIG_DBUS_IDENTITY_TIMEOUT,
-                                     timeout);
-
-    if (res) g_object_notify_by_pspec (G_OBJECT (config),
-                                       properties[PROP_IDENTITY_TIMEOUT]);
-
-    return res;
-}
-
-guint
-gsignond_config_get_identity_timeout (GSignondConfig *config)
-{
-    return gsignond_config_get_integer (config,
-                                        GSIGNOND_CONFIG_DBUS_IDENTITY_TIMEOUT);
-}
-
-gboolean
-gsignond_config_set_auth_session_timeout (GSignondConfig *config, guint timeout)
-{
-    gboolean res =
-        gsignond_config_set_integer (config,
-                                     GSIGNOND_CONFIG_DBUS_AUTH_SESSION_TIMEOUT,
-                                     timeout);
-
-    if (res) g_object_notify_by_pspec (G_OBJECT (config),
-                                       properties[PROP_AUTH_SESSION_TIMEOUT]);
-
-    return res;
-}
-
-guint
-gsignond_config_get_auth_session_timeout (GSignondConfig *config)
-{
-    return gsignond_config_get_integer (config,
-                                     GSIGNOND_CONFIG_DBUS_AUTH_SESSION_TIMEOUT);
-}
-
-const GHashTable *
-gsignond_config_get_config_table (GSignondConfig *config)
-{
-    return config->priv->config_table;
-}
-
 GSignondConfig *
 gsignond_config_new ()
 {
index 37607c0..e97ba8e 100644 (file)
@@ -848,10 +848,7 @@ gsignond_db_metadata_database_open (GSignondDbMetadataDatabase *self)
 
     g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), FALSE);
 
-    config_table = gsignond_config_get_config_table(self->config);
-    g_return_val_if_fail (config_table != NULL, FALSE);
-
-    filename = (const gchar *) g_hash_table_lookup (config_table,
+    filename = gsignond_config_get_string (self->config,
             GSIGNOND_CONFIG_DB_METADATA_DB_FILENAME);
 
     return _gsignond_db_metadata_database_open (
index 13d1385..259763b 100644 (file)
@@ -358,8 +358,10 @@ gsignond_daemon_init_extensions (GSignondDaemon *self)
     gchar *initf_name;
     GSignondExtensionInit ext_init;
 
-    ext_path = gsignond_config_get_extensions_dir (self->priv->config);
-    ext_name = gsignond_config_get_extension (self->priv->config);
+    ext_path = gsignond_config_get_string (self->priv->config, 
+        GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR);
+    ext_name = gsignond_config_get_string (self->priv->config,
+        GSIGNOND_CONFIG_GENERAL_EXTENSION);
     if (ext_name && !ext_path) return FALSE;
 
     if (ext_name && g_strcmp0 (ext_name, "default") != 0) {
@@ -410,10 +412,8 @@ gsignond_daemon_init_storage (GSignondDaemon *self)
 
     storage_location = gsignond_storage_manager_mount_filesystem (
                                                    self->priv->storage_manager);
-    config_table = gsignond_config_get_config_table (self->priv->config);
-    g_assert (config_table != NULL);
-    g_hash_table_replace (config_table, GSIGNOND_CONFIG_GENERAL_SECURE_DIR,
-                          g_strdup (storage_location));
+    gsignond_config_set_string(self->priv->config, 
+        GSIGNOND_CONFIG_GENERAL_SECURE_DIR, storage_location);                                                 
 
     return (storage_location != NULL);
 }
@@ -434,12 +434,14 @@ gsignond_daemon_open_database (GSignondDaemon *self)
 
 guint gsignond_daemon_identity_timeout (GSignondDaemon *self)
 {
-    return gsignond_config_get_identity_timeout (self->priv->config);
+    return gsignond_config_get_integer (self->priv->config,
+        GSIGNOND_CONFIG_DBUS_IDENTITY_TIMEOUT);
 }
 
 guint gsignond_daemon_auth_session_timeout (GSignondDaemon *self)
 {
-    return gsignond_config_get_auth_session_timeout (self->priv->config);
+    return gsignond_config_get_integer (self->priv->config,
+        GSIGNOND_CONFIG_DBUS_AUTH_SESSION_TIMEOUT);
 }
 
 static const gchar *