jaraco / jaraco/keyring

SecretService KWallet backwards compatibility

Open
#730 3 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted Linux
Dominant language
Python
Stars
1.5k
Forks
196
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
KWallet has support for SecretService now, however, KWallet created entries appear to store the service as 'server' in SecretService, while SecretService created entries do not show up at all in the KWallet interface.

For example, this is a KWallet created entry, in GNOME Passwords:
Image

and, here's a Secret Service created entry:
Image

**To Reproduce**
Steps to reproduce the behavior:
1. Create an entry using KWallet

```sh
PYTHON_KEYRING_BACKEND=keyring.backends.kwallet.DBusKeyring keyring set example_service example_user
```
2. Requesting the entry using SecretService doesn't return anything
```sh
PYTHON_KEYRING_BACKEND=keyring.backends.SecretService.Keyring keyring get example_service example_user
```

The opposite also doesn't work.

**Expected behavior**
I expected get_password to work for both backends when both backends are supplied by KWallet.

**Environment**

- OS: Debian Forky

```
$ pip list | grep keyring
bash: pip: command not found
$ apt list --installed python3-keyring python3-secretstorage
python3-keyring/testing,testing,unstable,unstable,now 25.6.0-3 all [installed,automatic]
python3-secretstorage/testing,testing,unstable,unstable,now 3.4.0-1 all [installed,automatic]
$ keyring --list-backends
keyring.backends.SecretService.Keyring (priority: 5)
keyring.backends.kwallet.DBusKeyring (priority: 5.1)
keyring.backends.kwallet.DBusKeyringKWallet4 (priority: 4.1)
keyring.backends.fail.Keyring (priority: 0)
keyring.backends.libsecret.Keyring (priority: 4.8)
keyring.backends.chainer.ChainerBackend (priority: 10)
```

**Additional context**
The ChainerBackend does still work so this isn't an urgent issue, but I still thought it was worth raising to make it known. I believe a possible solution is to query both 'service' and 'server' for SecretService. KWallet will also only show entries with 'server', not 'service'.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing the keyring.backends.kwallet.DBusKeyring and keyring.backends.SecretService.Keyring entry points, reproducing the two keyring set/get commands from the report. Done means entries created through either KWallet or SecretService can be retrieved through both interfaces, including the differing service and server names.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.