Description
Define the action type structs and Pipeline interface in pkg/extension/types/.
Action types:
GRPCMethodAction (request phase) — invokes a registered gRPC method, evaluates response with Intention
AllowAction (request phase) — allows/denies based on request attributes only
AddHeadersAction (response phase) — adds headers via a CEL expression
WithResponseCodeAction (response phase) — overrides the HTTP status code
RequestAction and ResponseAction are separate interfaces because request-phase actions can deny the request (failed Intention stops it), while response-phase actions cannot deny.
Acceptance Criteria
References
Description
Define the action type structs and
Pipelineinterface inpkg/extension/types/.Action types:
GRPCMethodAction(request phase) — invokes a registered gRPC method, evaluates response with IntentionAllowAction(request phase) — allows/denies based on request attributes onlyAddHeadersAction(response phase) — adds headers via a CEL expressionWithResponseCodeAction(response phase) — overrides the HTTP status codeRequestActionandResponseActionare separate interfaces because request-phase actions can deny the request (failed Intention stops it), while response-phase actions cannot deny.Acceptance Criteria
RequestActionandResponseActioninterfaces definedGRPCMethodAction,AllowAction,AddHeadersAction,WithResponseCodeActionstructs definedActionTypeenum withgrpc_method,allow,add_headers,with_response_codevaluesPipelineinterface withOnRequest(ctx, ...RequestAction) errorandOnResponse(ctx, ...ResponseAction) errorReferences