jaraco / jaraco/keyring

Secret schema on Linux is inconsistent with `keytar`

Open
#402 2 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**
Unfortunately it doesn't seem like there are predefined schemas for secrets in the freedesktop secretservice backend, other than for network servers. Keytar chose to use `account` and keyring chose `username`. Setting both fields would allow the libraries to interoperate. Alternatively, giving the user the ability to override the schema would allow them to fix this themselves, but then it's still likely that different library developers would choose incompatible schemas.

keytar is the most popular keychain library on NPM, so sharing a common schema would be likely to increase compatibility with Node applications that interface with common services.

https://github.com/atom/node-keytar/blob/master/src/keytar_posix.cc#L14-L17
https://github.com/jaraco/keyring/blob/master/keyring/backends/SecretService.py#L84-L87

**To Reproduce**
Steps to reproduce the behavior:
1. Add a secret with either library.
2. Try to retrieve the secret with the other library.
[it fails]

**Expected behavior**
The secret should be returned

**Environment**

- Ubuntu 18.04

```
$ pip list | grep keyring
10.6.0
...
$ keyring --list-backends

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with keyring/backends/SecretService.py around the schema lines referenced in the issue, then compare them with the linked node-keytar implementation. Reproduce the mismatch on the listed Linux environment by storing and retrieving a secret through both libraries. Done means the two libraries can retrieve each other's secrets using a compatible schema.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, security
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.