compiler

package
v0.17.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BadExtractor = extractors.BadExtractor

BadExtractor is an error occurring when extractor is invalid.

View Source
var BadLabelName = extractors.BadLabelName

BadLabelName is an error occurring when label name is invalid.

View Source
var BadRego = badRego{}

BadRego is an error occurring when rego compilation fails.

View Source
var BadSelector = badSelector{}

BadSelector is an error occurring when selector is invalid.

Functions

This section is empty.

Types

type CompiledRuleset

type CompiledRuleset struct {
	ControlPointID selectors.ControlPointID
	Labelers       []LabelerWithSelector
	ReportedRules  []ReportedRule
}

CompiledRuleset is compiled form of Classifier proto.

func CompileRuleset

func CompileRuleset(ctx context.Context, name string, classifierWrapper *policysyncv1.ClassifierWrapper) (CompiledRuleset, error)

CompileRuleset parses ruleset's selector and compiles its rules.

type Labeler

type Labeler struct {
	// rego query that's prepared to take envoy authz request as an input.
	// Result expression should be a single value (if LabelName is set) or a
	// map[string]interface{} otherwise.
	Query rego.PreparedEvalQuery
	// flags for created flow labels:
	LabelsTelemetry map[string]bool // multi-label variant
	// flow label that the result should be assigned to (single-label variant)
	LabelName string
	Telemetry bool // single-label variant
}

Labeler is used to create flow labels

label can create either: * a single label – LabelName is non-empty or * multiple labels – LabelName is empty.

type LabelerWithSelector

type LabelerWithSelector struct {
	Labeler          *Labeler
	LabelSelector    multimatcher.Expr
	CommonAttributes *policysyncv1.CommonAttributes
}

LabelerWithSelector is a labeler with its selector.

type ReportedRule

type ReportedRule struct {
	FlowSelector *policylangv1.FlowSelector
	Rule         *policylangv1.Rule
	RulesetName  string
	LabelName    string
}

ReportedRule is a rule along with its selector and label name.

Jump to

Keyboard shortcuts

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