Skip to content

Commit

Permalink
fix(vault): Fix support for versioned k/v store
Browse files Browse the repository at this point in the history
  • Loading branch information
timo-reymann committed Oct 25, 2024
1 parent babdeed commit 164cddf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/vault/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ type vaultResponse struct {
}

func getSecret(addr string, token string, path string, field string) (string, error) {
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/v1/%s", strings.TrimSuffix(addr, "/"), path), bytes.NewBuffer([]byte{}))
pathParts := strings.SplitN(path, "/", 2)
engine, secret := pathParts[0], pathParts[1]

req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/v1/%s/data/%s", strings.TrimSuffix(addr, "/"), engine, secret), bytes.NewBuffer([]byte{}))
if err != nil {
return "", err
}
Expand Down

0 comments on commit 164cddf

Please sign in to comment.