pluginexec

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ControlledPath = "/usr/local/bin:/usr/bin:/bin"

	MaxEnvValueBytes = 16 * 1024
)

Variables

This section is empty.

Functions

func BuildEnv added in v0.1.14

func BuildEnv(policy pluginpolicy.ExecEnv, lookup func(string) (string, bool), extraEnv []string) ([]string, error)

Types

type DefaultRunner

type DefaultRunner struct{}

func (DefaultRunner) Run

func (DefaultRunner) Run(ctx context.Context, request Request) (Result, error)

type Error

type Error struct {
	Phase    string
	Reason   string
	Command  string
	ExitCode *int
	Err      error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Execution

type Execution struct {
	Phase    string
	Command  string
	Duration time.Duration
}

type Request

type Request struct {
	SourceDir       string
	RepositoryDir   string
	SourceRelPath   string
	Config          pluginpolicy.ExecConfig
	ProtectedRoots  []string
	EnvLookup       func(string) (string, bool)
	ExtraEnv        []string
	SensitiveValues []string
}

type Result

type Result struct {
	Stdout     []byte
	Executions []Execution
}

type Runner

type Runner interface {
	Run(ctx context.Context, request Request) (Result, error)
}

type Workspace added in v0.1.14

type Workspace struct {
	Workdir        string
	ArgumentRoot   string
	ProtectedRoots []string
	Cleanup        func()
}

func PrepareWorkspace added in v0.1.14

func PrepareWorkspace(request Request) (Workspace, error)

Jump to

Keyboard shortcuts

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