mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-12-24 14:27:07 +00:00
Added 'sys/auth/<path>/tune' endpoints.
Displaying 'Default TTL' and 'Max TTL' in the output of 'vault auth -methods'
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/vault/api"
|
||||
@@ -266,11 +267,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))
|
||||
|
||||
Reference in New Issue
Block a user