command

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2015 License: MPL-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const EnvVaultAddress = "VAULT_ADDR"

EnvVaultAddress can be used to set the address of Vault

View Source
const EnvVaultCACert = "VAULT_CACERT"
View Source
const EnvVaultCAPath = "VAULT_CAPATH"
View Source
const EnvVaultInsecure = "VAULT_SKIP_VERIFY"

Variables

This section is empty.

Functions

func OutputSecret

func OutputSecret(ui cli.Ui, format string, secret *api.Secret) int

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
}

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

type AuthHandler interface {
	Auth(*api.Client, map[string]string) (string, error)
	Help() string
}

AuthHandler is the interface that any auth handlers must implement to enable auth via the CLI.

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 token-disk 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

func LoadConfig(path string) (*Config, 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.

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 HelpCommand

type HelpCommand struct {
	Meta
}

HelpCommand is a Command that lists the mounts.

func (*HelpCommand) Help

func (c *HelpCommand) Help() string

func (*HelpCommand) Run

func (c *HelpCommand) Run(args []string) int

func (*HelpCommand) Synopsis

func (c *HelpCommand) 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 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

func (m *Meta) Client() (*api.Client, error)

Client returns the API client to a Vault server given the configured flag settings for this command.

func (*Meta) Config

func (m *Meta) Config() (*Config, error)

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.Helper, 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 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 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 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 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

	Meta
}

ServerCommand is a Command that starts the Vault server.

func (*ServerCommand) Help

func (c *ServerCommand) Help() string

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 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 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 {
	Revision          string
	Version           string
	VersionPrerelease string
	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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL