commandpolicy

package
v0.7.85 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 4 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 commandpolicy evaluates allow/deny command rules for agents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

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

Policy evaluates ordered allow/deny command rules.

func New

func New(patterns []string) (*Policy, error)

New compiles the provided ordered rules.

func (*Policy) Allows

func (p *Policy) Allows(command string) bool

Allows reports whether command is allowed by the ordered rule set.

func (*Policy) Decide added in v0.7.0

func (p *Policy) Decide(command string) (bool, string)

Decide reports whether command is allowed and the rule that decided it, as written: the last rule that matches. The rule is empty when none matches.

Jump to

Keyboard shortcuts

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