policy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package policy embeds OPA directly in the proxy process - no network hop to a separate policy service, no per-call serialization round trip. This is the Fast Capability Plane's first latency bet: the policy bundle is compiled once at startup, and every subsequent evaluation runs in-memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decision

type Decision struct {
	Allow  bool
	Reason string
}

type Engine

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

func New

func New(ctx context.Context, policyPath string) (*Engine, error)

func NewDefault

func NewDefault(ctx context.Context) (*Engine, error)

NewDefault compiles the built-in permissive bundle - see defaultBundle for exactly what it does and does not enforce. Callers are expected to tell the operator they are running on it.

func (*Engine) Evaluate

func (e *Engine) Evaluate(ctx context.Context, input map[string]any) (Decision, error)

Jump to

Keyboard shortcuts

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