Sunday, May 3, 2009

Call for Advices: The design issues in the Python keyring lib

About this project's idea, here's the proposal's abstract:
As the Python desktop applications grew very fast, the need for a general, platform independent keyring API ,becomes important for development. Many services require authentication before they can be used. Application always needs to store these authentications safely.

This lib is aimed to address this problem. By making a single call to this library, an application can store login information on a keyring where the application can retrieve the information—also with a single call—when needed.
For more information, you may refer to Tarek's post on the original idea and the introduction of this project.

The design of this lib has been started. Here's the main issues in the design phase:

Issue #1, the architecture of the keyring lib.
There are several ways to implement an OS related lib. I've surveyed many related work on the python binding for the keyring service. These libs are designed for GTK (Gnome-python and Micheal's work ) or OSX(Keychain.py and PcMacAdmin) . Generally speaking, there are three way to implement such a lib.
  • Method 1, use the c/c++'s python extension. This method is used by Gnome-python for their gnomekeyring binding.
  • Method 2, load the system's library through the ctypes. PyMacAdmin use this way to wrap the Keychain service of OSX.
  • Method 3, execute a external tool using commonds. Keychain.py uses this method.
We prefer method 1, since it is faster and integrated with Python better.

Issue #2, about the lib's Windows implementation.
Windows dose not provided any keyring services like the Gnome keyring and KeyChain. One good option for Windows will be to provide our own lightweight keyring system, as we have everything needed in Python itself to do so. Another possible solution is using the CryptoAPI as Subversion did.

Issue #3, the API interface of this keyring lib.
We want to hear more voice from the potential developers who'll use this lib. An initial draft can be seen in the Tarek's post. I've also made some rough thoughts after looked into Subversion's code.
Since we've decided to construct the whole lib from bottom to up, and to make the API better. This issue is not in a hurry. It will always be waiting for your suggestions.

Any advice given will be credited. Don't hesitate to leave your thoughts here.:-)

2 comments:

Stuart Colville said...

I look forward to seeing how this pans out. It's going to be really great to have a proper cross platform python library for keychain access.

I totally agree that the best approach for the architecture is to be as low level as possible. When writing keychain.py I simply decided to 'shell out' as it was the quickest way to get what I needed - which at the time was just to provide a place to store credentials for a command line app without needing to meet the dependency of the objc libs for python.

In terms of the choices for cross platform keychains I'm wondering if a new general purpose keychain could be useful to more than just windows. Related to that there's some interesting content related to the development of 1Password (closed source mac application for password storage) where they created their own keychain format to get around certain limitations of the osx keychain particularly with regard to performance related to encryption. See http://help.agile.ws/1Password/os_x_keychain_history.html for more info. That url contains a link to the design document which provides more detail on how their keychain is designed.

The other possibility alluded to in Tarek's post is the idea that this library could be architected so you can add your own keychain backend.

longge said...

Because Louboutin Shoes have common features: sexy and charming, which is specific to the design style of Christian Louboutin Pumps . Footwear designer Christian Louboutin Boots designed in two aspects of originality and amazing prices. In general, the Christian Louboutin Sandals in a classic style at prices above $ 500.


The Hardy clothing attraction here is due to another reason, which is that anyone is able to own a piece of the garment due to its affordability. There are clothes and ED Hardy Shoes , which are priced in the lower side. Besides the various hardy shirt outlets this unique line of hardy shirts is also available online.


The Breitling is equipped with an exclusive automatic movement - Bentley Motors calibre. The COSC-certified Bentley Motors T incorporates a unique mechanism called the 30-second Montbrillant Datora , implying the central hand sweeps around the dial every 30 seconds, instead of 60 seconds as in case with common chronographs.

Post a Comment