Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error code #13

Open
mrbardia72 opened this issue Aug 10, 2021 · 0 comments
Open

error code #13

mrbardia72 opened this issue Aug 10, 2021 · 0 comments

Comments

@mrbardia72
Copy link

mrbardia72 commented Aug 10, 2021

github.com/mch1307/vaultlib.(*Client).GetSecret:36: Could not get kv version

package main

import (
	"fmt"
	"log"
	"os"

	vault "github.com/mch1307/vaultlib"
)

func main() {
	err := os.Setenv("VAULT_ADDR", "http://localhost:8200")
	if err != nil {
		return
	}

	vcConf := vault.NewConfig()
	vcConf.Address = "http://localhost:8200"

	vcConf.AppRoleCredentials.RoleID = "myRoleID"
	vcConf.AppRoleCredentials.SecretID = "mySecretID"

	vaultCli, err := vault.NewClient(vcConf)
	if err != nil {
		log.Fatal(err)
	}
	kv, err := vaultCli.GetSecret("secrets/fabric_ca_credentials/admin")
	if err != nil {
		fmt.Println(err)
	}
	for k, v := range kv.KV {
		fmt.Printf("secret %v: %v\n", k, v)
	}
}

@mch1307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant