check

package
v0.0.0-...-38eeddb Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CELCheck

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

CELCheck evaluates a CEL expression against the hook input.

func (*CELCheck) Execute

func (c *CELCheck) Execute(ctx context.Context, input *types.HookInput) (*types.CheckResult, error)

func (*CELCheck) Init

func (c *CELCheck) Init(params map[string]interface{}) error

func (*CELCheck) Name

func (c *CELCheck) Name() string

type CmdCheck

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

CmdCheck runs an arbitrary shell command and passes/fails based on exit code. Unlike Linter, it does not require a file path — suitable for Stop events.

func (*CmdCheck) Execute

func (c *CmdCheck) Execute(ctx context.Context, input *types.HookInput) (*types.CheckResult, error)

func (*CmdCheck) Init

func (c *CmdCheck) Init(params map[string]interface{}) error

func (*CmdCheck) Name

func (c *CmdCheck) Name() string

type CmdValidate

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

CmdValidate checks bash commands against deny/allow patterns.

func (*CmdValidate) Execute

func (c *CmdValidate) Execute(ctx context.Context, input *types.HookInput) (*types.CheckResult, error)

func (*CmdValidate) Init

func (c *CmdValidate) Init(params map[string]interface{}) error

func (*CmdValidate) Name

func (c *CmdValidate) Name() string

type DetectSecrets

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

DetectSecrets integrates Yelp detect-secrets for secret scanning. It dynamically generates a baseline config from YAML params and calls `detect-secrets scan --string` for each line of content.

func (*DetectSecrets) Execute

func (d *DetectSecrets) Execute(ctx context.Context, input *types.HookInput) (*types.CheckResult, error)

func (*DetectSecrets) Init

func (d *DetectSecrets) Init(params map[string]interface{}) error

func (*DetectSecrets) Name

func (d *DetectSecrets) Name() string

type DirACL

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

DirACL checks file paths against allow/deny glob patterns.

func (*DirACL) Execute

func (d *DirACL) Execute(ctx context.Context, input *types.HookInput) (*types.CheckResult, error)

func (*DirACL) Init

func (d *DirACL) Init(params map[string]interface{}) error

func (*DirACL) Name

func (d *DirACL) Name() string

type Factory

type Factory func() types.Check

Factory creates a new instance of a Check.

type Linter

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

Linter runs an external linter command on files after write/edit.

func (*Linter) Execute

func (l *Linter) Execute(ctx context.Context, input *types.HookInput) (*types.CheckResult, error)

func (*Linter) Init

func (l *Linter) Init(params map[string]interface{}) error

func (*Linter) Name

func (l *Linter) Name() string

type PromptModify

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

PromptModify injects additional context into user prompts.

func (*PromptModify) Execute

func (p *PromptModify) Execute(ctx context.Context, input *types.HookInput) (*types.CheckResult, error)

func (*PromptModify) Init

func (p *PromptModify) Init(params map[string]interface{}) error

func (*PromptModify) Name

func (p *PromptModify) Name() string

type Registry

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

Registry maps check type names to their factories.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a Registry with all built-in checks registered.

func (*Registry) Get

func (r *Registry) Get(name string) (types.Check, error)

Get creates a new instance of the named check.

func (*Registry) Register

func (r *Registry) Register(name string, factory Factory)

Register adds a check factory to the registry.

type RepoAccess

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

RepoAccess checks if the current repository is in the allow/deny list.

func (*RepoAccess) Execute

func (r *RepoAccess) Execute(ctx context.Context, input *types.HookInput) (*types.CheckResult, error)

func (*RepoAccess) Init

func (r *RepoAccess) Init(params map[string]interface{}) error

func (*RepoAccess) Name

func (r *RepoAccess) Name() string

type SecretDetect

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

SecretDetect scans tool_input content for secret patterns.

func (*SecretDetect) Execute

func (s *SecretDetect) Execute(ctx context.Context, input *types.HookInput) (*types.CheckResult, error)

func (*SecretDetect) Init

func (s *SecretDetect) Init(params map[string]interface{}) error

func (*SecretDetect) Name

func (s *SecretDetect) Name() string

type SkillInject

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

SkillInject loads context from a file or inline text at session start.

func (*SkillInject) Execute

func (s *SkillInject) Execute(ctx context.Context, input *types.HookInput) (*types.CheckResult, error)

func (*SkillInject) Init

func (s *SkillInject) Init(params map[string]interface{}) error

func (*SkillInject) Name

func (s *SkillInject) Name() string

Jump to

Keyboard shortcuts

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