planner

package
v0.33.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Or                 = "or"
	And                = "and"
	Not                = "not"
	Equals             = "eq"
	NotEquals          = "ne"
	GreaterThan        = "gt"
	GreaterThanOrEqual = "ge"
	LessThan           = "lt"
	LessThanOrEqual    = "le"
	In                 = "in"
	List               = "list"
	Struct             = "struct"
	Add                = "add"
	Sub                = "sub"
	Mult               = "mult"
	Div                = "div"
	Mod                = "mod"
	SetField           = "set-field"
	GetField           = "get-field"
	Index              = "index"
	All                = "all"
	Filter             = "filter"
	Exists             = "exists"
	ExistsOne          = "exists_one"
	Map                = "map"
	Lambda             = "lambda"
	If                 = "if"
)

Variables

View Source
var ErrUnknownOperator = errors.New("unknown operator")

Functions

func ResidualExpr

func ResidualExpr(a *cel.Ast, details *cel.EvalDetails) (*exprpb.Expr, error)

Types

type PolicyPlanResult

type PolicyPlanResult struct {
	Scope            string
	AllowFilter      []*qpN
	DenyFilter       []*qpN
	ValidationErrors []*schemav1.ValidationError
}

func CombinePlans

func CombinePlans(principalPolicyPlan, resourcePolicyPlan *PolicyPlanResult) *PolicyPlanResult

func (*PolicyPlanResult) Add

func (p *PolicyPlanResult) Add(filter *qpN, effect effectv1.Effect)

func (*PolicyPlanResult) Empty

func (p *PolicyPlanResult) Empty() bool

func (*PolicyPlanResult) ToPlanResourcesOutput

func (p *PolicyPlanResult) ToPlanResourcesOutput(input *enginev1.PlanResourcesInput) (*enginev1.PlanResourcesOutput, error)

type PrincipalPolicyEvaluator

type PrincipalPolicyEvaluator struct {
	Policy  *runtimev1.RunnablePrincipalPolicySet
	Globals map[string]any
	NowFn   func() time.Time
}

func (*PrincipalPolicyEvaluator) EvaluateResourcesQueryPlan

func (ppe *PrincipalPolicyEvaluator) EvaluateResourcesQueryPlan(ctx context.Context, input *enginev1.PlanResourcesInput) (*PolicyPlanResult, error)

type ResourcePolicyEvaluator

type ResourcePolicyEvaluator struct {
	Policy    *runtimev1.RunnableResourcePolicySet
	Globals   map[string]any
	SchemaMgr schema.Manager
	NowFn     func() time.Time
}

func (*ResourcePolicyEvaluator) EvaluateResourcesQueryPlan

func (rpe *ResourcePolicyEvaluator) EvaluateResourcesQueryPlan(ctx context.Context, input *enginev1.PlanResourcesInput) (*PolicyPlanResult, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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