scrubexec

package
v0.297.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package scrubexec is the ONE way agentprovision reaches a provisioning driver: a wrapper whose every exec into an agent's container runs with the container's turn credentials removed from its environment.

🔴 WHY A WRAPPER IN ITS OWN PACKAGE. An exec does not inherit ccd's environment (which ccd scrubs); it inherits the CONTAINER's, which holds MUSTER_GATEWAY_BEARER and, for a chief, CCD_GATEWAY_UPSTREAM_BEARER (agentspec.TurnCredentialEnv). A job's git run in the session-writable workspace, or the terminal's long-lived `tmux attach` client (readable at /proc/<pid>/environ by any same-uid process), would otherwise hold them. A helper every call site had to remember was walkable by spelling (an import alias, a local interface assertion, a wrapper elsewhere). Here the raw driver is an UNEXPORTED field of a type in another package: agentprovision cannot read it, so every exec it can make goes through Exec/ExecTTY below. The structural ledger (agentprovision's TestTheRawDriverIsReachableOnlyThroughTheScrub) pins that the adapter stores nothing else.

⚠ IT NEEDS `env` IN THE IMAGE (coreutils or busybox; every exec already needs `sh`). It does not stop an exec'd command from RUNNING as the agent's user — which the session already is — only from seeing the credentials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(cmd []string) []string

Command is cmd run with every agentspec.TurnCredentialEnv variable removed from its environment: `env -u NAME … cmd…`.

Types

type Driver

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

Driver is a provision.Provisioner whose Exec and ExecTTY strip the turn credentials. It deliberately exposes NO way back to the driver it wraps.

func Wrap

func Wrap(raw provision.Provisioner) Driver

Wrap is the only constructor. agentprovision.New calls it once, on Config.Driver, and keeps nothing else.

func (Driver) Capabilities

func (d Driver) Capabilities() provision.Capabilities

func (Driver) Create

func (d Driver) Create(ctx context.Context, spec provision.Spec) error

func (Driver) Destroy

func (d Driver) Destroy(ctx context.Context, ref provision.Ref) error

func (Driver) Driver

func (d Driver) Driver() string

func (Driver) Endpoint

func (d Driver) Endpoint(ctx context.Context, ref provision.Ref) (provision.Endpoint, error)

func (Driver) Exec

func (d Driver) Exec(ctx context.Context, ref provision.Ref, cmd []string, stdin io.Reader, stdout, stderr io.Writer) error

Exec runs Command(cmd) through the wrapped driver.

func (Driver) ExecContainer added in v0.110.0

func (d Driver) ExecContainer(ctx context.Context, ref provision.Ref, container string, cmd []string, stdin io.Reader, stdout, stderr io.Writer) error

ExecTTY runs Command(cmd) on a terminal through the wrapped driver. ExecContainer is Exec into a named container (a key holder's): the same prefix, though no turn credential is in that container's environment — every exec this wrapper passes carries it, so none can be added without it.

func (Driver) ExecTTY

func (d Driver) ExecTTY(ctx context.Context, ref provision.Ref, cmd []string, stdin io.Reader, stdout io.Writer, resize <-chan provision.TermSize) error

func (Driver) Get

func (Driver) List

func (d Driver) List(ctx context.Context) ([]provision.Instance, error)

func (Driver) Scale

func (d Driver) Scale(ctx context.Context, ref provision.Ref, replicas int) error

func (Driver) StreamLogs

func (d Driver) StreamLogs(ctx context.Context, ref provision.Ref, emit func(line string)) error

func (Driver) Update

func (d Driver) Update(ctx context.Context, spec provision.Spec) error

Jump to

Keyboard shortcuts

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