Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Session collection for testing libsecret backend #530

Merged
merged 2 commits into from Sep 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions keyring/backends/libsecret.py
Expand Up @@ -40,6 +40,7 @@ class Keyring(KeyringBackend):
"username": Secret.SchemaAttributeType.STRING,
},
)
collection = Secret.COLLECTION_DEFAULT

@properties.ClassProperty
@classmethod
Expand Down Expand Up @@ -77,7 +78,6 @@ def get_password(self, service, username):

def set_password(self, service, username, password):
"""Set password for the username of the service"""
collection = Secret.COLLECTION_DEFAULT
attributes = {
"application": self.appid,
"service": service,
Expand All @@ -86,7 +86,7 @@ def set_password(self, service, username, password):
label = "Password for '{}' on '{}'".format(username, service)
try:
stored = Secret.password_store_sync(
self.schema, attributes, collection, label, password, None
self.schema, attributes, self.collection, label, password, None
)
except GLib.Error as error:
quark = GLib.quark_try_string('secret-error')
Expand Down
1 change: 1 addition & 0 deletions tests/backends/test_libsecret.py
Expand Up @@ -18,6 +18,7 @@ def init_keyring(self):
"password prompts are for this keyring"
)
keyring = libsecret.Keyring()
keyring.collection = 'session'
return keyring


Expand Down