jaraco / keyring

MIT License
1.24k stars 152 forks source link

namespace problem / some items are not(?) in the namespace #653

Closed damnmso closed 9 months ago

damnmso commented 11 months ago

Describe the bug i wrote an application that uses keyring to store 3 secret variables. those should be in the same namespace. but looks like they are not.

To Reproduce Steps to reproduce the behavior: 1) use a code piece like that:

        keyring.set_password("obv_usermgmt", "DOMADMIN_USER", "pass")
        keyring.set_password("obv_usermgmt", "JIRA_TOKEN", "pass")
        keyring.set_password("obv_usermgmt", "DOMADMIN_PASS", "pass")

2) go to windows credentials and check

Expected behavior i would expect all 3 users in the namespace obv_usermgmt, but it looks like they are not. image

i am not 100% sure if its possible inside windows to have them all 3 look like the DOMADMIN_PASS and not as entry with $VARIABLE@obv_usermgmt

Environment

$ pip list | grep keyring
keyring                   24.2.0
...
$ keyring --list-backends
keyring.backends.chainer.ChainerBackend (priority: -1)
keyring.backends.fail.Keyring (priority: 0)
keyring.backends.Windows.WinVaultKeyring (priority: 5)

...

Additional context

jaraco commented 9 months ago

You're right. I don't think Windows Credential Vault allows you to have multiple passwords for the same System with different usernames. That's why keyring will set a "compound name" if a password already exists for the System (service). It's possible Windows Credential Vault has evolved since the code was originally written and it would be great to get rid of that logic if it's no longer needed, but unless someone wishes to investigate, I don't believe there's anything keyring could do differently.