Documentation
¶
Overview ¶
Package celcheck validates CEL policy packs at compile time.
Ensures that all .cel files parse and type-check correctly using cel-go, so they can be trusted in production.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ValidationResult ¶
type ValidationResult struct {
File string `json:"file"`
Valid bool `json:"valid"`
Rules int `json:"rules"`
Errors []string `json:"errors,omitempty"`
}
ValidationResult holds the outcome of validating one CEL file.
func ValidateDirectory ¶
func ValidateDirectory(dir string) ([]ValidationResult, error)
ValidateDirectory validates all .cel files in a directory tree.
func ValidateFile ¶
func ValidateFile(path string) ValidationResult
ValidateFile parses and type-checks a CEL policy file.
HELM CEL policy packs use a single compound boolean expression per file, with comment blocks separating logical clauses. We strip comments and blank lines, join the remaining code, and parse the result as one CEL expression.
Click to show internal directories.
Click to hide internal directories.