exec

package
v0.1.0-rc.11 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package exec implements the exec provider (step "exec"), which runs an external program directly (never through a shell) and exposes its exit code, stdout, stderr and duration for assertions and capture. The provider is disabled unless the CLI passes --allow-exec.

The "process" sandbox is a portability and hygiene feature, NOT a security boundary: it controls the working directory, environment, timeout and output capture, but it does not isolate the filesystem and does not reliably block network access. Use a real sandbox (e.g. Docker, reserved here but not yet implemented) for stronger isolation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Provider)

Option configures the provider.

func WithAllowExec

func WithAllowExec(allowed bool) Option

WithAllowExec enables (or disables) command execution. Disabled is the default; the CLI wires this from --allow-exec.

type Provider

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

Provider executes exec steps. allowExec is immutable after construction, so the provider is safe to share across parallel scenarios.

func New

func New(opts ...Option) *Provider

New creates an exec provider. Execution is disabled unless WithAllowExec(true) is passed.

func (*Provider) Execute

func (p *Provider) Execute(ctx context.Context, input provider.Input) (*provider.Output, error)

Execute gates on --allow-exec, then runs the program. The gate is checked before any work so a disabled run never resolves a command or spawns a process. docker mode is rejected (reserved, not implemented).

func (*Provider) Type

func (p *Provider) Type() string

Type returns the provider type.

Jump to

Keyboard shortcuts

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