Skip to content

Instantly share code, notes, and snippets.

@calavera
Last active April 1, 2024 22:42
Show Gist options
  • Save calavera/38fe1701d69d508856eabb7ffa6b72e4 to your computer and use it in GitHub Desktop.
Save calavera/38fe1701d69d508856eabb7ffa6b72e4 to your computer and use it in GitHub Desktop.
package main
import (
"github.com/docker/docker-credential-helpers/client"
"github.com/docker/docker-credential-helpers/credentials"
)
var nativeStore = client.NewShellProgramFunc("docker-credential-secretservice")
func main() {
c := &credentials.Credentials{
ServerURL: "https://api.github.com",
Username: "token",
Secret: "my-super-secret-token",
}
client.Store(nativeStore, c)
storedCreds, err := client.Get(nativeStore, "https://api.github.com")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment