scope

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AllowReadParent allows reading files from parent directories.
	AllowReadParent = "read:parent"
	// AllowReadRemote allows reading files from remote sources.
	AllowReadRemote = "read:remote"
	// AllowRunExec allows executing commands.
	AllowRunExec = "run:exec" //nostyle:repetition
	// DenyReadParent denies reading files from parent directories.
	DenyReadParent = "!read:parent"
	// DenyReadRemote denies reading files from remote sources.
	DenyReadRemote = "!read:remote"
	// DenyRunExec denies executing commands.
	DenyRunExec = "!run:exec" //nostyle:repetition
)

Variables

View Source
var ErrInvalidScope = errors.New("invalid scope") //nostyle:repetition

ErrInvalidScope is returned when an invalid scope is provided.

View Source
var Global = &Scopes{
	readParent: false,
	readRemote: false,
	runExec:    false,
}

Global is the global scopes instance.

Functions

func IsReadParentAllowed

func IsReadParentAllowed() bool

IsReadParentAllowed returns whether reading files from parent directories is allowed.

func IsReadRemoteAllowed

func IsReadRemoteAllowed() bool

IsReadRemoteAllowed returns whether reading files from remote sources is allowed.

func IsRunExecAllowed

func IsRunExecAllowed() bool

IsRunExecAllowed returns whether executing commands is allowed.

func Set

func Set(scopes ...string) error

Set sets the scopes for runn.

Types

type Scopes

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

Scopes holds the permission scopes for runn.

Jump to

Keyboard shortcuts

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