policy

package
v0.4.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const PolicyQuery = "data.authz"

Variables

This section is empty.

Functions

func RequestOrResponseToInput

func RequestOrResponseToInput(req any) (map[string]any, error)

Types

type Policy added in v0.1.1

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

func NewPolicy added in v0.1.1

func NewPolicy(name, policy string) (*Policy, error)

NewPolicy creates a policy from the given policy document

func (*Policy) Eval added in v0.1.1

func (p *Policy) Eval(ctx context.Context, input map[string]any) (map[string]any, error)

Eval evaluates the policy with the given input and returns the decision log.

Jump to

Keyboard shortcuts

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