validator

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRego

func CheckRego(filename string, src string) []error

CheckRego validates Rego policy syntax and compilation. Returns a list of validation errors (empty if valid).

Types

type ContractViolation

type ContractViolation struct {
	Path     string // The input.* path that was referenced (e.g., "input.metadata.name")
	Location string // Location in the policy file (e.g., "policy.rego:12:5")
}

ContractViolation represents a policy reference that doesn't exist in the schema.

func CheckContract

func CheckContract(filename string, src string, schema cue.Value) ([]ContractViolation, error)

CheckContract validates that all input.* references in a Rego policy exist in the provided CUE schema. Returns a list of contract violations (empty if all references are valid).

func (ContractViolation) Error

func (v ContractViolation) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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