Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FLuzzi-csw opened this issue Jan 24, 2024 · 2 comments
Open

Comments

@FLuzzi-csw
Copy link

FLuzzi-csw commented Jan 24, 2024

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:

  • serviceName = service:name
  • username = $YOUR_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:

  • add a "raw" counterpart to the public apis (RawGet, RawSet and RawDelete) that skips this behaviour on Windows (on other systems this would be a proxy to the original calls)
  • expose a new public api that can set/toggle a raw mode on Windows, but this will create problems with concurrent goroutines (on other systems that would be a NOOP)

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

@FLuzzi-csw FLuzzi-csw changed the title [Windows] keyring.Get has unexpected and limiting behaviour [Windows] Get, Set and Delte have unexpected and limiting behaviours Jan 24, 2024
@FLuzzi-csw FLuzzi-csw changed the title [Windows] Get, Set and Delte have unexpected and limiting behaviours [Windows] Get, Set and Delete have unexpected and limiting behaviours Jan 25, 2024
@mikkeloscar
Copy link
Member

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants