Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultTokenHelper() (token.TokenHelper, error)
- 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
- func PrintRawField(ui cli.Ui, secret *api.Secret, field string) int
- type AuditDisableCommand
- type AuditEnableCommand
- type AuditListCommand
- type AuthCommand
- type AuthDisableCommand
- type AuthEnableCommand
- type AuthHandler
- type CapabilitiesCommand
- type DefaultConfig
- type DeleteCommand
- type Formatter
- type GenerateRootCommand
- type InitCommand
- type JsonFormatter
- type KeyStatusCommand
- type ListCommand
- 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 UnwrapCommand
- 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 DefaultTokenHelper ¶ added in v0.6.0
func DefaultTokenHelper() (token.TokenHelper, error)
DefaultTokenHelper returns the token helper that is configured for Vault.
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 SIGINT 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 ¶
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 ¶
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 ¶
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.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 ¶
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 ¶
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
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 DefaultConfig ¶ added in v0.6.0
type DefaultConfig 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 Config ¶
func Config() (*DefaultConfig, error)
Config loads the configuration and returns it. If the configuration is already loaded, it is returned.
func LoadConfig ¶
func LoadConfig(path string) (*DefaultConfig, error)
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
func ParseConfig(contents string) (*DefaultConfig, error)
ParseConfig parses the given configuration as a string.
type DeleteCommand ¶
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 GenerateRootCommand ¶ added in v0.5.0
type GenerateRootCommand struct { meta.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 ¶
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
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
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 MountCommand ¶
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
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 ¶
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
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 ¶
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 ¶
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 ¶
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 ¶
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.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 // Whether to use the recovery key instead of barrier key, if available RecoveryKey bool }
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 ¶
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 ¶
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 ¶
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
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
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 ¶
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.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 ¶
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
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 ¶
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
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 ¶
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 ¶
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 ¶
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.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 UnwrapCommand ¶ added in v0.6.0
UnwrapCommand is a Command that behaves like ReadCommand but specifically for unwrapping cubbyhole-wrapped secrets
func (*UnwrapCommand) Help ¶ added in v0.6.0
func (c *UnwrapCommand) Help() string
func (*UnwrapCommand) Run ¶ added in v0.6.0
func (c *UnwrapCommand) Run(args []string) int
func (*UnwrapCommand) Synopsis ¶ added in v0.6.0
func (c *UnwrapCommand) 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 ¶
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
- 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
- unwrap.go
- util.go
- version.go
- write.go