mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 02:57:59 +00:00
Add PKI base command (#18512)
Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com> Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
This commit is contained in:
@@ -526,6 +526,16 @@ func initCommands(ui, serverCmdUi cli.Ui, runOpts *RunOptions) {
|
|||||||
BaseCommand: getBaseCommand(),
|
BaseCommand: getBaseCommand(),
|
||||||
}, nil
|
}, nil
|
||||||
},
|
},
|
||||||
|
"pki": func() (cli.Command, error) {
|
||||||
|
return &PKICommand{
|
||||||
|
BaseCommand: getBaseCommand(),
|
||||||
|
}, nil
|
||||||
|
},
|
||||||
|
"pki health-check": func() (cli.Command, error) {
|
||||||
|
return &PKIHealthCheckCommand{
|
||||||
|
BaseCommand: getBaseCommand(),
|
||||||
|
}, nil
|
||||||
|
},
|
||||||
"plugin": func() (cli.Command, error) {
|
"plugin": func() (cli.Command, error) {
|
||||||
return &PluginCommand{
|
return &PluginCommand{
|
||||||
BaseCommand: getBaseCommand(),
|
BaseCommand: getBaseCommand(),
|
||||||
@@ -797,11 +807,6 @@ func initCommands(ui, serverCmdUi cli.Ui, runOpts *RunOptions) {
|
|||||||
ShutdownCh: MakeShutdownCh(),
|
ShutdownCh: MakeShutdownCh(),
|
||||||
}, nil
|
}, nil
|
||||||
},
|
},
|
||||||
"pki health-check": func() (cli.Command, error) {
|
|
||||||
return &PKIHealthCheckCommand{
|
|
||||||
BaseCommand: getBaseCommand(),
|
|
||||||
}, nil
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initCommandsEnt(ui, serverCmdUi, runOpts)
|
initCommandsEnt(ui, serverCmdUi, runOpts)
|
||||||
|
|||||||
39
command/pki.go
Normal file
39
command/pki.go
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
package command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/mitchellh/cli"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ cli.Command = (*PKICommand)(nil)
|
||||||
|
|
||||||
|
type PKICommand struct {
|
||||||
|
*BaseCommand
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *PKICommand) Synopsis() string {
|
||||||
|
return "Interact with Vault's Key-Value storage"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *PKICommand) Help() string {
|
||||||
|
helpText := `
|
||||||
|
Usage: vault pki <subcommand> [options] [args]
|
||||||
|
|
||||||
|
This command has subcommands for interacting with Vault's PKI Secrets
|
||||||
|
Engine. Here are some simple examples, and more detailed examples are
|
||||||
|
available in the subcommands or the documentation.
|
||||||
|
|
||||||
|
Check the health of a PKI mount, to the best of this token's abilities:
|
||||||
|
|
||||||
|
$ vault pki health-check pki
|
||||||
|
|
||||||
|
Please see the individual subcommand help for detailed usage information.
|
||||||
|
`
|
||||||
|
|
||||||
|
return strings.TrimSpace(helpText)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *PKICommand) Run(args []string) int {
|
||||||
|
return cli.RunResultHelp
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user