Skip to content

Define action types and Pipeline interface #1901

@philbrookes

Description

@philbrookes

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

  • RequestAction and ResponseAction interfaces defined
  • GRPCMethodAction, AllowAction, AddHeadersAction, WithResponseCodeAction structs defined
  • ActionType enum with grpc_method, allow, add_headers, with_response_code values
  • Pipeline interface with OnRequest(ctx, ...RequestAction) error and OnResponse(ctx, ...ResponseAction) error
  • Unit tests

References

Metadata

Metadata

Assignees

Labels

feat/extensionsLabel created for organizing the work related to extensions. Felt pretty, might delete later.kind/enhancementNew feature or request

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions