Documentation
¶
Overview ¶
Package permissions provides tool permission checking based on configurable Allow/Ask/Deny patterns.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker evaluates tool permissions based on configured patterns
func NewChecker ¶
func NewChecker(cfg *latest.PermissionsConfig) *Checker
NewChecker creates a new permission checker from config
func (*Checker) Check ¶
Check evaluates the permission for a given tool name without arguments. This is a convenience method that calls CheckWithArgs with nil arguments. Evaluation order: Deny (checked first), then Allow, then Ask (default)
func (*Checker) CheckWithArgs ¶
CheckWithArgs evaluates the permission for a given tool name and its arguments. Evaluation order: Deny (checked first), then Allow, then Ask (default)
The toolName can be a simple name like "shell" or a qualified name like "mcp:github:create_issue".
Patterns support: - Simple tool names: "shell", "read_*" - Argument matching: "shell:cmd=ls*" matches shell tool with cmd argument starting with "ls" - Multiple arguments: "shell:cmd=ls*:cwd=/home/*" matches both conditions - Glob patterns in both tool names and argument values