我正在尝试在golang中实现自定义Vault HTTP客户端。我成功地设法启动了Vault。但是,当我尝试启用AppRole时,我在HTTP响应中收到以下错误消息:
{"errors":["node not active but active node not found"]}
相关的代码片段是:
appRoleUrl := BASE_VAULT_URL + "sys/auth/approle"
// enable app role
_request := gorequest.New()
if _, body, errs := _request.Post(appRoleUrl).
Set("X-Vault-Token", rootToken).
Send(`{"type":"approle"}`).End(); hasErrs(errs) {
return errors.New(stringifyErrs(errs))
} else {
fmt.Println("enableAppRoleWithPolicy", body) // error here
return createACLPolicy(rootToken)
}
网址和根令牌是正确的!我错过了什么?