mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-13 16:01:28 +05:30
Add go.mod, and vendor wincred v1.0.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
committed by
Tibor Vass
parent
f78081d1f7
commit
f7d32862eb
@@ -0,0 +1,8 @@
|
||||
module github.com/docker/docker-credential-helpers
|
||||
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
github.com/danieljoos/wincred v1.0.0
|
||||
github.com/stretchr/testify v1.7.0 // indirect
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
github.com/danieljoos/wincred v1.0.0 h1:JKQJ2Ek8EcovCUNlUTvLjXMw1onuHm3eMKSF8SEO8SI=
|
||||
github.com/danieljoos/wincred v1.0.0/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U=
|
||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
@@ -0,0 +1 @@
|
||||
*.go text eol=lf
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
|
||||
# Folders
|
||||
_obj
|
||||
_test
|
||||
|
||||
# Architecture specific extensions/prefixes
|
||||
*.[568vq]
|
||||
[568vq].out
|
||||
|
||||
*.cgo1.go
|
||||
*.cgo2.c
|
||||
_cgo_defun.c
|
||||
_cgo_gotypes.go
|
||||
_cgo_export.*
|
||||
|
||||
_testmain.go
|
||||
|
||||
*.exe
|
||||
*.test
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
wincred
|
||||
=======
|
||||
|
||||
Go wrapper around the Windows Credential Manager API functions.
|
||||
|
||||
[](https://ci.appveyor.com/project/danieljoos/wincred/branch/master)
|
||||
[](https://godoc.org/github.com/danieljoos/wincred)
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
```Go
|
||||
go get github.com/danieljoos/wincred
|
||||
```
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
See the following examples:
|
||||
|
||||
### Create and store a new generic credential object
|
||||
```Go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/danieljoos/wincred"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cred := wincred.NewGenericCredential("myGoApplication")
|
||||
cred.CredentialBlob = []byte("my secret")
|
||||
err := cred.Write()
|
||||
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Retrieve a credential object
|
||||
```Go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/danieljoos/wincred"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cred, err := wincred.GetGenericCredential("myGoApplication")
|
||||
if err == nil {
|
||||
fmt.Println(string(cred.CredentialBlob))
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Remove a credential object
|
||||
```Go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/danieljoos/wincred"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cred, err := wincred.GetGenericCredential("myGoApplication")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
cred.Delete()
|
||||
}
|
||||
```
|
||||
|
||||
### List all available credentials
|
||||
```Go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/danieljoos/wincred"
|
||||
)
|
||||
|
||||
func main() {
|
||||
creds, err := wincred.List()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
for i := range(creds) {
|
||||
fmt.Println(creds[i].TargetName)
|
||||
}
|
||||
}
|
||||
```
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
version: '{build}'
|
||||
clone_folder: c:\gopath\src\github.com\danieljoos\wincred
|
||||
environment:
|
||||
GOPATH: c:\gopath
|
||||
install:
|
||||
- cmd: >-
|
||||
rmdir c:\go /s /q
|
||||
|
||||
appveyor DownloadFile https://storage.googleapis.com/golang/go1.6.1.windows-amd64.msi
|
||||
|
||||
msiexec /i go1.6.1.windows-amd64.msi /q
|
||||
|
||||
go version
|
||||
|
||||
go env
|
||||
|
||||
go get -t
|
||||
build_script:
|
||||
- cmd: go install
|
||||
test_script:
|
||||
- cmd: >-
|
||||
cd %GOPATH%/src/github.com/danieljoos/wincred
|
||||
|
||||
go test -v -cover
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
# github.com/danieljoos/wincred v1.0.0
|
||||
github.com/danieljoos/wincred
|
||||
Reference in New Issue
Block a user