opa

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValidatedAssets

func GetValidatedAssets(ctx context.Context, regoPolicy string, dataset map[string]interface{}, output OpaOutput) (types.Result, error)

GetValidatedAssets performs the validation of the dataset against the given rego policy

Types

type OpaOutput added in v0.2.0

type OpaOutput struct {
	Validation   string   `json:"validation" yaml:"validation"`
	Observations []string `json:"observations" yaml:"observations"`
}

type OpaProvider added in v0.2.0

type OpaProvider struct {
	// Context is the context that the OPA policy is being evaluated in
	Context context.Context `json:"context" yaml:"context"`

	// Spec is the specification of the OPA policy
	Spec OpaSpec `json:"spec" yaml:"spec"`
}

func (OpaProvider) Evaluate added in v0.2.0

func (o OpaProvider) Evaluate(resources types.DomainResources) (types.Result, error)

type OpaSpec added in v0.2.0

type OpaSpec struct {
	Rego   string    `json:"rego" yaml:"rego"`
	Output OpaOutput `json:"output" yaml:"output"`
}

Jump to

Keyboard shortcuts

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