policydevel

package
v1.138.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 31 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 Initialize

func Initialize(opts *InitOptions) error

Types

type Content

type Content struct {
	YAML string
	Rego string
}

type EvalOptions added in v1.36.0

type EvalOptions struct {
	PolicyPath         string
	MaterialKind       string
	Annotations        map[string]string
	MaterialPath       string
	Inputs             map[string]string
	AllowedHostnames   []string
	Debug              bool
	AttestationClient  controlplanev1.AttestationServiceClient
	ControlPlaneConn   *grpc.ClientConn
	ProjectName        string
	ProjectVersionName string
}

type EvalResult added in v1.36.0

type EvalResult struct {
	Violations  []string          `json:"violations"`
	Findings    []json.RawMessage `json:"findings,omitempty"`
	SkipReasons []string          `json:"skip_reasons"`
	Skipped     bool              `json:"skipped"`
}

type EvalSummary added in v1.42.0

type EvalSummary struct {
	Result    *EvalResult           `json:"result"`
	DebugInfo *EvalSummaryDebugInfo `json:"debug_info,omitempty"`
}

func Evaluate added in v1.36.0

func Evaluate(opts *EvalOptions, logger zerolog.Logger) (*EvalSummary, error)

type EvalSummaryDebugInfo added in v1.42.0

type EvalSummaryDebugInfo struct {
	Inputs     []json.RawMessage `json:"inputs"`
	RawResults []json.RawMessage `json:"raw_results"`
}

type File added in v1.35.0

type File struct {
	Path    string
	Content []byte
}

type InitOptions

type InitOptions struct {
	Directory   string
	Embedded    bool
	Force       bool
	Name        string
	Description string
}

type PolicyToLint added in v1.35.0

type PolicyToLint struct {
	Path      string
	YAMLFiles []*File
	RegoFiles []*File
	WASMFiles []*File
	Format    bool
	Config    string
	Errors    []ValidationError
}

func Lookup added in v1.35.0

func Lookup(absPath, config string, format bool) (*PolicyToLint, error)

Read policy files

func (*PolicyToLint) AddError added in v1.35.0

func (p *PolicyToLint) AddError(path, message string, line int)

Adds a new validation error

func (*PolicyToLint) HasErrors added in v1.35.0

func (p *PolicyToLint) HasErrors() bool

Returns true if any validation errors were found

func (*PolicyToLint) Validate added in v1.35.0

func (p *PolicyToLint) Validate()

type TemplateData

type TemplateData struct {
	Name         string
	Description  string
	RegoPath     string
	RegoContent  string
	Embedded     bool
	MaterialKind string
}

type ValidationError added in v1.35.0

type ValidationError struct {
	Path    string
	Line    int
	Message string
}

func (ValidationError) Error added in v1.35.0

func (e ValidationError) Error() string

Jump to

Keyboard shortcuts

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