Skip to content

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

@FLuzzi-csw

Description

@FLuzzi-csw

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 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions