permissions

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 4 Imported by: 0

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