Kong / go-pdk

Write Kong plugins in Go! 🦍
https://pkg.go.dev/github.com/Kong/go-pdk
Apache License 2.0
144 stars 48 forks source link

Need support for HeaderFilter and BodyFilter phases #197

Closed 0angelic0 closed 3 months ago

0angelic0 commented 3 months ago

Need support for HeaderFilter and BodyFilter phases.

Since I use serverless plugin (AWS Lambda) and the plugin's Response phase is not called. But from a lua plugin header_filter and body_filter will be called. So, I need go plugin to support HeaderFilter and BodyFilter phases as well.

Thank you.

jschmid1 commented 3 months ago

pinging @gszr and @StarlightIbuki for effort estimation and initial assessment

gszr commented 3 months ago

Hi @0angelic0,

Thanks for opening this issue and welcome to the Kong community.

The header_filter and body_filter phases do not support the socket API Kong uses to communicate with the pluginserver; this is a known limitation, by design.

The goal of the Go PDK is not to replace the Lua PDK entirely, but to allow you to tap into the Go ecosystem when there isn't a Lua equivalent library available; therefore, we recommend you to write your plugin in Lua if it's paramount to use the header and body filters.

We have a planned task to improve our docs and make this (and other) limitations clearer.

As always, happy to answer questions. For now, I will leave this issue open.

Happy Konging! 🦍

jschmid1 commented 3 months ago

Answered, closing.