zalando / go-keyring

Cross-platform keyring interface for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] Persistent Keyring

hardikmodha opened this issue · comments

Hi, First of all, thanks to the maintainer team for the wonderful library.

Does go-keyring provide a persistent mechanism? Is it cross-platform? e.g. I want to persist some secret which should remain across machine restarts for n number of days. I've observed that stored secrets were getting removed when restarting the machine. Is it possible to achieve this with this library?

It uses the OS native keychain so it depends on that whether the credentials are stored or not. I personally use Linux and there they are persisted via the SecretService keychain implementation.

If you observe something else maybe we need to investigate what's happening. What OS are you using?

Just to confirm for me - I use this on MacOS and Linux and the tokens are permanent / they persist after restarting

Thanks for the confirmation guys. ATM I don't have all the necessary details as the issue was reported internally by someone else, I posted here to get inputs from the community. I'll get back with more details soon.

@mikkeloscar

I personally use Linux and there they are persisted via the SecretService keychain implementation.

Does SecretService keychain implementation require any additional packages like libdbus on Linux OS for persistent keyring? Is it present by default on Ubuntu, Redhat Enterprise Linux (RHEL), and CentOS?

It needs libdbus.

AFAIK Secret Service was supposed to be a standard, but it is only really implemented by the Gnome keyring - https://wiki.gnome.org/Projects/GnomeKeyring/KeyringIntro
It should be present wherever you have Gnome installed.

There's a PR #52 open for kwallet (KDE) support (that also needs dbus).