apache / apisix-go-plugin-runner

Go Plugin Runner for APISIX
https://apisix.apache.org/
Apache License 2.0
167 stars 69 forks source link

Question #62 whether Apisix version 2.12 can be implemented? #67

Closed rampagecong closed 2 years ago

rampagecong commented 2 years ago

Issue description

Can #62 be implemented if you rewrite apisix-go-plugin-runne yourself? The technical plan for the company project should be made. If it can't be realized, the technical plan can only be changed.

Environment

spacewander commented 2 years ago

It requires modifying APISIX. Are you interested in working on it?

rampagecong commented 2 years ago

It requires modifying APISIX. Are you interested in working on it? Very interested, but what skills are required.

spacewander commented 2 years ago

You can

  1. read the doc in https://github.com/apache/apisix/pull/6336
  2. add a response header field to https://github.com/api7/ext-plugin-proto/blob/70ee1218b214fd206a8a949fb0f4f7d00f9e460f/ext-plugin.fbs#L102
  3. generate the code
  4. update APISIX to support it in https://github.com/apache/apisix/blob/9b98f1d13187c58195543bd48cb8b66e33aeab27/apisix/plugins/ext-plugin/init.lua#L601
  5. update Go Plugin Runner to support it
rampagecong commented 2 years ago

Ok.I'll try it.thanks.

rampagecong commented 2 years ago

Could you please take a look at those commits that implement the response header setting: https://github.com/rampagecong/apisix-go-plugin-runner/commit/d498697abb87b91002cdfabdc55f3cdc2b162328 https://github.com/rampagecong/ext-plugin-proto/commit/0fc113f3bd182ad3fed12fc63e236c82bca253dc https://github.com/rampagecong/apisix/commit/83d505771ea10bd8999aea1009500c6a77741b22 I basically just add a resp_headers field to Req and Rewrite struct and regen the code. Modified the FetchChanges method so that I can get the modified response header from the respHdr filed that I added to flatbuffer pb file. @spacewander

spacewander commented 2 years ago

Good. Could you submit them as Pull Request so that I can review them?

spacewander commented 2 years ago

Already done.