mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00:00
command/write
This commit is contained in:
54
command/read.go
Normal file
54
command/read.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// ReadCommand is a Command that gets data from the Vault.
|
||||
type ReadCommand struct {
|
||||
Meta
|
||||
}
|
||||
|
||||
func (c *ReadCommand) Run(args []string) int {
|
||||
flags := c.Meta.FlagSet("read", FlagSetDefault)
|
||||
flags.Usage = func() { c.Ui.Error(c.Help()) }
|
||||
if err := flags.Parse(args); err != nil {
|
||||
return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
func (c *ReadCommand) Synopsis() string {
|
||||
return "Read data or secrets from Vault"
|
||||
}
|
||||
|
||||
func (c *ReadCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: vault get [options] path
|
||||
|
||||
Read data from Vault.
|
||||
|
||||
Read reads data at the given path from Vault. This can be used to
|
||||
read secrets and configuration as well as generate dynamic values from
|
||||
materialized backends. Please reference the documentation for the
|
||||
backends in use to determine key structure.
|
||||
|
||||
General Options:
|
||||
|
||||
-address=TODO The address of the Vault server.
|
||||
|
||||
-ca-cert=path Path to a PEM encoded CA cert file to use to
|
||||
verify the Vault server SSL certificate.
|
||||
|
||||
-ca-path=path Path to a directory of PEM encoded CA cert files
|
||||
to verify the Vault server SSL certificate. If both
|
||||
-ca-cert and -ca-path are specified, -ca-path is used.
|
||||
|
||||
-insecure Do not verify TLS certificate. This is highly
|
||||
not recommended. This is especially not recommended
|
||||
for unsealing a vault.
|
||||
|
||||
`
|
||||
return strings.TrimSpace(helpText)
|
||||
}
|
||||
Reference in New Issue
Block a user