uberj/inv-tool — pull request #2 by whd (2013-04-19 22:21:06+00:00)
Title: Add keyring support to inv-tool

It's desirable to avoid storing LDAP credentials in plain text. This patch adds keyring support to inv-tool, akin to boto's, that allows you to store your password in the system keyring. See:

https://pypi.python.org/pypi/keyring

for more about the keyring bindings.

Instead of storing your credentials like this:

[authorization]
ldap_username = USERNAME
ldap_password = PASSWORD

Do this:

[authorization]
ldap_username = USERNAME
keyring = KEYRING_NAME

And to add your password to the keyring:

$ python
>>> import keyring
>>> keyring.set_password(KEYRING_NAME, USERNAME, PASSWORD)

NOTES:

The patch has some documentation change, but doesn't actually say explicitly how to set up the keyring (as this pull request does). The invtool.conf-dist provided looks to be a "fill in these fields" type example configuration file, while this would be of the "do this instead of that" variant. Anyway, docs may need to be updated to make the new functionality clearer.

If you are using Fedora, the python-keyring RPM provided in the standard distribution may be out of date, requiring you to install a newer version via another mechanism.