Skip to content

Commit

Permalink
[VAULT-14990] Support retrieving kv secret paths with trailing spaces (
Browse files Browse the repository at this point in the history
  • Loading branch information
AnPucel authored May 10, 2022
1 parent 2d961cb commit 9a7c692
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog/15188.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
cli: kv get command now honors trailing spaces to retrieve secrets
```
6 changes: 4 additions & 2 deletions command/kv_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ func (c *KVGetCommand) Run(args []string) int {
// Parse the paths and grab the KV version
if mountFlagSyntax {
// In this case, this arg is the secret path (e.g. "foo").
partialPath = sanitizePath(args[0])
partialPath = args[0]

mountPath = sanitizePath(c.flagMount)
_, v2, err = isKVv2(mountPath, client)
if err != nil {
Expand All @@ -134,7 +135,8 @@ func (c *KVGetCommand) Run(args []string) int {
} else {
// In this case, this arg is a path-like combination of mountPath/secretPath.
// (e.g. "secret/foo")
partialPath = sanitizePath(args[0])
partialPath = args[0]

mountPath, v2, err = isKVv2(partialPath, client)
if err != nil {
c.UI.Error(err.Error())
Expand Down

0 comments on commit 9a7c692

Please sign in to comment.