Skip to content

Commit

Permalink
Order list responses (#5178)
Browse files Browse the repository at this point in the history
We do this already in the CLI, but because we do it there the UI doesn't
have ordered responses.

We could put it in the UI, but it seems like we might as well just make
it nice for all API users.

Fixes #5141
  • Loading branch information
jefferai authored Aug 24, 2018
1 parent 7109c02 commit c3eae77
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions logical/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package logical
import (
"encoding/json"
"errors"
"sort"

"github.com/hashicorp/vault/helper/wrapping"
)
Expand Down Expand Up @@ -113,6 +114,7 @@ func ListResponse(keys []string) *Response {
Data: map[string]interface{}{},
}
if len(keys) != 0 {
sort.Strings(keys)
resp.Data["keys"] = keys
}
return resp
Expand Down

0 comments on commit c3eae77

Please sign in to comment.