File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ require (
1010 github.com/keybase/dbus v0.0.0-20220506165403-5aa21ea2c23a
1111 github.com/keybase/go-keychain v0.0.1
1212 github.com/stretchr/testify v1.10.0
13+ golang.org/x/sys v0.29.0
1314 golang.org/x/text v0.21.0
1415)
1516
@@ -19,7 +20,6 @@ require (
1920 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
2021 github.com/pmezard/go-difflib v1.0.0 // indirect
2122 golang.org/x/crypto v0.32.0 // indirect
22- golang.org/x/sys v0.29.0 // indirect
2323 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
2424 gopkg.in/yaml.v3 v3.0.1 // indirect
2525)
Original file line number Diff line number Diff line change 88
99 "github.com/danieljoos/wincred"
1010 "github.com/docker/secrets-engine/store"
11+ "golang.org/x/sys/windows"
1112 "golang.org/x/text/encoding/unicode"
1213 "golang.org/x/text/transform"
1314)
1718 ErrInvalidCredentialFlags = errors .New ("an invalid flag was specified for the flags parameter" )
1819 ErrInvalidCredentialParameter = errors .New ("protected field does not match provided value for an existing credential" )
1920 ErrNoLogonSession = errors .New ("logon session does not exist or there is no credential set associated with this logon session" )
21+ sysErrInvalidCredentialFlags = windows .Errno (windows .ERROR_INVALID_FLAGS )
22+ sysErrNoSuchLogonSession = windows .Errno (windows .ERROR_NO_SUCH_LOGON_SESSION )
2023)
2124
2225func (k * keychainStore [T ]) Delete (ctx context.Context , id store.ID ) error {
@@ -179,6 +182,10 @@ func mapWindowsCredentialError(err error) error {
179182 return ErrCredentialBadUsername
180183 case wincred .ErrInvalidParameter :
181184 return ErrInvalidCredentialParameter
185+ case sysErrInvalidCredentialFlags :
186+ return ErrInvalidCredentialFlags
187+ case sysErrNoSuchLogonSession :
188+ return ErrNoLogonSession
182189 }
183- return nil
190+ return err
184191}
You can’t perform that action at this time.
0 commit comments