jaraco / keyring

MIT License
1.26k stars 159 forks source link

libsecret: skip if there is no secret service running #603

Closed lazka closed 1 year ago

lazka commented 1 year ago

In case libsecret and its Python bindings are available the libsecret backend will get selected. This doesn't mean though that the system service it connects to is available.

This leads to the backend being used and then failing, for example in get_credential() with: g-dbus-error-quark: The name org.freedesktop.secrets is unknown (2)

To avoid this ask libsecret to connect to the system service first before considering to use it.

Fixes #600

lazka commented 1 year ago

I noticed priority gets called quite a lot (~8 times), so the priortiy/viable split that the code hints at seems like a good idea. In this case everything after the first call is quite fast with libsecret, so this shouldn't be a blocker. Just something I've noticed.

lazka commented 1 year ago

(oops, small conflict as I was trying to force push the black CI error fix at the same time, should be fixed again)

lazka commented 1 year ago

Thanks!