commands

package
v0.0.0-...-56d91b6 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetApiInfo

func GetApiInfo(serverUrl string, caCerts []string, skipTlsValidation bool) (*server.Info, error)

func MarkTokensAsRevokedInConfig

func MarkTokensAsRevokedInConfig(cfg *config.Config)

func PrintVersion

func PrintVersion() error

func PrintWarnings

func PrintWarnings(serverUrl string, skipTlsValidation bool) error

func ReadOrGetCaCerts

func ReadOrGetCaCerts(caCerts []string) ([]string, error)

func RevokeTokenIfNecessary

func RevokeTokenIfNecessary(cfg config.Config) error

Types

type ApiCommand

type ApiCommand struct {
	Server            ApiPositionalArgs `positional-args:"yes" env:"CREDHUB_SERVER"`
	ServerFlagUrl     string            `short:"s" long:"server" description:"URI of API server to target" env:"CREDHUB_SERVER"`
	CaCerts           []string          `` /* 126-byte string literal not displayed */
	SkipTlsValidation bool              `long:"skip-tls-validation" description:"Skip certificate validation of the API endpoint. Not recommended!"`
}

func (ApiCommand) Execute

func (cmd ApiCommand) Execute([]string) error

type ApiPositionalArgs

type ApiPositionalArgs struct {
	ServerUrl string `positional-arg-name:"SERVER" description:"URI of API server to target"`
}

type CredhubCommand

type CredhubCommand struct {
	Api        ApiCommand        `` /* 352-byte string literal not displayed */
	Delete     DeleteCommand     `` /* 225-byte string literal not displayed */
	Find       FindCommand       `` /* 262-byte string literal not displayed */
	Generate   GenerateCommand   `` /* 533-byte string literal not displayed */
	Get        GetCommand        `` /* 193-byte string literal not displayed */
	Import     ImportCommand     `` /* 365-byte string literal not displayed */
	Login      LoginCommand      `` /* 318-byte string literal not displayed */
	Logout     LogoutCommand     `` /* 193-byte string literal not displayed */
	Regenerate RegenerateCommand `` /* 308-byte string literal not displayed */
	Set        SetCommand        `` /* 490-byte string literal not displayed */

	Version func() `long:"version" description:"Version of CLI and targeted CredHub API"`
	Token   func() `long:"token" description:"Return your current CredHub authentication token"`
}
var CredHub CredhubCommand

type DeleteCommand

type DeleteCommand struct {
	CredentialIdentifier string `short:"n" long:"name" required:"yes" description:"Name of the credential to delete"`
}

func (DeleteCommand) Execute

func (cmd DeleteCommand) Execute([]string) error

type FindCommand

type FindCommand struct {
	PartialCredentialIdentifier string `short:"n" long:"name-like" description:"Find credentials whose name contains the query string"`
	PathIdentifier              string `short:"p" long:"path" description:"Find credentials that exist under the provided path"`
	AllPaths                    bool   `short:"a" long:"all-paths" description:"List all existing credential paths"`
	OutputJson                  bool   `short:"j" long:"output-json" description:"Return response in JSON format"`
}

func (FindCommand) Execute

func (cmd FindCommand) Execute([]string) error

type GenerateCommand

type GenerateCommand struct {
	CredentialIdentifier string   `short:"n" required:"yes" long:"name" description:"Name of the credential to generate"`
	CredentialType       string   `` /* 145-byte string literal not displayed */
	NoOverwrite          bool     `short:"O" long:"no-overwrite" description:"Credential is not modified if stored value already exists"`
	OutputJson           bool     `short:"j" long:"output-json" description:"Return response in JSON format"`
	Username             string   `short:"z" long:"username" description:"Sets the username value of the credential"`
	Length               int      `short:"l" long:"length" description:"[Password, User] Length of the generated value (Default: 30)"`
	IncludeSpecial       bool     `short:"S" long:"include-special" description:"[Password, User] Include special characters in the generated value"`
	ExcludeNumber        bool     `short:"N" long:"exclude-number" description:"[Password, User] Exclude number characters from the generated value"`
	ExcludeUpper         bool     `short:"U" long:"exclude-upper" description:"[Password, User] Exclude upper alpha characters from the generated value"`
	ExcludeLower         bool     `short:"L" long:"exclude-lower" description:"[Password, User] Exclude lower alpha characters from the generated value"`
	SshComment           string   `short:"m" long:"ssh-comment" description:"[SSH] Comment appended to public key to help identify in environment"`
	KeyLength            int      `short:"k" long:"key-length" description:"[Certificate, SSH, RSA] Bit length of the generated key (Default: 2048)"`
	Duration             int      `short:"d" long:"duration" description:"[Certificate] Valid duration (in days) of the generated certificate (Default: 365)"`
	CommonName           string   `short:"c" long:"common-name" description:"[Certificate] Common name of the generated certificate"`
	Organization         string   `short:"o" long:"organization" description:"[Certificate] Organization of the generated certificate"`
	OrganizationUnit     string   `short:"u" long:"organization-unit" description:"[Certificate] Organization unit of the generated certificate"`
	Locality             string   `short:"i" long:"locality" description:"[Certificate] Locality/city of the generated certificate"`
	State                string   `short:"s" long:"state" description:"[Certificate] State/province of the generated certificate"`
	Country              string   `short:"y" long:"country" description:"[Certificate] Country of the generated certificate"`
	AlternativeName      []string `` /* 151-byte string literal not displayed */
	KeyUsage             []string `` /* 139-byte string literal not displayed */
	ExtendedKeyUsage     []string `` /* 152-byte string literal not displayed */
	Ca                   string   `long:"ca" description:"[Certificate] Name of CA used to sign the generated certificate"`
	IsCA                 bool     `long:"is-ca" description:"[Certificate] The generated certificate is a certificate authority"`
	SelfSign             bool     `long:"self-sign" description:"[Certificate] The generated certificate will be self-signed"`
}

func (GenerateCommand) Execute

func (cmd GenerateCommand) Execute([]string) error

type GetCommand

type GetCommand struct {
	Name             string `short:"n" long:"name" description:"Name of the credential to retrieve"`
	Id               string `long:"id" description:"ID of the credential to retrieve"`
	NumberOfVersions int    `long:"versions" description:"Number of versions of the credential to retrieve"`
	OutputJson       bool   `short:"j" long:"output-json" description:"Return response in JSON format"`
}

func (GetCommand) Execute

func (cmd GetCommand) Execute([]string) error

type ImportCommand

type ImportCommand struct {
	File string `short:"f" long:"file" description:"File containing credentials to import" required:"true"`
}

func (ImportCommand) Execute

func (cmd ImportCommand) Execute([]string) error

type LoginCommand

type LoginCommand struct {
	Username          string   `short:"u" long:"username" description:"Authentication username"`
	Password          string   `short:"p" long:"password" description:"Authentication password"`
	ClientName        string   `long:"client-name" description:"Client name for UAA client grant" env:"CREDHUB_CLIENT"`
	ClientSecret      string   `long:"client-secret" description:"Client secret for UAA client grant" env:"CREDHUB_SECRET"`
	ServerUrl         string   `short:"s" long:"server" description:"URI of API server to target" env:"CREDHUB_SERVER"`
	CaCerts           []string `long:"ca-cert" description:"Trusted CA for API and UAA TLS connections" env:"CREDHUB_CA_CERT"`
	SkipTlsValidation bool     `long:"skip-tls-validation" description:"Skip certificate validation of the API endpoint. Not recommended!"`
}

func (LoginCommand) Execute

func (cmd LoginCommand) Execute([]string) error

type LogoutCommand

type LogoutCommand struct {
}

func (LogoutCommand) Execute

func (cmd LogoutCommand) Execute([]string) error

type RegenerateCommand

type RegenerateCommand struct {
	CredentialIdentifier string `required:"yes" short:"n" long:"name" description:"Selects the credential to regenerate"`
	OutputJson           bool   `short:"j" long:"output-json" description:"Return response in JSON format"`
}

func (RegenerateCommand) Execute

func (cmd RegenerateCommand) Execute([]string) error

type SetCommand

type SetCommand struct {
	CredentialIdentifier string `short:"n" required:"yes" long:"name" description:"Name of the credential to set"`
	Type                 string `` /* 150-byte string literal not displayed */
	NoOverwrite          bool   `short:"O" long:"no-overwrite" description:"Credential is not modified if stored value already exists"`
	Value                string `short:"v" long:"value" description:"[Value, JSON] Sets the value for the credential"`
	CaName               string `short:"m" long:"ca-name" description:"[Certificate] Sets the root CA to a stored CA credential"`
	Root                 string `short:"r" long:"root" description:"[Certificate] Sets the root CA from file or value"`
	Certificate          string `short:"c" long:"certificate" description:"[Certificate] Sets the certificate from file or value"`
	Private              string `short:"p" long:"private" description:"[Certificate, SSH, RSA] Sets the private key from file or value"`
	Public               string `short:"u" long:"public" description:"[SSH, RSA] Sets the public key from file or value"`
	Username             string `short:"z" long:"username" description:"[User] Sets the username value of the credential"`
	Password             string `short:"w" long:"password" description:"[Password, User] Sets the password value of the credential"`
	OutputJson           bool   `short:"j" long:"output-json" description:"Return response in JSON format"`
}

func (SetCommand) Execute

func (cmd SetCommand) Execute([]string) error

Jump to

Keyboard shortcuts

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