Closed janssen closed 7 years ago
Right, if you want to use the synchronous API, you need to install the Python GI bindings (aka PyGObject).
They cannot be installed from PyPI, but they are available in e.g. python3-gi
package on Debian/Ubuntu.
Unfortunately, I need secretstorage for a venv, that doesn't use the system Python, and I don't see any easy way to install the bindings there. How about catching the ImportError and just prompting using Python's "input" (or "raw_input" on Python 2) if that happens?
What is your use case? One of the key points of Secret Service is its integration with the desktop environments, so input
will simply make no sense here (and it's also not available in GUI applications).
If you need some simple API to store passwords in a command-line application, I think you should use something like python-keyring instead, which has, among others, an encrypted file backend.
If you really need desktop integration and want to use it from virtualenv, you can build PyGObject yourself from the source code.
Finally, you can install PyQt5 from PyPI and use it instead of PyGObject to implement the main loop. In this case you will need to use exec_prompt_qt
function of SecretStorage (or your own callback).
I'm running a command-line program that uses Python keyring to store secrets which allow it to communicate with a Web service (basically, a secure cookie, via keyringcookiejar). We want to use the user's login store for this, not an extra encrypted file that has to be locked and unlocked each time. We want this to work the same way it does on the Mac, where the keyring backend talks to the login keychain of the user. Prompting for the password using "raw_input" would work well for this.
What I'd really like is some option in secretstorage which would allow the user to select what method to use to get information from the user via a prompt.
The prompting is done not by SecretStorage. It is just a wrapper around the D-Bus API, the actual prompting is done by the server side (i.e. gnome-keyring). We have no control over this.
See the specification for details.
I'm seeing this failure:
Apparently there is also a dependency on some module 'gi'?