pluginkit

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Overview

errors.go contains error definitions to streamline testing and log management

Index

Constants

This section is empty.

Variables

View Source
var (
	CORRUPTION_FOUND = func() error {
		return errors.New("target state may be corrupted! Halting to prevent futher damage. See logs for more information")
	}
	NO_EVALUATION_SUITES = func() error {
		return errors.New("no control evaluations provided by the plugin")
	}
	EVAL_NAME_MISSING = func() error {
		return errors.New("evaluationSuite name must not be empty")
	}
)

Errors with no parameters

View Source
var (
	VESSEL_NAMES_NOT_SET = func(serviceName, pluginName string) error {
		return fmt.Errorf("expected service and plugin names to be set. ServiceName='%s' PluginName='%s'", serviceName, pluginName)
	}
	EVALUATION_ORCHESTRATOR_NAMES_NOT_SET = func(serviceName, pluginName string) error {
		return fmt.Errorf("expected service and plugin names to be set. ServiceName='%s' PluginName='%s'", serviceName, pluginName)
	}
	WRITE_FAILED = func(name, err string) error {
		return fmt.Errorf("failed to write results for evaluation suite. name: %s, error: %s", name, err)
	}
	BAD_LOADER = func(pluginName string, err error) error {
		return fmt.Errorf("failed to load payload for %s: %s", pluginName, err)
	}
)

Errors with parameters required

Functions

This section is empty.

Types

type DataLoader added in v1.0.1

type DataLoader func(*config.Config) (interface{}, error)

type EvaluationOrchestrator added in v1.3.0

type EvaluationOrchestrator struct {
	ServiceName       string `yaml:"service-name"`
	PluginName        string `yaml:"plugin-name"`
	Payload           interface{}
	Evaluation_Suites []*EvaluationSuite `yaml:"evaluation-suites"` // EvaluationSuite is a map of evaluations to their catalog names
	// contains filtered or unexported fields
}

The evaluation orchestrator gets the plugin in position to execute the specified evaluation suites

func NewEvaluationOrchestrator added in v1.3.0

func NewEvaluationOrchestrator(pluginName string, loader DataLoader, requiredVars []string) *EvaluationOrchestrator

func (*EvaluationOrchestrator) AddEvaluationSuite added in v1.3.0

func (v *EvaluationOrchestrator) AddEvaluationSuite(catalogId string, loader DataLoader, evaluations []*layer4.ControlEvaluation, requirements map[string]*layer2.AssessmentRequirement)

func (*EvaluationOrchestrator) Mobilize added in v1.3.0

func (v *EvaluationOrchestrator) Mobilize() error

func (*EvaluationOrchestrator) WriteResults added in v1.3.0

func (v *EvaluationOrchestrator) WriteResults() error

type EvaluationSuite added in v1.0.0

type EvaluationSuite struct {
	Name   string        // Name is the name of the suite
	Result layer4.Result // Result is Passed if all evaluations in the suite passed

	CatalogId string `yaml:"catalog-id"` // CatalogId associates this suite with an catalog
	StartTime string `yaml:"start-time"` // StartTime is the time the plugin started
	EndTime   string `yaml:"end-time"`   // EndTime is the time the plugin ended

	CorruptedState bool `yaml:"corrupted-state"` // BadState is true if any testSet failed to revert at the end of the evaluation

	ControlEvaluations []*layer4.ControlEvaluation `yaml:"control-evaluations"` // ControlEvaluations is a slice of evaluations to be executed
	// contains filtered or unexported fields
}

TestSuite is a struct that contains the results of all ControlEvaluations, organized by name

func (*EvaluationSuite) Evaluate added in v1.0.0

func (e *EvaluationSuite) Evaluate(name string) error

Execute is used to execute a list of ControlEvaluations provided by a Plugin and customized by user config Name is an arbitrary string that will be used to identify the EvaluationSuite

func (*EvaluationSuite) WriteControlEvaluations added in v1.0.0

func (e *EvaluationSuite) WriteControlEvaluations(serviceName string, output string) error

type PayloadTypeExample added in v1.0.0

type PayloadTypeExample struct {
	CustomPayloadField bool
}

type TestSet

type TestSet func() (result layer4.ControlEvaluation)

Jump to

Keyboard shortcuts

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