zalando / go-keyring

Cross-platform keyring interface for Go
MIT License
815 stars 82 forks source link

Add support for custom keyring names on linux #47

Open JojiiOfficial opened 4 years ago

JojiiOfficial commented 4 years ago

I've implemented a way to use custom keyring names (on linux). To let it compile on another OS than linux, every keyring_<os>.go file needs to implement the secretServiceProvider to allow a typecast in the keyring.go. This is required since there must be a way to set the keyringName in the keyring_linux.go from keyring.go to pass the desired keyring name.
I've successfully cross compiled a test application for every os
A test function for each function from the keyring interface is available as well. To use it a customKeyring object must be created using keyring.NewCustomKeyring("name"). Fixes #46

szuecs commented 4 years ago

Thanks for the pr, 2 comments from my side.