commands

package
v0.0.0-...-516d531 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: Apache-2.0 Imports: 26 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!"`
	ConfigCommand
}

func (*ApiCommand) Execute

func (c *ApiCommand) Execute([]string) error

type ApiPositionalArgs

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

type BulkRegenerateCommand

type BulkRegenerateCommand struct {
	SignedBy   string `required:"yes" long:"signed-by" description:"Selects the credential whose children should recursively be regenerated"`
	OutputJSON bool   `short:"j" long:"output-json" description:"Return response in JSON format"`
	ClientCommand
}

func (*BulkRegenerateCommand) Execute

func (c *BulkRegenerateCommand) Execute([]string) error

type ClientCommand

type ClientCommand struct {
	// contains filtered or unexported fields
}

func (*ClientCommand) SetClient

func (n *ClientCommand) SetClient(client *credhub.CredHub)

type ConfigCommand

type ConfigCommand struct {
	// contains filtered or unexported fields
}

func (*ConfigCommand) SetConfig

func (n *ConfigCommand) SetConfig(config config.Config)

type CredhubCommand

type CredhubCommand struct {
	API            ApiCommand            `` /* 352-byte string literal not displayed */
	Delete         DeleteCommand         `` /* 225-byte string literal not displayed */
	Export         ExportCommand         `` /* 182-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 */
	BulkRegenerate BulkRegenerateCommand `` /* 288-byte string literal not displayed */
	Set            SetCommand            `` /* 490-byte string literal not displayed */
	Curl           CurlCommand           `` /* 168-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 CurlCommand

type CurlCommand struct {
	Path          string `short:"p" long:"path" description:"The server endpoint to make the request against"`
	Method        string `short:"X" description:"HTTP method (default: GET)"`
	Data          string `short:"d" description:"HTTP data to include in the request body"`
	IncludeHeader bool   `short:"i" description:"Include the response headers in the output"`
	ClientCommand
}

func (*CurlCommand) Execute

func (c *CurlCommand) Execute([]string) error

type DeleteCommand

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

func (*DeleteCommand) Execute

func (c *DeleteCommand) Execute([]string) error

type ExportCommand

type ExportCommand struct {
	Path string `short:"p" long:"path" description:"Path of credentials to export" required:"false"`
	File string `short:"f" long:"file" description:"File in which to write credentials" required:"false"`
}

func (ExportCommand) Execute

func (cmd ExportCommand) 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"`
	OutputJSON                  bool   `short:"j" long:"output-json" description:"Return response in JSON format"`
	ClientCommand
}

func (*FindCommand) Execute

func (c *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:"[User] 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"`
	ClientCommand
}

func (GenerateCommand) Execute

func (c 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"`
	Key              string `short:"k" long:"key" description:"Return only the specified field of the requested credential"`
	ClientCommand
}

func (*GetCommand) Execute

func (c *GetCommand) Execute([]string) error

type ImportCommand

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

func (*ImportCommand) Execute

func (c *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!"`
	SSO               bool     `long:"sso" description:"Prompt for a one-time passcode to login"`
	SSOPasscode       string   `long:"sso-passcode" description:"One-time passcode"`
	ConfigCommand
}

func (*LoginCommand) Execute

func (c *LoginCommand) Execute([]string) error

type LogoutCommand

type LogoutCommand struct {
	ConfigCommand
}

func (*LogoutCommand) Execute

func (c *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"`
	ClientCommand
}

func (*RegenerateCommand) Execute

func (c *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"`
	ClientCommand
}

func (*SetCommand) Execute

func (c *SetCommand) Execute([]string) error

Jump to

Keyboard shortcuts

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