Skip to content

Instantly share code, notes, and snippets.

@frodopwns
Created April 11, 2016 21:13
Show Gist options
  • Save frodopwns/05022429594318cf2e86a413ed2b4b13 to your computer and use it in GitHub Desktop.
Save frodopwns/05022429594318cf2e86a413ed2b4b13 to your computer and use it in GitHub Desktop.
cfg := api.DefaultConfig()
cfg.Address = "https://your_vault_addr:8200"
client, err := api.NewClient(cfg)
if err != nil {
fmt.Println(err)
}
inputs := map[string]string{
"mount": "github",
"token": "token",
}
cliHandler := github.CLIHandler{}
cTok, err2 := cliHandler.Auth(client, inputs)
if err2 != nil {
fmt.Println(err2)
}
client.SetToken(cTok)
l := client.Logical()
s, err3 := l.Read("secret/testing")
if err3 != nil {
fmt.Println(err3)
}
fmt.Printf("%+v\n", *cfg)
fmt.Printf("%+v\n", *client)
fmt.Printf("%+v\n", *s)`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment