[Authentication] Solution to prompting and async operations

Stef Walter stef-list at memberwebs.com
Sat Oct 31 18:31:05 PDT 2009


I've finally come up with a solution the whole set of problems to do
with prompting and long running or asynchronous operations. I believe
this covers every requirement. This wasn't an easy task.

 * Operations that may require prompting can optionally return
   the object path to a 'prompt object'.
 * The Prompt() method of the prompt object will then be called
   by the client application.
 * Prompts objects can be dismissed with the Dismiss() method
   of the prompt objects.
 * Prompt objects have a 'Completed' signal which is fired when
   the prompt and operation completes. A result can be returned.

This solves all sorts of problems:

 * Operations succeed or fail immediately but may defer their
   action pending user input.
 * No deferred failure of operations.
 * No strange race conditions between the starting and completion
   of an operation. Completion notification is simple.
 * Cancellation of prompting possible.
 * No long running DBus methods, with associated DBus timeout
   malarkey. I'm still not impressed with the design of DBus
   in this area.
 * Extensible to future operations.
 * Prompt timeouts can be implemented on the client side if
   so desired.
 * Prompts currently being displayed on behalf of a client
   application can be closed by an application (if the user
   closes a window, for example).
 * Prompts for an application are tied to the lifetime of that
   applications connection to the DBus bus.
 * Fast path when no prompts are neccessary.
 * Easy to batch prompting for unlocking.

Methods that optionally return prompt objects are listed here. Obviously
some service implementations would never prompt in certain situations.
But this API is meant to be able to handle varying service implementations.

 Service.CreateCollection
 Collection.Delete
 Collection.CreateItem
 Item.Delete
 Service.Unlock
 Service.Lock

Obviously multiple prompts could be shown for one prompt object. One
example would be the user could be prompted repeatedly until they type
the right password, or cancel. This would all be covered by one prompt
object.

I've pushed these changes, and am moving forward with implementation.
Comments are still welcome, but we need to actually get this stuff done,
so I hope that's okay.

Cheers,

Stef



More information about the Authentication mailing list