coder

package
v1.46.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSuggestedPattern

func GetSuggestedPattern(toolName, args string) string

Types

type Action

type Action string
const (
	ActionAllow Action = "allow"
	ActionDeny  Action = "deny"
	ActionAsk   Action = "ask"
)

type PolicyManager

type PolicyManager struct {
	Rules []Rule `json:"rules"`
	// contains filtered or unexported fields
}

func NewPolicyManager

func NewPolicyManager(logger *zap.Logger) (*PolicyManager, error)

func (*PolicyManager) AddRule

func (pm *PolicyManager) AddRule(pattern string, action Action) error

func (*PolicyManager) Check

func (pm *PolicyManager) Check(toolName, args string) Action

type Rule

type Rule struct {
	Pattern string `json:"pattern"`
	Action  Action `json:"action"`
}

type SecurityDecision

type SecurityDecision int
const (
	DecisionRunOnce SecurityDecision = iota
	DecisionAllowAlways
	DecisionDenyOnce
	DecisionDenyForever
)

func PromptSecurityCheck

func PromptSecurityCheck(ctx context.Context, toolName, args string) SecurityDecision

Jump to

Keyboard shortcuts

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