gatepolicy

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package gatepolicy evaluates assignment policy without reading or writing a store. Callers must obtain authority from a gateauthority.Snapshot; a failed read belongs on the fault path, not in a policy input.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

Input contains policy facts, not host payload bytes. Event identifies the occurrence; the caller supplies its classified action and runtime properties. Decide does not reclassify or mutate those facts.

type Refusal

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

Refusal is an immutable fault value. Its zero value is invalid.

func NewRefusal

func NewRefusal(kind RefusalKind) (Refusal, error)

func (Refusal) Error

func (r Refusal) Error() string

func (Refusal) IsValid

func (r Refusal) IsValid() bool

func (Refusal) Kind

func (r Refusal) Kind() RefusalKind

type RefusalKind

type RefusalKind uint8

RefusalKind identifies a failure to evaluate, never a policy denial.

const (
	RefusalUnset RefusalKind = iota
	RefusalPhaseUnknown
	RefusalPolicyUnlisted
)

func (RefusalKind) IsValid

func (k RefusalKind) IsValid() bool

type Result

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

Result holds exactly one valid decision or refusal, or neither when invalid. Constructors reject invalid operands by returning the unusable zero value.

func Decide

func Decide(in Input) (Result, error)

Decide evaluates the ordered policy rules. An error means the input runtime vocabulary is invalid; a refused Result means authority or tables could not support evaluation. Neither is a policy Deny. No rule requests human input.

func Decided

func Decided(d backend.Decision) Result

func Refused

func Refused(r Refusal) Result

func (Result) Decision

func (r Result) Decision() (backend.Decision, bool)

func (Result) Refusal

func (r Result) Refusal() (*Refusal, bool)

Refusal returns a copy. Replacing the pointed-to value cannot alter Result.

Jump to

Keyboard shortcuts

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