permissions

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Choices

func Choices(isDangerous bool) []string

Types

type Choice

type Choice int
const (
	ChoiceAllow Choice = iota
	ChoiceAllowSession
	ChoiceDeny
	ChoiceAskWhatToDo
)

func ChoiceAt

func ChoiceAt(cursor int, isDangerous bool) Choice

type Request

type Request struct {
	RequestID    string
	ToolName     string
	Path         string
	ResolvedPath string
	IsDangerous  bool
	Preview      string
	PreviewKind  string
	AutoApproved bool
	Status       Status
	ResponseChan chan bool
}

type Requester

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

func NewAutoApproveRequester

func NewAutoApproveRequester() *Requester

func NewRequester

func NewRequester(projectPerms *config.ProjectPermissions) *Requester

func (*Requester) GetRequestChan

func (r *Requester) GetRequestChan() <-chan *Request

func (*Requester) HasPendingRequest

func (r *Requester) HasPendingRequest() bool

func (*Requester) IsSessionAllowed

func (r *Requester) IsSessionAllowed(toolName string) bool

func (*Requester) RequestPermission

func (r *Requester) RequestPermission(ctx context.Context, toolName, path, resolvedPath string, isDangerous bool) (bool, error)

func (*Requester) ResetSessionPermissions

func (r *Requester) ResetSessionPermissions()

func (*Requester) SendResponse

func (r *Requester) SendResponse(choice Choice, toolName string)

type Status

type Status string
const (
	StatusPending            Status = "pending"
	StatusAllowed            Status = "allowed"
	StatusAllowedSession     Status = "allowed_session"
	StatusDenied             Status = "denied"
	StatusAutoAllowedSession Status = "auto_allowed_session"
	StatusRedirected         Status = "redirected"
)

Jump to

Keyboard shortcuts

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