token

package
v0.6.0-beta1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecScript added in v0.1.2

func ExecScript(script string) (*exec.Cmd, error)

ExecScript returns a command to execute a script

func ExternalTokenHelperPath added in v0.5.0

func ExternalTokenHelperPath(path string) (string, error)

ExternalTokenHelperPath takes the configured path to a helper and expands it to a full absolute path that can be executed. As of 0.5, the default token helper is internal, to avoid problems running in dev mode (see GH-850 and GH-783), so special assumptions of prepending "vault token-" no longer apply.

As an additional result, only absolute paths are now allowed. Looking in the path or a current directory for an arbitrary executable could allow someone to switch the expected binary for one further up the path (or in the current directory), potentially opening up execution of an arbitrary binary.

func Test

func Test(t *testing.T, h TokenHelper)

Test is a public function that can be used in other tests to test that a helper is functioning properly.

func TestExternalTokenHelperProcessCLI added in v0.5.0

func TestExternalTokenHelperProcessCLI(t *testing.T, cmd cli.Command)

TestExternalTokenHelperProcessCLI can be called to implement TestExternalTokenHelperProcess for TestProcess that just executes a CLI command.

func TestProcess

func TestProcess(t *testing.T, s ...string)

TestProcess is used to re-execute this test in order to use it as the helper process. For this to work, the TestExternalTokenHelperProcess function must exist.

func TestProcessPath

func TestProcessPath(t *testing.T, s ...string) string

TestProcessPath returns the path to the test process.

Types

type ExternalTokenHelper added in v0.5.0

type ExternalTokenHelper struct {
	BinaryPath