Documentation
¶
Overview ¶
Package responseactions dispatches admitted policy intents to operator-configured enforcers. Evaluate never waits for network I/O; delivery failure cannot allow a deny.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchStatus ¶
BatchStatus distinguishes admission from delivery. Effects execute independently in winning-rule declaration order; failures do not roll back preceding effects.
Types ¶
type Broker ¶
type Broker struct {
Operations *runtimeobs.Monitor
// contains filtered or unexported fields
}
func (*Broker) Batch ¶
Batch returns latest delivery receipts for up to MaxEffects winning-rule IDs. Missing/evicted IDs are unknown, never proof that every effect succeeded.
func (*Broker) Receipts ¶
Receipts is a bounded chronological snapshot. No source values or tokens appear.
func (*Broker) Submit ¶
Submit requires an independently attributed source from the trusted ingress boundary. Never derive trustedSource from HTTP forwarding headers or policy Attributes/Fields. A duplicate retains its original deadline, including failures. After expiry plus Retention, the same rule/source may start a new lease.
type Config ¶
type Config struct {
Scopes map[string]Scope
QueueSize int
// MaxPending bounds both intent IDs and source/scope reservations, including cooldown.
MaxPending int
MaxReceipts int
Retention time.Duration
TLSConfig *tls.Config
// MaxActionsPerMinute caps new admissions across all scopes in a fixed window.
// Duplicates consume no budget. Queue-full attempts do consume budget.
MaxActionsPerMinute int
}
type Evaluator ¶
type Evaluator struct {
Policy PolicyEvaluator
Broker *Broker
Source SourceResolver
Flow func(policy.Event) (enforcer.Flow, bool)
// Replay prevents dispatch even when wrapping an enforce-mode policy.
Replay bool
}
func (*Evaluator) RequiresBody ¶
RequiresBody preserves dependency discovery through the dispatch wrapper. Evaluators without metadata conservatively require bodies in known phases.
type PolicyEvaluator ¶
type Scope ¶
type Scope struct {
Profiles map[string]enforcer.Profile
// Notification makes Endpoint a preconfigured HTTPS sink.
// It receives bounded intent metadata only, with no event body or policy URL.
Notification bool
NotificationPath string
Endpoint string
TokenEnv string
Network enforcer.Scope
ProtectedCIDRs []string
ProtectedServices []enforcer.Service
}
Scope is configured by the operator, never by a policy. Endpoint is an HTTPS origin; TokenEnv names an environment variable resolved once at construction.
type SourceResolver ¶
SourceResolver is a trusted integration boundary, not policy configuration. It must authorize each target from ingress attribution (socket peer, validated proxy chain, or packet tuple). Returning event headers/Attributes is unsafe.