command

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoginHandlers = map[string]LoginHandler{
	"aws":    &credAws.CLIHandler{},
	"cert":   &credCert.CLIHandler{},
	"github": &credGitHub.CLIHandler{},
	"ldap":   &credLdap.CLIHandler{},
	"okta":   &credOkta.CLIHandler{},
	"radius": &credUserpass.CLIHandler{
		DefaultMount: "radius",
	},
	"token": &credToken.CLIHandler{},
	"userpass": &credUserpass.CLIHandler{
		DefaultMount: "userpass",
	},
}

LoginHandlers is an k:v datatype with authentication method type and the related vault Handler

Functions

func EnsureTrailingSlash added in v0.1.3

func EnsureTrailingSlash(s string) string

EnsureTrailingSlash ensures the given string has a trailing slash.

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func Login

func Login(client *api.Client, method string, loginConfig map[string]string, out io.Writer) error

Login function returns an error o print the token saved inside the ~/.vault-token file

func NewClient

func NewClient(config *api.Config) (*api.Client, error)

NewClient return a new vault client and an error

func PasswordFromEnv

func PasswordFromEnv() string

PasswordFromEnv returns the password stored into PASSWORD or the empty string

func UsernameFromEnv

func UsernameFromEnv() string

UsernameFromEnv returns the username stored into LOGNAME or USER if defined or the empty string

Types

type LoginHandler

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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