>>>>> "Javier" == Javier Jardón <[log in to unmask]> writes:
Javier> On Thu, 2011-06-02 at 13:32 -0400, Sam Hartman wrote:
>> Hi. So, I think I'd like to take a step back here.
>>
>> I'd like to ask you to document MoonshotServer.get_identity. On
>> inspection, I don't think it particularly does what I'd expect it
>> to do, and it's what I'd expect to involve services.
Javier> That's done now, take a look to this commit [1]
I've duplicated the documentation below for the convenience of the list:
/**
* This is the function used by the GSS mechanism to get the NAI,
* password and certificate of the ID card for the specificated service.
*
* The function will block until the user choose the ID card.
*
* @param nai NAI of the ID Card (optional)
* @param password Password of the ID Card (optional)
* @param service Service application request an ID Card for
First, service may be optional as well. See the first attachment to my
mail to Codethink last Monday.
* @param nai_out NAI stored in the ID Card
* @param password_out Password stored in the ID Card
* @param certificate Certificate stored in th ID Card
*
* @return true if the user choose a correct ID card for that service,
* false otherwise.
*/
This doesn't seem right.
My understanding is that we're storing a set of services associated with
an ID card to automate selection in cases where the user has already
chosen something.
This code seems to fail if the service is not attached to the ID card.
I'd expect this code to implement an algorithm similar to the one
described in "selecting a service" on
http://www.project-moonshot.org/devwiki/design/identity-provisioning/
The current version can be simpler because no rules will trigger since
rules have not been implemented, but I'd still expect a reasonably
complicated algorithm that dealt with automating things when the user
had previously selected an identity for a given service, and that
updated the service list associated with an ID card appropriately.
Also, previously, Rob said that the MSRPC and DBUS code was inherently
different and so different implementations would be needed, but all the
application logic would be in common code. However, there seems to be
significant logic that is cut&paste between moonshot-dbus-server.vala
and moonshot-msrpc-server.vala. The thing that mostly stands out is that
the loop that figures out whether a service is present in the ID card is
duplicated between these two functions.
I think code refactoring is required and more of the implementation
needs to move into the request object. Both get_identity for dbus and
msrpc have approximately the same signatures (we'd expect this).
So, I'd expect the flow to be:
* construct a request object passing in the inputs
* manage to arrange for a callback and yield in rpc-specific manner
* call a single method to retrieve the outputs from the request
>> I suspect once you've written a design for the get_identity
>> interface we'll be better in a position to understand the
>> disconnect and where we're missing uses of services.
Javier> I have a question here: should be the identity cards say
Javier> what services they provide, or is this done automatically
Javier> when the application makes the first identity request?
I don't understand the question.
>> I'm also concerned about the implementation of this interface.
>> There appears to be a single callback on the main window. What
>> happens when two different processes call
>> MoonshotServer.set_identity at the same time?
Javier> This should be fixed later today
It seems fixed for Linux. However for Windows, the RPC thread is left
blocked while the request is outstanding.
Does the runtime create new threads for each request? If not, will each
request be processed serially?
--Sam
|