Documentation
¶
Overview ¶
Package policy provides layered, auditable capability decisions. Discovery and execution use the same immutable snapshot, but execution must evaluate the policy again immediately before a side effect.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decision ¶
type Decision struct {
Effect Effect `json:"effect"`
Layer Layer `json:"layer,omitempty"`
ReasonCode string `json:"reason_code"`
Action string `json:"action"`
Resource string `json:"resource,omitempty"`
Immutable bool `json:"immutable,omitempty"`
}
Decision is the auditable effective result.
type Rule ¶
type Rule struct {
Action string `json:"action"`
Resource string `json:"resource,omitempty"`
Effect Effect `json:"effect"`
ReasonCode string `json:"reason_code"`
Immutable bool `json:"immutable,omitempty"`
}
Rule applies to one action and optional resource. A trailing * is a prefix match; an empty resource matches every resource.
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot is an immutable policy projection for one admitted run.
func NewSnapshot ¶
NewSnapshot validates and deep-copies policy layers.
func (Snapshot) AllowedActions ¶
AllowedActions filters candidate action names before model discovery.
func (Snapshot) Decide ¶
Decide evaluates every matching rule. Deny always wins; otherwise approval wins over allow. No matching rule fails closed.