open-vault/command/read.go
Mitchell Hashimoto 1d07df9db6 command/write
2015-03-15 20:35:33 -07:00

55 lines
1.5 KiB
Go

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)
}