GNOME Bugzilla – Bug 656954
gnome-keyring use DBus for prompting
Last modified: 2011-12-19 07:41:49 UTC
gnome-keyring should define a DBus API and well known service name that it will use for prompting. It will provide a default implementation of that API, which shows the usual dialog. Then the Shell can implement this same API and gnome-keyring will prompt via gnome-shell system modal dialogs.
Created attachment 194289 [details] [review] Initial rough of dbus API This is the initial rough of the DBus API. Considerations: * Easy to implement, a single object/interface. * Async API with use of string identifiers instead of object paths. * This allows caller to listen on a single signal, and perform one less operation. * Instead of: CreatePrompt() (listen on new prompt object for signal PromptComplete) ShowPrompt() PromptComplete signal * We have the simpler: (listen on prompter object for all PromptComplete signals) DisplayPrompt() PromptComplete signal * The caller can optimize the signal by sending it back to the one caller instead of broadcasting. This is optional because we use DH to prevent other listeners from getting the password anyway. * Uses DH as implemented by GcrSecretExchange to establish an encrypted context as the password as its transferred back to the caller. I'm not happy with with the number and lack of extensibility for the arguments of DisplayPrompt and PromptComplete. I'd really like to use an a{ss} for extensibility in: * The DisplayPrompt() method. The a{sv} would include the warning, choice_label, and choice_default arguments. * The PromptComplete signal. The a{sv} would include the choice_selected argument. However I'm not sure how to do a{sv} in the javascript implementation in gnome-shell. How would I create an appropriate a{sv} in javascript for sending back over dbus? Ray, do you know?
*** Bug 652462 has been marked as a duplicate of this bug. ***
(In reply to comment #1) > How would I create an appropriate a{sv} in javascript for sending > back over dbus? let foo = {}; foo[key] = GLib.Variant.new(typeString, value);
I've redesigned this interface several times, and have been implementing it, and have decided to make it a private implementation detail in libgcr. This especially makes sense because we're using GcrSecretExchange to transfer the secrets.
Here's the completed interface and implementation. The dbus interface itself [1] is an implementation detail, which basically remotes the GcrPrompt interface [2]. [1] http://git.gnome.org/browse/gcr/tree/gcr/org.gnome.keyring.Prompter.xml [2] http://git.gnome.org/browse/gcr/tree/gcr/gcr-prompt.h