After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 656954 - gnome-keyring use DBus for prompting
gnome-keyring use DBus for prompting
Status: RESOLVED FIXED
Product: gnome-keyring
Classification: Core
Component: prompting
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
: 652462 (view as bug list)
Depends on: 656955
Blocks: 652459
 
 
Reported: 2011-08-20 14:08 UTC by Stef Walter
Modified: 2011-12-19 07:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Initial rough of dbus API (2.81 KB, patch)
2011-08-20 14:35 UTC, Stef Walter
none Details | Review

Description Stef Walter 2011-08-20 14:08:16 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.
Comment 1 Stef Walter 2011-08-20 14:35:04 UTC
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?
Comment 2 Stef Walter 2011-09-01 09:19:06 UTC
*** Bug 652462 has been marked as a duplicate of this bug. ***
Comment 3 Florian Müllner 2011-11-29 17:48:16 UTC
(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);
Comment 4 Stef Walter 2011-11-29 20:52:41 UTC
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.
Comment 5 Stef Walter 2011-12-19 07:41:49 UTC
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