Merge pull request #1531 from hashicorp/auth-mount-tune-params

Auth tune endpoints and config settings output from CLI
This commit is contained in:
Vishal Nayak
2016-06-20 20:24:47 -04:00
committed by GitHub
7 changed files with 271 additions and 81 deletions

View File

@@ -7,6 +7,7 @@ import (
"io"
"os"
"sort"
"strconv"
"strings"
"github.com/hashicorp/vault/api"
@@ -271,11 +272,19 @@ func (c *AuthCommand) listMethods() int {
}
sort.Strings(paths)
columns := []string{"Path | Type | Description"}
for _, k := range paths {
a := auth[k]
columns := []string{"Path | Type | Default TTL | Max TTL | Description"}
for _, path := range paths {
auth := auth[path]
defTTL := "system"
if auth.Config.DefaultLeaseTTL != 0 {
defTTL = strconv.Itoa(auth.Config.DefaultLeaseTTL)
}
maxTTL := "system"
if auth.Config.MaxLeaseTTL != 0 {
maxTTL = strconv.Itoa(auth.Config.MaxLeaseTTL)
}
columns = append(columns, fmt.Sprintf(
"%s | %s | %s", k, a.Type, a.Description))
"%s | %s | %s | %s | %s", path, auth.Type, defTTL, maxTTL, auth.Description))
}
c.Ui.Output(columnize.SimpleFormat(columns))