apache / apisix-dashboard

Dashboard for Apache APISIX
https://apisix.apache.org/
Apache License 2.0
1.01k stars 530 forks source link

Enable plugin to global_rules in 'Plugin List', dashboard will removed the _meta.filter setting when insert the plugin to ETCD. #2957

Open FionJHYang opened 4 months ago

FionJHYang commented 4 months ago

Issue description

Enable plugin to global_rules in 'Plugin List', dashboard will removed the _meta.filter setting when insert the plugin to ETCD.

if I want insert the request-validation plugin like below setting: { "_meta": { "disable": true, "filter": [ [ "host", "~=", "test.com.tw" ] ] }, "header_schema": { "properties": { "Origin": { "type": "string" } }, "required": [ "Origin" ], "type": "object" } }

After click submit button, the data in ETCD will remove filter section like below: { "_meta": { "disable": true }, "header_schema": { "properties": { "Origin": { "type": "string" } }, "required": [ "Origin" ], "type": "object" } }

Expected behavior

The data in ETCD should look like this: { "_meta": { "disable": true, "filter": [ [ "host", "~=", "test.com.tw" ] ] }, "header_schema": { "properties": { "Origin": { "type": "string" } }, "required": [ "Origin" ], "type": "object" } }

How to Reproduce

  1. Login Apisix Dashboard
  2. Click side menu 'Plugin'
  3. Click 'Enable' button to enable a plugin
  4. Select one plugin to enable and set _meta.filter config
  5. Click submit to finish enable

Screenshots

No response

Environment

Additional context

No response