Documentation ¶
Index ¶
- Constants
- Variables
- func MakeShutdownCh() chan struct{}
- func MakeSighupCh() chan struct{}
- func OutputList(ui cli.Ui, format string, secret *api.Secret) int
- func OutputSecret(ui cli.Ui, format string, secret *api.Secret) int
- type AuditDisableCommand
- type AuditEnableCommand
- type AuditListCommand
- type AuthCommand
- type AuthDisableCommand
- type AuthEnableCommand
- type AuthHandler
- type CapabilitiesCommand
- type Config
- type DeleteCommand
- type FlagSetFlags
- type Formatter
- type GenerateRootCommand
- type InitCommand
- type JsonFormatter
- type KeyStatusCommand
- type ListCommand
- type Meta
- type MountCommand
- type MountTuneCommand
- type MountsCommand
- type PathHelpCommand
- type PolicyDeleteCommand
- type PolicyListCommand
- type PolicyWriteCommand
- type ReadCommand
- type RekeyCommand
- type RemountCommand
- type RenewCommand
- type RevokeCommand
- type RotateCommand
- type SSHCommand
- type SSHCredentialResp
- type SealCommand
- type ServerCommand
- type StatusCommand
- type StepDownCommand
- type TableFormatter
- type TokenCreateCommand
- type TokenLookupCommand
- type TokenRenewCommand
- type TokenRevokeCommand
- type UnmountCommand
- type UnsealCommand
- type VersionCommand
- type WriteCommand
- type YamlFormatter
Constants ¶
const ( // DefaultConfigPath is the default path to the configuration file DefaultConfigPath = "~/.vault" // ConfigPathEnv is the environment variable that can be used to // override where the Vault configuration is. ConfigPathEnv = "VAULT_CONFIG_PATH" )
Variables ¶
var Formatters = map[string]Formatter{ "json": JsonFormatter{}, "table": TableFormatter{}, "yaml": YamlFormatter{}, }
Functions ¶
func MakeShutdownCh ¶ added in v0.5.2
func MakeShutdownCh() chan struct{}
MakeShutdownCh returns a channel that can be used for shutdown notifications for commands. This channel will send a message for every interrupt or SIGTERM received.
func MakeSighupCh ¶ added in v0.5.2
func MakeSighupCh() chan struct{}
MakeSighupCh returns a channel that can be used for SIGHUP reloading. This channel will send a message for every SIGHUP received.
Types ¶
type AuditDisableCommand ¶
type AuditDisableCommand struct {
Meta
}
AuditDisableCommand is a Command that mounts a new mount.
func (*AuditDisableCommand) Help ¶
func (c *AuditDisableCommand) Help() string
func (*AuditDisableCommand) Run ¶
func (c *AuditDisableCommand) Run(args []string) int
func (*AuditDisableCommand) Synopsis ¶
func (c *AuditDisableCommand) Synopsis() string
type AuditEnableCommand ¶
type AuditEnableCommand struct { Meta // contains filtered or unexported fields }
AuditEnableCommand is a Command that mounts a new mount.
func (*AuditEnableCommand) Help ¶
func (c *AuditEnableCommand) Help() string
func (*AuditEnableCommand) Run ¶
func (c *AuditEnableCommand) Run(args []string) int
func (*AuditEnableCommand) Synopsis ¶
func (c *AuditEnableCommand) Synopsis() string
type AuditListCommand ¶
type AuditListCommand struct {
Meta
}
AuditListCommand is a Command that lists the enabled audits.
func (*AuditListCommand) Help ¶
func (c *AuditListCommand) Help() string
func (*AuditListCommand) Run ¶
func (c *AuditListCommand) Run(args []string) int
func (*AuditListCommand) Synopsis ¶
func (c *AuditListCommand) Synopsis() string
type AuthCommand ¶
type AuthCommand struct { Meta Handlers map[string]AuthHandler // contains filtered or unexported fields }
AuthCommand is a Command that handles authentication.
func (*AuthCommand) Help ¶
func (c *AuthCommand) Help() string
func (*AuthCommand) Run ¶
func (c *AuthCommand) Run(args []string) int
func (*AuthCommand) Synopsis ¶
func (c *AuthCommand) Synopsis() string
type AuthDisableCommand ¶
type AuthDisableCommand struct {
Meta
}
AuthDisableCommand is a Command that enables a new endpoint.
func (*AuthDisableCommand) Help ¶
func (c *AuthDisableCommand) Help() string
func (*AuthDisableCommand) Run ¶
func (c *AuthDisableCommand) Run(args []string) int
func (*AuthDisableCommand) Synopsis ¶
func (c *AuthDisableCommand) Synopsis() string
type AuthEnableCommand ¶
type AuthEnableCommand struct {
Meta
}
AuthEnableCommand is a Command that enables a new endpoint.
func (*AuthEnableCommand) Help ¶
func (c *AuthEnableCommand) Help() string
func (*AuthEnableCommand) Run ¶
func (c *AuthEnableCommand) Run(args []string) int
func (*AuthEnableCommand) Synopsis ¶
func (c *AuthEnableCommand) Synopsis() string
type AuthHandler ¶
AuthHandler is the interface that any auth handlers must implement to enable auth via the CLI.
type CapabilitiesCommand ¶ added in v0.5.2
type CapabilitiesCommand struct {
Meta
}
CapabilitiesCommand is a Command that enables a new endpoint.
func (*CapabilitiesCommand) Help ¶ added in v0.5.2
func (c *CapabilitiesCommand) Help() string
func (*CapabilitiesCommand) Run ¶ added in v0.5.2
func (c *CapabilitiesCommand) Run(args []string) int
func (*CapabilitiesCommand) Synopsis ¶ added in v0.5.2
func (c *CapabilitiesCommand) Synopsis() string
type Config ¶
type Config struct { // TokenHelper is the executable/command that is executed for storing // and retrieving the authentication token for the Vault CLI. If this // is not specified, then vault's internal token store will be used, which // stores the token on disk unencrypted. TokenHelper string `hcl:"token_helper"` }
Config is the CLI configuration for Vault that can be specified via a `$HOME/.vault` file which is HCL-formatted (therefore HCL or JSON).
func LoadConfig ¶
LoadConfig reads the configuration from the given path. If path is empty, then the default path will be used, or the environment variable if set.
func ParseConfig ¶ added in v0.5.2
ParseConfig parses the given configuration as a string.
type DeleteCommand ¶
type DeleteCommand struct {
Meta
}
DeleteCommand is a Command that puts data into the Vault.
func (*DeleteCommand) Help ¶
func (c *DeleteCommand) Help() string
func (*DeleteCommand) Run ¶
func (c *DeleteCommand) Run(args []string) int
func (*DeleteCommand) Synopsis ¶
func (c *DeleteCommand) Synopsis() string
type FlagSetFlags ¶
type FlagSetFlags uint
FlagSetFlags is an enum to define what flags are present in the default FlagSet returned by Meta.FlagSet.
const ( FlagSetNone FlagSetFlags = 0 FlagSetServer FlagSetFlags = 1 << iota FlagSetDefault = FlagSetServer )
type GenerateRootCommand ¶ added in v0.5.0
type GenerateRootCommand struct { Meta // Key can be used to pre-seed the key. If it is set, it will not // be asked with the `password` helper. Key string // The nonce for the rekey request to send along Nonce string }
GenerateRootCommand is a Command that generates a new root token.
func (*GenerateRootCommand) Help ¶ added in v0.5.0
func (c *GenerateRootCommand) Help() string
func (*GenerateRootCommand) Run ¶ added in v0.5.0
func (c *GenerateRootCommand) Run(args []string) int
func (*GenerateRootCommand) Synopsis ¶ added in v0.5.0
func (c *GenerateRootCommand) Synopsis() string
type InitCommand ¶
type InitCommand struct {
Meta
}
InitCommand is a Command that initializes a new Vault server.
func (*InitCommand) Help ¶
func (c *InitCommand) Help() string
func (*InitCommand) Run ¶
func (c *InitCommand) Run(args []string) int
func (*InitCommand) Synopsis ¶
func (c *InitCommand) Synopsis() string
type JsonFormatter ¶ added in v0.5.1
type JsonFormatter struct { }
An output formatter for json output of an object
type KeyStatusCommand ¶ added in v0.2.0
type KeyStatusCommand struct {
Meta
}
KeyStatusCommand is a Command that provides information about the key status
func (*KeyStatusCommand) Help ¶ added in v0.2.0
func (c *KeyStatusCommand) Help() string
func (*KeyStatusCommand) Run ¶ added in v0.2.0
func (c *KeyStatusCommand) Run(args []string) int
func (*KeyStatusCommand) Synopsis ¶ added in v0.2.0
func (c *KeyStatusCommand) Synopsis() string
type ListCommand ¶ added in v0.5.0
type ListCommand struct {
Meta
}
ListCommand is a Command that lists data from the Vault.
func (*ListCommand) Help ¶ added in v0.5.0
func (c *ListCommand) Help() string
func (*ListCommand) Run ¶ added in v0.5.0
func (c *ListCommand) Run(args []string) int
func (*ListCommand) Synopsis ¶ added in v0.5.0
func (c *ListCommand) Synopsis() string
type Meta ¶
type Meta struct { ClientToken string Ui cli.Ui // The things below can be set, but aren't common ForceAddress string // Address to force for API clients ForceConfig *Config // Force a config, don't load from disk // contains filtered or unexported fields }
Meta contains the meta-options and functionality that nearly every Vault command inherits.
func (*Meta) Client ¶
Client returns the API client to a Vault server given the configured flag settings for this command.
func (*Meta) Config ¶
Config loads the configuration and returns it. If the configuration is already loaded, it is returned.
func (*Meta) FlagSet ¶
func (m *Meta) FlagSet(n string, fs FlagSetFlags) *flag.FlagSet
FlagSet returns a FlagSet with the common flags that every command implements. The exact behavior of FlagSet can be configured using the flags as the second parameter, for example to disable server settings on the commands that don't talk to a server.
func (*Meta) TokenHelper ¶
func (m *Meta) TokenHelper() (token.TokenHelper, error)
TokenHelper returns the token helper that is configured for Vault.
type MountCommand ¶
type MountCommand struct {
Meta
}
MountCommand is a Command that mounts a new mount.
func (*MountCommand) Help ¶
func (c *MountCommand) Help() string
func (*MountCommand) Run ¶
func (c *MountCommand) Run(args []string) int
func (*MountCommand) Synopsis ¶
func (c *MountCommand) Synopsis() string
type MountTuneCommand ¶ added in v0.3.0
type MountTuneCommand struct {
Meta
}
MountTuneCommand is a Command that remounts a mounted secret backend to a new endpoint.
func (*MountTuneCommand) Help ¶ added in v0.3.0
func (c *MountTuneCommand) Help() string
func (*MountTuneCommand) Run ¶ added in v0.3.0
func (c *MountTuneCommand) Run(args []string) int
func (*MountTuneCommand) Synopsis ¶ added in v0.3.0
func (c *MountTuneCommand) Synopsis() string
type MountsCommand ¶
type MountsCommand struct {
Meta
}
MountsCommand is a Command that lists the mounts.
func (*MountsCommand) Help ¶
func (c *MountsCommand) Help() string
func (*MountsCommand) Run ¶
func (c *MountsCommand) Run(args []string) int
func (*MountsCommand) Synopsis ¶
func (c *MountsCommand) Synopsis() string
type PathHelpCommand ¶ added in v0.2.0
type PathHelpCommand struct {
Meta
}
PathHelpCommand is a Command that lists the mounts.
func (*PathHelpCommand) Help ¶ added in v0.2.0
func (c *PathHelpCommand) Help() string
func (*PathHelpCommand) Run ¶ added in v0.2.0
func (c *PathHelpCommand) Run(args []string) int
func (*PathHelpCommand) Synopsis ¶ added in v0.2.0
func (c *PathHelpCommand) Synopsis() string
type PolicyDeleteCommand ¶
type PolicyDeleteCommand struct {
Meta
}
PolicyDeleteCommand is a Command that enables a new endpoint.
func (*PolicyDeleteCommand) Help ¶
func (c *PolicyDeleteCommand) Help() string
func (*PolicyDeleteCommand) Run ¶
func (c *PolicyDeleteCommand) Run(args []string) int
func (*PolicyDeleteCommand) Synopsis ¶
func (c *PolicyDeleteCommand) Synopsis() string
type PolicyListCommand ¶
type PolicyListCommand struct {
Meta
}
PolicyListCommand is a Command that enables a new endpoint.
func (*PolicyListCommand) Help ¶
func (c *PolicyListCommand) Help() string
func (*PolicyListCommand) Run ¶
func (c *PolicyListCommand) Run(args []string) int
func (*PolicyListCommand) Synopsis ¶
func (c *PolicyListCommand) Synopsis() string
type PolicyWriteCommand ¶
type PolicyWriteCommand struct {
Meta
}
PolicyWriteCommand is a Command that enables a new endpoint.
func (*PolicyWriteCommand) Help ¶
func (c *PolicyWriteCommand) Help() string
func (*PolicyWriteCommand) Run ¶
func (c *PolicyWriteCommand) Run(args []string) int
func (*PolicyWriteCommand) Synopsis ¶
func (c *PolicyWriteCommand) Synopsis() string
type ReadCommand ¶
type ReadCommand struct {
Meta
}
ReadCommand is a Command that reads data from the Vault.
func (*ReadCommand) Help ¶
func (c *ReadCommand) Help() string
func (*ReadCommand) Run ¶
func (c *ReadCommand) Run(args []string) int
func (*ReadCommand) Synopsis ¶
func (c *ReadCommand) Synopsis() string
type RekeyCommand ¶ added in v0.2.0
type RekeyCommand struct { Meta // Key can be used to pre-seed the key. If it is set, it will not // be asked with the `password` helper. Key string // The nonce for the rekey request to send along Nonce string }
RekeyCommand is a Command that rekeys the vault.
func (*RekeyCommand) Help ¶ added in v0.2.0
func (c *RekeyCommand) Help() string
func (*RekeyCommand) Run ¶ added in v0.2.0
func (c *RekeyCommand) Run(args []string) int
func (*RekeyCommand) Synopsis ¶ added in v0.2.0
func (c *RekeyCommand) Synopsis() string
type RemountCommand ¶
type RemountCommand struct {
Meta
}
RemountCommand is a Command that remounts a mounted secret backend to a new endpoint.
func (*RemountCommand) Help ¶
func (c *RemountCommand) Help() string
func (*RemountCommand) Run ¶
func (c *RemountCommand) Run(args []string) int
func (*RemountCommand) Synopsis ¶
func (c *RemountCommand) Synopsis() string
type RenewCommand ¶
type RenewCommand struct {
Meta
}
RenewCommand is a Command that mounts a new mount.
func (*RenewCommand) Help ¶
func (c *RenewCommand) Help() string
func (*RenewCommand) Run ¶
func (c *RenewCommand) Run(args []string) int
func (*RenewCommand) Synopsis ¶
func (c *RenewCommand) Synopsis() string
type RevokeCommand ¶
type RevokeCommand struct {
Meta
}
RevokeCommand is a Command that mounts a new mount.
func (*RevokeCommand) Help ¶
func (c *RevokeCommand) Help() string
func (*RevokeCommand) Run ¶
func (c *RevokeCommand) Run(args []string) int
func (*RevokeCommand) Synopsis ¶
func (c *RevokeCommand) Synopsis() string
type RotateCommand ¶ added in v0.2.0
type RotateCommand struct {
Meta
}
RotateCommand is a Command that rotates the encryption key being used
func (*RotateCommand) Help ¶ added in v0.2.0
func (c *RotateCommand) Help() string
func (*RotateCommand) Run ¶ added in v0.2.0
func (c *RotateCommand) Run(args []string) int
func (*RotateCommand) Synopsis ¶ added in v0.2.0
func (c *RotateCommand) Synopsis() string
type SSHCommand ¶ added in v0.3.0
type SSHCommand struct {
Meta
}
SSHCommand is a Command that establishes a SSH connection with target by generating a dynamic key
func (*SSHCommand) Help ¶ added in v0.3.0
func (c *SSHCommand) Help() string
func (*SSHCommand) Run ¶ added in v0.3.0
func (c *SSHCommand) Run(args []string) int
func (*SSHCommand) Synopsis ¶ added in v0.3.0
func (c *SSHCommand) Synopsis() string
type SSHCredentialResp ¶ added in v0.3.0
type SSHCredentialResp struct { KeyType string `mapstructure:"key_type"` Key string `mapstructure:"key"` Username string `mapstructure:"username"` IP string `mapstructure:"ip"` Port int `mapstructure:"port"` }
Structure to hold the fields returned when asked for a credential from SSHh backend.
type SealCommand ¶
type SealCommand struct {
Meta
}
SealCommand is a Command that seals the vault.
func (*SealCommand) Help ¶
func (c *SealCommand) Help() string
func (*SealCommand) Run ¶
func (c *SealCommand) Run(args []string) int
func (*SealCommand) Synopsis ¶
func (c *SealCommand) Synopsis() string
type ServerCommand ¶
type ServerCommand struct { AuditBackends map[string]audit.Factory CredentialBackends map[string]logical.Factory LogicalBackends map[string]logical.Factory ShutdownCh chan struct{} SighupCh chan struct{} Meta ReloadFuncs map[string][]server.ReloadFunc }
ServerCommand is a Command that starts the Vault server.
func (*ServerCommand) Help ¶
func (c *ServerCommand) Help() string
func (*ServerCommand) Reload ¶ added in v0.5.2
func (c *ServerCommand) Reload(configPath []string) error
func (*ServerCommand) Run ¶
func (c *ServerCommand) Run(args []string) int
func (*ServerCommand) Synopsis ¶
func (c *ServerCommand) Synopsis() string
type StatusCommand ¶
type StatusCommand struct {
Meta
}
StatusCommand is a Command that outputs the status of whether Vault is sealed or not as well as HA information.
func (*StatusCommand) Help ¶
func (c *StatusCommand) Help() string
func (*StatusCommand) Run ¶
func (c *StatusCommand) Run(args []string) int
func (*StatusCommand) Synopsis ¶
func (c *StatusCommand) Synopsis() string
type StepDownCommand ¶ added in v0.5.2
type StepDownCommand struct {
Meta
}
StepDownCommand is a Command that seals the vault.
func (*StepDownCommand) Help ¶ added in v0.5.2
func (c *StepDownCommand) Help() string
func (*StepDownCommand) Run ¶ added in v0.5.2
func (c *StepDownCommand) Run(args []string) int
func (*StepDownCommand) Synopsis ¶ added in v0.5.2
func (c *StepDownCommand) Synopsis() string
type TableFormatter ¶ added in v0.5.1
type TableFormatter struct { }
An output formatter for table output of an object
func (TableFormatter) OutputList ¶ added in v0.5.1
func (TableFormatter) OutputSecret ¶ added in v0.5.1
type TokenCreateCommand ¶
type TokenCreateCommand struct {
Meta
}
TokenCreateCommand is a Command that mounts a new mount.
func (*TokenCreateCommand) Help ¶
func (c *TokenCreateCommand) Help() string
func (*TokenCreateCommand) Run ¶
func (c *TokenCreateCommand) Run(args []string) int
func (*TokenCreateCommand) Synopsis ¶
func (c *TokenCreateCommand) Synopsis() string
type TokenLookupCommand ¶ added in v0.5.0
type TokenLookupCommand struct {
Meta
}
TokenLookupCommand is a Command that outputs details about the provided.
func (*TokenLookupCommand) Help ¶ added in v0.5.0
func (c *TokenLookupCommand) Help() string
func (*TokenLookupCommand) Run ¶ added in v0.5.0
func (c *TokenLookupCommand) Run(args []string) int
func (*TokenLookupCommand) Synopsis ¶ added in v0.5.0
func (c *TokenLookupCommand) Synopsis() string
type TokenRenewCommand ¶
type TokenRenewCommand struct {
Meta
}
TokenRenewCommand is a Command that mounts a new mount.
func (*TokenRenewCommand) Help ¶
func (c *TokenRenewCommand) Help() string
func (*TokenRenewCommand) Run ¶
func (c *TokenRenewCommand) Run(args []string) int
func (*TokenRenewCommand) Synopsis ¶
func (c *TokenRenewCommand) Synopsis() string
type TokenRevokeCommand ¶
type TokenRevokeCommand struct {
Meta
}
TokenRevokeCommand is a Command that mounts a new mount.
func (*TokenRevokeCommand) Help ¶
func (c *TokenRevokeCommand) Help() string
func (*TokenRevokeCommand) Run ¶
func (c *TokenRevokeCommand) Run(args []string) int
func (*TokenRevokeCommand) Synopsis ¶
func (c *TokenRevokeCommand) Synopsis() string
type UnmountCommand ¶
type UnmountCommand struct {
Meta
}
UnmountCommand is a Command that mounts a new mount.
func (*UnmountCommand) Help ¶
func (c *UnmountCommand) Help() string
func (*UnmountCommand) Run ¶
func (c *UnmountCommand) Run(args []string) int
func (*UnmountCommand) Synopsis ¶
func (c *UnmountCommand) Synopsis() string
type UnsealCommand ¶
type UnsealCommand struct { Meta // Key can be used to pre-seed the key. If it is set, it will not // be asked with the `password` helper. Key string }
UnsealCommand is a Command that unseals the vault.
func (*UnsealCommand) Help ¶
func (c *UnsealCommand) Help() string
func (*UnsealCommand) Run ¶
func (c *UnsealCommand) Run(args []string) int
func (*UnsealCommand) Synopsis ¶
func (c *UnsealCommand) Synopsis() string
type VersionCommand ¶
type VersionCommand struct { VersionInfo *version.VersionInfo Ui cli.Ui }
VersionCommand is a Command implementation prints the version.
func (*VersionCommand) Help ¶
func (c *VersionCommand) Help() string
func (*VersionCommand) Run ¶
func (c *VersionCommand) Run(_ []string) int
func (*VersionCommand) Synopsis ¶
func (c *VersionCommand) Synopsis() string
type WriteCommand ¶
type WriteCommand struct { Meta // contains filtered or unexported fields }
WriteCommand is a Command that puts data into the Vault.
func (*WriteCommand) Help ¶
func (c *WriteCommand) Help() string
func (*WriteCommand) Run ¶
func (c *WriteCommand) Run(args []string) int
func (*WriteCommand) Synopsis ¶
func (c *WriteCommand) Synopsis() string
type YamlFormatter ¶ added in v0.5.1
type YamlFormatter struct { }
An output formatter for yaml output format of an object
Source Files ¶
- audit_disable.go
- audit_enable.go
- audit_list.go
- auth.go
- auth_disable.go
- auth_enable.go
- capabilities.go
- config.go
- delete.go
- format.go
- generate-root.go
- init.go
- key_status.go
- list.go
- meta.go
- mount.go
- mounts.go
- mounttune.go
- path_help.go
- policy_delete.go
- policy_list.go
- policy_write.go
- read.go
- rekey.go
- remount.go
- renew.go
- revoke.go
- rotate.go
- seal.go
- server.go
- ssh.go
- status.go
- step-down.go
- token_create.go
- token_lookup.go
- token_renew.go
- token_revoke.go
- unmount.go
- unseal.go
- version.go
- write.go