diff --git a/apisix/constants.lua b/apisix/constants.lua index 0b3ec160b53d..c84d9b7d18b1 100644 --- a/apisix/constants.lua +++ b/apisix/constants.lua @@ -43,4 +43,13 @@ return { ["/stream_routes"] = true, ["/plugin_metadata"] = true, }, + -- plugin category enum + PLUGIN_CATEGORY_GENERAL = "General", + PLUGIN_CATEGORY_TRANSFORMATION = "Transformation", + PLUGIN_CATEGORY_AUTHENTICATION = "Authentication", + PLUGIN_CATEGORY_SECURITY = "Security", + PLUGIN_CATEGORY_TRAFFIC = "Traffic", + PLUGIN_CATEGORY_OBSERVABILITY = "Observability", + PLUGIN_CATEGORY_SERVERLESS = "Serverless", + PLUGIN_CATEGORY_OTHER_PROTOCOLS = "Other protocols", } diff --git a/apisix/plugins/api-breaker.lua b/apisix/plugins/api-breaker.lua index eabca140af11..ee923f619b1e 100644 --- a/apisix/plugins/api-breaker.lua +++ b/apisix/plugins/api-breaker.lua @@ -15,7 +15,9 @@ -- limitations under the License. -- +local require = require local core = require("apisix.core") +local constants = require("apisix.constants") local plugin_name = "api-breaker" local ngx = ngx local math = math @@ -32,6 +34,11 @@ end local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRAFFIC + }, break_response_code = { type = "integer", minimum = 200, diff --git a/apisix/plugins/authz-casbin.lua b/apisix/plugins/authz-casbin.lua index 834c747b19af..da76389091ad 100644 --- a/apisix/plugins/authz-casbin.lua +++ b/apisix/plugins/authz-casbin.lua @@ -14,16 +14,22 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- - +local require = require local casbin = require("casbin") local core = require("apisix.core") local plugin = require("apisix.plugin") +local constants = require("apisix.constants") local plugin_name = "authz-casbin" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_AUTHENTICATION + }, model_path = { type = "string" }, policy_path = { type = "string" }, model = { type = "string" }, diff --git a/apisix/plugins/authz-casdoor.lua b/apisix/plugins/authz-casdoor.lua index 4ed1c92b924e..dfb178587e4a 100644 --- a/apisix/plugins/authz-casdoor.lua +++ b/apisix/plugins/authz-casdoor.lua @@ -14,9 +14,11 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local http = require("resty.http") local session = require("resty.session") +local constants = require("apisix.constants") local ngx = ngx local rand = math.random local tostring = tostring @@ -26,6 +28,11 @@ local plugin_name = "authz-casdoor" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_AUTHENTICATION + }, -- Note: endpoint_addr and callback_url should not end with '/' endpoint_addr = {type = "string", pattern = "^[^%?]+[^/]$"}, client_id = {type = "string"}, diff --git a/apisix/plugins/authz-keycloak.lua b/apisix/plugins/authz-keycloak.lua index 731e1f86cb93..d1aea11e7c0a 100644 --- a/apisix/plugins/authz-keycloak.lua +++ b/apisix/plugins/authz-keycloak.lua @@ -14,8 +14,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local http = require "resty.http" +local constants = require("apisix.constants") local sub_str = string.sub local type = type local ngx = ngx @@ -28,6 +30,11 @@ local pairs = pairs local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_AUTHENTICATION + }, discovery = {type = "string", minLength = 1, maxLength = 4096}, token_endpoint = {type = "string", minLength = 1, maxLength = 4096}, resource_registration_endpoint = {type = "string", minLength = 1, maxLength = 4096}, diff --git a/apisix/plugins/basic-auth.lua b/apisix/plugins/basic-auth.lua index c91ddee77a44..45046820f45f 100644 --- a/apisix/plugins/basic-auth.lua +++ b/apisix/plugins/basic-auth.lua @@ -14,10 +14,14 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local ngx = ngx local ngx_re = require("ngx.re") local consumer = require("apisix.consumer") +local constants = require("apisix.constants") + + local lrucache = core.lrucache.new({ ttl = 300, count = 512 }) @@ -26,6 +30,11 @@ local schema = { type = "object", title = "work with route or service object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_AUTHENTICATION + }, hide_credentials = { type = "boolean", default = false, diff --git a/apisix/plugins/batch-requests.lua b/apisix/plugins/batch-requests.lua index a1b574307ef6..528f2899c385 100644 --- a/apisix/plugins/batch-requests.lua +++ b/apisix/plugins/batch-requests.lua @@ -14,9 +14,11 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local http = require("resty.http") local plugin = require("apisix.plugin") +local constants = require("apisix.constants") local ngx = ngx local ipairs = ipairs local pairs = pairs @@ -41,6 +43,13 @@ local attr_schema = { local schema = { type = "object", + properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_GENERAL + }, + } } local default_max_body_size = 1024 * 1024 -- 1MiB diff --git a/apisix/plugins/body-transformer.lua b/apisix/plugins/body-transformer.lua index 368ccf9de0d2..fc80fe4dd440 100644 --- a/apisix/plugins/body-transformer.lua +++ b/apisix/plugins/body-transformer.lua @@ -14,10 +14,12 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local xml2lua = require("xml2lua") local xmlhandler = require("xmlhandler.tree") local template = require("resty.template") +local constants = require("apisix.constants") local ngx = ngx local decode_base64 = ngx.decode_base64 local req_set_body_data = ngx.req.set_body_data @@ -44,6 +46,11 @@ local transform_schema = { local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRANSFORMATION + }, request = transform_schema, response = transform_schema, }, diff --git a/apisix/plugins/cas-auth.lua b/apisix/plugins/cas-auth.lua index 2a3e5049c446..a7dfafc0316c 100644 --- a/apisix/plugins/cas-auth.lua +++ b/apisix/plugins/cas-auth.lua @@ -14,8 +14,10 @@ ---- See the License for the specific language governing permissions and ---- limitations under the License. ---- +local require = require local core = require("apisix.core") local http = require("resty.http") +local constants = require("apisix.constants") local ngx = ngx local ngx_re_match = ngx.re.match @@ -32,6 +34,11 @@ local plugin_name = "cas-auth" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_AUTHENTICATION + }, idp_uri = {type = "string"}, cas_callback_uri = {type = "string"}, logout_uri = {type = "string"}, diff --git a/apisix/plugins/chaitin-waf.lua b/apisix/plugins/chaitin-waf.lua index cc870a47f47e..6dd6e441f54b 100644 --- a/apisix/plugins/chaitin-waf.lua +++ b/apisix/plugins/chaitin-waf.lua @@ -14,12 +14,14 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + local require = require local core = require("apisix.core") local rr_balancer = require("apisix.balancer.roundrobin") local plugin = require("apisix.plugin") local t1k = require "resty.t1k" local expr = require("resty.expr.v1") +local constants = require("apisix.constants") local ngx = ngx local ngx_now = ngx.now @@ -50,6 +52,11 @@ local plugin_schema = { properties = { -- TODO: we should add a configuration "mode" here -- It can be one of off, block and monitor + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_SECURITY + }, match = match_schema, append_waf_resp_header = { type = "boolean", diff --git a/apisix/plugins/clickhouse-logger.lua b/apisix/plugins/clickhouse-logger.lua index b2e656797362..1b6920f74336 100644 --- a/apisix/plugins/clickhouse-logger.lua +++ b/apisix/plugins/clickhouse-logger.lua @@ -15,11 +15,13 @@ -- limitations under the License. -- +local require = require local bp_manager_mod = require("apisix.utils.batch-processor-manager") local log_util = require("apisix.utils.log-util") local core = require("apisix.core") local http = require("resty.http") local url = require("net.url") +local constants = require("apisix.constants") local math_random = math.random local tostring = tostring @@ -30,6 +32,11 @@ local batch_processor_manager = bp_manager_mod.new(plugin_name) local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, -- deprecated, use "endpoint_addrs" instead endpoint_addr = core.schema.uri_def, endpoint_addrs = {items = core.schema.uri_def, type = "array", minItems = 1}, diff --git a/apisix/plugins/client-control.lua b/apisix/plugins/client-control.lua index 1975098c83ce..a0b02b655af4 100644 --- a/apisix/plugins/client-control.lua +++ b/apisix/plugins/client-control.lua @@ -15,7 +15,9 @@ -- limitations under the License. -- local require = require +local require = require local core = require("apisix.core") +local constants = require("apisix.constants") local ok, apisix_ngx_client = pcall(require, "resty.apisix.client") local tonumber = tonumber @@ -23,6 +25,11 @@ local tonumber = tonumber local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRAFFIC + }, max_body_size = { type = "integer", minimum = 0, diff --git a/apisix/plugins/consumer-restriction.lua b/apisix/plugins/consumer-restriction.lua index 88c2bbd959d6..190d78dbacee 100644 --- a/apisix/plugins/consumer-restriction.lua +++ b/apisix/plugins/consumer-restriction.lua @@ -14,12 +14,21 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local ipairs = ipairs local core = require("apisix.core") +local constants = require("apisix.constants") local ngx = ngx + + local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_SECURITY + }, type = { type = "string", enum = {"consumer_name", "service_id", "route_id", "consumer_group_id"}, diff --git a/apisix/plugins/cors.lua b/apisix/plugins/cors.lua index 94f54683ef55..f34abee34cb6 100644 --- a/apisix/plugins/cors.lua +++ b/apisix/plugins/cors.lua @@ -14,8 +14,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local plugin = require("apisix.plugin") +local constants = require("apisix.constants") local ngx = ngx local plugin_name = "cors" local str_find = core.string.find @@ -48,6 +50,11 @@ local metadata_schema = { local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_SECURITY + }, allow_origins = { description = "you can use '*' to allow all origins when no credentials," .. diff --git a/apisix/plugins/csrf.lua b/apisix/plugins/csrf.lua index 4ed2ad624aa7..9847b612a6ae 100644 --- a/apisix/plugins/csrf.lua +++ b/apisix/plugins/csrf.lua @@ -14,9 +14,12 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local core = require("apisix.core") local resty_sha256 = require("resty.sha256") local str = require("resty.string") +local constants = require("apisix.constants") local ngx = ngx local ngx_encode_base64 = ngx.encode_base64 local ngx_decode_base64 = ngx.decode_base64 @@ -29,6 +32,11 @@ local SAFE_METHODS = {"GET", "HEAD", "OPTIONS"} local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_SECURITY + }, key = { description = "use to generate csrf token", type = "string", diff --git a/apisix/plugins/datadog.lua b/apisix/plugins/datadog.lua index 7f0ed8ab9ca0..10161eeccea7 100644 --- a/apisix/plugins/datadog.lua +++ b/apisix/plugins/datadog.lua @@ -13,9 +13,10 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. - +local require = require local core = require("apisix.core") local plugin = require("apisix.plugin") +local constants = require("apisix.constants") local bp_manager_mod = require("apisix.utils.batch-processor-manager") local fetch_log = require("apisix.utils.log-util").get_full_log local service_fetch = require("apisix.http.service").get @@ -37,6 +38,11 @@ local batch_processor_manager = bp_manager_mod.new(plugin_name) local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, prefer_name = {type = "boolean", default = true} } } diff --git a/apisix/plugins/degraphql.lua b/apisix/plugins/degraphql.lua index e47a276a8068..af9e704a4633 100644 --- a/apisix/plugins/degraphql.lua +++ b/apisix/plugins/degraphql.lua @@ -14,8 +14,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local gq_parse = require("graphql").parse +local constants = require("apisix.constants") local req_set_body_data = ngx.req.set_body_data local ipairs = ipairs local pcall = pcall @@ -25,6 +27,11 @@ local type = type local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRANSFORMATION + }, query = { type = "string", minLength = 1, diff --git a/apisix/plugins/dubbo-proxy.lua b/apisix/plugins/dubbo-proxy.lua index 57a093f062a3..8cea5f133299 100644 --- a/apisix/plugins/dubbo-proxy.lua +++ b/apisix/plugins/dubbo-proxy.lua @@ -14,7 +14,9 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") +local constants = require("apisix.constants") local ngx_var = ngx.var @@ -23,6 +25,11 @@ local plugin_name = "dubbo-proxy" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OTHER_PROTOCOLS + }, service_name = { type = "string", minLength = 1, diff --git a/apisix/plugins/echo.lua b/apisix/plugins/echo.lua index 525c1750e0bf..d424b22ee741 100644 --- a/apisix/plugins/echo.lua +++ b/apisix/plugins/echo.lua @@ -14,7 +14,9 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") +local constants = require("apisix.constants") local pairs = pairs local type = type local ngx = ngx @@ -23,6 +25,11 @@ local ngx = ngx local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_GENERAL + }, before_body = { description = "body before the filter phase.", type = "string" diff --git a/apisix/plugins/elasticsearch-logger.lua b/apisix/plugins/elasticsearch-logger.lua index de29da2e0184..2d04a41fef04 100644 --- a/apisix/plugins/elasticsearch-logger.lua +++ b/apisix/plugins/elasticsearch-logger.lua @@ -15,10 +15,12 @@ -- limitations under the License. -- +local require = require local core = require("apisix.core") local http = require("resty.http") local log_util = require("apisix.utils.log-util") local bp_manager_mod = require("apisix.utils.batch-processor-manager") +local constants = require("apisix.constants") local ngx = ngx local str_format = core.string.format @@ -31,6 +33,11 @@ local batch_processor_manager = bp_manager_mod.new(plugin_name) local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, -- deprecated, use "endpoint_addrs" instead endpoint_addr = { type = "string", diff --git a/apisix/plugins/error-log-logger.lua b/apisix/plugins/error-log-logger.lua index 5d5c5d2a9f8b..1179505b3d22 100644 --- a/apisix/plugins/error-log-logger.lua +++ b/apisix/plugins/error-log-logger.lua @@ -15,6 +15,7 @@ -- limitations under the License. -- +local require = require local core = require("apisix.core") local errlog = require("ngx.errlog") local batch_processor = require("apisix.utils.batch-processor") @@ -22,6 +23,7 @@ local plugin = require("apisix.plugin") local timers = require("apisix.timers") local http = require("resty.http") local producer = require("resty.kafka.producer") +local constants = require("apisix.constants") local plugin_name = "error-log-logger" local table = core.table local schema_def = core.schema @@ -152,6 +154,13 @@ local metadata_schema = { local schema = { type = "object", + properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, + } } diff --git a/apisix/plugins/ext-plugin-pre-req.lua b/apisix/plugins/ext-plugin-pre-req.lua index 183506d798fb..ba6fc1bddf2e 100644 --- a/apisix/plugins/ext-plugin-pre-req.lua +++ b/apisix/plugins/ext-plugin-pre-req.lua @@ -14,6 +14,7 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local ext = require("apisix.plugins.ext-plugin.init") diff --git a/apisix/plugins/ext-plugin/init.lua b/apisix/plugins/ext-plugin/init.lua index 424f29dc4f9b..6a136011350c 100644 --- a/apisix/plugins/ext-plugin/init.lua +++ b/apisix/plugins/ext-plugin/init.lua @@ -102,6 +102,11 @@ local schema = { items = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_GENERAL + }, name = { type = "string", maxLength = 128, diff --git a/apisix/plugins/fault-injection.lua b/apisix/plugins/fault-injection.lua index 34ca05e817fb..daa4578e4ac3 100644 --- a/apisix/plugins/fault-injection.lua +++ b/apisix/plugins/fault-injection.lua @@ -14,8 +14,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local expr = require("resty.expr.v1") +local constants = require("apisix.constants") local sleep = core.sleep local random = math.random @@ -30,6 +32,11 @@ local plugin_name = "fault-injection" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRANSFORMATION + }, abort = { type = "object", properties = { diff --git a/apisix/plugins/file-logger.lua b/apisix/plugins/file-logger.lua index 298fae2e4c5b..05406547e5e2 100644 --- a/apisix/plugins/file-logger.lua +++ b/apisix/plugins/file-logger.lua @@ -14,9 +14,12 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local log_util = require("apisix.utils.log-util") local core = require("apisix.core") local expr = require("resty.expr.v1") +local constants = require("apisix.constants") local ngx = ngx local io_open = io.open local is_apisix_or, process = pcall(require, "resty.apisix.process") @@ -28,6 +31,11 @@ local plugin_name = "file-logger" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, path = { type = "string" }, diff --git a/apisix/plugins/forward-auth.lua b/apisix/plugins/forward-auth.lua index 6d4454a581e8..d7779911d6f5 100644 --- a/apisix/plugins/forward-auth.lua +++ b/apisix/plugins/forward-auth.lua @@ -14,14 +14,20 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- - +local require = require local ipairs = ipairs local core = require("apisix.core") local http = require("resty.http") +local constants = require("apisix.constants") local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_AUTHENTICATION + }, uri = {type = "string"}, allow_degradation = {type = "boolean", default = false}, ssl_verify = { diff --git a/apisix/plugins/gm.lua b/apisix/plugins/gm.lua index ee147ce29d92..288e79c61c69 100644 --- a/apisix/plugins/gm.lua +++ b/apisix/plugins/gm.lua @@ -24,6 +24,7 @@ local get_request = require("resty.core.base").get_request local core = require("apisix.core") local radixtree_sni = require("apisix.ssl.router.radixtree_sni") local apisix_ssl = require("apisix.ssl") +local constants = require("apisix.constants") local _, ssl = pcall(require, "resty.apisix.ssl") local error = error @@ -122,6 +123,11 @@ local plugin_name = "gm" local plugin_schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_SECURITY + }, }, } diff --git a/apisix/plugins/google-cloud-logging.lua b/apisix/plugins/google-cloud-logging.lua index 74360e9b3984..f93d80ff4911 100644 --- a/apisix/plugins/google-cloud-logging.lua +++ b/apisix/plugins/google-cloud-logging.lua @@ -15,12 +15,14 @@ -- limitations under the License. -- +local require = require local core = require("apisix.core") local tostring = tostring local http = require("resty.http") local log_util = require("apisix.utils.log-util") local bp_manager_mod = require("apisix.utils.batch-processor-manager") local google_oauth = require("apisix.plugins.google-cloud-logging.oauth") +local constants = require("apisix.constants") local lrucache = core.lrucache.new({ @@ -32,6 +34,11 @@ local batch_processor_manager = bp_manager_mod.new(plugin_name) local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, auth_config = { type = "object", properties = { diff --git a/apisix/plugins/grpc-transcode.lua b/apisix/plugins/grpc-transcode.lua index a89008d39790..4bd80adfbc93 100644 --- a/apisix/plugins/grpc-transcode.lua +++ b/apisix/plugins/grpc-transcode.lua @@ -15,11 +15,13 @@ -- limitations under the License. -- local ngx = ngx +local require = require local core = require("apisix.core") local schema_def = require("apisix.schema_def") local proto = require("apisix.plugins.grpc-transcode.proto") local request = require("apisix.plugins.grpc-transcode.request") local response = require("apisix.plugins.grpc-transcode.response") +local constants = require("apisix.constants") local plugin_name = "grpc-transcode" @@ -47,6 +49,11 @@ local pb_option_def = { local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRANSFORMATION + }, proto_id = schema_def.id_schema, service = { description = "the grpc service name", diff --git a/apisix/plugins/grpc-web.lua b/apisix/plugins/grpc-web.lua index 18465063b343..b628f26819c2 100644 --- a/apisix/plugins/grpc-web.lua +++ b/apisix/plugins/grpc-web.lua @@ -13,10 +13,11 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. - +local require = require local ngx = ngx local ngx_arg = ngx.arg local core = require("apisix.core") +local constants = require("apisix.constants") local req_set_uri = ngx.req.set_uri local req_set_body_data = ngx.req.set_body_data local decode_base64 = ngx.decode_base64 @@ -37,7 +38,13 @@ local plugin_name = "grpc-web" local schema = { type = "object", - properties = {}, + properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRANSFORMATION + }, + }, } local grpc_web_content_encoding = { diff --git a/apisix/plugins/gzip.lua b/apisix/plugins/gzip.lua index dfd0f10c071b..6500dbafdab2 100644 --- a/apisix/plugins/gzip.lua +++ b/apisix/plugins/gzip.lua @@ -14,8 +14,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local is_apisix_or, response = pcall(require, "resty.apisix.response") +local constants = require("apisix.constants") local ngx_header = ngx.header local req_http_version = ngx.req.http_version local str_sub = string.sub @@ -27,6 +29,11 @@ local type = type local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_GENERAL + }, types = { anyOf = { { diff --git a/apisix/plugins/hmac-auth.lua b/apisix/plugins/hmac-auth.lua index 94916e975216..3834d17ccc52 100644 --- a/apisix/plugins/hmac-auth.lua +++ b/apisix/plugins/hmac-auth.lua @@ -14,6 +14,7 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local ngx = ngx local type = type local abs = math.abs @@ -27,6 +28,7 @@ local core = require("apisix.core") local hmac = require("resty.hmac") local consumer = require("apisix.consumer") local plugin = require("apisix.plugin") +local constants = require("apisix.constants") local ngx_decode_base64 = ngx.decode_base64 local ngx_encode_base64 = ngx.encode_base64 @@ -43,7 +45,13 @@ local MAX_REQ_BODY = 1024 * 512 local schema = { type = "object", title = "work with route or service object", - properties = {}, + properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_AUTHENTICATION + }, + }, } local consumer_schema = { diff --git a/apisix/plugins/http-logger.lua b/apisix/plugins/http-logger.lua index c417e29f87d4..53a31ce27cd3 100644 --- a/apisix/plugins/http-logger.lua +++ b/apisix/plugins/http-logger.lua @@ -14,12 +14,13 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- - +local require = require local bp_manager_mod = require("apisix.utils.batch-processor-manager") local log_util = require("apisix.utils.log-util") local core = require("apisix.core") local http = require("resty.http") local url = require("net.url") +local constants = require("apisix.constants") local tostring = tostring local ipairs = ipairs @@ -30,6 +31,11 @@ local batch_processor_manager = bp_manager_mod.new("http logger") local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, uri = core.schema.uri_def, auth_header = {type = "string"}, timeout = {type = "integer", minimum = 1, default = 3}, diff --git a/apisix/plugins/inspect.lua b/apisix/plugins/inspect.lua index 19f50c79e55b..47a7d268c5a7 100644 --- a/apisix/plugins/inspect.lua +++ b/apisix/plugins/inspect.lua @@ -14,9 +14,11 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local plugin = require("apisix.plugin") local inspect = require("apisix.inspect") +local constants = require("apisix.constants") local plugin_name = "inspect" @@ -24,7 +26,13 @@ local plugin_name = "inspect" local schema = { type = "object", - properties = {}, + properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_GENERAL + }, + }, } diff --git a/apisix/plugins/ip-restriction/init.lua b/apisix/plugins/ip-restriction/init.lua index 8933c8b78c3d..4804e59b2213 100644 --- a/apisix/plugins/ip-restriction/init.lua +++ b/apisix/plugins/ip-restriction/init.lua @@ -14,8 +14,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local ipairs = ipairs local core = require("apisix.core") +local constants = require("apisix.constants") local lrucache = core.lrucache.new({ ttl = 300, count = 512 }) @@ -24,6 +26,11 @@ local lrucache = core.lrucache.new({ local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_SECURITY + }, message = { type = "string", minLength = 1, diff --git a/apisix/plugins/jwt-auth.lua b/apisix/plugins/jwt-auth.lua index 26211b98dece..1b583083b95e 100644 --- a/apisix/plugins/jwt-auth.lua +++ b/apisix/plugins/jwt-auth.lua @@ -14,11 +14,13 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local jwt = require("resty.jwt") local consumer_mod = require("apisix.consumer") local resty_random = require("resty.random") local new_tab = require ("table.new") +local constants = require("apisix.constants") local ngx_encode_base64 = ngx.encode_base64 local ngx_decode_base64 = ngx.decode_base64 @@ -35,6 +37,11 @@ local pcall = pcall local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_AUTHENTICATION + }, header = { type = "string", default = "authorization" diff --git a/apisix/plugins/kafka-logger.lua b/apisix/plugins/kafka-logger.lua index ca004e9ccad5..884c5fb3f0d2 100644 --- a/apisix/plugins/kafka-logger.lua +++ b/apisix/plugins/kafka-logger.lua @@ -14,9 +14,12 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local core = require("apisix.core") local log_util = require("apisix.utils.log-util") local producer = require ("resty.kafka.producer") +local constants = require("apisix.constants") local bp_manager_mod = require("apisix.utils.batch-processor-manager") local math = math @@ -32,6 +35,11 @@ local lrucache = core.lrucache.new({ local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, meta_format = { type = "string", default = "default", diff --git a/apisix/plugins/kafka-proxy.lua b/apisix/plugins/kafka-proxy.lua index 0882692dd2e5..39df5ea8b2ba 100644 --- a/apisix/plugins/kafka-proxy.lua +++ b/apisix/plugins/kafka-proxy.lua @@ -14,12 +14,19 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") +local constants = require("apisix.constants") local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OTHER_PROTOCOLS + }, sasl = { type = "object", properties = { diff --git a/apisix/plugins/key-auth.lua b/apisix/plugins/key-auth.lua index f8cfddae0cf8..99735a86dbfb 100644 --- a/apisix/plugins/key-auth.lua +++ b/apisix/plugins/key-auth.lua @@ -14,14 +14,21 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local consumer_mod = require("apisix.consumer") +local constants = require("apisix.constants") local plugin_name = "key-auth" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_AUTHENTICATION + }, header = { type = "string", default = "apikey", diff --git a/apisix/plugins/ldap-auth.lua b/apisix/plugins/ldap-auth.lua index 11f205c6b8f5..534bef1d9b32 100644 --- a/apisix/plugins/ldap-auth.lua +++ b/apisix/plugins/ldap-auth.lua @@ -14,16 +14,23 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local ngx = ngx local ngx_re = require("ngx.re") local consumer_mod = require("apisix.consumer") local ldap = require("resty.ldap") +local constants = require("apisix.constants") local schema = { type = "object", title = "work with route or service object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_AUTHENTICATION + }, base_dn = { type = "string" }, ldap_uri = { type = "string" }, use_tls = { type = "boolean", default = false }, diff --git a/apisix/plugins/limit-conn.lua b/apisix/plugins/limit-conn.lua index d8389b701bcc..539d4c0b364b 100644 --- a/apisix/plugins/limit-conn.lua +++ b/apisix/plugins/limit-conn.lua @@ -14,14 +14,22 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local core = require("apisix.core") local limit_conn = require("apisix.plugins.limit-conn.init") +local constants = require("apisix.constants") local plugin_name = "limit-conn" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRAFFIC + }, conn = {type = "integer", exclusiveMinimum = 0}, burst = {type = "integer", minimum = 0}, default_conn_delay = {type = "number", exclusiveMinimum = 0}, diff --git a/apisix/plugins/limit-count/init.lua b/apisix/plugins/limit-count/init.lua index 049e238e916a..2774c14bcea4 100644 --- a/apisix/plugins/limit-count/init.lua +++ b/apisix/plugins/limit-count/init.lua @@ -14,8 +14,11 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local core = require("apisix.core") local apisix_plugin = require("apisix.plugin") +local constants = require("apisix.constants") local tab_insert = table.insert local ipairs = ipairs local pairs = pairs @@ -101,6 +104,11 @@ local policy_to_additional_properties = { local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRAFFIC + }, count = {type = "integer", exclusiveMinimum = 0}, time_window = {type = "integer", exclusiveMinimum = 0}, group = {type = "string"}, diff --git a/apisix/plugins/limit-req.lua b/apisix/plugins/limit-req.lua index 536d06176b1f..b41afbabfa49 100644 --- a/apisix/plugins/limit-req.lua +++ b/apisix/plugins/limit-req.lua @@ -14,8 +14,11 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local limit_req_new = require("resty.limit.req").new local core = require("apisix.core") +local constants = require("apisix.constants") local plugin_name = "limit-req" local sleep = core.sleep @@ -27,6 +30,11 @@ local lrucache = core.lrucache.new({ local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRAFFIC + }, rate = {type = "number", exclusiveMinimum = 0}, burst = {type = "number", minimum = 0}, key = {type = "string"}, diff --git a/apisix/plugins/log-rotate.lua b/apisix/plugins/log-rotate.lua index 4b0f32753836..822f365d53a6 100644 --- a/apisix/plugins/log-rotate.lua +++ b/apisix/plugins/log-rotate.lua @@ -15,12 +15,14 @@ -- limitations under the License. -- +local require = require local core = require("apisix.core") local timers = require("apisix.timers") local plugin = require("apisix.plugin") local process = require("ngx.process") local signal = require("resty.signal") local shell = require("resty.shell") +local constants = require("apisix.constants") local ipairs = ipairs local ngx = ngx local ngx_time = ngx.time @@ -53,7 +55,13 @@ local SLASH_BYTE = str_byte("/") local schema = { type = "object", - properties = {}, + properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, + }, } diff --git a/apisix/plugins/loggly.lua b/apisix/plugins/loggly.lua index 92fafb78287d..1613651c5965 100644 --- a/apisix/plugins/loggly.lua +++ b/apisix/plugins/loggly.lua @@ -14,12 +14,15 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local core = require("apisix.core") local plugin = require("apisix.plugin") local bp_manager_mod = require("apisix.utils.batch-processor-manager") local log_util = require("apisix.utils.log-util") local path = require("pl.path") local http = require("resty.http") +local constants = require("apisix.constants") local ngx = ngx local tostring = tostring local pairs = pairs @@ -54,6 +57,11 @@ end local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, customer_token = {type = "string"}, severity = { type = "string", diff --git a/apisix/plugins/loki-logger.lua b/apisix/plugins/loki-logger.lua index e4c834e30e9a..d2f437909d2c 100644 --- a/apisix/plugins/loki-logger.lua +++ b/apisix/plugins/loki-logger.lua @@ -15,11 +15,13 @@ -- limitations under the License. -- +local require = require local bp_manager_mod = require("apisix.utils.batch-processor-manager") local log_util = require("apisix.utils.log-util") local core = require("apisix.core") local http = require("resty.http") local new_tab = require("table.new") +local constants = require("apisix.constants") local pairs = pairs local ipairs = ipairs @@ -35,6 +37,11 @@ local batch_processor_manager = bp_manager_mod.new("loki logger") local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, -- core configurations endpoint_addrs = { type = "array", diff --git a/apisix/plugins/mocking.lua b/apisix/plugins/mocking.lua index af5bc75edb2a..48a5e17e7030 100644 --- a/apisix/plugins/mocking.lua +++ b/apisix/plugins/mocking.lua @@ -14,8 +14,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local xml2lua = require("xml2lua") +local constants = require("apisix.constants") local json = core.json local math = math @@ -37,6 +39,11 @@ local support_content_type = { local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRANSFORMATION + }, -- specify response delay time,default 0ms delay = { type = "integer", default = 0 }, -- specify response status,default 200 diff --git a/apisix/plugins/node-status.lua b/apisix/plugins/node-status.lua index b80007b49a27..968a1fd8382e 100644 --- a/apisix/plugins/node-status.lua +++ b/apisix/plugins/node-status.lua @@ -14,7 +14,9 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") +local constants = require("apisix.constants") local ngx = ngx local re_gmatch = ngx.re.gmatch local ngx_capture = ngx.location.capture @@ -25,6 +27,13 @@ local ipairs = ipairs local schema = { type = "object", + properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + } + } } diff --git a/apisix/plugins/opa.lua b/apisix/plugins/opa.lua index 24bdb5be1a46..8e71b9c95c26 100644 --- a/apisix/plugins/opa.lua +++ b/apisix/plugins/opa.lua @@ -14,16 +14,22 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- - +local require = require local core = require("apisix.core") local http = require("resty.http") local helper = require("apisix.plugins.opa.helper") +local constants = require("apisix.constants") local type = type local ipairs = ipairs local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_AUTHENTICATION + }, host = {type = "string"}, ssl_verify = { type = "boolean", diff --git a/apisix/plugins/openid-connect.lua b/apisix/plugins/openid-connect.lua index a64ba2fa9122..772750cee2e7 100644 --- a/apisix/plugins/openid-connect.lua +++ b/apisix/plugins/openid-connect.lua @@ -14,11 +14,12 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- - +local require = require local core = require("apisix.core") local ngx_re = require("ngx.re") local openidc = require("resty.openidc") local random = require("resty.random") +local constants = require("apisix.constants") local string = string local ngx = ngx local ipairs = ipairs @@ -32,6 +33,11 @@ local plugin_name = "openid-connect" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_AUTHENTICATION + }, client_id = {type = "string"}, client_secret = {type = "string"}, discovery = {type = "string"}, diff --git a/apisix/plugins/opentelemetry.lua b/apisix/plugins/opentelemetry.lua index aac18897c0b1..945aa4a60c21 100644 --- a/apisix/plugins/opentelemetry.lua +++ b/apisix/plugins/opentelemetry.lua @@ -15,9 +15,11 @@ -- limitations under the License. -- local plugin_name = "opentelemetry" +local require = require local core = require("apisix.core") local plugin = require("apisix.plugin") local process = require("ngx.process") +local constants = require("apisix.constants") local always_off_sampler_new = require("opentelemetry.trace.sampling.always_off_sampler").new local always_on_sampler_new = require("opentelemetry.trace.sampling.always_on_sampler").new @@ -124,6 +126,11 @@ local attr_schema = { local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, sampler = { type = "object", properties = { diff --git a/apisix/plugins/openwhisk.lua b/apisix/plugins/openwhisk.lua index 7043f14f5a05..4fff9d00edf4 100644 --- a/apisix/plugins/openwhisk.lua +++ b/apisix/plugins/openwhisk.lua @@ -14,9 +14,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- - +local require = require local core = require("apisix.core") local http = require("resty.http") +local constants = require("apisix.constants") local ngx_encode_base64 = ngx.encode_base64 local tostring = tostring @@ -25,6 +26,11 @@ local name_pattern = [[\A([\w]|[\w][\w@ .-]*[\w@.-]+)\z]] local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_SERVERLESS + }, api_host = {type = "string"}, ssl_verify = { type = "boolean", diff --git a/apisix/plugins/prometheus.lua b/apisix/plugins/prometheus.lua index b1546975412d..04a62de0b2b4 100644 --- a/apisix/plugins/prometheus.lua +++ b/apisix/plugins/prometheus.lua @@ -14,14 +14,21 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local exporter = require("apisix.plugins.prometheus.exporter") +local constants = require("apisix.constants") local plugin_name = "prometheus" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, prefer_name = { type = "boolean", default = false diff --git a/apisix/plugins/proxy-cache/init.lua b/apisix/plugins/proxy-cache/init.lua index 918f755994ea..a6eefaabca96 100644 --- a/apisix/plugins/proxy-cache/init.lua +++ b/apisix/plugins/proxy-cache/init.lua @@ -15,10 +15,12 @@ -- limitations under the License. -- +local require = require local memory_handler = require("apisix.plugins.proxy-cache.memory_handler") local disk_handler = require("apisix.plugins.proxy-cache.disk_handler") local util = require("apisix.plugins.proxy-cache.util") local core = require("apisix.core") +local constants = require("apisix.constants") local ipairs = ipairs local plugin_name = "proxy-cache" @@ -30,6 +32,11 @@ local DEFAULT_CACHE_ZONE = "disk_cache_one" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRAFFIC + }, cache_zone = { type = "string", minLength = 1, diff --git a/apisix/plugins/proxy-control.lua b/apisix/plugins/proxy-control.lua index fc87e4529811..462dfe2a7fbf 100644 --- a/apisix/plugins/proxy-control.lua +++ b/apisix/plugins/proxy-control.lua @@ -15,13 +15,20 @@ -- limitations under the License. -- local require = require +local require = require local core = require("apisix.core") +local constants = require("apisix.constants") local ok, apisix_ngx_client = pcall(require, "resty.apisix.client") local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRAFFIC + }, request_buffering = { type = "boolean", default = true, diff --git a/apisix/plugins/proxy-mirror.lua b/apisix/plugins/proxy-mirror.lua index d6cede6e9b59..a99b244b4329 100644 --- a/apisix/plugins/proxy-mirror.lua +++ b/apisix/plugins/proxy-mirror.lua @@ -14,8 +14,11 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local core = require("apisix.core") local url = require("net.url") +local constants = require("apisix.constants") local math_random = math.random local has_mod, apisix_ngx_client = pcall(require, "resty.apisix.client") @@ -25,6 +28,11 @@ local plugin_name = "proxy-mirror" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRAFFIC + }, host = { type = "string", pattern = [=[^(http(s)?|grpc(s)?):\/\/([\da-zA-Z.-]+|\[[\da-fA-F:]+\])(:\d+)?$]=], diff --git a/apisix/plugins/proxy-rewrite.lua b/apisix/plugins/proxy-rewrite.lua index 21f44bc43e8a..92b7fcd18b9c 100644 --- a/apisix/plugins/proxy-rewrite.lua +++ b/apisix/plugins/proxy-rewrite.lua @@ -14,7 +14,9 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") +local constants = require("apisix.constants") local plugin_name = "proxy-rewrite" local pairs = pairs local ipairs = ipairs @@ -50,6 +52,11 @@ end) local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRANSFORMATION + }, uri = { description = "new uri for upstream", type = "string", diff --git a/apisix/plugins/public-api.lua b/apisix/plugins/public-api.lua index ad3f9dc0bfd2..9a293f160745 100644 --- a/apisix/plugins/public-api.lua +++ b/apisix/plugins/public-api.lua @@ -15,12 +15,19 @@ -- limitations under the License. -- +local require = require local core = require("apisix.core") local router = require("apisix.router") +local constants = require("apisix.constants") local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_SECURITY + }, uri = {type = "string"}, }, } diff --git a/apisix/plugins/real-ip.lua b/apisix/plugins/real-ip.lua index 71c33095b801..e39448afc88a 100644 --- a/apisix/plugins/real-ip.lua +++ b/apisix/plugins/real-ip.lua @@ -14,7 +14,9 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") +local constants = require("apisix.constants") local ngx_re_split = require("ngx.re").split local is_apisix_or, client = pcall(require, "resty.apisix.client") local str_byte = string.byte @@ -29,6 +31,11 @@ local lrucache = core.lrucache.new({ local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_GENERAL + }, trusted_addresses = { type = "array", items = {anyOf = core.schema.ip_def}, diff --git a/apisix/plugins/redirect.lua b/apisix/plugins/redirect.lua index 421007d20d82..c4f1ddc74e68 100644 --- a/apisix/plugins/redirect.lua +++ b/apisix/plugins/redirect.lua @@ -14,8 +14,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local plugin = require("apisix.plugin") +local constants = require("apisix.constants") local tab_insert = table.insert local tab_concat = table.concat local string_format = string.format @@ -40,6 +42,11 @@ local reg = [[(\\\$[0-9a-zA-Z_]+)|]] -- \$host local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_GENERAL + }, ret_code = {type = "integer", minimum = 200, default = 302}, uri = {type = "string", minLength = 2, pattern = reg}, regex_uri = { diff --git a/apisix/plugins/referer-restriction.lua b/apisix/plugins/referer-restriction.lua index 85e8ea3bc1e1..67618676572c 100644 --- a/apisix/plugins/referer-restriction.lua +++ b/apisix/plugins/referer-restriction.lua @@ -14,9 +14,11 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local ipairs = ipairs local core = require("apisix.core") local http = require "resty.http" +local constants = require("apisix.constants") local lrucache = core.lrucache.new({ ttl = 300, count = 512 }) @@ -25,6 +27,11 @@ local lrucache = core.lrucache.new({ local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_SECURITY + }, bypass_missing = { type = "boolean", default = false, diff --git a/apisix/plugins/request-id.lua b/apisix/plugins/request-id.lua index dac3162db5ed..cbecd15c4c3f 100644 --- a/apisix/plugins/request-id.lua +++ b/apisix/plugins/request-id.lua @@ -16,9 +16,11 @@ -- local ngx = ngx +local require = require local core = require("apisix.core") local uuid = require("resty.jit-uuid") local nanoid = require("nanoid") +local constants = require("apisix.constants") local math_random = math.random local str_byte = string.byte local ffi = require "ffi" @@ -28,6 +30,11 @@ local plugin_name = "request-id" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRAFFIC + }, header_name = {type = "string", default = "X-Request-Id"}, include_in_response = {type = "boolean", default = true}, algorithm = { diff --git a/apisix/plugins/request-validation.lua b/apisix/plugins/request-validation.lua index 0e6d36d95e22..ecbed05fb967 100644 --- a/apisix/plugins/request-validation.lua +++ b/apisix/plugins/request-validation.lua @@ -14,13 +14,21 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local core = require("apisix.core") +local constants = require("apisix.constants") local plugin_name = "request-validation" local ngx = ngx local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRAFFIC + }, header_schema = {type = "object"}, body_schema = {type = "object"}, rejected_code = {type = "integer", minimum = 200, maximum = 599, default = 400}, diff --git a/apisix/plugins/response-rewrite.lua b/apisix/plugins/response-rewrite.lua index d9aa816ce3de..11fa412eb0e1 100644 --- a/apisix/plugins/response-rewrite.lua +++ b/apisix/plugins/response-rewrite.lua @@ -14,9 +14,11 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local expr = require("resty.expr.v1") local re_compile = require("resty.core.regex").re_match_compile +local constants = require("apisix.constants") local plugin_name = "response-rewrite" local ngx = ngx local ngx_header = ngx.header @@ -38,6 +40,11 @@ local lrucache = core.lrucache.new({ local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRANSFORMATION + }, headers = { description = "new headers for response", anyOf = { diff --git a/apisix/plugins/rocketmq-logger.lua b/apisix/plugins/rocketmq-logger.lua index 3cefa7fbbea3..628d98604fc1 100644 --- a/apisix/plugins/rocketmq-logger.lua +++ b/apisix/plugins/rocketmq-logger.lua @@ -14,11 +14,14 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local core = require("apisix.core") local log_util = require("apisix.utils.log-util") local producer = require ("resty.rocketmq.producer") local acl_rpchook = require("resty.rocketmq.acl_rpchook") local bp_manager_mod = require("apisix.utils.batch-processor-manager") +local constants = require("apisix.constants") local type = type local plugin_name = "rocketmq-logger" @@ -31,6 +34,11 @@ local lrucache = core.lrucache.new({ local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, meta_format = { type = "string", default = "default", diff --git a/apisix/plugins/server-info.lua b/apisix/plugins/server-info.lua index 9ced84cd4042..99a44f2027f9 100644 --- a/apisix/plugins/server-info.lua +++ b/apisix/plugins/server-info.lua @@ -18,6 +18,7 @@ local require = require local core = require("apisix.core") local timers = require("apisix.timers") local plugin = require("apisix.plugin") +local constants = require("apisix.constants") local ngx_time = ngx.time local ngx_timer_at = ngx.timer.at @@ -35,6 +36,11 @@ local schema = { local attr_schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_GENERAL + }, report_ttl = { type = "integer", description = "live time for server info in etcd", diff --git a/apisix/plugins/serverless/generic-upstream.lua b/apisix/plugins/serverless/generic-upstream.lua index 52a0cb3ea346..80e494723e13 100644 --- a/apisix/plugins/serverless/generic-upstream.lua +++ b/apisix/plugins/serverless/generic-upstream.lua @@ -18,6 +18,7 @@ local ngx = ngx local require = require local type = type local string = string +local constants = require("apisix.constants") return function(plugin_name, version, priority, request_processor, authz_schema, metadata_schema) local core = require("apisix.core") @@ -32,6 +33,11 @@ return function(plugin_name, version, priority, request_processor, authz_schema, local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_SERVERLESS + }, function_uri = {type = "string"}, authorization = authz_schema, timeout = {type = "integer", minimum = 100, default = 3000}, diff --git a/apisix/plugins/serverless/init.lua b/apisix/plugins/serverless/init.lua index 6ed8c9604ae8..a3a940a75955 100644 --- a/apisix/plugins/serverless/init.lua +++ b/apisix/plugins/serverless/init.lua @@ -19,6 +19,7 @@ local pcall = pcall local loadstring = loadstring local require = require local type = type +local constants = require("apisix.constants") local phases = { @@ -38,6 +39,11 @@ return function(plugin_name, priority) local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_SERVERLESS + }, phase = { type = "string", default = "access", diff --git a/apisix/plugins/skywalking-logger.lua b/apisix/plugins/skywalking-logger.lua index 136b9dec1b34..8f785764a6eb 100644 --- a/apisix/plugins/skywalking-logger.lua +++ b/apisix/plugins/skywalking-logger.lua @@ -14,13 +14,13 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- - +local require = require local bp_manager_mod = require("apisix.utils.batch-processor-manager") local log_util = require("apisix.utils.log-util") local core = require("apisix.core") local http = require("resty.http") local url = require("net.url") - +local constants = require("apisix.constants") local base64 = require("ngx.base64") local ngx_re = require("ngx.re") @@ -33,6 +33,11 @@ local batch_processor_manager = bp_manager_mod.new("skywalking logger") local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, endpoint_addr = core.schema.uri_def, service_name = {type = "string", default = "APISIX"}, service_instance_name = {type = "string", default = "APISIX Instance Name"}, diff --git a/apisix/plugins/skywalking.lua b/apisix/plugins/skywalking.lua index de170487e0f9..cffc29dde103 100644 --- a/apisix/plugins/skywalking.lua +++ b/apisix/plugins/skywalking.lua @@ -20,6 +20,7 @@ local plugin = require("apisix.plugin") local process = require("ngx.process") local sw_tracer = require("skywalking.tracer") local Span = require("skywalking.span") +local constants = require("apisix.constants") local ngx = ngx local math = math @@ -50,6 +51,11 @@ local attr_schema = { local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, sample_ratio = { type = "number", minimum = 0.00001, diff --git a/apisix/plugins/sls-logger.lua b/apisix/plugins/sls-logger.lua index de2fbae67ffa..c65c1fb9fd45 100644 --- a/apisix/plugins/sls-logger.lua +++ b/apisix/plugins/sls-logger.lua @@ -14,9 +14,11 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local log_util = require("apisix.utils.log-util") local bp_manager_mod = require("apisix.utils.batch-processor-manager") +local constants = require("apisix.constants") local plugin_name = "sls-logger" @@ -32,6 +34,11 @@ local batch_processor_manager = bp_manager_mod.new(plugin_name) local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, include_req_body = {type = "boolean", default = false}, timeout = {type = "integer", minimum = 1, default= 5000}, log_format = {type = "object"}, diff --git a/apisix/plugins/splunk-hec-logging.lua b/apisix/plugins/splunk-hec-logging.lua index 6aa88e298dbb..239de61924b6 100644 --- a/apisix/plugins/splunk-hec-logging.lua +++ b/apisix/plugins/splunk-hec-logging.lua @@ -15,12 +15,14 @@ -- limitations under the License. -- +local require = require local core = require("apisix.core") local ngx = ngx local ngx_now = ngx.now local http = require("resty.http") local log_util = require("apisix.utils.log-util") local bp_manager_mod = require("apisix.utils.batch-processor-manager") +local constants = require("apisix.constants") local table_insert = core.table.insert local table_concat = core.table.concat local ipairs = ipairs @@ -37,6 +39,11 @@ local batch_processor_manager = bp_manager_mod.new(plugin_name) local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, endpoint = { type = "object", properties = { diff --git a/apisix/plugins/syslog.lua b/apisix/plugins/syslog.lua index 155ea7b41bba..b12054b8edb6 100644 --- a/apisix/plugins/syslog.lua +++ b/apisix/plugins/syslog.lua @@ -15,16 +15,23 @@ -- limitations under the License. -- +local require = require local core = require("apisix.core") local log_util = require("apisix.utils.log-util") local bp_manager_mod = require("apisix.utils.batch-processor-manager") local syslog = require("apisix.plugins.syslog.init") +local constants = require("apisix.constants") local plugin_name = "syslog" local batch_processor_manager = bp_manager_mod.new("sys logger") local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, host = {type = "string"}, port = {type = "integer"}, flush_limit = {type = "integer", minimum = 1, default = 4096}, diff --git a/apisix/plugins/tcp-logger.lua b/apisix/plugins/tcp-logger.lua index 444afe1d968a..6458163499cf 100644 --- a/apisix/plugins/tcp-logger.lua +++ b/apisix/plugins/tcp-logger.lua @@ -14,8 +14,11 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local core = require("apisix.core") local log_util = require("apisix.utils.log-util") +local constants = require("apisix.constants") local bp_manager_mod = require("apisix.utils.batch-processor-manager") local plugin_name = "tcp-logger" local tostring = tostring @@ -27,6 +30,11 @@ local batch_processor_manager = bp_manager_mod.new("tcp logger") local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, host = {type = "string"}, port = {type = "integer", minimum = 0}, tls = {type = "boolean", default = false}, diff --git a/apisix/plugins/tencent-cloud-cls.lua b/apisix/plugins/tencent-cloud-cls.lua index 7a4b7783f35b..063f78205dbb 100644 --- a/apisix/plugins/tencent-cloud-cls.lua +++ b/apisix/plugins/tencent-cloud-cls.lua @@ -15,10 +15,12 @@ -- limitations under the License. -- -local core = require("apisix.core") -local log_util = require("apisix.utils.log-util") -local bp_manager_mod = require("apisix.utils.batch-processor-manager") -local cls_sdk = require("apisix.plugins.tencent-cloud-cls.cls-sdk") +local require = require +local core = require("apisix.core") +local log_util = require("apisix.utils.log-util") +local bp_manager_mod = require("apisix.utils.batch-processor-manager") +local cls_sdk = require("apisix.plugins.tencent-cloud-cls.cls-sdk") +local constants = require("apisix.constants") local math = math local pairs = pairs @@ -28,6 +30,11 @@ local batch_processor_manager = bp_manager_mod.new(plugin_name) local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, cls_host = { type = "string" }, cls_topic = { type = "string" }, secret_id = { type = "string" }, diff --git a/apisix/plugins/traffic-split.lua b/apisix/plugins/traffic-split.lua index f546225c8c95..d92b8b74ecaa 100644 --- a/apisix/plugins/traffic-split.lua +++ b/apisix/plugins/traffic-split.lua @@ -14,12 +14,15 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local core = require("apisix.core") local upstream = require("apisix.upstream") local schema_def = require("apisix.schema_def") local roundrobin = require("resty.roundrobin") local ipmatcher = require("resty.ipmatcher") local expr = require("resty.expr.v1") +local constants = require("apisix.constants") local pairs = pairs local ipairs = ipairs local type = type @@ -78,6 +81,11 @@ local upstreams_schema = { local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_TRAFFIC + }, rules = { type = "array", items = { diff --git a/apisix/plugins/ua-restriction.lua b/apisix/plugins/ua-restriction.lua index 577dc2b67cbb..81056f1843da 100644 --- a/apisix/plugins/ua-restriction.lua +++ b/apisix/plugins/ua-restriction.lua @@ -14,10 +14,12 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local ipairs = ipairs local core = require("apisix.core") local re_compile = require("resty.core.regex").re_match_compile local stringx = require('pl.stringx') +local constants = require("apisix.constants") local type = type local str_strip = stringx.strip local re_find = ngx.re.find @@ -28,6 +30,11 @@ local lrucache_deny = core.lrucache.new({ ttl = 300, count = 4096 }) local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_SECURITY + }, bypass_missing = { type = "boolean", default = false, diff --git a/apisix/plugins/udp-logger.lua b/apisix/plugins/udp-logger.lua index 7d76a4b02eae..bd0a53ba6542 100644 --- a/apisix/plugins/udp-logger.lua +++ b/apisix/plugins/udp-logger.lua @@ -14,8 +14,11 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local core = require("apisix.core") local log_util = require("apisix.utils.log-util") +local constants = require("apisix.constants") local bp_manager_mod = require("apisix.utils.batch-processor-manager") local plugin_name = "udp-logger" local tostring = tostring @@ -27,6 +30,11 @@ local batch_processor_manager = bp_manager_mod.new("udp logger") local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, host = {type = "string"}, port = {type = "integer", minimum = 0}, timeout = {type = "integer", minimum = 1, default = 3}, diff --git a/apisix/plugins/uri-blocker.lua b/apisix/plugins/uri-blocker.lua index 4612532d53b6..c543af6196f4 100644 --- a/apisix/plugins/uri-blocker.lua +++ b/apisix/plugins/uri-blocker.lua @@ -14,14 +14,21 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local re_compile = require("resty.core.regex").re_match_compile +local constants = require("apisix.constants") local re_find = ngx.re.find local ipairs = ipairs local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_SECURITY + }, block_rules = { type = "array", items = { diff --git a/apisix/plugins/wolf-rbac.lua b/apisix/plugins/wolf-rbac.lua index 154fde41a4ad..fb3f9533b9d6 100644 --- a/apisix/plugins/wolf-rbac.lua +++ b/apisix/plugins/wolf-rbac.lua @@ -14,10 +14,11 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- - +local require = require local core = require("apisix.core") local consumer = require("apisix.consumer") local json = require("apisix.core.json") +local constants = require("apisix.constants") local sleep = core.sleep local ngx_re = require("ngx.re") local http = require("resty.http") @@ -36,6 +37,11 @@ local plugin_name = "wolf-rbac" local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_AUTHENTICATION + }, appid = { type = "string", default = "unset" diff --git a/apisix/plugins/workflow.lua b/apisix/plugins/workflow.lua index 73d68375dd9d..8b99d3dac091 100644 --- a/apisix/plugins/workflow.lua +++ b/apisix/plugins/workflow.lua @@ -14,14 +14,21 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local limit_count = require("apisix.plugins.limit-count.init") local expr = require("resty.expr.v1") +local constants = require("apisix.constants") local ipairs = ipairs local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_GENERAL + }, rules = { type = "array", items = { diff --git a/apisix/plugins/zipkin.lua b/apisix/plugins/zipkin.lua index 0b9efa8f2732..cf51537e7bc9 100644 --- a/apisix/plugins/zipkin.lua +++ b/apisix/plugins/zipkin.lua @@ -14,11 +14,14 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- + +local require = require local core = require("apisix.core") local new_tracer = require("opentracing.tracer").new local zipkin_codec = require("apisix.plugins.zipkin.codec") local new_random_sampler = require("apisix.plugins.zipkin.random_sampler").new local new_reporter = require("apisix.plugins.zipkin.reporter").new +local constants = require("apisix.constants") local ngx = ngx local ngx_var = ngx.var local ngx_re = require("ngx.re") @@ -40,6 +43,11 @@ local lrucache = core.lrucache.new({ local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OBSERVABILITY + }, endpoint = {type = "string"}, sample_ratio = {type = "number", minimum = 0.00001, maximum = 1}, service_name = { diff --git a/apisix/stream/plugins/mqtt-proxy.lua b/apisix/stream/plugins/mqtt-proxy.lua index f075e204db95..037dd3a4e9c7 100644 --- a/apisix/stream/plugins/mqtt-proxy.lua +++ b/apisix/stream/plugins/mqtt-proxy.lua @@ -14,8 +14,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local bit = require("bit") +local constants = require("apisix.constants") local ngx = ngx local str_byte = string.byte local str_sub = string.sub @@ -29,6 +31,11 @@ end) local schema = { type = "object", properties = { + category = { + type = "string", + description = "This field is used for plugin classification", + default = constants.PLUGIN_CATEGORY_OTHER_PROTOCOLS + }, protocol_name = {type = "string"}, protocol_level = {type = "integer"} }, diff --git a/t/plugin/api-breaker.t b/t/plugin/api-breaker.t index 280bf01d7dbb..25c1e2aeee00 100644 --- a/t/plugin/api-breaker.t +++ b/t/plugin/api-breaker.t @@ -75,7 +75,7 @@ done --- request GET /t --- response_body -{"break_response_code":502,"healthy":{"http_statuses":[200],"successes":3},"max_breaker_sec":300,"unhealthy":{"failures":3,"http_statuses":[500]}} +{"break_response_code":502,"category":"Traffic","healthy":{"http_statuses":[200],"successes":3},"max_breaker_sec":300,"unhealthy":{"failures":3,"http_statuses":[500]}} @@ -100,7 +100,7 @@ GET /t --- request GET /t --- response_body -{"break_response_code":502,"healthy":{"http_statuses":[200],"successes":3},"max_breaker_sec":300,"unhealthy":{"failures":3,"http_statuses":[500]}} +{"break_response_code":502,"category":"Traffic","healthy":{"http_statuses":[200],"successes":3},"max_breaker_sec":300,"unhealthy":{"failures":3,"http_statuses":[500]}} @@ -125,7 +125,7 @@ GET /t --- request GET /t --- response_body -{"break_response_code":502,"healthy":{"http_statuses":[200],"successes":3},"max_breaker_sec":300,"unhealthy":{"failures":3,"http_statuses":[500]}} +{"break_response_code":502,"category":"Traffic","healthy":{"http_statuses":[200],"successes":3},"max_breaker_sec":300,"unhealthy":{"failures":3,"http_statuses":[500]}} diff --git a/t/plugin/consumer-restriction.t b/t/plugin/consumer-restriction.t index cc86aacdcd7d..c6feb544b037 100644 --- a/t/plugin/consumer-restriction.t +++ b/t/plugin/consumer-restriction.t @@ -48,7 +48,7 @@ __DATA__ --- request GET /t --- response_body -{"rejected_code":403,"title":"whitelist","type":"consumer_name","whitelist":["jack1","jack2"]} +{"category":"Security","rejected_code":403,"title":"whitelist","type":"consumer_name","whitelist":["jack1","jack2"]} diff --git a/t/plugin/echo.t b/t/plugin/echo.t index 25ab78fa1e22..fd81f6d8206f 100644 --- a/t/plugin/echo.t +++ b/t/plugin/echo.t @@ -205,7 +205,7 @@ Location: https://www.iresty.com --- request GET /t --- response_body -{"echo":{"before_body":"before the body modification ","headers":{"Location":"https://www.iresty.com"}}} +{"echo":{"before_body":"before the body modification ","category":"General","headers":{"Location":"https://www.iresty.com"}}} diff --git a/t/plugin/openid-connect.t b/t/plugin/openid-connect.t index f539a5fba8d4..ad64f6a49e70 100644 --- a/t/plugin/openid-connect.t +++ b/t/plugin/openid-connect.t @@ -876,7 +876,7 @@ OIDC introspection failed: invalid token } } --- response_body -{"accept_none_alg":false,"accept_unsupported_alg":true,"access_token_expires_leeway":0,"access_token_in_authorization_header":false,"bearer_only":false,"client_id":"kbyuFDidLLm280LIwVFiazOqjO3ty8KH","client_jwt_assertion_expires_in":60,"client_secret":"60Op4HFM0I8ajz0WdiStAbziZ-VFQttXuxixHHs2R7r7-CW8GR79l-mmLqMhc-Sa","discovery":"http://127.0.0.1:1980/.well-known/openid-configuration","force_reauthorize":false,"iat_slack":120,"introspection_endpoint_auth_method":"client_secret_basic","introspection_interval":0,"jwk_expires_in":86400,"jwt_verification_cache_ignore":false,"logout_path":"/logout","realm":"apisix","renew_access_token_on_expiry":true,"revoke_tokens_on_logout":false,"scope":"openid","set_access_token_header":true,"set_id_token_header":true,"set_refresh_token_header":false,"set_userinfo_header":true,"ssl_verify":false,"timeout":3,"token_endpoint_auth_method":"client_secret_basic","unauth_action":"auth","use_nonce":false,"use_pkce":false} +{"accept_none_alg":false,"accept_unsupported_alg":true,"access_token_expires_leeway":0,"access_token_in_authorization_header":false,"bearer_only":false,"category":"Authentication","client_id":"kbyuFDidLLm280LIwVFiazOqjO3ty8KH","client_jwt_assertion_expires_in":60,"client_secret":"60Op4HFM0I8ajz0WdiStAbziZ-VFQttXuxixHHs2R7r7-CW8GR79l-mmLqMhc-Sa","discovery":"http://127.0.0.1:1980/.well-known/openid-configuration","force_reauthorize":false,"iat_slack":120,"introspection_endpoint_auth_method":"client_secret_basic","introspection_interval":0,"jwk_expires_in":86400,"jwt_verification_cache_ignore":false,"logout_path":"/logout","realm":"apisix","renew_access_token_on_expiry":true,"revoke_tokens_on_logout":false,"scope":"openid","set_access_token_header":true,"set_id_token_header":true,"set_refresh_token_header":false,"set_userinfo_header":true,"ssl_verify":false,"timeout":3,"token_endpoint_auth_method":"client_secret_basic","unauth_action":"auth","use_nonce":false,"use_pkce":false} diff --git a/t/plugin/proxy-rewrite.t b/t/plugin/proxy-rewrite.t index 4d7465862d69..4f29c904e073 100644 --- a/t/plugin/proxy-rewrite.t +++ b/t/plugin/proxy-rewrite.t @@ -1000,7 +1000,7 @@ q: apisix) --- request GET /t --- response_body -{"proxy-rewrite":{"headers":{"X-Api":"v2"},"uri":"/uri/plugin_proxy_rewrite","use_real_request_uri_unsafe":false}} +{"proxy-rewrite":{"category":"Transformation","headers":{"X-Api":"v2"},"uri":"/uri/plugin_proxy_rewrite","use_real_request_uri_unsafe":false}} diff --git a/t/plugin/response-rewrite.t b/t/plugin/response-rewrite.t index 2e4dcf4eb324..19025ff3b7cd 100644 --- a/t/plugin/response-rewrite.t +++ b/t/plugin/response-rewrite.t @@ -449,7 +449,7 @@ invalid base64 content --- request GET /t --- response_body -{"response-rewrite":{"body":"new body\n","body_base64":false,"headers":{"Content-Type":"","X-Server-id":3,"X-Server-status":"on"}}} +{"response-rewrite":{"body":"new body\n","body_base64":false,"category":"Transformation","headers":{"Content-Type":"","X-Server-id":3,"X-Server-status":"on"}}} diff --git a/t/plugin/wolf-rbac.t b/t/plugin/wolf-rbac.t index 8136e3df6bc0..3a30784bba0c 100644 --- a/t/plugin/wolf-rbac.t +++ b/t/plugin/wolf-rbac.t @@ -54,7 +54,7 @@ __DATA__ } } --- response_body_like eval -qr/\{"appid":"unset","header_prefix":"X-","server":"http:\/\/127\.0\.0\.1:12180"\}/ +qr/\{"appid":"unset","category":"Authentication","header_prefix":"X-","server":"http:\/\/127\.0\.0\.1:12180"\}/