core

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MPL-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoValidError

type NoValidError struct {
	Details interface{}
}

NoValidError indicates

func (NoValidError) Error

func (e NoValidError) Error() string

func (NoValidError) GetDetails

func (e NoValidError) GetDetails() interface{}

type OPAError

type OPAError interface {
	GetDetails() interface{}
}

type Policy

type Policy struct {
	// contains filtered or unexported fields
}

Policy contains policy and metedata

func Parse

func Parse(content, ruleQuery string) (Policy, error)

Parse constructs OPA policy from string

func (Policy) Eval

func (p Policy) Eval(data interface{}, query string) error

Eval validates data against given policy returns error if there're any violations found

func (Policy) EvalGateKeeperCompliant

func (p Policy) EvalGateKeeperCompliant(data map[string]interface{}, parameters map[string]interface{}, query string) error

EvalGateKeeperCompliant modifies the data to be Gatekeeper compliant and validates data against given policy returns error if there're any violations found

Jump to

Keyboard shortcuts

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