Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CELEvaluator ¶
type CELEvaluator interface {
EvaluateRequestCondition(expression string, ctx *policy.RequestContext) (bool, error)
EvaluateResponseCondition(expression string, ctx *policy.ResponseContext) (bool, error)
}
CELEvaluator interface for condition evaluation
type ChainExecutor ¶
type ChainExecutor struct {
// contains filtered or unexported fields
}
ChainExecutor represents the policy chain execution engine T048: Added CEL evaluator for condition evaluation and metrics collection
func NewChainExecutor ¶
func NewChainExecutor(reg *registry.PolicyRegistry, celEvaluator CELEvaluator, tracer trace.Tracer) *ChainExecutor
NewChainExecutor creates a new ChainExecutor execution engine
func (*ChainExecutor) ExecuteRequestPolicies ¶
func (c *ChainExecutor) ExecuteRequestPolicies(traceCtx context.Context, policyList []policy.Policy, ctx *policy.RequestContext, specs []policy.PolicySpec, api, route string) (*RequestExecutionResult, error)
ExecuteRequestPolicies executes request policies with condition evaluation T043: Implements execution with condition evaluation and short-circuit logic
func (*ChainExecutor) ExecuteResponsePolicies ¶
func (c *ChainExecutor) ExecuteResponsePolicies(traceCtx context.Context, policyList []policy.Policy, ctx *policy.ResponseContext, specs []policy.PolicySpec, api, route string) (*ResponseExecutionResult, error)
ExecuteResponsePolicies executes response policies with condition evaluation T044: Implements execution with condition evaluation
type RequestExecutionResult ¶
type RequestExecutionResult struct {
Results []RequestPolicyResult
ShortCircuited bool // true if chain stopped early due to ImmediateResponse
FinalAction policy.RequestAction // Final action to apply
TotalExecutionTime time.Duration
}
RequestExecutionResult represents the result of executing all request policies in a chain
type RequestPolicyResult ¶
type RequestPolicyResult struct {
PolicyName string
PolicyVersion string
Action policy.RequestAction
ExecutionTime time.Duration
Skipped bool // true if condition evaluated to false
}
RequestPolicyResult represents the result of executing a single request policy
type ResponseExecutionResult ¶
type ResponseExecutionResult struct {
Results []ResponsePolicyResult
FinalAction policy.ResponseAction // Final action to apply
TotalExecutionTime time.Duration
}
ResponseExecutionResult represents the result of executing all response policies in a chain
type ResponsePolicyResult ¶
type ResponsePolicyResult struct {
PolicyName string
PolicyVersion string
Action policy.ResponseAction
Error error
ExecutionTime time.Duration
Skipped bool // true if condition evaluated to false
}
ResponsePolicyResult represents the result of executing a single response policy