policy

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package policy is wowapi's ABAC condition engine: it evaluates a policy's conditions against an attribute bag using a closed operator set. It is the PolicyEngine kernel/authz delegates to, kept separate so the matching logic is small, pure, and independently testable (blueprint 01 §3 step 5).

Operators never execute arbitrary expressions; each is a fixed comparison, so a policy row can constrain but never inject behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct{}

Engine implements authz.PolicyEngine. It is stateless and safe for concurrent use.

func New

func New() *Engine

New returns a policy engine.

func (Engine) Matches

func (Engine) Matches(conds []authz.Condition, attrs map[string]any) (bool, error)

Matches reports whether every condition holds against attrs (logical AND — an empty condition set matches). A malformed condition (unknown operator, unparsable value) is an error, not a silent false: a broken policy must fail loud, never quietly stop denying.

Jump to

Keyboard shortcuts

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