[gnome-online-accounts] daemon: Abstract the way we initialize the Kerberos provider
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] daemon: Abstract the way we initialize the Kerberos provider
- Date: Sat, 21 May 2016 09:50:07 +0000 (UTC)
commit f854c94e2b775770ef0f26e2f0e2de59d31a1c79
Author: Debarshi Ray <debarshir gnome org>
Date: Fri May 20 14:55:40 2016 +0200
daemon: Abstract the way we initialize the Kerberos provider
The Kerberos backend needs to perform some class-wide (ie. not
instance-specific) initialization when goa-daemon starts. This code is
embedded into the class' type registration code.
There is no reason to call out to the Kerberos provider explicitly by
creating a dummy instance. The provider class will perform all
necessary initialization at the time of extension registration. Merely
ensuring the extensions are registered is better because it makes the
backend implementation details more opaque.
https://bugzilla.gnome.org/show_bug.cgi?id=766733
src/daemon/goadaemon.c | 27 +++------------------------
src/goabackend/goakerberosprovider.c | 1 +
2 files changed, 4 insertions(+), 24 deletions(-)
---
diff --git a/src/daemon/goadaemon.c b/src/daemon/goadaemon.c
index 82b91b4..8379758 100644
--- a/src/daemon/goadaemon.c
+++ b/src/daemon/goadaemon.c
@@ -28,6 +28,7 @@
#include "goadaemon.h"
#include "goabackend/goabackend.h"
+#include "goabackend/goaprovider-priv.h"
#include "goabackend/goautils.h"
struct _GoaDaemon
@@ -210,26 +211,6 @@ on_network_monitor_network_changed (GoaDaemon *self, gboolean available)
queue_check_credentials (self);
}
-#ifdef GOA_KERBEROS_ENABLED
-static void
-activate_identity_service (GoaDaemon *self)
-{
- GoaProvider *provider;
-
- /* We activate the identity service implicitly by using the kerberos
- * backend. This way if the kerberos backend isn't enabled, we don't
- * end up starting the identity service needlessly
- */
- provider = goa_provider_get_for_provider_type (GOA_KERBEROS_NAME);
-
- if (provider != NULL)
- {
- g_debug ("activated kerberos provider");
- g_object_unref (provider);
- }
-}
-#endif
-
static void
goa_daemon_init (GoaDaemon *self)
{
@@ -243,6 +224,8 @@ goa_daemon_init (GoaDaemon *self)
goa_error_domain = GOA_ERROR;
goa_error_domain; /* shut up -Wunused-but-set-variable */
+ goa_provider_ensure_builtins_loaded ();
+
/* TODO: maybe nicer to pass in a GDBusConnection* construct property */
self->connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
@@ -291,10 +274,6 @@ goa_daemon_init (GoaDaemon *self)
g_dbus_object_manager_server_set_connection (self->object_manager, self->connection);
queue_check_credentials (self);
-
-#ifdef GOA_KERBEROS_ENABLED
- activate_identity_service (self);
-#endif
}
static void
diff --git a/src/goabackend/goakerberosprovider.c b/src/goabackend/goakerberosprovider.c
index d11815a..87314bc 100644
--- a/src/goabackend/goakerberosprovider.c
+++ b/src/goabackend/goakerberosprovider.c
@@ -85,6 +85,7 @@ goa_kerberos_provider_module_init (void)
{
create_object_manager ();
create_identity_manager ();
+ g_debug ("activated kerberos provider");
}
static const gchar *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]