[gnome-online-accounts/wip/rishi/kerberos: 1/2] identity: Add Renew to org.gnome.Identity.Manager



commit fb171684e3051ac3fcc75bfd8453b1e17b6865dd
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Aug 1 12:10:38 2016 +0200

    identity: Add Renew to org.gnome.Identity.Manager
    
    In a subsequent commit, we will use this to offer a button to
    explicitly renew Kerberos tickets from the UI.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769267

 src/goaidentity/goaidentityservice.c   |   29 +++++++++++++++++++++++++++++
 src/goaidentity/org.gnome.Identity.xml |   10 ++++++++++
 2 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/src/goaidentity/goaidentityservice.c b/src/goaidentity/goaidentityservice.c
index 89307c0..7cc402c 100644
--- a/src/goaidentity/goaidentityservice.c
+++ b/src/goaidentity/goaidentityservice.c
@@ -275,6 +275,34 @@ ensure_account_credentials (GoaIdentityService *self,
                                        self);
 }
 
+static gboolean
+goa_identity_service_handle_renew (GoaIdentityServiceManager *manager,
+                                   GDBusMethodInvocation     *invocation,
+                                   const char                *identifier,
+                                   GVariant                  *details)
+{
+  GoaIdentityService *self = GOA_IDENTITY_SERVICE (manager);
+  GTask *task;
+
+  task = g_task_new (self, NULL, NULL, NULL);
+  g_task_set_task_data (self, g_object_ref (invocation), g_object_ref);
+
+  goa_identity_manager_get_identity (GOA_IDENTITY_MANAGER (self->priv->identity_manager),
+                                     identifier,
+                                     NULL,
+                                     (GAsyncReadyCallback) on_got_identity_for_renew,
+                                     self);
+
+  goa_identity_manager_renew_identity (GOA_IDENTITY_MANAGER (self->priv->identity_manager),
+                                       identity,
+                                       NULL,
+                                       (GAsyncReadyCallback)
+                                       on_identity_renewed,
+                                       self);
+
+  return TRUE;
+}
+
 static void
 on_sign_in_handled (GoaIdentityService    *self,
                     GAsyncResult          *result,
@@ -640,6 +668,7 @@ goa_identity_service_handle_exchange_secret_keys (GoaIdentityServiceManager *man
 static void
 identity_service_manager_interface_init (GoaIdentityServiceManagerIface *interface)
 {
+  interface->handle_renew = goa_identity_service_handle_renew;
   interface->handle_sign_in = goa_identity_service_handle_sign_in;
   interface->handle_sign_out = goa_identity_service_handle_sign_out;
   interface->handle_exchange_secret_keys = goa_identity_service_handle_exchange_secret_keys;
diff --git a/src/goaidentity/org.gnome.Identity.xml b/src/goaidentity/org.gnome.Identity.xml
index 3857746..5ef4707 100644
--- a/src/goaidentity/org.gnome.Identity.xml
+++ b/src/goaidentity/org.gnome.Identity.xml
@@ -34,6 +34,16 @@
     </method>
 
     <!--
+        Renew:
+        @identifier: The identifier of the identity (i.e., a kerberos principal name)
+
+        Renews an identity.
+    -->
+    <method name="Renew">
+      <arg name="identifier" type="s" direction="in"/>
+    </method>
+
+    <!--
         SignIn:
         @identifier: kerberos principal or partial principal
         @details: Extra key/value pairs to set.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]