Re: New simpler gnome-keyring API



Stef Walter wrote:
> Havoc Pennington wrote:
>>  - the docs don't really explain what the NETWORK_PASSWORD,
>>    GENERIC_SECRET, NOTE thing is for. My understanding
>>    is that basically everyone should use GENERIC_SECRET?
> 
> True, good point. It may be that we could come up with some additional
> types and suggested sets of attributes to be used with them.
> 
>>  - more pie-in-the-sky, it *might* (or might not) be
>>    clearer/simpler to do the API as follows:
>>
>>     schema = gnome_keyring_item_schema_new(
>>        GNOME_KEYRING_ITEM_GENERIC_SECRET,
>>        GNOME_KEYRING_DEFAULT,
>>        _("My special password"),
>>        "login", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
>>        "server", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
>>        NULL);
> 
> Yes, I did give a schema based API a bit of thought, and it may be a
> good idea.

By combining these two ideas, I think it'll work nicely. I've changed
the API to something more like:

 * A schema defined by a static C structure, which defines allowed
   attributes and their types.
 * Predefined schemas in gnome-keyring
 * Each gnome_keyring_*_password() function accepts schema, and
   parses/validates its arguments accordingly.

See: http://live.gnome.org/GnomeKeyring/StoringPasswords

This should simplify the function calls, and hopefully encourage users
to use similar schemas and item types for similar things.

I'd like to include more predefined schemas with the next release of
gnome-keyring for things like web logins and http auth.

However I'm not really super clear on how a browser matches which
password to use for a given website. I'm sure it has to do with the
server/port, but more likely things like path, SSL also makes a difference.

Cheers,
Stef Walter



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