Skip to content

Instantly share code, notes, and snippets.

@meeuw
Created December 12, 2024 19:40
Show Gist options
  • Save meeuw/3e02a8f284bc2d5aa516a5ae2ef0ae1c to your computer and use it in GitHub Desktop.
Save meeuw/3e02a8f284bc2d5aa516a5ae2ef0ae1c to your computer and use it in GitHub Desktop.
List all secrets in gnome-keyring. Somewhat like secret-tool search --all where you don't have to specify any attributes.
import gi
gi.require_version('Secret', '1')
from gi.repository import Secret
for item in Secret.password_search_sync(None, {}, Secret.SearchFlags.ALL, None):
print(f'attributes {item.get_attributes()}')
print(f'label {item.get_label()}')
print(f'secret {item.retrieve_secret_sync().get()}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment