Skip to content

Add ActionType discriminator to wasm Action struct #1906

@philbrookes

Description

@philbrookes

Description

Add an explicit ActionType discriminator field to the wasm Action struct in internal/wasm/types.go. The wasm-shim dispatches based on this field value rather than inspecting which fields are present.

New fields on Action:

  • ActionTypegrpc_method, allow, add_headers, with_response_code
  • Intention — CEL expression
  • ActionMethod — registered method name
  • HeadersToAdd — CEL expression evaluating to a map of headers
  • NewResponseCode — HTTP status code

Existing actions (auth, ratelimit, tracing) do not set ActionType — the wasm-shim falls back to ServiceName-based dispatch when empty, preserving backwards compatibility.

Acceptance Criteria

  • ActionType field and constants added to Action struct
  • New pipeline action fields added (Intention, ActionMethod, HeadersToAdd, NewResponseCode)
  • Existing actions unaffected (backwards compatible)
  • 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