effects

package
v0.1.34 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanScope

func CleanScope(path string) string

func GrantAllowsKey

func GrantAllowsKey(grantedKey, requestedKey string) bool

func GrantKey

func GrantKey(kind Kind, pattern string) string

Types

type Effect

type Effect struct {
	Kind     Kind
	Scope    string
	Risk     Risk
	Metadata map[string]string
}

func ExternalDirectoryEffect

func ExternalDirectoryEffect(path string) Effect

func ReadPathEffect

func ReadPathEffect(path string) Effect

func ShellExecEffect

func ShellExecEffect(command string) Effect

func WritePathEffect

func WritePathEffect(path string) Effect

type Grant

type Grant struct {
	Kind    Kind
	Pattern string
	Action  string
}

func ParseGrantKey

func ParseGrantKey(key string) (Grant, bool)

type Kind

type Kind string
const (
	ExternalDirectory Kind = "external_directory"
	ReadPath          Kind = "read_path"
	WritePath         Kind = "write_path"
	ShellExec         Kind = "shell_exec"
)

type Plan

type Plan struct {
	Effects []Effect
	Risk    Risk
}

type Risk

type Risk string
const (
	RiskSafeRead     Risk = "safe_read"
	RiskBoundedWrite Risk = "bounded_write"
	RiskUnknown      Risk = "unknown"
)

Jump to

Keyboard shortcuts

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