zalando / go-keyring

Cross-platform keyring interface for Go
MIT License
847 stars 85 forks source link

Fallback to default secret object path #22

Closed ukautz closed 6 years ago

ukautz commented 6 years ago

The object path /org/freedesktop/secrets/collection/login is not necessarily available.

The D-Bus API reference from freedesktop.org specifies /org/freedesktop/secrets/aliases/default, which is commonly used. See: https://specifications.freedesktop.org/secret-service/ch12.html

This patch tries to accommodate both scenarios, by first checking whether the direct path is available. If so it will be used as before, if not it will fall back to the alias path.

ukautz commented 6 years ago

Here you go :)

mikkeloscar commented 6 years ago

:+1:

szuecs commented 6 years ago

:+1: