Closed khurshid-alam closed 6 years ago
Two options:
Fork creating a kupfer_secretstorage plugin:
Direct use of secretstorage
has better performance but restrict your keys to secretstorage, keyring
have other backends.
Filter result of get_all_items:
Filter before Leaf creation
for obj in self.resource.get_all_items():
if obj.get('xdg:schema') == 'org.freedesktop.Secret.Generic'
yield KeyLeaf(obj)
I'm inclined to implement both and add a setting to filter :smile:
So we can access secret storage backends with keyring? Can you give an example?
May be using Using secret from gi would be better (They have asynchronous mode so that it doesn't block gui).
gi.require_version('Secret', '1')
from gi.repository import Secret
#Example using gi
EXAMPLE_SCHEMA = Secret.Schema.new("org.freedesktop.Secret.Generic",
Secret.SchemaFlags.NONE, {'rtm': Secret.SchemaAttributeType.STRING}
)
password = Secret.password_lookup_sync(EXAMPLE_SCHEMA, {'rtm': 'rtm_token'}, None)
print (password)
I will try and replicate keyring code with it.
This should be closed.
It would be nice if we can search and find (paste secret to clipboard) secret of an item in Seahorse or anything that uses libsecret.
For example:
Note: I only want to search those items which was created by me and not by chrome/firefox, .i.e which has
'xdg:schema': 'org.freedesktop.Secret.Generic'
So we use
search_items
instead ofget_all_items
in keysource ⟶Thoughts?