jaraco / jaraco/keyring

get_credential(service, None) does not find anything after deleting one of two usernames

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

Description

on Windows 10, using the default backend:
```python
keyring.set_password('test', 'user-1', 'pwd-1')
keyring.set_password('test', 'user-2', 'pwd-2')
cred = keyring.get_credential('test', None)
print(cred.username, cred.password)
```
This returns `user-2 pwd-2`. So far, so good.

```python
keyring.delete_password('test', 'user-2')
cred = keyring.get_credential('test', 'user-1')
print(cred.username, cred.password)
cred = keyring.get_credential('test', None)
print(cred)
```
Here, the first output is `user-1 pwd-1`, showing that the first credential is still there.
However, the second output `None`, i.e. the credential is not found without a username.

Is this a bug, or an expected behaviour?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the Windows default-backend sequence using get_credential and delete_password with two usernames. Inspect how the backend handles username-less lookup after one credential is deleted, then compare that behavior with the reported result. Done means the behavior is explained and, if it is a bug, corrected with coverage for this sequence.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.