zalando / go-keyring

Cross-platform keyring interface for Go
MIT License
846 stars 84 forks source link

[Windows] Get, Set and Delete have unexpected and limiting behaviours #102

Open FLuzzi-csw opened 8 months ago

FLuzzi-csw commented 8 months ago

Hi, I've found an issue while retrieving credentials set in the Windows Credential Manager by another application (not using go-keyring).

Let's take this scenario, the main application sets a new credential to a specific service and username:

When trying to call keyring.Get("service:name","$YOUR_USERNAME"), the searched service name is created merging serviceName and username (searchedServiceName = service:name:$YOUR_USERNAME), this behaviour is implemented in the function credName.

This problem is the same also with keyring.Delete and keyring.Set.

Since changing this behavior would break every windows application using this library, I'd propose:

I'm open to work on this as soon as a decision is taken. Thanks 😄

mikkeloscar commented 8 months ago

Just do understand your use case from a high level, do you want to be able to set a credential with another app and read it with an app using go-keyring? Can you elaborate on the use case you have in mind?

FLuzzi-csw commented 8 months ago

Yes, you got it right. I need to access the credentials set by the main application (not using go-keyring) with an external tool that uses go-keyring. Sadly, the behaviour described before makes it impossible.