Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
keychain module - query (service, account)
-
@omz, this maybe a really stupid question, but given it's Christmas I will ask anyway. It seems to me you should be able to query the keychain module about services and accounts stored. I realise with that info you can then get the password stored. But this local, so someone would need physical access to your device to extract the passwords. Even without the query, if they had access to your device they could look through your scripts and more than likely find enough info to recover your passwords.
But without a way to query the services/accounts you have in your keychain, any sort of management is not possible. Then you have to record the services and accounts you have used somewhere else so you can remember them if you want to re-use that service.
I do see its function as is. But I still think it would be nice to be able to query it regarding the stored services/accounts. Even if the query api call had its own password(global to the device).
Ok, just food for thought. But at least in my mind, there is someone missing in this whole equation with keychain -
keychain module in Pythonista is a candidate for major overhaul. Lot of missing stuff like protecting passwords with Touch ID so other scripts can't silently retrieve them, sync / do not sync between devices, condition when they're accessible (always, unlocked, first unlock), etc. I'd recommend to start with Keychain Services to learn what can be done here.
-
@Phuket2 you mean like
keychain.get_services()
-
@JonB , yes thank you. But its not documented. I will raise an issue on the repo
BTW, I see it if I do dir(keychain), just didn't cross my mind too do it -
>>> import keychain >>> help(keychain)
-
@ccc , I understand. But because I didn't see it in the docs, I assumed there was some reason why this was not being exposed for security reasons, although I didn't make sense. Stupidly enough I did search for the keychain module in the site-packages which does not exist. I get why its not a python module. But in hindsight, i should have done dir or help on the module.
Live and learn I guess. -
I'm working on drop-in replacement of Pythonista keychain module. I'll include it in the Black Mamba when finished with things like Touch ID protection, labels, ... Not finished yet, but I decided to share Pythonista compatibility layer I've got in this module, so, others can learn what exactly Pythonista keychain module does, something about CF, ctypes, ... Here's the gist.