mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
CLI: Tune plugin version for auth/secret mounts (#17277)
* Add -plugin-version flag to vault auth/secrets tune * CLI tests for auth/secrets tune * CLI test for plugin register * Plugin catalog listing bug where plugins of different type with the same name could be double counted * Use constant for -plugin-version flag name
This commit is contained in:
@@ -32,6 +32,7 @@ type SecretsEnableCommand struct {
|
||||
flagAllowedResponseHeaders []string
|
||||
flagForceNoCache bool
|
||||
flagPluginName string
|
||||
flagPluginVersion string
|
||||
flagOptions map[string]string
|
||||
flagLocal bool
|
||||
flagSealWrap bool
|
||||
@@ -173,6 +174,13 @@ func (c *SecretsEnableCommand) Flags() *FlagSets {
|
||||
"exist in Vault's plugin catalog.",
|
||||
})
|
||||
|
||||
f.StringVar(&StringVar{
|
||||
Name: flagNamePluginVersion,
|
||||
Target: &c.flagPluginVersion,
|
||||
Default: "",
|
||||
Usage: "Select the semantic version of the plugin to enable.",
|
||||
})
|
||||
|
||||
f.StringMapVar(&StringMapVar{
|
||||
Name: "options",
|
||||
Target: &c.flagOptions,
|
||||
@@ -320,6 +328,10 @@ func (c *SecretsEnableCommand) Run(args []string) int {
|
||||
if fl.Name == flagNameAllowedManagedKeys {
|
||||
mountInput.Config.AllowedManagedKeys = c.flagAllowedManagedKeys
|
||||
}
|
||||
|
||||
if fl.Name == flagNamePluginVersion {
|
||||
mountInput.Config.PluginVersion = c.flagPluginVersion
|
||||
}
|
||||
})
|
||||
|
||||
if err := client.Sys().Mount(mountPath, mountInput); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user