Documentation
¶
Index ¶
- func ExecScript(script string) (*exec.Cmd, error)
- func ExternalTokenHelperPath(path string) (string, error)
- func Test(t *testing.T, h TokenHelper)
- func TestExternalTokenHelperProcessCLI(t *testing.T, cmd cli.Command)
- func TestProcess(t *testing.T, s ...string)
- func TestProcessPath(t *testing.T, s ...string) string
- type ExternalTokenHelper
- type InternalTokenHelper
- type TokenHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecScript ¶ added in v0.1.2
ExecScript returns a command to execute a script
func ExternalTokenHelperPath ¶ added in v0.5.0
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
TestExternalTokenHelperProcessCLI can be called to implement TestExternalTokenHelperProcess for TestProcess that just executes a CLI command.
func TestProcess ¶
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.
Types ¶
type ExternalTokenHelper ¶ added in v0.5.0
type ExternalTokenHelper struct {
BinaryPath