Port over some changes

This commit is contained in:
Jeff Mitchell
2017-11-30 09:43:07 -05:00
parent f6839fb9d6
commit c2cef877f4
15 changed files with 203 additions and 27 deletions

View File

@@ -377,7 +377,7 @@ func (c *AuthCommand) listMethods() int {
}
sort.Strings(paths)
columns := []string{"Path | Type | Accessor | Default TTL | Max TTL | Replication Behavior | Description"}
columns := []string{"Path | Type | Accessor | Default TTL | Max TTL | Replication Behavior | Seal Wrap | Description"}
for _, path := range paths {
auth := auth[path]
defTTL := "system"
@@ -393,7 +393,7 @@ func (c *AuthCommand) listMethods() int {
replicatedBehavior = "local"
}
columns = append(columns, fmt.Sprintf(
"%s | %s | %s | %s | %s | %s | %s", path, auth.Type, auth.Accessor, defTTL, maxTTL, replicatedBehavior, auth.Description))
"%s | %s | %s | %s | %s | %s | %t | %s", path, auth.Type, auth.Accessor, defTTL, maxTTL, replicatedBehavior, auth.SealWrap, auth.Description))
}
c.Ui.Output(columnize.SimpleFormat(columns))

View File

@@ -16,12 +16,13 @@ type AuthEnableCommand struct {
func (c *AuthEnableCommand) Run(args []string) int {
var description, path, pluginName string
var local bool
var local, sealWrap bool
flags := c.Meta.FlagSet("auth-enable", meta.FlagSetDefault)
flags.StringVar(&description, "description", "", "")
flags.StringVar(&path, "path", "", "")
flags.StringVar(&pluginName, "plugin-name", "", "")
flags.BoolVar(&local, "local", false, "")
flags.BoolVar(&sealWrap, "seal-wrap", false, "")
flags.Usage = func() { c.Ui.Error(c.Help()) }
if err := flags.Parse(args); err != nil {
return 1
@@ -60,7 +61,8 @@ func (c *AuthEnableCommand) Run(args []string) int {
Config: api.AuthConfigInput{
PluginName: pluginName,
},
Local: local,
Local: local,
SealWrap: sealWrap,
}); err != nil {
c.Ui.Error(fmt.Sprintf(
"Error: %s", err))
@@ -110,6 +112,8 @@ Auth Enable Options:
-local Mark the mount as a local mount. Local mounts
are not replicated nor (if a secondary)
removed by replication.
-seal-wrap Turn on seal wrapping for the mount.
`
return strings.TrimSpace(helpText)
}
@@ -137,5 +141,6 @@ func (c *AuthEnableCommand) AutocompleteFlags() complete.Flags {
"-path": complete.PredictNothing,
"-plugin-name": complete.PredictNothing,
"-local": complete.PredictNothing,
"-seal-wrap": complete.PredictNothing,
}
}

View File

@@ -16,7 +16,7 @@ type MountCommand struct {
func (c *MountCommand) Run(args []string) int {
var description, path, defaultLeaseTTL, maxLeaseTTL, pluginName string
var local, forceNoCache bool
var local, forceNoCache, sealWrap bool
flags := c.Meta.FlagSet("mount", meta.FlagSetDefault)
flags.StringVar(&description, "description", "", "")
flags.StringVar(&path, "path", "", "")
@@ -25,6 +25,7 @@ func (c *MountCommand) Run(args []string) int {
flags.StringVar(&pluginName, "plugin-name", "", "")
flags.BoolVar(&forceNoCache, "force-no-cache", false, "")
flags.BoolVar(&local, "local", false, "")
flags.BoolVar(&sealWrap, "seal-wrap", false, "")
flags.Usage = func() { c.Ui.Error(c.Help()) }
if err := flags.Parse(args); err != nil {
return 1
@@ -66,7 +67,8 @@ func (c *MountCommand) Run(args []string) int {
ForceNoCache: forceNoCache,
PluginName: pluginName,
},
Local: local,
Local: local,
SealWrap: sealWrap,
}
if err := client.Sys().Mount(path, mountInfo); err != nil {
@@ -131,6 +133,8 @@ Mount Options:
-local Mark the mount as a local mount. Local mounts
are not replicated nor (if a secondary)
removed by replication.
-seal-wrap Turn on seal wrapping for the mount.
`
return strings.TrimSpace(helpText)
}
@@ -160,5 +164,6 @@ func (c *MountCommand) AutocompleteFlags() complete.Flags {
"-force-no-cache": complete.PredictNothing,
"-plugin-name": complete.PredictNothing,
"-local": complete.PredictNothing,
"-seal-wrap": complete.PredictNothing,
}
}

View File

@@ -42,7 +42,7 @@ func (c *MountsCommand) Run(args []string) int {
}
sort.Strings(paths)
columns := []string{"Path | Type | Accessor | Plugin | Default TTL | Max TTL | Force No Cache | Replication Behavior | Description"}
columns := []string{"Path | Type | Accessor | Plugin | Default TTL | Max TTL | Force No Cache | Replication Behavior | Seal Wrap | Description"}
for _, path := range paths {
mount := mounts[path]
pluginName := "n/a"
@@ -70,8 +70,8 @@ func (c *MountsCommand) Run(args []string) int {
replicatedBehavior = "local"
}
columns = append(columns, fmt.Sprintf(
"%s | %s | %s | %s | %s | %s | %v | %s | %s", path, mount.Type, mount.Accessor, pluginName, defTTL, maxTTL,
mount.Config.ForceNoCache, replicatedBehavior, mount.Description))
"%s | %s | %s | %s | %s | %s | %v | %s | %t | %s", path, mount.Type, mount.Accessor, pluginName, defTTL, maxTTL,
mount.Config.ForceNoCache, replicatedBehavior, mount.SealWrap, mount.Description))
}
c.Ui.Output(columnize.SimpleFormat(columns))