Address some review feedback
This commit is contained in:
parent
5341cb69cc
commit
455931873a
|
@ -166,6 +166,7 @@ func outputFormatTableList(ui cli.Ui, s *api.Secret, bare bool) int {
|
|||
for _, k := range s.Data["keys"].([]string) {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
|
||||
for _, k := range keys {
|
||||
input = append(input, fmt.Sprintf("%s", k))
|
||||
|
|
|
@ -30,11 +30,8 @@ func handleLogical(core *vault.Core, dataOnly bool) http.Handler {
|
|||
op = logical.DeleteOperation
|
||||
case "GET":
|
||||
// Need to call ParseForm to get query params loaded
|
||||
err := r.ParseForm()
|
||||
if err != nil {
|
||||
respondError(w, http.StatusBadRequest, err)
|
||||
}
|
||||
if r.Form.Get("list") == "true" {
|
||||
queryVals := r.URL.Query()
|
||||
if queryVals.Get("list") == "true" {
|
||||
op = logical.ListOperation
|
||||
} else {
|
||||
op = logical.ReadOperation
|
||||
|
|
|
@ -3,7 +3,6 @@ package vault
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/vault/logical"
|
||||
|
@ -168,8 +167,6 @@ func (b *CubbyholeBackend) handleList(
|
|||
strippedKeys[i] = req.MountPoint + req.Path + strings.TrimPrefix(key, req.ClientToken+"/")
|
||||
}
|
||||
|
||||
sort.Strings(strippedKeys)
|
||||
|
||||
// Generate the response
|
||||
return logical.ListResponse(strippedKeys), nil
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package vault
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -227,9 +226,6 @@ func (b *PassthroughBackend) handleList(
|
|||
retKeys[i] = req.MountPoint + req.Path + k
|
||||
}
|
||||
|
||||
// Sort
|
||||
sort.Strings(retKeys)
|
||||
|
||||
// Generate the response
|
||||
return logical.ListResponse(retKeys), nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue