Help us shape the future of Go! Take the 2026 Go Developer Survey

enforce

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package enforce reports the session-level execution capability.

Index

Constants

View Source
const (
	HelperCommand          = "__codemeld_confine"
	ProbeArg               = "--probe"
	ControlArg             = "--control"
	SetupFailureExitCode   = 125
	ModePlan               = "plan"
	ModeAutoEdits          = "auto_edits"
	NetworkAccessAuthority = "network access"
	MaxPolicyFrameBytes    = 64 * 1024
)

Variables

This section is empty.

Functions

func RunHelper

func RunHelper(args []string) int

func WritePolicyFrame

func WritePolicyFrame(w io.Writer, p Policy) error

Types

type Capability

type Capability string
const (
	Constrained Capability = "constrained"
	Refused     Capability = "refused"
)

type Leg

type Leg struct {
	Name       string
	Observed   string
	Diagnostic string
}

type Policy

type Policy struct {
	Mode                 string   `json:"mode"`
	ExceptionalAuthority string   `json:"exceptional_authority"`
	BlockedPaths         []string `json:"blocked_paths"`
	WriteRoots           []string `json:"write_roots"`
	NoWritePaths         []string `json:"no_write_paths"`
	TmpDir               string   `json:"tmp_dir"`
}

func ReadPolicyFrame

func ReadPolicyFrame(r io.Reader) (Policy, error)

type Resolution

type Resolution struct {
	Capability     Capability
	Reason         string
	Legs           []Leg
	SelfTestPassed bool
}

func Resolve

func Resolve(in ResolveInput) Resolution

func (Resolution) SandboxLabel

func (r Resolution) SandboxLabel(modeKey string) string

func (Resolution) SandboxState

func (r Resolution) SandboxState(modeKey string) string

type ResolveInput

type ResolveInput struct {
	Home             string
	HelperExecutable string
}

Jump to

Keyboard shortcuts

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