diff --git a/.gitignore b/.gitignore index fe5e01e..34ce8cf 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ #.vscode/ # Web related -lib/generated_plugin_registrant.dart # Symbolication related app.*.symbols @@ -48,6 +47,7 @@ migrate_working_dir/ .pub-cache/ .pub/ build/ +node_modules/ # Android related **/android/**/gradle-wrapper.jar @@ -906,4 +906,4 @@ DerivedData/ !**/ios/**/default.mode2v3 !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages \ No newline at end of file +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/README.md b/README.md index 0dec60b..e8622e7 100644 --- a/README.md +++ b/README.md @@ -2,35 +2,15 @@ #Base project to test grpc call with envoy and apiSix proxy -#To run grpc call through envoy proxy - -1. In IDE terminal start the Node.js gRPC service, which is set to listen on port `:9017`. - - ```sh - $ node server.js & - ``` - -2. In IDE terminal run the Envoy proxy. The `envoy.yaml` file configures Envoy to listen to - browser requests at port `:9081`, and forward them to port `:9017` - -> ```sh -> $ docker run -d -v "$(pwd)"/envoy.yaml:/etc/envoy/envoy.yaml:ro \ -> -p 9081:9081 -p 9901:9901 envoyproxy/envoy:v1.22.0 -> ``` - -Now Launch Flutter app in chrome (web) and click on Test Hello, you will observe the following output. - -``` -Hello! Mohsin Javed -``` #To run grpc call through apisix proxy 1. In IDE terminal start the Node.js gRPC service, which is set to listen on port `:9017`. - ```sh - $ node server.js & - ``` +Please run npm install to install dependencies +```sh +$ node server.js & +``` 2. In IDE terminal navigate to the "example" folder of the apisix_docker @@ -40,9 +20,9 @@ cd apisix_docker/example 3. Now, we can start all modules with docker-compose - ```sh - $ docker-compose -p docker-apisix up -d - ``` +```sh +$ docker-compose -p docker-apisix up -d +``` If you check you Docker Desktop, you should see the list of running containers. @@ -54,6 +34,20 @@ http://localhost:9000/user/login And enter username:admin , password:admin + 5. After successful login, welcome screen should be opened. add route configuration here. + + Request Basic Define Host 127.0.0.1 + Upsteam type Node + Targets Host : host.docker.internal PORT 9017 + Schema grPc + ENABLE CORS AND GRPC-WEB plugin + +All other settings default 6. After adding route configurations Now Launch Flutter app in chrome (web) and click on Test Hello. +Now Launch Flutter app in chrome (web) and click on Test Hello, you will observe the following output. run this command from the root directory + +```sh + $ flutter build web -t lib/main.dart --no-tree-shake-icons && flutter run -d chrome -t lib/main.dart --flavor development +``` diff --git a/apisix_docker/example/dashboard_conf/conf.yaml b/apisix_docker/example/dashboard_conf/conf.yaml index ea0b15d..d1d836a 100644 --- a/apisix_docker/example/dashboard_conf/conf.yaml +++ b/apisix_docker/example/dashboard_conf/conf.yaml @@ -17,54 +17,54 @@ conf: listen: - host: 0.0.0.0 # `manager api` listening ip or host name - port: 9000 # `manager api` listening port - allow_list: # If we don't set any IP list, then any IP access is allowed by default. + host: 0.0.0.0 # `manager api` listening ip or host name + port: 9000 # `manager api` listening port + allow_list: # If we don't set any IP list, then any IP access is allowed by default. - 0.0.0.0/0 etcd: - endpoints: # supports defining multiple etcd host addresses for an etcd cluster + endpoints: # supports defining multiple etcd host addresses for an etcd cluster - "http://etcd:2379" - # yamllint disable rule:comments-indentation - # etcd basic auth info + # yamllint disable rule:comments-indentation + # etcd basic auth info # username: "root" # ignore etcd username if not enable etcd auth # password: "123456" # ignore etcd password if not enable etcd auth mtls: - key_file: "" # Path of your self-signed client side key - cert_file: "" # Path of your self-signed client side cert - ca_file: "" # Path of your self-signed ca cert, the CA is used to sign callers' certificates + key_file: "" # Path of your self-signed client side key + cert_file: "" # Path of your self-signed client side cert + ca_file: "" # Path of your self-signed ca cert, the CA is used to sign callers' certificates # prefix: /apisix # apisix config's prefix in etcd, /apisix by default log: error_log: - level: warn # supports levels, lower to higher: debug, info, warn, error, panic, fatal + level: warn # supports levels, lower to higher: debug, info, warn, error, panic, fatal file_path: - logs/error.log # supports relative path, absolute path, standard output - # such as: logs/error.log, /tmp/logs/error.log, /dev/stdout, /dev/stderr + logs/error.log # supports relative path, absolute path, standard output + # such as: logs/error.log, /tmp/logs/error.log, /dev/stdout, /dev/stderr access_log: file_path: - logs/access.log # supports relative path, absolute path, standard output - # such as: logs/access.log, /tmp/logs/access.log, /dev/stdout, /dev/stderr - # log example: 2020-12-09T16:38:09.039+0800 INFO filter/logging.go:46 /apisix/admin/routes/r1 {"status": 401, "host": "127.0.0.1:9000", "query": "asdfsafd=adf&a=a", "requestId": "3d50ecb8-758c-46d1-af5b-cd9d1c820156", "latency": 0, "remoteIP": "127.0.0.1", "method": "PUT", "errs": []} + logs/access.log # supports relative path, absolute path, standard output + # such as: logs/access.log, /tmp/logs/access.log, /dev/stdout, /dev/stderr + # log example: 2020-12-09T16:38:09.039+0800 INFO filter/logging.go:46 /apisix/admin/routes/r1 {"status": 401, "host": "127.0.0.1:9000", "query": "asdfsafd=adf&a=a", "requestId": "3d50ecb8-758c-46d1-af5b-cd9d1c820156", "latency": 0, "remoteIP": "127.0.0.1", "method": "PUT", "errs": []} security: - # access_control_allow_origin: "http://httpbin.org" - # access_control_allow_credentials: true # support using custom cors configration - # access_control_allow_headers: "Authorization" - # access_control-allow_methods: "*" - # x_frame_options: "deny" - content_security_policy: "default-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; frame-src *" # You can set frame-src to provide content for your grafana panel. + # access_control_allow_origin: "http://httpbin.org" + # access_control_allow_credentials: true # support using custom cors configration + # access_control_allow_headers: "Authorization" + # access_control-allow_methods: "*" + # x_frame_options: "deny" + content_security_policy: "default-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; frame-src *" # You can set frame-src to provide content for your grafana panel. authentication: secret: - secret # secret for jwt token generation. - # NOTE: Highly recommended to modify this value to protect `manager api`. - # if it's default value, when `manager api` start, it will generate a random string to replace it. - expire_time: 3600 # jwt token expire time, in second - users: # yamllint enable rule:comments-indentation - - username: admin # username and password for login `manager api` + secret # secret for jwt token generation. + # NOTE: Highly recommended to modify this value to protect `manager api`. + # if it's default value, when `manager api` start, it will generate a random string to replace it. + expire_time: 3600 # jwt token expire time, in second + users: # yamllint enable rule:comments-indentation + - username: admin # username and password for login `manager api` password: admin - username: user password: user -plugins: # plugin list (sorted in alphabetical order) +plugins: # plugin list (sorted in alphabetical order) - api-breaker - authz-keycloak - basic-auth @@ -75,6 +75,8 @@ plugins: # plugin list (sorted in alphabetical order) - echo # - error-log-logger # - example-plugin + - grpc-web-custom + - grpc-web - fault-injection - grpc-transcode - hmac-auth diff --git a/apisix_docker/example/docker-compose.yml b/apisix_docker/example/docker-compose.yml index dc9348e..79a219f 100644 --- a/apisix_docker/example/docker-compose.yml +++ b/apisix_docker/example/docker-compose.yml @@ -20,19 +20,24 @@ version: "3" services: apisix-dashboard: image: apache/apisix-dashboard:3.0.1-alpine + #command: sh -c 'echo "Initialization command"; rm /usr/local/apisix-dashboard/conf/schema.json;' restart: always volumes: - - ./dashboard_conf/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml + - ./dashboard_conf/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml + # - ./schema.json:/usr/local/apisix-dashboard/conf/schema.json + - ./grpc-web-custom.lua:/usr/local/apisix/apisix/plugins/grpc-web-custom.lua ports: - - "9000:9000" + - "9000:9000" networks: apisix: apisix: image: apache/apisix:${APISIX_IMAGE_TAG:-3.6.0-debian} + #extra_lua_padth: "/usr/local/apisix/plugin/grpc-web-custom.lua" restart: always volumes: - ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro + - ./grpc-web-custom.lua:/usr/local/apisix/apisix/plugins/grpc-web-custom.lua depends_on: - etcd ##network_mode: host diff --git a/apisix_docker/example/grpc-web-custom.lua b/apisix_docker/example/grpc-web-custom.lua new file mode 100644 index 0000000..21201d0 --- /dev/null +++ b/apisix_docker/example/grpc-web-custom.lua @@ -0,0 +1,161 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one or more +-- contributor license agreements. See the NOTICE file distributed with +-- this work for additional information regarding copyright ownership. +-- The ASF licenses this file to You under the Apache License, Version 2.0 +-- (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- 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 ngx = ngx +local ngx_arg = ngx.arg +local core = require("apisix.core") +local req_set_uri = ngx.req.set_uri +local req_set_body_data = ngx.req.set_body_data +local decode_base64 = ngx.decode_base64 +local encode_base64 = ngx.encode_base64 + + +local ALLOW_METHOD_OPTIONS = "OPTIONS" +local ALLOW_METHOD_POST = "POST" +local CONTENT_ENCODING_BASE64 = "base64" +local CONTENT_ENCODING_BINARY = "binary" +local DEFAULT_CORS_ALLOW_ORIGIN = "*" +local DEFAULT_CORS_ALLOW_METHODS = "POST, OPTIONS" +local DEFAULT_CORS_ALLOW_HEADERS = "content-type,x-grpc-web,x-user-agent,grpc-accept-encoding" +local DEFAULT_PROXY_CONTENT_TYPE = "application/grpc" +local DEFAULT_CORS_ALLOW_EXPOSE_HEADERS = "grpc-status,grpc-message" + + +local plugin_name = "grpc-web-custom" + +local schema = { + type = "object", + properties = {}, +} + +local grpc_web_content_encoding = { + ["application/grpc-web"] = CONTENT_ENCODING_BINARY, + ["application/grpc-web-text"] = CONTENT_ENCODING_BASE64, + ["application/grpc-web+proto"] = CONTENT_ENCODING_BINARY, + ["application/grpc-web-text+proto"] = CONTENT_ENCODING_BASE64, +} + +local _M = { + version = 0.1, + priority = 505, + name = plugin_name, + schema = schema, +} + +function _M.check_schema(conf) + return core.schema.check(schema, conf) +end + +function _M.access(conf, ctx) + -- set context variable mime + -- When processing non gRPC Web requests, `mime` can be obtained in the context + -- and set to the `Content-Type` of the response + ctx.grpc_web_mime = core.request.header(ctx, "Content-Type") + + local method = core.request.get_method() + if method == ALLOW_METHOD_OPTIONS then + return 204 + end + + if method ~= ALLOW_METHOD_POST then + -- https://github.com/grpc/grpc-web/blob/master/doc/browser-features.md#cors-support + core.log.error("request method: `", method, "` invalid") + return 400 + end + + local encoding = grpc_web_content_encoding[ctx.grpc_web_mime] + if not encoding then + core.log.error("request Content-Type: `", ctx.grpc_web_mime, "` invalid") + return 400 + end + + -- set context variable encoding method + ctx.grpc_web_encoding = encoding + + -- set grpc path + if not (ctx.curr_req_matched and ctx.curr_req_matched[":ext"]) then + core.log.error("routing configuration error, grpc-web plugin only supports ", + "`prefix matching` pattern routing") + return 400 + end + + local path = ctx.curr_req_matched[":ext"] + if path:byte(1) ~= core.string.byte("/") then + path = "/" .. path + end + + req_set_uri(path) + + -- set grpc body + local body, err = core.request.get_body() + if err then + core.log.error("failed to read request body, err: ", err) + return 400 + end + + if encoding == CONTENT_ENCODING_BASE64 then + body = decode_base64(body) + if not body then + core.log.error("failed to decode request body") + return 400 + end + end + + -- set grpc content-type + core.request.set_header(ctx, "Content-Type", DEFAULT_PROXY_CONTENT_TYPE) + -- set grpc body + req_set_body_data(body) +end + +function _M.header_filter(conf, ctx) + local method = core.request.get_method() + if method == ALLOW_METHOD_OPTIONS then + core.response.set_header("Access-Control-Allow-Methods", DEFAULT_CORS_ALLOW_METHODS) + core.response.set_header("Access-Control-Allow-Headers", DEFAULT_CORS_ALLOW_HEADERS) + -- core.response.set_header("Access-Control-Expose-Headers", DEFAULT_CORS_ALLOW_EXPOSE_HEADERS) + end + + if not ctx.cors_allow_origins then + core.response.set_header("Access-Control-Allow-Origin", DEFAULT_CORS_ALLOW_ORIGIN) + -- core.response.set_header("Access-Control-Expose-Headers", DEFAULT_CORS_ALLOW_EXPOSE_HEADERS) + end + core.response.set_header("Content-Type", ctx.grpc_web_mime) + core.response.set_header("Access-Control-Expose-Headers", DEFAULT_CORS_ALLOW_EXPOSE_HEADERS) + print("###########################") + core.log.error("request method: `",core.response.get_body() , "` invalid") + print("###########################") +end + +function _M.body_filter(conf, ctx) + -- If the MIME extension type description of the gRPC-Web standard is not obtained, + -- indicating that the request is not based on the gRPC Web specification, + -- the processing of the request body will be ignored + -- https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md + -- https://github.com/grpc/grpc-web/blob/master/doc/browser-features.md#cors-support + if not ctx.grpc_web_mime then + return + end + + if ctx.grpc_web_encoding == CONTENT_ENCODING_BASE64 then + local chunk = ngx_arg[1] + chunk = encode_base64(chunk) + ngx_arg[1] = chunk + end +end + +return _M \ No newline at end of file diff --git a/apisix_docker/example/schema.json b/apisix_docker/example/schema.json new file mode 100644 index 0000000..7045d46 --- /dev/null +++ b/apisix_docker/example/schema.json @@ -0,0 +1,7670 @@ +{ + "main": { + "plugins": { + "items": { + "properties": { + "stream": { "type": "boolean" }, + "additionalProperties": false, + "name": { "minLength": 1, "type": "string" } + }, + "required": ["name"], + "type": "object" + }, + "type": "array" + }, + "plugin_config": { + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "plugins": { "type": "object" }, + "create_time": { "type": "integer" }, + "desc": { "maxLength": 256, "type": "string" }, + "labels": { + "description": "key/value pairs to specify attributes", + "patternProperties": { + ".*": { + "minLength": 1, + "maxLength": 256, + "type": "string", + "pattern": "^\\S+$", + "description": "value of label" + } + }, + "type": "object" + }, + "update_time": { "type": "integer" } + }, + "required": ["id", "plugins"], + "additionalProperties": false, + "type": "object" + }, + "consumer": { + "properties": { + "plugins": { "type": "object" }, + "username": { + "pattern": "^[a-zA-Z0-9_]+$", + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "create_time": { "type": "integer" }, + "desc": { "maxLength": 256, "type": "string" }, + "labels": { + "description": "key/value pairs to specify attributes", + "patternProperties": { + ".*": { + "minLength": 1, + "maxLength": 256, + "type": "string", + "pattern": "^\\S+$", + "description": "value of label" + } + }, + "type": "object" + }, + "group_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "update_time": { "type": "integer" } + }, + "required": ["username"], + "additionalProperties": false, + "type": "object" + }, + "upstream_hash_vars_schema": { + "pattern": "^((uri|server_name|server_addr|request_uri|remote_port|remote_addr|query_string|host|hostname|mqtt_client_id)|arg_[0-9a-zA-z_-]+)$", + "type": "string" + }, + "global_rule": { + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "plugins": { "type": "object" }, + "update_time": { "type": "integer" }, + "create_time": { "type": "integer" } + }, + "required": ["id", "plugins"], + "additionalProperties": false, + "type": "object" + }, + "service": { + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "plugins": { "type": "object" }, + "script": { "maxLength": 102400, "minLength": 10, "type": "string" }, + "name": { "type": "string", "minLength": 1, "maxLength": 100 }, + "desc": { "maxLength": 256, "type": "string" }, + "upstream": { + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "keepalive_pool": { + "properties": { + "idle_timeout": { + "default": 60, + "minimum": 0, + "type": "number" + }, + "requests": { + "default": 1000, + "minimum": 1, + "type": "integer" + }, + "size": { "default": 320, "minimum": 1, "type": "integer" } + }, + "type": "object" + }, + "create_time": { "type": "integer" }, + "retries": { "minimum": 0, "type": "integer" }, + "retry_timeout": { "minimum": 0, "type": "number" }, + "tls": { + "properties": { + "client_key": { + "maxLength": 65536, + "minLength": 128, + "type": "string" + }, + "verify": { + "default": false, + "type": "boolean", + "description": "Turn on server certificate verification, currently only kafka upstream is supported" + }, + "client_cert": { + "maxLength": 65536, + "minLength": 128, + "type": "string" + }, + "client_cert_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + } + }, + "dependencies": { + "client_cert_id": { + "not": { "required": ["client_client", "client_key"] } + }, + "client_cert": { + "not": { "required": ["client_cert_id"] }, + "required": ["client_key"] + }, + "client_key": { + "not": { "required": ["client_cert_id"] }, + "required": ["client_cert"] + } + }, + "type": "object" + }, + "checks": { + "properties": { + "passive": { + "properties": { + "healthy": { + "properties": { + "successes": { + "minimum": 0, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [ + 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, + 300, 301, 302, 303, 304, 305, 306, 307, 308 + ], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "unhealthy": { + "properties": { + "timeouts": { + "minimum": 0, + "default": 7, + "maximum": 254, + "type": "integer" + }, + "http_failures": { + "minimum": 0, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "tcp_failures": { + "minimum": 0, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [429, 500, 503], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "type": { + "default": "http", + "enum": ["http", "https", "tcp"], + "type": "string" + } + }, + "type": "object" + }, + "active": { + "properties": { + "concurrency": { "default": 10, "type": "integer" }, + "http_path": { "default": "/", "type": "string" }, + "https_verify_certificate": { + "default": true, + "type": "boolean" + }, + "type": { + "default": "http", + "enum": ["http", "https", "tcp"], + "type": "string" + }, + "timeout": { "default": 1, "type": "number" }, + "req_headers": { + "items": { "uniqueItems": true, "type": "string" }, + "minItems": 1, + "type": "array" + }, + "healthy": { + "properties": { + "successes": { + "minimum": 1, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "interval": { + "minimum": 1, + "default": 1, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [200, 302], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "port": { + "minimum": 1, + "maximum": 65535, + "type": "integer" + }, + "unhealthy": { + "properties": { + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [429, 404, 500, 501, 502, 503, 504, 505], + "minItems": 1, + "type": "array" + }, + "interval": { + "minimum": 1, + "default": 1, + "type": "integer" + }, + "http_failures": { + "minimum": 1, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "tcp_failures": { + "minimum": 1, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "timeouts": { + "minimum": 1, + "default": 3, + "maximum": 254, + "type": "integer" + } + }, + "type": "object" + }, + "host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + } + }, + "type": "object" + } + }, + "additionalProperties": false, + "anyOf": [ + { "required": ["active"] }, + { "required": ["active", "passive"] } + ], + "type": "object" + }, + "timeout": { + "properties": { + "send": { "exclusiveMinimum": 0, "type": "number" }, + "read": { "exclusiveMinimum": 0, "type": "number" }, + "connect": { "exclusiveMinimum": 0, "type": "number" } + }, + "required": ["connect", "send", "read"], + "type": "object" + }, + "discovery_type": { + "type": "string", + "description": "discovery type" + }, + "labels": { + "description": "key/value pairs to specify attributes", + "patternProperties": { + ".*": { + "minLength": 1, + "maxLength": 256, + "type": "string", + "pattern": "^\\S+$", + "description": "value of label" + } + }, + "type": "object" + }, + "discovery_args": { + "properties": { + "group_name": { "type": "string", "description": "group name" }, + "namespace_id": { + "type": "string", + "description": "namespace id" + } + }, + "type": "object" + }, + "key": { + "type": "string", + "description": "the key of chash for dynamic load balancing" + }, + "name": { "type": "string", "minLength": 1, "maxLength": 100 }, + "desc": { "maxLength": 256, "type": "string" }, + "update_time": { "type": "integer" }, + "type": { + "default": "roundrobin", + "description": "algorithms of load balancing", + "type": "string" + }, + "upstream_host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "pass_host": { + "default": "pass", + "description": "mod of host passing", + "enum": ["pass", "node", "rewrite"], + "type": "string" + }, + "hash_on": { + "default": "vars", + "enum": [ + "vars", + "header", + "cookie", + "consumer", + "vars_combinations" + ], + "type": "string" + }, + "nodes": { + "anyOf": [ + { + "patternProperties": { + ".*": { + "minimum": 0, + "description": "weight of node", + "type": "integer" + } + }, + "type": "object" + }, + { + "items": { + "properties": { + "host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "weight": { + "minimum": 0, + "description": "weight of node", + "type": "integer" + }, + "metadata": { + "type": "object", + "description": "metadata of node" + }, + "port": { + "minimum": 1, + "description": "port of node", + "type": "integer" + }, + "priority": { + "default": 0, + "description": "priority of node", + "type": "integer" + } + }, + "required": ["host", "port", "weight"], + "type": "object" + }, + "type": "array" + } + ] + }, + "service_name": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "scheme": { + "default": "http", + "enum": [ + "grpc", + "grpcs", + "http", + "https", + "tcp", + "tls", + "udp", + "kafka" + ], + "description": "The scheme of the upstream. For L7 proxy, it can be one of grpc/grpcs/http/https. For L4 proxy, it can be one of tcp/tls/udp. For specific protocols, it can be kafka." + } + }, + "additionalProperties": false, + "oneOf": [ + { "required": ["nodes"] }, + { "required": ["service_name", "discovery_type"] } + ], + "type": "object" + }, + "update_time": { "type": "integer" }, + "enable_websocket": { + "type": "boolean", + "description": "enable websocket for request" + }, + "upstream_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "labels": { + "description": "key/value pairs to specify attributes", + "patternProperties": { + ".*": { + "minLength": 1, + "maxLength": 256, + "type": "string", + "pattern": "^\\S+$", + "description": "value of label" + } + }, + "type": "object" + }, + "hosts": { + "uniqueItems": true, + "items": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "create_time": { "type": "integer" } + }, + "additionalProperties": false, + "type": "object" + }, + "upstream_hash_header_schema": { + "pattern": "^[a-zA-Z0-9-_]+$", + "type": "string" + }, + "upstream": { + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "keepalive_pool": { + "properties": { + "idle_timeout": { "default": 60, "minimum": 0, "type": "number" }, + "requests": { "default": 1000, "minimum": 1, "type": "integer" }, + "size": { "default": 320, "minimum": 1, "type": "integer" } + }, + "type": "object" + }, + "create_time": { "type": "integer" }, + "retries": { "minimum": 0, "type": "integer" }, + "retry_timeout": { "minimum": 0, "type": "number" }, + "tls": { + "properties": { + "client_key": { + "maxLength": 65536, + "minLength": 128, + "type": "string" + }, + "verify": { + "default": false, + "type": "boolean", + "description": "Turn on server certificate verification, currently only kafka upstream is supported" + }, + "client_cert": { + "maxLength": 65536, + "minLength": 128, + "type": "string" + }, + "client_cert_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + } + }, + "dependencies": { + "client_cert_id": { + "not": { "required": ["client_client", "client_key"] } + }, + "client_cert": { + "not": { "required": ["client_cert_id"] }, + "required": ["client_key"] + }, + "client_key": { + "not": { "required": ["client_cert_id"] }, + "required": ["client_cert"] + } + }, + "type": "object" + }, + "checks": { + "properties": { + "passive": { + "properties": { + "healthy": { + "properties": { + "successes": { + "minimum": 0, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [ + 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, + 301, 302, 303, 304, 305, 306, 307, 308 + ], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "unhealthy": { + "properties": { + "timeouts": { + "minimum": 0, + "default": 7, + "maximum": 254, + "type": "integer" + }, + "http_failures": { + "minimum": 0, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "tcp_failures": { + "minimum": 0, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [429, 500, 503], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "type": { + "default": "http", + "enum": ["http", "https", "tcp"], + "type": "string" + } + }, + "type": "object" + }, + "active": { + "properties": { + "concurrency": { "default": 10, "type": "integer" }, + "http_path": { "default": "/", "type": "string" }, + "https_verify_certificate": { + "default": true, + "type": "boolean" + }, + "type": { + "default": "http", + "enum": ["http", "https", "tcp"], + "type": "string" + }, + "timeout": { "default": 1, "type": "number" }, + "req_headers": { + "items": { "uniqueItems": true, "type": "string" }, + "minItems": 1, + "type": "array" + }, + "healthy": { + "properties": { + "successes": { + "minimum": 1, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "interval": { + "minimum": 1, + "default": 1, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [200, 302], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "port": { "minimum": 1, "maximum": 65535, "type": "integer" }, + "unhealthy": { + "properties": { + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [429, 404, 500, 501, 502, 503, 504, 505], + "minItems": 1, + "type": "array" + }, + "interval": { + "minimum": 1, + "default": 1, + "type": "integer" + }, + "http_failures": { + "minimum": 1, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "tcp_failures": { + "minimum": 1, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "timeouts": { + "minimum": 1, + "default": 3, + "maximum": 254, + "type": "integer" + } + }, + "type": "object" + }, + "host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + } + }, + "type": "object" + } + }, + "additionalProperties": false, + "anyOf": [ + { "required": ["active"] }, + { "required": ["active", "passive"] } + ], + "type": "object" + }, + "timeout": { + "properties": { + "send": { "exclusiveMinimum": 0, "type": "number" }, + "read": { "exclusiveMinimum": 0, "type": "number" }, + "connect": { "exclusiveMinimum": 0, "type": "number" } + }, + "required": ["connect", "send", "read"], + "type": "object" + }, + "discovery_type": { "type": "string", "description": "discovery type" }, + "labels": { + "description": "key/value pairs to specify attributes", + "patternProperties": { + ".*": { + "minLength": 1, + "maxLength": 256, + "type": "string", + "pattern": "^\\S+$", + "description": "value of label" + } + }, + "type": "object" + }, + "discovery_args": { + "properties": { + "group_name": { "type": "string", "description": "group name" }, + "namespace_id": { "type": "string", "description": "namespace id" } + }, + "type": "object" + }, + "key": { + "type": "string", + "description": "the key of chash for dynamic load balancing" + }, + "name": { "type": "string", "minLength": 1, "maxLength": 100 }, + "desc": { "maxLength": 256, "type": "string" }, + "update_time": { "type": "integer" }, + "type": { + "default": "roundrobin", + "description": "algorithms of load balancing", + "type": "string" + }, + "upstream_host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "pass_host": { + "default": "pass", + "description": "mod of host passing", + "enum": ["pass", "node", "rewrite"], + "type": "string" + }, + "hash_on": { + "default": "vars", + "enum": ["vars", "header", "cookie", "consumer", "vars_combinations"], + "type": "string" + }, + "nodes": { + "anyOf": [ + { + "patternProperties": { + ".*": { + "minimum": 0, + "description": "weight of node", + "type": "integer" + } + }, + "type": "object" + }, + { + "items": { + "properties": { + "host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "weight": { + "minimum": 0, + "description": "weight of node", + "type": "integer" + }, + "metadata": { + "type": "object", + "description": "metadata of node" + }, + "port": { + "minimum": 1, + "description": "port of node", + "type": "integer" + }, + "priority": { + "default": 0, + "description": "priority of node", + "type": "integer" + } + }, + "required": ["host", "port", "weight"], + "type": "object" + }, + "type": "array" + } + ] + }, + "service_name": { "type": "string", "minLength": 1, "maxLength": 256 }, + "scheme": { + "default": "http", + "enum": [ + "grpc", + "grpcs", + "http", + "https", + "tcp", + "tls", + "udp", + "kafka" + ], + "description": "The scheme of the upstream. For L7 proxy, it can be one of grpc/grpcs/http/https. For L4 proxy, it can be one of tcp/tls/udp. For specific protocols, it can be kafka." + } + }, + "additionalProperties": false, + "oneOf": [ + { "required": ["nodes"] }, + { "required": ["service_name", "discovery_type"] } + ], + "type": "object" + }, + "route": { + "additionalProperties": false, + "not": { + "anyOf": [ + { "required": ["script", "plugins"] }, + { "required": ["script", "plugin_config_id"] } + ] + }, + "properties": { + "methods": { + "items": { + "description": "HTTP method", + "enum": [ + "GET", + "POST", + "PUT", + "DELETE", + "PATCH", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE", + "PURGE" + ], + "type": "string" + }, + "uniqueItems": true, + "type": "array" + }, + "host": { "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", "type": "string" }, + "remote_addrs": { + "uniqueItems": true, + "items": { + "description": "client IP", + "anyOf": [ + { "format": "ipv4", "title": "IPv4", "type": "string" }, + { + "pattern": "^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([12]?[0-9]|3[0-2])$", + "title": "IPv4/CIDR", + "type": "string" + }, + { "format": "ipv6", "title": "IPv6", "type": "string" }, + { + "pattern": "^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$", + "title": "IPv6/CIDR", + "type": "string" + } + ], + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "filter_func": { + "pattern": "^function", + "minLength": 10, + "type": "string" + }, + "script_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "timeout": { + "properties": { + "send": { "exclusiveMinimum": 0, "type": "number" }, + "read": { "exclusiveMinimum": 0, "type": "number" }, + "connect": { "exclusiveMinimum": 0, "type": "number" } + }, + "required": ["connect", "send", "read"], + "type": "object" + }, + "status": { + "default": 1, + "description": "route status, 1 to enable, 0 to disable", + "enum": [1, 0], + "type": "integer" + }, + "vars": { "type": "array" }, + "uris": { + "uniqueItems": true, + "items": { "type": "string", "description": "HTTP uri" }, + "minItems": 1, + "type": "array" + }, + "id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "create_time": { "type": "integer" }, + "plugin_config_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "hosts": { + "uniqueItems": true, + "items": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "name": { "type": "string", "minLength": 1, "maxLength": 100 }, + "desc": { "maxLength": 256, "type": "string" }, + "service_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "upstream": { + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "keepalive_pool": { + "properties": { + "idle_timeout": { + "default": 60, + "minimum": 0, + "type": "number" + }, + "requests": { + "default": 1000, + "minimum": 1, + "type": "integer" + }, + "size": { "default": 320, "minimum": 1, "type": "integer" } + }, + "type": "object" + }, + "create_time": { "type": "integer" }, + "retries": { "minimum": 0, "type": "integer" }, + "retry_timeout": { "minimum": 0, "type": "number" }, + "tls": { + "properties": { + "client_key": { + "maxLength": 65536, + "minLength": 128, + "type": "string" + }, + "verify": { + "default": false, + "type": "boolean", + "description": "Turn on server certificate verification, currently only kafka upstream is supported" + }, + "client_cert": { + "maxLength": 65536, + "minLength": 128, + "type": "string" + }, + "client_cert_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + } + }, + "dependencies": { + "client_cert_id": { + "not": { "required": ["client_client", "client_key"] } + }, + "client_cert": { + "not": { "required": ["client_cert_id"] }, + "required": ["client_key"] + }, + "client_key": { + "not": { "required": ["client_cert_id"] }, + "required": ["client_cert"] + } + }, + "type": "object" + }, + "checks": { + "properties": { + "passive": { + "properties": { + "healthy": { + "properties": { + "successes": { + "minimum": 0, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [ + 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, + 300, 301, 302, 303, 304, 305, 306, 307, 308 + ], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "unhealthy": { + "properties": { + "timeouts": { + "minimum": 0, + "default": 7, + "maximum": 254, + "type": "integer" + }, + "http_failures": { + "minimum": 0, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "tcp_failures": { + "minimum": 0, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [429, 500, 503], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "type": { + "default": "http", + "enum": ["http", "https", "tcp"], + "type": "string" + } + }, + "type": "object" + }, + "active": { + "properties": { + "concurrency": { "default": 10, "type": "integer" }, + "http_path": { "default": "/", "type": "string" }, + "https_verify_certificate": { + "default": true, + "type": "boolean" + }, + "type": { + "default": "http", + "enum": ["http", "https", "tcp"], + "type": "string" + }, + "timeout": { "default": 1, "type": "number" }, + "req_headers": { + "items": { "uniqueItems": true, "type": "string" }, + "minItems": 1, + "type": "array" + }, + "healthy": { + "properties": { + "successes": { + "minimum": 1, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "interval": { + "minimum": 1, + "default": 1, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [200, 302], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "port": { + "minimum": 1, + "maximum": 65535, + "type": "integer" + }, + "unhealthy": { + "properties": { + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [429, 404, 500, 501, 502, 503, 504, 505], + "minItems": 1, + "type": "array" + }, + "interval": { + "minimum": 1, + "default": 1, + "type": "integer" + }, + "http_failures": { + "minimum": 1, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "tcp_failures": { + "minimum": 1, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "timeouts": { + "minimum": 1, + "default": 3, + "maximum": 254, + "type": "integer" + } + }, + "type": "object" + }, + "host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + } + }, + "type": "object" + } + }, + "additionalProperties": false, + "anyOf": [ + { "required": ["active"] }, + { "required": ["active", "passive"] } + ], + "type": "object" + }, + "timeout": { + "properties": { + "send": { "exclusiveMinimum": 0, "type": "number" }, + "read": { "exclusiveMinimum": 0, "type": "number" }, + "connect": { "exclusiveMinimum": 0, "type": "number" } + }, + "required": ["connect", "send", "read"], + "type": "object" + }, + "discovery_type": { + "type": "string", + "description": "discovery type" + }, + "labels": { + "description": "key/value pairs to specify attributes", + "patternProperties": { + ".*": { + "minLength": 1, + "maxLength": 256, + "type": "string", + "pattern": "^\\S+$", + "description": "value of label" + } + }, + "type": "object" + }, + "discovery_args": { + "properties": { + "group_name": { "type": "string", "description": "group name" }, + "namespace_id": { + "type": "string", + "description": "namespace id" + } + }, + "type": "object" + }, + "key": { + "type": "string", + "description": "the key of chash for dynamic load balancing" + }, + "name": { "type": "string", "minLength": 1, "maxLength": 100 }, + "desc": { "maxLength": 256, "type": "string" }, + "update_time": { "type": "integer" }, + "type": { + "default": "roundrobin", + "description": "algorithms of load balancing", + "type": "string" + }, + "upstream_host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "pass_host": { + "default": "pass", + "description": "mod of host passing", + "enum": ["pass", "node", "rewrite"], + "type": "string" + }, + "hash_on": { + "default": "vars", + "enum": [ + "vars", + "header", + "cookie", + "consumer", + "vars_combinations" + ], + "type": "string" + }, + "nodes": { + "anyOf": [ + { + "patternProperties": { + ".*": { + "minimum": 0, + "description": "weight of node", + "type": "integer" + } + }, + "type": "object" + }, + { + "items": { + "properties": { + "host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "weight": { + "minimum": 0, + "description": "weight of node", + "type": "integer" + }, + "metadata": { + "type": "object", + "description": "metadata of node" + }, + "port": { + "minimum": 1, + "description": "port of node", + "type": "integer" + }, + "priority": { + "default": 0, + "description": "priority of node", + "type": "integer" + } + }, + "required": ["host", "port", "weight"], + "type": "object" + }, + "type": "array" + } + ] + }, + "service_name": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "scheme": { + "default": "http", + "enum": [ + "grpc", + "grpcs", + "http", + "https", + "tcp", + "tls", + "udp", + "kafka" + ], + "description": "The scheme of the upstream. For L7 proxy, it can be one of grpc/grpcs/http/https. For L4 proxy, it can be one of tcp/tls/udp. For specific protocols, it can be kafka." + } + }, + "additionalProperties": false, + "oneOf": [ + { "required": ["nodes"] }, + { "required": ["service_name", "discovery_type"] } + ], + "type": "object" + }, + "priority": { "default": 0, "type": "integer" }, + "labels": { + "description": "key/value pairs to specify attributes", + "patternProperties": { + ".*": { + "minLength": 1, + "maxLength": 256, + "type": "string", + "pattern": "^\\S+$", + "description": "value of label" + } + }, + "type": "object" + }, + "plugins": { "type": "object" }, + "enable_websocket": { + "type": "boolean", + "description": "enable websocket for request" + }, + "remote_addr": { + "description": "client IP", + "anyOf": [ + { "format": "ipv4", "title": "IPv4", "type": "string" }, + { + "pattern": "^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([12]?[0-9]|3[0-2])$", + "title": "IPv4/CIDR", + "type": "string" + }, + { "format": "ipv6", "title": "IPv6", "type": "string" }, + { + "pattern": "^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$", + "title": "IPv6/CIDR", + "type": "string" + } + ], + "type": "string" + }, + "upstream_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "uri": { "maxLength": 4096, "minLength": 1, "type": "string" }, + "update_time": { "type": "integer" }, + "script": { "maxLength": 102400, "minLength": 10, "type": "string" } + }, + "allOf": [ + { "oneOf": [{ "required": ["uri"] }, { "required": ["uris"] }] }, + { + "oneOf": [ + { + "not": { + "anyOf": [{ "required": ["host"] }, { "required": ["hosts"] }] + } + }, + { "required": ["host"] }, + { "required": ["hosts"] } + ] + }, + { + "oneOf": [ + { + "not": { + "anyOf": [ + { "required": ["remote_addr"] }, + { "required": ["remote_addrs"] } + ] + } + }, + { "required": ["remote_addr"] }, + { "required": ["remote_addrs"] } + ] + } + ], + "anyOf": [ + { "required": ["plugins", "uri"] }, + { "required": ["upstream", "uri"] }, + { "required": ["upstream_id", "uri"] }, + { "required": ["service_id", "uri"] }, + { "required": ["plugins", "uris"] }, + { "required": ["upstream", "uris"] }, + { "required": ["upstream_id", "uris"] }, + { "required": ["service_id", "uris"] }, + { "required": ["script", "uri"] }, + { "required": ["script", "uris"] } + ], + "type": "object" + }, + "ssl": { + "additionalProperties": false, + "then": { + "oneOf": [ + { "required": ["sni", "key", "cert"] }, + { "required": ["snis", "key", "cert"] } + ] + }, + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "create_time": { "type": "integer" }, + "cert": { + "oneOf": [ + { "maxLength": 65536, "minLength": 128, "type": "string" }, + { "pattern": "^\\$(secret|env)://", "type": "string" } + ] + }, + "labels": { + "description": "key/value pairs to specify attributes", + "patternProperties": { + ".*": { + "minLength": 1, + "maxLength": 256, + "type": "string", + "pattern": "^\\S+$", + "description": "value of label" + } + }, + "type": "object" + }, + "snis": { + "items": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "certs": { + "items": { "maxLength": 65536, "minLength": 128, "type": "string" }, + "type": "array" + }, + "key": { + "oneOf": [ + { "maxLength": 65536, "minLength": 128, "type": "string" }, + { "pattern": "^\\$(secret|env)://", "type": "string" } + ] + }, + "exptime": { "minimum": 1588262400, "type": "integer" }, + "client": { + "properties": { + "ca": { "maxLength": 65536, "minLength": 128, "type": "string" }, + "depth": { "minimum": 0, "default": 1, "type": "integer" }, + "skip_mtls_uri_regex": { + "uniqueItems": true, + "items": { + "type": "string", + "description": "uri regular expression to skip mtls" + }, + "minItems": 1, + "type": "array" + } + }, + "required": ["ca"], + "type": "object" + }, + "status": { + "default": 1, + "description": "ssl status, 1 to enable, 0 to disable", + "enum": [1, 0], + "type": "integer" + }, + "validity_start": { "type": "integer" }, + "sni": { "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", "type": "string" }, + "type": { + "default": "server", + "description": "ssl certificate type, server to server certificate, client to client certificate for upstream", + "enum": ["server", "client"], + "type": "string" + }, + "keys": { + "items": { "maxLength": 65536, "minLength": 128, "type": "string" }, + "type": "array" + }, + "update_time": { "type": "integer" }, + "ssl_protocols": { + "items": { "enum": ["TLSv1.1", "TLSv1.2", "TLSv1.3"] }, + "uniqueItems": true, + "maxItems": 3, + "type": "array", + "description": "set ssl protocols" + }, + "validity_end": { "type": "integer" } + }, + "else": { "required": ["key", "cert"] }, + "if": { "properties": { "type": { "enum": ["server"] } } }, + "type": "object" + }, + "stream_route": { + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "plugins": { "type": "object" }, + "create_time": { "type": "integer" }, + "desc": { "maxLength": 256, "type": "string" }, + "sni": { + "description": "server name indication", + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "update_time": { "type": "integer" }, + "protocol": { + "properties": { + "superior_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "conf": { + "type": "object", + "description": "protocol-specific configuration" + }, + "logger": { + "items": { + "properties": { + "conf": { + "type": "object", + "description": "logger plugin configuration" + }, + "filter": { + "type": "array", + "description": "logger filter rules" + }, + "name": { "type": "string" } + }, + "additionalProperties": false, + "dependencies": { "name": ["conf"] } + }, + "type": "array" + }, + "name": { "type": "string" } + }, + "required": ["name"], + "type": "object" + }, + "remote_addr": { + "description": "client IP", + "anyOf": [ + { "format": "ipv4", "title": "IPv4", "type": "string" }, + { + "pattern": "^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([12]?[0-9]|3[0-2])$", + "title": "IPv4/CIDR", + "type": "string" + }, + { "format": "ipv6", "title": "IPv6", "type": "string" }, + { + "pattern": "^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$", + "title": "IPv6/CIDR", + "type": "string" + } + ], + "type": "string" + }, + "upstream_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "server_port": { "type": "integer", "description": "server port" }, + "server_addr": { + "description": "server IP", + "anyOf": [ + { "format": "ipv4", "title": "IPv4", "type": "string" }, + { + "pattern": "^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([12]?[0-9]|3[0-2])$", + "title": "IPv4/CIDR", + "type": "string" + }, + { "format": "ipv6", "title": "IPv6", "type": "string" }, + { + "pattern": "^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$", + "title": "IPv6/CIDR", + "type": "string" + } + ], + "type": "string" + }, + "upstream": { + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "keepalive_pool": { + "properties": { + "idle_timeout": { + "default": 60, + "minimum": 0, + "type": "number" + }, + "requests": { + "default": 1000, + "minimum": 1, + "type": "integer" + }, + "size": { "default": 320, "minimum": 1, "type": "integer" } + }, + "type": "object" + }, + "create_time": { "type": "integer" }, + "retries": { "minimum": 0, "type": "integer" }, + "retry_timeout": { "minimum": 0, "type": "number" }, + "tls": { + "properties": { + "client_key": { + "maxLength": 65536, + "minLength": 128, + "type": "string" + }, + "verify": { + "default": false, + "type": "boolean", + "description": "Turn on server certificate verification, currently only kafka upstream is supported" + }, + "client_cert": { + "maxLength": 65536, + "minLength": 128, + "type": "string" + }, + "client_cert_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + } + }, + "dependencies": { + "client_cert_id": { + "not": { "required": ["client_client", "client_key"] } + }, + "client_cert": { + "not": { "required": ["client_cert_id"] }, + "required": ["client_key"] + }, + "client_key": { + "not": { "required": ["client_cert_id"] }, + "required": ["client_cert"] + } + }, + "type": "object" + }, + "checks": { + "properties": { + "passive": { + "properties": { + "healthy": { + "properties": { + "successes": { + "minimum": 0, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [ + 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, + 300, 301, 302, 303, 304, 305, 306, 307, 308 + ], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "unhealthy": { + "properties": { + "timeouts": { + "minimum": 0, + "default": 7, + "maximum": 254, + "type": "integer" + }, + "http_failures": { + "minimum": 0, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "tcp_failures": { + "minimum": 0, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [429, 500, 503], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "type": { + "default": "http", + "enum": ["http", "https", "tcp"], + "type": "string" + } + }, + "type": "object" + }, + "active": { + "properties": { + "concurrency": { "default": 10, "type": "integer" }, + "http_path": { "default": "/", "type": "string" }, + "https_verify_certificate": { + "default": true, + "type": "boolean" + }, + "type": { + "default": "http", + "enum": ["http", "https", "tcp"], + "type": "string" + }, + "timeout": { "default": 1, "type": "number" }, + "req_headers": { + "items": { "uniqueItems": true, "type": "string" }, + "minItems": 1, + "type": "array" + }, + "healthy": { + "properties": { + "successes": { + "minimum": 1, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "interval": { + "minimum": 1, + "default": 1, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [200, 302], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "port": { + "minimum": 1, + "maximum": 65535, + "type": "integer" + }, + "unhealthy": { + "properties": { + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [429, 404, 500, 501, 502, 503, 504, 505], + "minItems": 1, + "type": "array" + }, + "interval": { + "minimum": 1, + "default": 1, + "type": "integer" + }, + "http_failures": { + "minimum": 1, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "tcp_failures": { + "minimum": 1, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "timeouts": { + "minimum": 1, + "default": 3, + "maximum": 254, + "type": "integer" + } + }, + "type": "object" + }, + "host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + } + }, + "type": "object" + } + }, + "additionalProperties": false, + "anyOf": [ + { "required": ["active"] }, + { "required": ["active", "passive"] } + ], + "type": "object" + }, + "timeout": { + "properties": { + "send": { "exclusiveMinimum": 0, "type": "number" }, + "read": { "exclusiveMinimum": 0, "type": "number" }, + "connect": { "exclusiveMinimum": 0, "type": "number" } + }, + "required": ["connect", "send", "read"], + "type": "object" + }, + "discovery_type": { + "type": "string", + "description": "discovery type" + }, + "labels": { + "description": "key/value pairs to specify attributes", + "patternProperties": { + ".*": { + "minLength": 1, + "maxLength": 256, + "type": "string", + "pattern": "^\\S+$", + "description": "value of label" + } + }, + "type": "object" + }, + "discovery_args": { + "properties": { + "group_name": { "type": "string", "description": "group name" }, + "namespace_id": { + "type": "string", + "description": "namespace id" + } + }, + "type": "object" + }, + "key": { + "type": "string", + "description": "the key of chash for dynamic load balancing" + }, + "name": { "type": "string", "minLength": 1, "maxLength": 100 }, + "desc": { "maxLength": 256, "type": "string" }, + "update_time": { "type": "integer" }, + "type": { + "default": "roundrobin", + "description": "algorithms of load balancing", + "type": "string" + }, + "upstream_host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "pass_host": { + "default": "pass", + "description": "mod of host passing", + "enum": ["pass", "node", "rewrite"], + "type": "string" + }, + "hash_on": { + "default": "vars", + "enum": [ + "vars", + "header", + "cookie", + "consumer", + "vars_combinations" + ], + "type": "string" + }, + "nodes": { + "anyOf": [ + { + "patternProperties": { + ".*": { + "minimum": 0, + "description": "weight of node", + "type": "integer" + } + }, + "type": "object" + }, + { + "items": { + "properties": { + "host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "weight": { + "minimum": 0, + "description": "weight of node", + "type": "integer" + }, + "metadata": { + "type": "object", + "description": "metadata of node" + }, + "port": { + "minimum": 1, + "description": "port of node", + "type": "integer" + }, + "priority": { + "default": 0, + "description": "priority of node", + "type": "integer" + } + }, + "required": ["host", "port", "weight"], + "type": "object" + }, + "type": "array" + } + ] + }, + "service_name": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "scheme": { + "default": "http", + "enum": [ + "grpc", + "grpcs", + "http", + "https", + "tcp", + "tls", + "udp", + "kafka" + ], + "description": "The scheme of the upstream. For L7 proxy, it can be one of grpc/grpcs/http/https. For L4 proxy, it can be one of tcp/tls/udp. For specific protocols, it can be kafka." + } + }, + "additionalProperties": false, + "oneOf": [ + { "required": ["nodes"] }, + { "required": ["service_name", "discovery_type"] } + ], + "type": "object" + } + }, + "additionalProperties": false, + "type": "object" + }, + "consumer_group": { + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "plugins": { "type": "object" }, + "create_time": { "type": "integer" }, + "desc": { "maxLength": 256, "type": "string" }, + "labels": { + "description": "key/value pairs to specify attributes", + "patternProperties": { + ".*": { + "minLength": 1, + "maxLength": 256, + "type": "string", + "pattern": "^\\S+$", + "description": "value of label" + } + }, + "type": "object" + }, + "update_time": { "type": "integer" } + }, + "required": ["id", "plugins"], + "additionalProperties": false, + "type": "object" + }, + "proto": { + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "create_time": { "type": "integer" }, + "desc": { "maxLength": 256, "type": "string" }, + "content": { "maxLength": 1048576, "minLength": 1, "type": "string" }, + "update_time": { "type": "integer" } + }, + "required": ["content"], + "additionalProperties": false, + "type": "object" + } + }, + "plugins": { + "datadog": { + "version": 0.1, + "schema": { + "properties": { + "prefer_name": { "default": true, "type": "boolean" }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "name": { "default": "datadog", "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 495, + "metadata_schema": { + "properties": { + "host": { "default": "127.0.0.1", "type": "string" }, + "port": { "minimum": 0, "default": 8125, "type": "integer" }, + "namespace": { "default": "apisix", "type": "string" }, + "constant_tags": { + "default": ["source:apisix"], + "items": { "type": "string" }, + "type": "array" + } + }, + "type": "object" + } + }, + "zipkin": { + "version": 0.1, + "schema": { + "properties": { + "span_version": { "enum": [1, 2], "default": 2 }, + "sample_ratio": { "minimum": 1e-5, "maximum": 1, "type": "number" }, + "service_name": { + "default": "APISIX", + "type": "string", + "description": "service name for zipkin reporter" + }, + "endpoint": { "type": "string" }, + "server_addr": { + "type": "string", + "pattern": "^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$", + "description": "default is $server_addr, you can specify your external ip address" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "required": ["endpoint", "sample_ratio"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 12011 + }, + "elasticsearch-logger": { + "version": 0.1, + "schema": { + "oneOf": [ + { "required": ["endpoint_addr", "field"] }, + { "required": ["endpoint_addrs", "field"] } + ], + "properties": { + "endpoint_addrs": { + "items": { "pattern": "[^/]$", "type": "string" }, + "minItems": 1, + "type": "array" + }, + "auth": { + "properties": { + "username": { "minLength": 1, "type": "string" }, + "password": { "minLength": 1, "type": "string" } + }, + "required": ["username", "password"], + "type": "object" + }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "name": { "default": "elasticsearch-logger", "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "timeout": { "minimum": 1, "default": 10, "type": "integer" }, + "field": { + "properties": { + "type": { "type": "string" }, + "index": { "type": "string" } + }, + "required": ["index"], + "type": "object" + }, + "ssl_verify": { "default": true, "type": "boolean" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "endpoint_addr": { "pattern": "[^/]$", "type": "string" }, + "log_format": { "type": "object" } + }, + "$comment": "this is a mark for our injected plugin schema", + "encrypt_fields": ["auth.password"], + "type": "object" + }, + "priority": 413, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + } + }, + "opa": { + "version": 0.1, + "schema": { + "properties": { + "with_service": { "default": false, "type": "boolean" }, + "host": { "type": "string" }, + "keepalive_pool": { "minimum": 1, "default": 5, "type": "integer" }, + "keepalive_timeout": { + "minimum": 1000, + "default": 60000, + "type": "integer" + }, + "keepalive": { "default": true, "type": "boolean" }, + "timeout": { + "minimum": 1, + "default": 3000, + "description": "timeout in milliseconds", + "type": "integer", + "maximum": 60000 + }, + "ssl_verify": { "default": true, "type": "boolean" }, + "policy": { "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "send_headers_upstream": { + "description": "list of headers to pass to upstream in request", + "items": { "type": "string" }, + "minItems": 1, + "type": "array" + }, + "with_consumer": { "default": false, "type": "boolean" }, + "with_route": { "default": false, "type": "boolean" } + }, + "required": ["host", "policy"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 2001 + }, + "example-plugin": { + "version": 0.1, + "schema": { + "properties": { + "ip": { "type": "string" }, + "t": { "minItems": 1, "type": "array" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "port": { "type": "integer" }, + "s": { "type": "string" }, + "i": { "minimum": 0, "type": "number" } + }, + "required": ["i"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "metadata_schema": { + "properties": { + "ikey": { "minimum": 0, "type": "number" }, + "skey": { "type": "string" } + }, + "required": ["ikey", "skey"], + "type": "object" + }, + "priority": 0 + }, + "skywalking-logger": { + "version": 0.1, + "schema": { + "properties": { + "name": { "default": "skywalking logger", "type": "string" }, + "service_name": { "default": "APISIX", "type": "string" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "timeout": { "minimum": 1, "default": 3, "type": "integer" }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "include_req_body": { "default": false, "type": "boolean" }, + "service_instance_name": { + "default": "APISIX Instance Name", + "type": "string" + }, + "endpoint_addr": { + "pattern": "^[^\\/]+:\\/\\/([\\da-zA-Z.-]+|\\[[\\da-fA-F:]+\\])(:\\d+)?", + "type": "string" + }, + "log_format": { "type": "object" } + }, + "required": ["endpoint_addr"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 408, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + } + }, + "cors": { + "version": 0.1, + "schema": { + "properties": { + "allow_methods": { + "default": "*", + "description": "you can use '*' to allow all methods when no credentials,'**' to allow forcefully(it will bring some security risks, be carefully),multiple method use ',' to split. default: *.", + "type": "string" + }, + "allow_origins_by_metadata": { + "items": { "maxLength": 4096, "minLength": 1, "type": "string" }, + "uniqueItems": true, + "description": "set allowed origins by referencing origins in plugin metadata", + "minItems": 1, + "type": "array" + }, + "allow_headers": { + "default": "*", + "description": "you can use '*' to allow all header when no credentials,'**' to allow forcefully(it will bring some security risks, be carefully),multiple header use ',' to split. default: *.", + "type": "string" + }, + "expose_headers": { + "default": "*", + "description": "you can use '*' to expose all header when no credentials,'**' to allow forcefully(it will bring some security risks, be carefully),multiple header use ',' to split. default: *.", + "type": "string" + }, + "max_age": { + "default": 5, + "description": "maximum number of seconds the results can be cached.-1 means no cached, the max value is depend on browser,more details plz check MDN. default: 5.", + "type": "integer" + }, + "allow_credential": { + "default": false, + "description": "allow client append credential. according to CORS specification,if you set this option to 'true', you can not use '*' for other options.", + "type": "boolean" + }, + "allow_origins": { + "default": "*", + "description": "you can use '*' to allow all origins when no credentials,'**' to allow forcefully(it will bring some security risks, be carefully),multiple origin use ',' to split. default: *.", + "pattern": "^(\\*|\\*\\*|null|\\w+://[^,]+(,\\w+://[^,]+)*)$", + "type": "string" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "allow_origins_by_regex": { + "items": { "maxLength": 4096, "minLength": 1, "type": "string" }, + "uniqueItems": true, + "description": "you can use regex to allow specific origins when no credentials,for example use [.*\\.test.com] to allow a.test.com and b.test.com", + "minItems": 1, + "type": "array" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "metadata_schema": { + "properties": { + "allow_origins": { + "additionalProperties": { + "pattern": "^(\\*|\\*\\*|null|\\w+://[^,]+(,\\w+://[^,]+)*)$", + "type": "string" + }, + "type": "object" + } + }, + "type": "object" + }, + "priority": 4000 + }, + "wolf-rbac": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "appid": { "default": "unset", "type": "string" }, + "header_prefix": { "default": "X-", "type": "string" }, + "server": { "default": "http://127.0.0.1:12180", "type": "string" } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "type": "auth", + "priority": 2555 + }, + "uri-blocker": { + "version": 0.1, + "schema": { + "properties": { + "block_rules": { + "items": { "maxLength": 4096, "minLength": 1, "type": "string" }, + "uniqueItems": true, + "type": "array" + }, + "rejected_code": { + "minimum": 200, + "default": 403, + "type": "integer" + }, + "rejected_msg": { "minLength": 1, "type": "string" }, + "case_insensitive": { "default": false, "type": "boolean" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "required": ["block_rules"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 2900 + }, + "limit-conn": { + "version": 0.1, + "schema": { + "properties": { + "key": { "type": "string" }, + "conn": { "exclusiveMinimum": 0, "type": "integer" }, + "rejected_msg": { "minLength": 1, "type": "string" }, + "burst": { "minimum": 0, "type": "integer" }, + "default_conn_delay": { "exclusiveMinimum": 0, "type": "number" }, + "only_use_default_delay": { "default": false, "type": "boolean" }, + "key_type": { + "default": "var", + "enum": ["var", "var_combination"], + "type": "string" + }, + "allow_degradation": { "default": false, "type": "boolean" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "rejected_code": { + "minimum": 200, + "default": 503, + "maximum": 599, + "type": "integer" + } + }, + "required": ["conn", "burst", "default_conn_delay", "key"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 1003 + }, + "real-ip": { + "version": 0.1, + "schema": { + "properties": { + "trusted_addresses": { + "items": { + "anyOf": [ + { "format": "ipv4", "title": "IPv4", "type": "string" }, + { + "pattern": "^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([12]?[0-9]|3[0-2])$", + "title": "IPv4/CIDR", + "type": "string" + }, + { "format": "ipv6", "title": "IPv6", "type": "string" }, + { + "pattern": "^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$", + "title": "IPv6/CIDR", + "type": "string" + } + ] + }, + "minItems": 1, + "type": "array" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "recursive": { "default": false, "type": "boolean" }, + "source": { "minLength": 1, "type": "string" } + }, + "required": ["source"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 23000 + }, + "redirect": { + "version": 0.1, + "schema": { + "properties": { + "ret_code": { "minimum": 200, "default": 302, "type": "integer" }, + "regex_uri": { + "items": { "type": "string", "description": "regex uri" }, + "type": "array", + "maxItems": 2, + "minItems": 2, + "description": "params for generating new uri that substitute from client uri, first param is regular expression, the second one is uri template" + }, + "uri": { + "pattern": "(\\\\\\$[0-9a-zA-Z_]+)|\\$\\{([0-9a-zA-Z_]+)\\}|\\$([0-9a-zA-Z_]+)|(\\$|[^$\\\\]+)", + "minLength": 2, + "type": "string" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "http_to_https": { "type": "boolean" }, + "encode_uri": { "default": false, "type": "boolean" }, + "append_query_string": { "default": false, "type": "boolean" } + }, + "$comment": "this is a mark for our injected plugin schema", + "oneOf": [ + { "required": ["uri"] }, + { "required": ["regex_uri"] }, + { "required": ["http_to_https"] } + ], + "type": "object" + }, + "priority": 900 + }, + "proxy-control": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "request_buffering": { "default": true, "type": "boolean" } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 21990 + }, + "grpc-web": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 505 + }, + + "grpc-web-custom": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 505 + }, + "prometheus": { + "version": 0.2, + "schema": { + "properties": { + "prefer_name": { "default": false, "type": "boolean" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 500 + }, + "ua-restriction": { + "version": 0.1, + "schema": { + "properties": { + "message": { + "default": "Not allowed", + "maxLength": 1024, + "minLength": 1, + "type": "string" + }, + "bypass_missing": { "default": false, "type": "boolean" }, + "allowlist": { + "items": { "minLength": 1, "type": "string" }, + "minItems": 1, + "type": "array" + }, + "denylist": { + "items": { "minLength": 1, "type": "string" }, + "minItems": 1, + "type": "array" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "oneOf": [{ "required": ["allowlist"] }, { "required": ["denylist"] }], + "type": "object" + }, + "priority": 2999 + }, + "loggly": { + "version": 0.1, + "schema": { + "properties": { + "severity_map": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^[1-5][0-9]{2}$": { + "description": "keys are HTTP status code, values are severity", + "enum": [ + "CRIT", + "crit", + "ERR", + "err", + "EMEGR", + "emegr", + "WARNING", + "warning", + "INFO", + "info", + "DEBUG", + "debug", + "NOTICE", + "notice", + "ALERT", + "alert" + ], + "type": "string" + } + }, + "description": "upstream response code vs syslog severity mapping" + }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "ssl_verify": { "default": true, "type": "boolean" }, + "name": { "default": "loggly", "type": "string" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "tags": { + "default": ["apisix"], + "items": { "pattern": "^(?!tag=)[ -~]*", "type": "string" }, + "minItems": 1, + "type": "array" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "severity": { + "default": "INFO", + "description": "base severity log level", + "enum": [ + "CRIT", + "crit", + "ERR", + "err", + "EMEGR", + "emegr", + "WARNING", + "warning", + "INFO", + "info", + "DEBUG", + "debug", + "NOTICE", + "notice", + "ALERT", + "alert" + ], + "type": "string" + }, + "include_resp_body_expr": { + "items": { "type": "array" }, + "minItems": 1, + "type": "array" + }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "include_req_body": { "default": false, "type": "boolean" }, + "customer_token": { "type": "string" }, + "include_resp_body": { "default": false, "type": "boolean" }, + "log_format": { "type": "object" } + }, + "required": ["customer_token"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "metadata_schema": { + "properties": { + "timeout": { "minimum": 1, "default": 5000, "type": "integer" }, + "host": { "default": "logs-01.loggly.com", "type": "string" }, + "protocol": { + "default": "syslog", + "enum": ["syslog", "http", "https"], + "type": "string" + }, + "port": { "default": 514, "type": "integer" }, + "log_format": { "type": "object" } + }, + "type": "object" + }, + "priority": 411 + }, + "kafka-logger": { + "version": 0.1, + "schema": { + "properties": { + "broker_list": { + "type": "object", + "patternProperties": { + ".*": { + "minimum": 1, + "maximum": 65535, + "description": "the port of kafka broker", + "type": "integer" + } + }, + "minProperties": 1 + }, + "meta_format": { + "default": "default", + "enum": ["default", "origin"], + "type": "string" + }, + "kafka_topic": { "type": "string" }, + "producer_type": { + "default": "async", + "enum": ["async", "sync"], + "type": "string" + }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "include_resp_body_expr": { + "items": { "type": "array" }, + "minItems": 1, + "type": "array" + }, + "cluster_name": { "minimum": 1, "default": 1, "type": "integer" }, + "producer_batch_num": { + "minimum": 1, + "default": 200, + "type": "integer" + }, + "producer_batch_size": { + "minimum": 0, + "default": 1048576, + "type": "integer" + }, + "producer_max_buffering": { + "minimum": 1, + "default": 50000, + "type": "integer" + }, + "producer_time_linger": { + "minimum": 1, + "default": 1, + "type": "integer" + }, + "key": { "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "brokers": { + "uniqueItems": true, + "items": { + "properties": { + "port": { + "minimum": 1, + "description": "the port of kafka broker", + "maximum": 65535, + "type": "integer" + }, + "sasl_config": { + "properties": { + "password": { "description": "password", "type": "string" }, + "mechanism": { + "default": "PLAIN", + "enum": ["PLAIN"], + "type": "string" + }, + "user": { "description": "user", "type": "string" } + }, + "required": ["user", "password"], + "type": "object", + "description": "sasl config" + }, + "host": { + "description": "the host of kafka broker", + "type": "string" + } + }, + "required": ["host", "port"], + "type": "object" + }, + "minItems": 1, + "type": "array" + }, + "name": { "default": "kafka logger", "type": "string" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "meta_refresh_interval": { + "minimum": 1, + "default": 30, + "type": "integer" + }, + "timeout": { "minimum": 1, "default": 3, "type": "integer" }, + "required_acks": { + "default": 1, + "enum": [0, 1, -1], + "type": "integer" + }, + "include_req_body": { "default": false, "type": "boolean" }, + "include_resp_body": { "default": false, "type": "boolean" }, + "include_req_body_expr": { + "items": { "type": "array" }, + "minItems": 1, + "type": "array" + }, + "log_format": { "type": "object" } + }, + "$comment": "this is a mark for our injected plugin schema", + "oneOf": [ + { "required": ["broker_list", "kafka_topic"] }, + { "required": ["brokers", "kafka_topic"] } + ], + "type": "object" + }, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + }, + "priority": 403 + }, + "response-rewrite": { + "version": 0.1, + "schema": { + "properties": { + "body_base64": { + "default": false, + "description": "whether new body for response need base64 decode before return", + "type": "boolean" + }, + "headers": { + "anyOf": [ + { + "type": "object", + "patternProperties": { + "^[^:]+$": { + "oneOf": [{ "type": "string" }, { "type": "number" }] + } + }, + "minProperties": 1 + }, + { + "properties": { + "add": { + "items": { + "pattern": "^[^:]+:[^:]*[^/]$", + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "remove": { + "items": { "pattern": "^[^:]+$", "type": "string" }, + "minItems": 1, + "type": "array" + }, + "set": { + "type": "object", + "patternProperties": { + "^[^:]+$": { + "oneOf": [{ "type": "string" }, { "type": "number" }] + } + }, + "minProperties": 1 + } + } + } + ], + "description": "new headers for response" + }, + "status_code": { + "minimum": 200, + "maximum": 598, + "description": "new status code for response", + "type": "integer" + }, + "filters": { + "description": "a group of filters that modify response bodyby replacing one specified string by another", + "items": { + "properties": { + "options": { + "default": "jo", + "description": "regex options", + "type": "string" + }, + "replace": { + "type": "string", + "description": "regex substitution content" + }, + "regex": { + "description": "match pattern on response body", + "minLength": 1, + "type": "string" + }, + "scope": { + "default": "once", + "description": "regex substitution range", + "enum": ["once", "global"], + "type": "string" + } + }, + "required": ["regex", "replace"], + "description": "filter that modifies response body", + "type": "object" + }, + "minItems": 1, + "type": "array" + }, + "vars": { "type": "array" }, + "body": { "type": "string", "description": "new body for response" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "dependencies": { + "body": { "not": { "required": ["filters"] } }, + "filters": { "not": { "required": ["body"] } } + }, + "type": "object" + }, + "priority": 899 + }, + "traffic-split": { + "version": 0.1, + "schema": { + "properties": { + "rules": { + "items": { + "properties": { + "match": { + "items": { + "properties": { "vars": { "type": "array" } }, + "type": "object" + }, + "type": "array" + }, + "weighted_upstreams": { + "items": { + "properties": { + "upstream_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "upstream": { + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + }, + "keepalive_pool": { + "properties": { + "idle_timeout": { + "default": 60, + "minimum": 0, + "type": "number" + }, + "requests": { + "default": 1000, + "minimum": 1, + "type": "integer" + }, + "size": { + "default": 320, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "create_time": { "type": "integer" }, + "retries": { "minimum": 0, "type": "integer" }, + "retry_timeout": { "minimum": 0, "type": "number" }, + "tls": { + "properties": { + "client_key": { + "maxLength": 65536, + "minLength": 128, + "type": "string" + }, + "verify": { + "default": false, + "type": "boolean", + "description": "Turn on server certificate verification, currently only kafka upstream is supported" + }, + "client_cert": { + "maxLength": 65536, + "minLength": 128, + "type": "string" + }, + "client_cert_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + } + }, + "dependencies": { + "client_cert_id": { + "not": { + "required": ["client_client", "client_key"] + } + }, + "client_cert": { + "not": { "required": ["client_cert_id"] }, + "required": ["client_key"] + }, + "client_key": { + "not": { "required": ["client_cert_id"] }, + "required": ["client_cert"] + } + }, + "type": "object" + }, + "checks": { + "properties": { + "passive": { + "properties": { + "healthy": { + "properties": { + "successes": { + "minimum": 0, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [ + 200, 201, 202, 203, 204, 205, 206, + 207, 208, 226, 300, 301, 302, 303, + 304, 305, 306, 307, 308 + ], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "unhealthy": { + "properties": { + "timeouts": { + "minimum": 0, + "default": 7, + "maximum": 254, + "type": "integer" + }, + "http_failures": { + "minimum": 0, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "tcp_failures": { + "minimum": 0, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [429, 500, 503], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "type": { + "default": "http", + "enum": ["http", "https", "tcp"], + "type": "string" + } + }, + "type": "object" + }, + "active": { + "properties": { + "concurrency": { + "default": 10, + "type": "integer" + }, + "http_path": { + "default": "/", + "type": "string" + }, + "https_verify_certificate": { + "default": true, + "type": "boolean" + }, + "type": { + "default": "http", + "enum": ["http", "https", "tcp"], + "type": "string" + }, + "timeout": { "default": 1, "type": "number" }, + "req_headers": { + "items": { + "uniqueItems": true, + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "healthy": { + "properties": { + "successes": { + "minimum": 1, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "interval": { + "minimum": 1, + "default": 1, + "type": "integer" + }, + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [200, 302], + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "port": { + "minimum": 1, + "maximum": 65535, + "type": "integer" + }, + "unhealthy": { + "properties": { + "http_statuses": { + "items": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "uniqueItems": true, + "default": [ + 429, 404, 500, 501, 502, 503, 504, 505 + ], + "minItems": 1, + "type": "array" + }, + "interval": { + "minimum": 1, + "default": 1, + "type": "integer" + }, + "http_failures": { + "minimum": 1, + "default": 5, + "maximum": 254, + "type": "integer" + }, + "tcp_failures": { + "minimum": 1, + "default": 2, + "maximum": 254, + "type": "integer" + }, + "timeouts": { + "minimum": 1, + "default": 3, + "maximum": 254, + "type": "integer" + } + }, + "type": "object" + }, + "host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + } + }, + "type": "object" + } + }, + "additionalProperties": false, + "anyOf": [ + { "required": ["active"] }, + { "required": ["active", "passive"] } + ], + "type": "object" + }, + "timeout": { + "properties": { + "send": { + "exclusiveMinimum": 0, + "type": "number" + }, + "read": { + "exclusiveMinimum": 0, + "type": "number" + }, + "connect": { + "exclusiveMinimum": 0, + "type": "number" + } + }, + "required": ["connect", "send", "read"], + "type": "object" + }, + "discovery_type": { + "type": "string", + "description": "discovery type" + }, + "labels": { + "description": "key/value pairs to specify attributes", + "patternProperties": { + ".*": { + "minLength": 1, + "maxLength": 256, + "type": "string", + "pattern": "^\\S+$", + "description": "value of label" + } + }, + "type": "object" + }, + "discovery_args": { + "properties": { + "group_name": { + "type": "string", + "description": "group name" + }, + "namespace_id": { + "type": "string", + "description": "namespace id" + } + }, + "type": "object" + }, + "key": { + "type": "string", + "description": "the key of chash for dynamic load balancing" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "desc": { "maxLength": 256, "type": "string" }, + "update_time": { "type": "integer" }, + "type": { + "default": "roundrobin", + "description": "algorithms of load balancing", + "type": "string" + }, + "upstream_host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "pass_host": { + "default": "pass", + "description": "mod of host passing", + "enum": ["pass", "node", "rewrite"], + "type": "string" + }, + "hash_on": { + "default": "vars", + "enum": [ + "vars", + "header", + "cookie", + "consumer", + "vars_combinations" + ], + "type": "string" + }, + "nodes": { + "anyOf": [ + { + "patternProperties": { + ".*": { + "minimum": 0, + "description": "weight of node", + "type": "integer" + } + }, + "type": "object" + }, + { + "items": { + "properties": { + "host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "weight": { + "minimum": 0, + "description": "weight of node", + "type": "integer" + }, + "metadata": { + "type": "object", + "description": "metadata of node" + }, + "port": { + "minimum": 1, + "description": "port of node", + "type": "integer" + }, + "priority": { + "default": 0, + "description": "priority of node", + "type": "integer" + } + }, + "required": ["host", "port", "weight"], + "type": "object" + }, + "type": "array" + } + ] + }, + "service_name": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "scheme": { + "default": "http", + "enum": [ + "grpc", + "grpcs", + "http", + "https", + "tcp", + "tls", + "udp", + "kafka" + ], + "description": "The scheme of the upstream. For L7 proxy, it can be one of grpc/grpcs/http/https. For L4 proxy, it can be one of tcp/tls/udp. For specific protocols, it can be kafka." + } + }, + "additionalProperties": false, + "oneOf": [ + { "required": ["nodes"] }, + { "required": ["service_name", "discovery_type"] } + ], + "type": "object" + }, + "weight": { + "default": 1, + "minimum": 0, + "description": "used to split traffic between differentupstreams for plugin configuration", + "type": "integer" + } + }, + "type": "object" + }, + "default": [{ "weight": 1 }], + "maxItems": 20, + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 966 + }, + "consumer-restriction": { + "version": 0.1, + "schema": { + "properties": { + "whitelist": { + "items": { "type": "string" }, + "minItems": 1, + "type": "array" + }, + "allowed_by_methods": { + "items": { + "properties": { + "methods": { + "items": { + "description": "HTTP method", + "enum": [ + "GET", + "POST", + "PUT", + "DELETE", + "PATCH", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE", + "PURGE" + ], + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "user": { "type": "string" } + }, + "type": "object" + }, + "type": "array" + }, + "rejected_msg": { "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "rejected_code": { + "minimum": 200, + "default": 403, + "type": "integer" + }, + "blacklist": { + "items": { "type": "string" }, + "minItems": 1, + "type": "array" + }, + "type": { + "default": "consumer_name", + "enum": [ + "consumer_name", + "service_id", + "route_id", + "consumer_group_id" + ], + "type": "string" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "anyOf": [ + { "required": ["blacklist"] }, + { "required": ["whitelist"] }, + { "required": ["allowed_by_methods"] } + ], + "type": "object" + }, + "priority": 2400 + }, + "echo": { + "version": 0.1, + "schema": { + "minProperties": 1, + "properties": { + "headers": { + "minProperties": 1, + "description": "new headers for response", + "type": "object" + }, + "before_body": { + "type": "string", + "description": "body before the filter phase." + }, + "body": { + "type": "string", + "description": "body to replace upstream response." + }, + "after_body": { + "type": "string", + "description": "body after the modification of filter phase." + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "anyOf": [ + { "required": ["before_body"] }, + { "required": ["body"] }, + { "required": ["after_body"] } + ], + "type": "object" + }, + "priority": 412 + }, + "cas-auth": { + "version": 0.1, + "schema": { + "properties": { + "cas_callback_uri": { "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "idp_uri": { "type": "string" }, + "logout_uri": { "type": "string" } + }, + "required": ["idp_uri", "cas_callback_uri", "logout_uri"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 2597 + }, + "openfunction": { + "version": 0.1, + "schema": { + "properties": { + "timeout": { "minimum": 100, "default": 3000, "type": "integer" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "ssl_verify": { "default": true, "type": "boolean" }, + "authorization": { "service_token": { "type": "string" } }, + "keepalive_pool": { "minimum": 1, "default": 5, "type": "integer" }, + "function_uri": { "type": "string" }, + "keepalive_timeout": { + "minimum": 1000, + "default": 60000, + "type": "integer" + }, + "keepalive": { "default": true, "type": "boolean" } + }, + "required": ["function_uri"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": -1902 + }, + "body-transformer": { + "version": 0.1, + "schema": { + "properties": { + "request": { + "properties": { + "input_format": { "enum": ["xml", "json"], "type": "string" }, + "template": { "type": "string" } + }, + "required": ["template"], + "type": "object" + }, + "response": { + "properties": { + "input_format": { "enum": ["xml", "json"], "type": "string" }, + "template": { "type": "string" } + }, + "required": ["template"], + "type": "object" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "anyOf": [ + { "required": ["request"] }, + { "required": ["response"] }, + { "required": ["request", "response"] } + ], + "type": "object" + }, + "priority": 1080 + }, + "loki-logger": { + "version": 0.1, + "schema": { + "properties": { + "keepalive_pool": { "minimum": 1, "default": 5, "type": "integer" }, + "keepalive": { "default": true, "type": "boolean" }, + "timeout": { + "minimum": 1, + "default": 3000, + "description": "timeout in milliseconds", + "type": "integer", + "maximum": 60000 + }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "include_resp_body": { "default": false, "type": "boolean" }, + "endpoint_addrs": { + "items": { + "pattern": "^[^\\/]+:\\/\\/([\\da-zA-Z.-]+|\\[[\\da-fA-F:]+\\])(:\\d+)?", + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "endpoint_uri": { + "default": "/loki/api/v1/push", + "minLength": 1, + "type": "string" + }, + "keepalive_timeout": { + "minimum": 1000, + "description": "keepalive timeout in milliseconds", + "default": 60000, + "type": "integer" + }, + "tenant_id": { "default": "fake", "type": "string" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "log_labels": { + "default": { "job": "apisix" }, + "patternProperties": { ".*": { "minLength": 1, "type": "string" } }, + "type": "object" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "name": { "default": "loki logger", "type": "string" }, + "include_resp_body_expr": { + "items": { "type": "array" }, + "minItems": 1, + "type": "array" + }, + "include_req_body": { "default": false, "type": "boolean" }, + "ssl_verify": { "default": false, "type": "boolean" }, + "include_req_body_expr": { + "items": { "type": "array" }, + "minItems": 1, + "type": "array" + }, + "log_format": { "type": "object" } + }, + "required": ["endpoint_addrs"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + }, + "priority": 414 + }, + "authz-keycloak": { + "version": 0.1, + "schema": { + "required": ["client_id"], + "allOf": [ + { + "anyOf": [ + { "required": ["discovery"] }, + { "required": ["token_endpoint"] } + ] + }, + { + "anyOf": [ + { "properties": { "lazy_load_paths": { "enum": [false] } } }, + { + "properties": { "lazy_load_paths": { "enum": [true] } }, + "anyOf": [ + { "required": ["discovery"] }, + { "required": ["resource_registration_endpoint"] } + ] + } + ] + } + ], + "properties": { + "keepalive_pool": { "minimum": 1, "default": 5, "type": "integer" }, + "keepalive": { "default": true, "type": "boolean" }, + "timeout": { "minimum": 1000, "default": 3000, "type": "integer" }, + "ssl_verify": { "default": true, "type": "boolean" }, + "discovery": { "maxLength": 4096, "minLength": 1, "type": "string" }, + "token_endpoint": { + "maxLength": 4096, + "minLength": 1, + "type": "string" + }, + "resource_registration_endpoint": { + "maxLength": 4096, + "minLength": 1, + "type": "string" + }, + "client_secret": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "grant_type": { + "minLength": 1, + "maxLength": 100, + "default": "urn:ietf:params:oauth:grant-type:uma-ticket", + "enum": ["urn:ietf:params:oauth:grant-type:uma-ticket"], + "type": "string" + }, + "policy_enforcement_mode": { + "default": "ENFORCING", + "enum": ["ENFORCING", "PERMISSIVE"], + "type": "string" + }, + "keepalive_timeout": { + "minimum": 1000, + "default": 60000, + "type": "integer" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "permissions": { + "default": {}, + "items": { "maxLength": 100, "minLength": 1, "type": "string" }, + "uniqueItems": true, + "type": "array" + }, + "lazy_load_paths": { "default": false, "type": "boolean" }, + "client_id": { "maxLength": 100, "minLength": 1, "type": "string" }, + "cache_ttl_seconds": { + "minimum": 1, + "default": 86400, + "type": "integer" + }, + "access_denied_redirect_uri": { + "maxLength": 2048, + "minLength": 1, + "type": "string" + }, + "access_token_expires_in": { + "minimum": 1, + "default": 300, + "type": "integer" + }, + "access_token_expires_leeway": { + "minimum": 0, + "default": 0, + "type": "integer" + }, + "refresh_token_expires_in": { + "minimum": 1, + "default": 3600, + "type": "integer" + }, + "refresh_token_expires_leeway": { + "minimum": 0, + "default": 0, + "type": "integer" + }, + "password_grant_token_generation_incoming_uri": { + "maxLength": 4096, + "minLength": 1, + "type": "string" + }, + "http_method_as_scope": { "default": false, "type": "boolean" } + }, + "$comment": "this is a mark for our injected plugin schema", + "encrypt_fields": ["client_secret"], + "type": "object" + }, + "priority": 2000 + }, + "client-control": { + "version": 0.1, + "schema": { + "properties": { + "max_body_size": { "minimum": 0, "type": "integer" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 22000 + }, + "openwhisk": { + "version": 0.1, + "schema": { + "properties": { + "keepalive_pool": { "minimum": 1, "default": 5, "type": "integer" }, + "action": { + "type": "string", + "pattern": "\\A([\\w]|[\\w][\\w@ .-]*[\\w@.-]+)\\z", + "maxLength": 256 + }, + "api_host": { "type": "string" }, + "keepalive": { "default": true, "type": "boolean" }, + "service_token": { "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "ssl_verify": { "default": true, "type": "boolean" }, + "keepalive_timeout": { + "minimum": 1000, + "default": 60000, + "type": "integer" + }, + "namespace": { + "type": "string", + "pattern": "\\A([\\w]|[\\w][\\w@ .-]*[\\w@.-]+)\\z", + "maxLength": 256 + }, + "result": { "default": true, "type": "boolean" }, + "package": { + "type": "string", + "pattern": "\\A([\\w]|[\\w][\\w@ .-]*[\\w@.-]+)\\z", + "maxLength": 256 + }, + "timeout": { + "minimum": 1, + "default": 3000, + "description": "timeout in milliseconds", + "type": "integer", + "maximum": 60000 + } + }, + "required": ["api_host", "service_token", "namespace", "action"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": -1901 + }, + "basic-auth": { + "consumer_schema": { + "required": ["username", "password"], + "title": "work with consumer object", + "properties": { + "username": { "type": "string" }, + "password": { "type": "string" } + }, + "encrypt_fields": ["password"], + "type": "object" + }, + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "hide_credentials": { "default": false, "type": "boolean" } + }, + "$comment": "this is a mark for our injected plugin schema", + "title": "work with route or service object", + "type": "object" + }, + "type": "auth", + "priority": 2520 + }, + "aws-lambda": { + "version": 0.1, + "schema": { + "properties": { + "timeout": { "minimum": 100, "default": 3000, "type": "integer" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "ssl_verify": { "default": true, "type": "boolean" }, + "authorization": { + "properties": { + "apikey": { "type": "string" }, + "iam": { + "properties": { + "secretkey": { + "description": "secret access key from from aws iam console", + "type": "string" + }, + "service": { + "default": "execute-api", + "description": "the service that is receiving the request", + "type": "string" + }, + "accesskey": { + "description": "access key id from from aws iam console", + "type": "string" + }, + "aws_region": { + "default": "us-east-1", + "description": "the aws region that is receiving the request", + "type": "string" + } + }, + "required": ["accesskey", "secretkey"], + "type": "object" + } + }, + "type": "object" + }, + "keepalive_pool": { "minimum": 1, "default": 5, "type": "integer" }, + "function_uri": { "type": "string" }, + "keepalive_timeout": { + "minimum": 1000, + "default": 60000, + "type": "integer" + }, + "keepalive": { "default": true, "type": "boolean" } + }, + "required": ["function_uri"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": -1899 + }, + "ai": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema" + }, + "priority": 22900, + "scope": "global" + }, + "openid-connect": { + "version": 0.2, + "schema": { + "required": ["client_id", "client_secret", "discovery"], + "properties": { + "session": { + "properties": { + "secret": { + "type": "string", + "minLength": 16, + "description": "the key used for the encrypt and HMAC calculation" + } + }, + "required": ["secret"], + "additionalProperties": false, + "type": "object" + }, + "access_token_in_authorization_header": { + "default": false, + "description": "Whether the access token should be added in the Authorization header as opposed to the X-Access-Token header.", + "type": "boolean" + }, + "set_id_token_header": { + "default": true, + "description": "Whether the ID token should be added in the X-ID-Token header to the request for downstream.", + "type": "boolean" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "timeout": { + "minimum": 1, + "description": "timeout in seconds", + "default": 3, + "type": "integer" + }, + "ssl_verify": { "default": false, "type": "boolean" }, + "introspection_endpoint": { "type": "string" }, + "discovery": { "type": "string" }, + "bearer_only": { "default": false, "type": "boolean" }, + "client_secret": { "type": "string" }, + "realm": { "default": "apisix", "type": "string" }, + "logout_path": { "default": "/logout", "type": "string" }, + "redirect_uri": { + "description": "use ngx.var.request_uri if not configured", + "type": "string" + }, + "client_id": { "type": "string" }, + "post_logout_redirect_uri": { + "description": "the URI will be redirect when request logout_path", + "type": "string" + }, + "set_refresh_token_header": { + "default": false, + "description": "Whether the refresh token should be added in the X-Refresh-Token header to the request for downstream.", + "type": "boolean" + }, + "unauth_action": { + "default": "auth", + "description": "The action performed when client is not authorized. Use auth to redirect user to identity provider, deny to respond with 401 Unauthorized, and pass to allow the request regardless.", + "enum": ["auth", "deny", "pass"], + "type": "string" + }, + "set_userinfo_header": { + "default": true, + "description": "Whether the user info token should be added in the X-Userinfo header to the request for downstream.", + "type": "boolean" + }, + "proxy_opts": { + "properties": { + "no_proxy": { + "description": "Comma separated list of hosts that should not be proxied.", + "type": "string" + }, + "https_proxy_authorization": { + "description": "Basic [base64 username:password].", + "type": "string" + }, + "http_proxy_authorization": { + "description": "Basic [base64 username:password].", + "type": "string" + }, + "http_proxy": { + "description": "HTTP proxy like: http://proxy-server:80.", + "type": "string" + }, + "https_proxy": { + "description": "HTTPS proxy like: http://proxy-server:80.", + "type": "string" + } + }, + "description": "HTTP proxy server be used to access identity server.", + "type": "object" + }, + "scope": { "default": "openid", "type": "string" }, + "public_key": { "type": "string" }, + "token_signing_alg_values_expected": { "type": "string" }, + "use_pkce": { + "default": false, + "description": "when set to true the PKEC(Proof Key for Code Exchange) will be used.", + "type": "boolean" + }, + "introspection_endpoint_auth_method": { + "default": "client_secret_basic", + "type": "string" + }, + "set_access_token_header": { + "default": true, + "description": "Whether the access token should be added as a header to the request for downstream", + "type": "boolean" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "encrypt_fields": ["client_secret"], + "type": "object" + }, + "priority": 2599 + }, + "udp-logger": { + "version": 0.1, + "schema": { + "properties": { + "host": { "type": "string" }, + "name": { "default": "udp logger", "type": "string" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "timeout": { "minimum": 1, "default": 3, "type": "integer" }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "include_req_body": { "default": false, "type": "boolean" }, + "port": { "minimum": 0, "type": "integer" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "log_format": { "type": "object" } + }, + "required": ["host", "port"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 400, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + } + }, + "limit-req": { + "version": 0.1, + "schema": { + "properties": { + "key": { "type": "string" }, + "rejected_code": { + "minimum": 200, + "default": 503, + "maximum": 599, + "type": "integer" + }, + "rejected_msg": { "minLength": 1, "type": "string" }, + "nodelay": { "default": false, "type": "boolean" }, + "burst": { "minimum": 0, "type": "number" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "key_type": { + "default": "var", + "enum": ["var", "var_combination"], + "type": "string" + }, + "allow_degradation": { "default": false, "type": "boolean" }, + "rate": { "exclusiveMinimum": 0, "type": "number" } + }, + "required": ["rate", "burst", "key"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 1001 + }, + "ldap-auth": { + "consumer_schema": { + "properties": { "user_dn": { "type": "string" } }, + "required": ["user_dn"], + "title": "work with consumer object", + "type": "object" + }, + "version": 0.1, + "schema": { + "required": ["base_dn", "ldap_uri"], + "title": "work with route or service object", + "properties": { + "base_dn": { "type": "string" }, + "ldap_uri": { "type": "string" }, + "use_tls": { "default": false, "type": "boolean" }, + "uid": { "default": "cn", "type": "string" }, + "tls_verify": { "default": false, "type": "boolean" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "type": "auth", + "priority": 2540 + }, + "splunk-hec-logging": { + "version": 0.1, + "schema": { + "properties": { + "name": { "default": "splunk-hec-logging", "type": "string" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "ssl_verify": { "default": true, "type": "boolean" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "endpoint": { + "properties": { + "timeout": { "minimum": 1, "default": 10, "type": "integer" }, + "token": { "type": "string" }, + "channel": { "type": "string" }, + "uri": { + "pattern": "^[^\\/]+:\\/\\/([\\da-zA-Z.-]+|\\[[\\da-fA-F:]+\\])(:\\d+)?", + "type": "string" + } + }, + "required": ["uri", "token"], + "type": "object" + }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "log_format": { "type": "object" } + }, + "required": ["endpoint"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 409, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + } + }, + "ext-plugin-post-req": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "allow_degradation": { "default": false, "type": "boolean" }, + "conf": { + "items": { + "properties": { + "value": { "type": "string" }, + "name": { "type": "string", "minLength": 1, "maxLength": 128 } + }, + "required": ["name", "value"], + "type": "object" + }, + "minItems": 1, + "type": "array" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": -3000 + }, + "google-cloud-logging": { + "version": 0.1, + "schema": { + "oneOf": [ + { "required": ["auth_config"] }, + { "required": ["auth_file"] } + ], + "properties": { + "name": { "default": "google-cloud-logging", "type": "string" }, + "resource": { + "properties": { + "labels": { "type": "object" }, + "type": { "type": "string" } + }, + "required": ["type"], + "default": { "type": "global" }, + "type": "object" + }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "ssl_verify": { "default": true, "type": "boolean" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "auth_config": { + "properties": { + "client_email": { "type": "string" }, + "private_key": { "type": "string" }, + "project_id": { "type": "string" }, + "token_uri": { + "default": "https://oauth2.googleapis.com/token", + "type": "string" + }, + "scopes": { + "items": { + "type": "string", + "description": "Google OAuth2 Authorization Scopes" + }, + "uniqueItems": true, + "default": [ + "https://www.googleapis.com/auth/logging.read", + "https://www.googleapis.com/auth/logging.write", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/cloud-platform" + ], + "minItems": 1, + "type": "array" + }, + "entries_uri": { + "default": "https://logging.googleapis.com/v2/entries:write", + "type": "string" + } + }, + "required": [ + "client_email", + "private_key", + "project_id", + "token_uri" + ], + "type": "object" + }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "auth_file": { "type": "string" }, + "log_id": { "default": "apisix.apache.org%2Flogs", "type": "string" }, + "log_format": { "type": "object" } + }, + "$comment": "this is a mark for our injected plugin schema", + "encrypt_fields": ["auth_config.private_key"], + "type": "object" + }, + "priority": 407, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + } + }, + "ext-plugin-pre-req": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "allow_degradation": { "default": false, "type": "boolean" }, + "conf": { + "items": { + "properties": { + "value": { "type": "string" }, + "name": { "type": "string", "minLength": 1, "maxLength": 128 } + }, + "required": ["name", "value"], + "type": "object" + }, + "minItems": 1, + "type": "array" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 12000 + }, + "clickhouse-logger": { + "version": 0.1, + "schema": { + "oneOf": [ + { + "required": [ + "endpoint_addr", + "user", + "password", + "database", + "logtable" + ] + }, + { + "required": [ + "endpoint_addrs", + "user", + "password", + "database", + "logtable" + ] + } + ], + "properties": { + "password": { "default": "", "type": "string" }, + "user": { "default": "", "type": "string" }, + "timeout": { "minimum": 1, "default": 3, "type": "integer" }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "include_resp_body": { "default": false, "type": "boolean" }, + "endpoint_addr": { + "pattern": "^[^\\/]+:\\/\\/([\\da-zA-Z.-]+|\\[[\\da-fA-F:]+\\])(:\\d+)?", + "type": "string" + }, + "endpoint_addrs": { + "items": { + "pattern": "^[^\\/]+:\\/\\/([\\da-zA-Z.-]+|\\[[\\da-fA-F:]+\\])(:\\d+)?", + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "name": { "default": "clickhouse-logger", "type": "string" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "database": { "default": "", "type": "string" }, + "logtable": { "default": "", "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "include_resp_body_expr": { + "items": { "type": "array" }, + "minItems": 1, + "type": "array" + }, + "include_req_body": { "default": false, "type": "boolean" }, + "ssl_verify": { "default": true, "type": "boolean" }, + "include_req_body_expr": { + "items": { "type": "array" }, + "minItems": 1, + "type": "array" + }, + "log_format": { "type": "object" } + }, + "$comment": "this is a mark for our injected plugin schema", + "encrypt_fields": ["password"], + "type": "object" + }, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + }, + "priority": 398 + }, + "request-validation": { + "version": 0.1, + "schema": { + "properties": { + "body_schema": { "type": "object" }, + "rejected_code": { + "minimum": 200, + "default": 400, + "maximum": 599, + "type": "integer" + }, + "rejected_msg": { + "maxLength": 256, + "minLength": 1, + "type": "string" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "header_schema": { "type": "object" } + }, + "$comment": "this is a mark for our injected plugin schema", + "anyOf": [ + { "required": ["header_schema"] }, + { "required": ["body_schema"] } + ], + "type": "object" + }, + "type": "validation", + "priority": 2800 + }, + "key-auth": { + "consumer_schema": { + "properties": { "key": { "type": "string" } }, + "required": ["key"], + "encrypt_fields": ["key"], + "type": "object" + }, + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "hide_credentials": { "default": false, "type": "boolean" }, + "query": { "default": "apikey", "type": "string" }, + "header": { "default": "apikey", "type": "string" } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "type": "auth", + "priority": 2500 + }, + "authz-casdoor": { + "version": 0.1, + "schema": { + "required": [ + "callback_url", + "endpoint_addr", + "client_id", + "client_secret" + ], + "properties": { + "callback_url": { "pattern": "^[^%?]+[^/]$", "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "client_id": { "type": "string" }, + "endpoint_addr": { "pattern": "^[^%?]+[^/]$", "type": "string" }, + "client_secret": { "type": "string" } + }, + "$comment": "this is a mark for our injected plugin schema", + "encrypt_fields": ["client_secret"], + "type": "object" + }, + "priority": 2559 + }, + "forward-auth": { + "version": 0.1, + "schema": { + "properties": { + "upstream_headers": { + "default": {}, + "items": { "type": "string" }, + "description": "authorization response header that will be sent to the upstream", + "type": "array" + }, + "keepalive_timeout": { + "minimum": 1000, + "default": 60000, + "type": "integer" + }, + "client_headers": { + "default": {}, + "items": { "type": "string" }, + "description": "authorization response header that will be sent tothe client when authorizing failed", + "type": "array" + }, + "keepalive": { "default": true, "type": "boolean" }, + "timeout": { + "minimum": 1, + "default": 3000, + "description": "timeout in milliseconds", + "type": "integer", + "maximum": 60000 + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "ssl_verify": { "default": true, "type": "boolean" }, + "uri": { "type": "string" }, + "keepalive_pool": { "minimum": 1, "default": 5, "type": "integer" }, + "request_headers": { + "default": {}, + "items": { "type": "string" }, + "description": "client request header that will be sent to the authorization service", + "type": "array" + }, + "allow_degradation": { "default": false, "type": "boolean" }, + "request_method": { + "default": "GET", + "description": "the method for client to request the authorization service", + "enum": ["GET", "POST"], + "type": "string" + } + }, + "required": ["uri"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 2002 + }, + "public-api": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "uri": { "type": "string" } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 501 + }, + "workflow": { + "version": 0.1, + "schema": { + "properties": { + "rules": { + "items": { + "properties": { + "actions": { + "items": { "minItems": 1, "type": "array" }, + "type": "array" + }, + "case": { + "items": { + "anyOf": [{ "type": "array" }, { "type": "string" }] + }, + "minItems": 1, + "type": "array" + } + }, + "required": ["case", "actions"], + "type": "object" + }, + "type": "array" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "required": ["rules"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 1006 + }, + "csrf": { + "version": 0.1, + "schema": { + "required": ["key"], + "properties": { + "key": { + "type": "string", + "description": "use to generate csrf token" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "expires": { + "default": 7200, + "description": "expires time(s) for csrf token", + "type": "integer" + }, + "name": { + "default": "apisix-csrf-token", + "description": "the csrf token name", + "type": "string" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "encrypt_fields": ["key"], + "type": "object" + }, + "priority": 2980 + }, + "rocketmq-logger": { + "version": 0.1, + "schema": { + "required": ["nameserver_list", "topic"], + "properties": { + "secret_key": { "default": "", "type": "string" }, + "meta_format": { + "default": "default", + "enum": ["default", "origin"], + "type": "string" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "timeout": { "minimum": 1, "default": 3, "type": "integer" }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "include_resp_body": { "default": false, "type": "boolean" }, + "key": { "type": "string" }, + "name": { "default": "rocketmq logger", "type": "string" }, + "nameserver_list": { + "items": { "type": "string" }, + "minItems": 1, + "type": "array" + }, + "access_key": { "default": "", "type": "string" }, + "tag": { "type": "string" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "use_tls": { "default": false, "type": "boolean" }, + "topic": { "type": "string" }, + "include_req_body": { "default": false, "type": "boolean" }, + "include_resp_body_expr": { + "items": { "type": "array" }, + "minItems": 1, + "type": "array" + }, + "include_req_body_expr": { + "items": { "type": "array" }, + "minItems": 1, + "type": "array" + }, + "log_format": { "type": "object" } + }, + "$comment": "this is a mark for our injected plugin schema", + "encrypt_fields": ["secret_key"], + "type": "object" + }, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + }, + "priority": 402 + }, + "mocking": { + "version": 0.1, + "schema": { + "properties": { + "delay": { "default": 0, "type": "integer" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "response_headers": { + "type": "object", + "patternProperties": { + "^[^:]+$": { + "oneOf": [{ "type": "string" }, { "type": "number" }] + } + }, + "minProperties": 1 + }, + "response_status": { + "default": 200, + "minimum": 100, + "type": "integer" + }, + "content_type": { + "default": "application/json;charset=utf8", + "type": "string" + }, + "response_example": { "type": "string" }, + "response_schema": { "type": "object" }, + "with_mock_header": { "default": true, "type": "boolean" } + }, + "$comment": "this is a mark for our injected plugin schema", + "anyOf": [ + { "required": ["response_example"] }, + { "required": ["response_schema"] } + ], + "type": "object" + }, + "priority": 10900 + }, + "ip-restriction": { + "version": 0.1, + "schema": { + "properties": { + "message": { + "default": "Your IP address is not allowed", + "maxLength": 1024, + "minLength": 1, + "type": "string" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "whitelist": { + "items": { + "anyOf": [ + { "format": "ipv4", "title": "IPv4", "type": "string" }, + { + "pattern": "^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([12]?[0-9]|3[0-2])$", + "title": "IPv4/CIDR", + "type": "string" + }, + { "format": "ipv6", "title": "IPv6", "type": "string" }, + { + "pattern": "^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$", + "title": "IPv6/CIDR", + "type": "string" + } + ] + }, + "minItems": 1, + "type": "array" + }, + "blacklist": { + "items": { + "anyOf": [ + { "format": "ipv4", "title": "IPv4", "type": "string" }, + { + "pattern": "^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([12]?[0-9]|3[0-2])$", + "title": "IPv4/CIDR", + "type": "string" + }, + { "format": "ipv6", "title": "IPv6", "type": "string" }, + { + "pattern": "^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$", + "title": "IPv6/CIDR", + "type": "string" + } + ] + }, + "minItems": 1, + "type": "array" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "oneOf": [{ "required": ["whitelist"] }, { "required": ["blacklist"] }], + "type": "object" + }, + "priority": 3000 + }, + "proxy-cache": { + "version": 0.2, + "schema": { + "properties": { + "cache_http_status": { + "items": { + "minimum": 200, + "maximum": 599, + "description": "http response status", + "type": "integer" + }, + "uniqueItems": true, + "default": [200, 301, 404], + "minItems": 1, + "type": "array" + }, + "cache_ttl": { "minimum": 1, "default": 300, "type": "integer" }, + "cache_method": { + "items": { + "description": "supported http method", + "enum": ["GET", "POST", "HEAD"], + "type": "string" + }, + "uniqueItems": true, + "default": ["GET", "HEAD"], + "minItems": 1, + "type": "array" + }, + "hide_cache_headers": { "default": false, "type": "boolean" }, + "cache_control": { "default": false, "type": "boolean" }, + "cache_bypass": { + "items": { + "pattern": "(^[^\\$].+$|^\\$[0-9a-zA-Z_]+$)", + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "no_cache": { + "items": { + "pattern": "(^[^\\$].+$|^\\$[0-9a-zA-Z_]+$)", + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "cache_zone": { + "default": "disk_cache_one", + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "cache_strategy": { + "default": "disk", + "enum": ["disk", "memory"], + "type": "string" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "cache_key": { + "default": ["$host", "$request_uri"], + "items": { + "description": "a key for caching", + "pattern": "(^[^\\$].+$|^\\$[0-9a-zA-Z_]+$)", + "type": "string" + }, + "minItems": 1, + "type": "array" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 1085 + }, + "proxy-rewrite": { + "version": 0.1, + "schema": { + "properties": { + "host": { + "description": "new host for upstream", + "pattern": "^[0-9a-zA-Z-.]+(:\\d{1,5})?$", + "type": "string" + }, + "method": { + "description": "proxy route method", + "enum": [ + "OPTIONS", + "PROPFIND", + "LOCK", + "UNLOCK", + "PATCH", + "TRACE", + "GET", + "HEAD", + "POST", + "PUT", + "DELETE", + "MKCOL", + "COPY", + "MOVE" + ], + "type": "string" + }, + "uri": { + "minLength": 1, + "maxLength": 4096, + "type": "string", + "pattern": "^\\/.*", + "description": "new uri for upstream" + }, + "use_real_request_uri_unsafe": { + "default": false, + "description": "use real_request_uri instead, THIS IS VERY UNSAFE.", + "type": "boolean" + }, + "regex_uri": { + "description": "new uri that substitute from client uri for upstream, lower priority than uri property", + "items": { "type": "string", "description": "regex uri" }, + "minItems": 2, + "type": "array" + }, + "headers": { + "oneOf": [ + { + "properties": { + "add": { + "type": "object", + "patternProperties": { + "^[^:]+$": { + "oneOf": [{ "type": "string" }, { "type": "number" }] + } + }, + "minProperties": 1 + }, + "remove": { + "items": { "pattern": "^[^:]+$", "type": "string" }, + "minItems": 1, + "type": "array" + }, + "set": { + "type": "object", + "patternProperties": { + "^[^:]+$": { + "oneOf": [{ "type": "string" }, { "type": "number" }] + } + }, + "minProperties": 1 + } + }, + "additionalProperties": false, + "type": "object", + "minProperties": 1 + }, + { + "type": "object", + "patternProperties": { + "^[^:]+$": { + "oneOf": [{ "type": "string" }, { "type": "number" }] + } + }, + "minProperties": 1 + } + ], + "description": "new headers for request" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "minProperties": 1, + "type": "object" + }, + "priority": 1008 + }, + "tcp-logger": { + "version": 0.1, + "schema": { + "properties": { + "tls_options": { "type": "string" }, + "host": { "type": "string" }, + "name": { "default": "tcp logger", "type": "string" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "tls": { "default": false, "type": "boolean" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "timeout": { "minimum": 1, "default": 1000, "type": "integer" }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "include_req_body": { "default": false, "type": "boolean" }, + "port": { "minimum": 0, "type": "integer" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "log_format": { "type": "object" } + }, + "required": ["host", "port"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 405, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + } + }, + "fault-injection": { + "version": 0.1, + "schema": { + "properties": { + "delay": { + "properties": { + "percentage": { "minimum": 0, "maximum": 100, "type": "integer" }, + "duration": { "minimum": 0, "type": "number" }, + "vars": { + "maxItems": 20, + "items": { "type": "array" }, + "type": "array" + } + }, + "required": ["duration"], + "type": "object" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "abort": { + "properties": { + "headers": { + "type": "object", + "patternProperties": { + "^[^:]+$": { + "oneOf": [{ "type": "string" }, { "type": "number" }] + } + }, + "minProperties": 1 + }, + "percentage": { "minimum": 0, "maximum": 100, "type": "integer" }, + "vars": { + "maxItems": 20, + "items": { "type": "array" }, + "type": "array" + }, + "body": { "minLength": 0, "type": "string" }, + "http_status": { "minimum": 200, "type": "integer" } + }, + "required": ["http_status"], + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "minProperties": 1, + "type": "object" + }, + "priority": 11000 + }, + "api-breaker": { + "version": 0.1, + "schema": { + "properties": { + "break_response_code": { + "minimum": 200, + "maximum": 599, + "type": "integer" + }, + "break_response_body": { "type": "string" }, + "break_response_headers": { + "items": { + "properties": { + "key": { "minLength": 1, "type": "string" }, + "value": { "minLength": 1, "type": "string" } + }, + "required": ["key", "value"], + "type": "object" + }, + "type": "array" + }, + "max_breaker_sec": { + "minimum": 3, + "default": 300, + "type": "integer" + }, + "unhealthy": { + "properties": { + "failures": { "minimum": 1, "default": 3, "type": "integer" }, + "http_statuses": { + "items": { "minimum": 500, "maximum": 599, "type": "integer" }, + "uniqueItems": true, + "default": [500], + "minItems": 1, + "type": "array" + } + }, + "default": { "failures": 3, "http_statuses": [500] }, + "type": "object" + }, + "healthy": { + "properties": { + "successes": { "minimum": 1, "default": 3, "type": "integer" }, + "http_statuses": { + "items": { "minimum": 200, "maximum": 499, "type": "integer" }, + "uniqueItems": true, + "default": [200], + "minItems": 1, + "type": "array" + } + }, + "default": { "successes": 3, "http_statuses": [200] }, + "type": "object" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "required": ["break_response_code"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 1005 + }, + "http-logger": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "name": { "default": "http logger", "type": "string" }, + "auth_header": { "type": "string" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "concat_method": { + "default": "json", + "enum": ["json", "new_line"], + "type": "string" + }, + "timeout": { "minimum": 1, "default": 3, "type": "integer" }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "include_resp_body_expr": { + "items": { "type": "array" }, + "minItems": 1, + "type": "array" + }, + "uri": { + "pattern": "^[^\\/]+:\\/\\/([\\da-zA-Z.-]+|\\[[\\da-fA-F:]+\\])(:\\d+)?", + "type": "string" + }, + "include_req_body": { "default": false, "type": "boolean" }, + "include_resp_body": { "default": false, "type": "boolean" }, + "ssl_verify": { "default": false, "type": "boolean" }, + "log_format": { "type": "object" } + }, + "required": ["uri"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + }, + "priority": 410 + }, + "grpc-transcode": { + "version": 0.1, + "schema": { + "additionalProperties": true, + "properties": { + "service": { + "type": "string", + "description": "the grpc service name" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "method": { + "type": "string", + "description": "the method name in the grpc service." + }, + "show_status_in_body": { + "default": false, + "description": "show decoded grpc-status-details-bin in response body", + "type": "boolean" + }, + "pb_option": { + "default": [ + "enum_as_name", + "int64_as_number", + "auto_default_values", + "disable_hooks" + ], + "items": { + "anyOf": [ + { + "description": "enum as result", + "enum": [ + "int64_as_number", + "int64_as_string", + "int64_as_hexstring" + ], + "type": "string" + }, + { + "description": "int64 as result", + "enum": ["enum_as_name", "enum_as_value"], + "type": "string" + }, + { + "description": "default values option", + "enum": [ + "auto_default_values", + "no_default_values", + "use_default_values", + "use_default_metatable" + ], + "type": "string" + }, + { + "description": "hooks option", + "enum": ["enable_hooks", "disable_hooks"], + "type": "string" + } + ], + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "status_detail_type": { + "type": "string", + "description": "the message type of the grpc-status-details-bin's details part, if not given, the details part will not be decoded" + }, + "deadline": { + "default": 0, + "description": "deadline for grpc, millisecond", + "type": "number" + }, + "proto_id": { + "anyOf": [ + { + "pattern": "^[a-zA-Z0-9-_.]+$", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + { "minimum": 1, "type": "integer" } + ] + } + }, + "$comment": "this is a mark for our injected plugin schema", + "required": ["proto_id", "service", "method"], + "type": "object" + }, + "priority": 506 + }, + "referer-restriction": { + "version": 0.1, + "schema": { + "properties": { + "message": { + "default": "Your referer host is not allowed", + "maxLength": 1024, + "minLength": 1, + "type": "string" + }, + "bypass_missing": { "default": false, "type": "boolean" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "whitelist": { + "items": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "blacklist": { + "items": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:]+$", + "type": "string" + }, + "minItems": 1, + "type": "array" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "oneOf": [{ "required": ["whitelist"] }, { "required": ["blacklist"] }], + "type": "object" + }, + "priority": 2990 + }, + "azure-functions": { + "version": 0.1, + "schema": { + "properties": { + "timeout": { "minimum": 100, "default": 3000, "type": "integer" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "ssl_verify": { "default": true, "type": "boolean" }, + "authorization": { + "properties": { + "apikey": { "type": "string" }, + "clientid": { "type": "string" } + }, + "type": "object" + }, + "keepalive_pool": { "minimum": 1, "default": 5, "type": "integer" }, + "function_uri": { "type": "string" }, + "keepalive_timeout": { + "minimum": 1000, + "default": 60000, + "type": "integer" + }, + "keepalive": { "default": true, "type": "boolean" } + }, + "required": ["function_uri"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": -1900, + "metadata_schema": { + "properties": { + "master_apikey": { "default": "", "type": "string" }, + "master_clientid": { "default": "", "type": "string" } + }, + "type": "object" + } + }, + "gzip": { + "version": 0.1, + "schema": { + "properties": { + "min_length": { "minimum": 1, "default": 20, "type": "integer" }, + "comp_level": { + "minimum": 1, + "default": 1, + "maximum": 9, + "type": "integer" + }, + "vary": { "type": "boolean" }, + "types": { + "anyOf": [ + { + "items": { "minLength": 1, "type": "string" }, + "minItems": 1, + "type": "array" + }, + { "enum": ["*"] } + ], + "default": ["text/html"] + }, + "http_version": { "enum": [1.1, 1], "default": 1.1 }, + "buffers": { + "properties": { + "number": { "minimum": 1, "default": 32, "type": "integer" }, + "size": { "minimum": 1, "default": 4096, "type": "integer" } + }, + "default": { "number": 32, "size": 4096 }, + "type": "object" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 995 + }, + "server-info": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 990, + "scope": "global" + }, + "degraphql": { + "version": 0.1, + "schema": { + "properties": { + "operation_name": { + "maxLength": 1024, + "minLength": 1, + "type": "string" + }, + "variables": { + "items": { "type": "string" }, + "minItems": 1, + "type": "array" + }, + "query": { "maxLength": 1024, "minLength": 1, "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "required": ["query"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 509 + }, + "authz-casbin": { + "version": 0.1, + "schema": { + "properties": { + "model_path": { "type": "string" }, + "policy_path": { "type": "string" }, + "model": { "type": "string" }, + "policy": { "type": "string" }, + "username": { "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "oneOf": [ + { "required": ["model_path", "policy_path", "username"] }, + { "required": ["model", "policy", "username"] } + ], + "type": "object" + }, + "priority": 2560, + "metadata_schema": { + "properties": { + "model": { "type": "string" }, + "policy": { "type": "string" } + }, + "required": ["model", "policy"], + "type": "object" + } + }, + "proxy-mirror": { + "version": 0.1, + "schema": { + "properties": { + "host": { + "pattern": "^(http(s)?|grpc(s)?):\\/\\/([\\da-zA-Z.-]+|\\[[\\da-fA-F:]+\\])(:\\d+)?$", + "type": "string" + }, + "path_concat_mode": { + "default": "replace", + "description": "the concatenation mode for custom path", + "enum": ["replace", "prefix"], + "type": "string" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "sample_ratio": { + "minimum": 1e-5, + "default": 1, + "maximum": 1, + "type": "number" + }, + "path": { "pattern": "^/[^?&]+$", "type": "string" } + }, + "required": ["host"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 1010 + }, + "limit-count": { + "version": 0.4, + "schema": { + "required": ["count", "time_window"], + "else": { + "then": { + "properties": { + "redis_cluster_name": { "type": "string" }, + "redis_password": { "minLength": 0, "type": "string" }, + "redis_cluster_ssl_verify": { + "default": false, + "type": "boolean" + }, + "redis_timeout": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "redis_cluster_ssl": { "default": false, "type": "boolean" }, + "redis_cluster_nodes": { + "items": { "maxLength": 100, "minLength": 2, "type": "string" }, + "minItems": 2, + "type": "array" + } + }, + "required": ["redis_cluster_nodes", "redis_cluster_name"] + }, + "if": { "properties": { "policy": { "enum": ["redis-cluster"] } } } + }, + "if": { "properties": { "policy": { "enum": ["redis"] } } }, + "properties": { + "key": { "default": "remote_addr", "type": "string" }, + "rejected_code": { + "minimum": 200, + "default": 503, + "maximum": 599, + "type": "integer" + }, + "rejected_msg": { "minLength": 1, "type": "string" }, + "time_window": { "exclusiveMinimum": 0, "type": "integer" }, + "show_limit_quota_header": { "default": true, "type": "boolean" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "key_type": { + "default": "var", + "enum": ["var", "var_combination", "constant"], + "type": "string" + }, + "allow_degradation": { "default": false, "type": "boolean" }, + "count": { "exclusiveMinimum": 0, "type": "integer" }, + "group": { "type": "string" }, + "policy": { + "default": "local", + "enum": ["local", "redis", "redis-cluster"], + "type": "string" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "then": { + "properties": { + "redis_username": { "minLength": 1, "type": "string" }, + "redis_password": { "minLength": 0, "type": "string" }, + "redis_database": { "minimum": 0, "default": 0, "type": "integer" }, + "redis_timeout": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "redis_ssl": { "default": false, "type": "boolean" }, + "redis_ssl_verify": { "default": false, "type": "boolean" }, + "redis_host": { "minLength": 2, "type": "string" }, + "redis_port": { "minimum": 1, "default": 6379, "type": "integer" } + }, + "required": ["redis_host"] + }, + "type": "object" + }, + "priority": 1002 + }, + "kafka-proxy": { + "version": 0.1, + "schema": { + "properties": { + "sasl": { + "properties": { + "username": { "type": "string" }, + "password": { "type": "string" } + }, + "required": ["username", "password"], + "type": "object" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "encrypt_fields": ["sasl.password"], + "type": "object" + }, + "priority": 508 + }, + "serverless-pre-function": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "phase": { + "default": "access", + "enum": [ + "rewrite", + "access", + "header_filter", + "body_filter", + "log", + "before_proxy" + ], + "type": "string" + }, + "functions": { + "items": { "type": "string" }, + "minItems": 1, + "type": "array" + } + }, + "required": ["functions"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 10000 + }, + "request-id": { + "version": 0.1, + "schema": { + "properties": { + "include_in_response": { "default": true, "type": "boolean" }, + "algorithm": { + "default": "uuid", + "enum": ["uuid", "nanoid", "range_id"], + "type": "string" + }, + "range_id": { + "properties": { + "char_set": { + "default": "abcdefghijklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ0123456789", + "minLength": 6, + "type": "string" + }, + "length": { "minimum": 6, "default": 16, "type": "integer" } + }, + "default": {}, + "type": "object" + }, + "header_name": { "default": "X-Request-Id", "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 12015 + }, + "ext-plugin-post-resp": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "allow_degradation": { "default": false, "type": "boolean" }, + "conf": { + "items": { + "properties": { + "value": { "type": "string" }, + "name": { "type": "string", "minLength": 1, "maxLength": 128 } + }, + "required": ["name", "value"], + "type": "object" + }, + "minItems": 1, + "type": "array" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": -4000 + }, + "chaitin-waf": { + "version": 0.1, + "schema": { + "properties": { + "append_waf_debug_header": { "default": false, "type": "boolean" }, + "match": { + "items": { + "properties": { "vars": { "type": "array" } }, + "type": "object" + }, + "type": "array" + }, + "config": { + "properties": { + "req_body_size": { "type": "integer" }, + "read_timeout": { "type": "integer" }, + "keepalive_timeout": { "type": "integer" }, + "send_timeout": { "type": "integer" }, + "keepalive_size": { "type": "integer" }, + "connect_timeout": { "type": "integer" } + }, + "type": "object" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "append_waf_resp_header": { "default": true, "type": "boolean" } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "metadata_schema": { + "properties": { + "nodes": { + "items": { + "properties": { + "port": { "minimum": 1, "default": 80, "type": "integer" }, + "host": { + "pattern": "^\\*?[0-9a-zA-Z-._\\[\\]:/]+$", + "type": "string" + } + }, + "required": ["host"], + "type": "object" + }, + "minItems": 1, + "type": "array" + }, + "config": { + "properties": { + "req_body_size": { "default": 1024, "type": "integer" }, + "read_timeout": { "default": 1000, "type": "integer" }, + "keepalive_timeout": { "default": 60000, "type": "integer" }, + "send_timeout": { "default": 1000, "type": "integer" }, + "keepalive_size": { "default": 256, "type": "integer" }, + "connect_timeout": { "default": 1000, "type": "integer" } + }, + "default": {}, + "type": "object" + } + }, + "required": ["nodes"], + "type": "object" + }, + "priority": 2700 + }, + "file-logger": { + "version": 0.1, + "schema": { + "properties": { + "include_resp_body_expr": { + "items": { "type": "array" }, + "minItems": 1, + "type": "array" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "match": { + "maxItems": 20, + "items": { "type": "array" }, + "type": "array" + }, + "include_resp_body": { "default": false, "type": "boolean" }, + "log_format": { "type": "object" }, + "path": { "type": "string" } + }, + "required": ["path"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + }, + "priority": 399 + }, + "jwt-auth": { + "consumer_schema": { + "required": ["key"], + "properties": { + "key": { "type": "string" }, + "algorithm": { + "default": "HS256", + "enum": ["HS256", "HS512", "RS256", "ES256"], + "type": "string" + }, + "base64_secret": { "default": false, "type": "boolean" }, + "exp": { "minimum": 1, "default": 86400, "type": "integer" }, + "secret": { "type": "string" }, + "lifetime_grace_period": { + "minimum": 0, + "default": 0, + "type": "integer" + } + }, + "dependencies": { + "algorithm": { + "oneOf": [ + { + "properties": { + "algorithm": { + "enum": ["HS256", "HS512"], + "default": "HS256" + } + } + }, + { + "properties": { + "private_key": { "type": "string" }, + "algorithm": { "enum": ["RS256", "ES256"] }, + "public_key": { "type": "string" } + }, + "required": ["public_key", "private_key"] + } + ] + } + }, + "encrypt_fields": ["secret", "private_key"], + "type": "object" + }, + "version": 0.1, + "schema": { + "properties": { + "header": { "default": "authorization", "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "query": { "default": "jwt", "type": "string" }, + "cookie": { "default": "jwt", "type": "string" }, + "hide_credentials": { "default": false, "type": "boolean" } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "type": "auth", + "priority": 2510 + }, + "tencent-cloud-cls": { + "version": 0.1, + "schema": { + "required": ["cls_host", "cls_topic", "secret_id", "secret_key"], + "properties": { + "secret_key": { "type": "string" }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "name": { "default": "tencent-cloud-cls", "type": "string" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "global_tag": { "type": "object" }, + "cls_host": { "type": "string" }, + "cls_topic": { "type": "string" }, + "secret_id": { "type": "string" }, + "include_req_body": { "default": false, "type": "boolean" }, + "include_resp_body": { "default": false, "type": "boolean" }, + "sample_ratio": { + "minimum": 1e-5, + "default": 1, + "maximum": 1, + "type": "number" + }, + "log_format": { "type": "object" } + }, + "$comment": "this is a mark for our injected plugin schema", + "encrypt_fields": ["secret_key"], + "type": "object" + }, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + }, + "priority": 397 + }, + "inspect": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 200 + }, + "sls-logger": { + "version": 0.1, + "schema": { + "required": [ + "host", + "port", + "project", + "logstore", + "access_key_id", + "access_key_secret" + ], + "properties": { + "project": { "type": "string" }, + "host": { "type": "string" }, + "access_key_id": { "type": "string" }, + "access_key_secret": { "type": "string" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "name": { "default": "sls-logger", "type": "string" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "timeout": { "minimum": 1, "default": 5000, "type": "integer" }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "include_req_body": { "default": false, "type": "boolean" }, + "port": { "type": "integer" }, + "logstore": { "type": "string" }, + "log_format": { "type": "object" } + }, + "$comment": "this is a mark for our injected plugin schema", + "encrypt_fields": ["access_key_secret"], + "type": "object" + }, + "priority": 406 + }, + "syslog": { + "version": 0.1, + "schema": { + "properties": { + "host": { "type": "string" }, + "tls": { "default": false, "type": "boolean" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "timeout": { "minimum": 1, "default": 3000, "type": "integer" }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "port": { "type": "integer" }, + "name": { "default": "sys logger", "type": "string" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "flush_limit": { "minimum": 1, "default": 4096, "type": "integer" }, + "drop_limit": { "default": 1048576, "type": "integer" }, + "include_req_body": { "default": false, "type": "boolean" }, + "sock_type": { + "default": "tcp", + "enum": ["tcp", "udp"], + "type": "string" + }, + "pool_size": { "minimum": 5, "default": 5, "type": "integer" }, + "log_format": { "type": "object" } + }, + "required": ["host", "port"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + }, + "priority": 401 + }, + "serverless-post-function": { + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "phase": { + "default": "access", + "enum": [ + "rewrite", + "access", + "header_filter", + "body_filter", + "log", + "before_proxy" + ], + "type": "string" + }, + "functions": { + "items": { "type": "string" }, + "minItems": 1, + "type": "array" + } + }, + "required": ["functions"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": -2000 + }, + "hmac-auth": { + "consumer_schema": { + "required": ["access_key", "secret_key"], + "title": "work with consumer object", + "properties": { + "secret_key": { "maxLength": 256, "minLength": 1, "type": "string" }, + "clock_skew": { "default": 0, "type": "integer" }, + "signed_headers": { + "items": { "maxLength": 50, "minLength": 1, "type": "string" }, + "type": "array" + }, + "keep_headers": { + "default": false, + "title": "whether to keep the http request header", + "type": "boolean" + }, + "algorithm": { + "default": "hmac-sha256", + "enum": ["hmac-sha1", "hmac-sha256", "hmac-sha512"], + "type": "string" + }, + "validate_request_body": { + "default": false, + "title": "A boolean value telling the plugin to enable body validation", + "type": "boolean" + }, + "max_req_body": { + "default": 524288, + "title": "Max request body size", + "type": "integer" + }, + "access_key": { "maxLength": 256, "minLength": 1, "type": "string" }, + "encode_uri_params": { + "default": true, + "title": "Whether to escape the uri parameter", + "type": "boolean" + } + }, + "encrypt_fields": ["secret_key"], + "type": "object" + }, + "version": 0.1, + "schema": { + "properties": { + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "title": "work with route or service object", + "type": "object" + }, + "type": "auth", + "priority": 2530 + } + }, + "stream_plugins": { + "syslog": { + "version": 0.1, + "schema": { + "properties": { + "max_retry_count": { "minimum": 0, "default": 0, "type": "integer" }, + "host": { "type": "string" }, + "retry_delay": { "minimum": 0, "default": 1, "type": "integer" }, + "name": { "default": "stream sys logger", "type": "string" }, + "buffer_duration": { "minimum": 1, "default": 60, "type": "integer" }, + "inactive_timeout": { "minimum": 1, "default": 5, "type": "integer" }, + "tls": { "default": false, "type": "boolean" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "timeout": { "minimum": 1, "default": 3000, "type": "integer" }, + "batch_max_size": { + "minimum": 1, + "default": 1000, + "type": "integer" + }, + "flush_limit": { "minimum": 1, "default": 4096, "type": "integer" }, + "drop_limit": { "default": 1048576, "type": "integer" }, + "sock_type": { + "default": "tcp", + "enum": ["tcp", "udp"], + "type": "string" + }, + "port": { "type": "integer" }, + "pool_size": { "minimum": 5, "default": 5, "type": "integer" }, + "log_format": { "type": "object" } + }, + "required": ["host", "port"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "metadata_schema": { + "properties": { + "log_format": { + "default": { + "client_ip": "$remote_addr", + "host": "$host", + "@timestamp": "$time_iso8601" + }, + "type": "object" + } + }, + "type": "object" + }, + "priority": 401 + }, + "mqtt-proxy": { + "version": 0.1, + "schema": { + "properties": { + "protocol_name": { "type": "string" }, + "protocol_level": { "type": "integer" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + } + }, + "required": ["protocol_name", "protocol_level"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 1000 + }, + "limit-conn": { + "version": 0.1, + "schema": { + "properties": { + "key": { "type": "string" }, + "conn": { "exclusiveMinimum": 0, "type": "integer" }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "key_type": { + "default": "var", + "enum": ["var", "var_combination"], + "type": "string" + }, + "burst": { "minimum": 0, "type": "integer" }, + "default_conn_delay": { "exclusiveMinimum": 0, "type": "number" }, + "only_use_default_delay": { "default": false, "type": "boolean" } + }, + "required": ["conn", "burst", "default_conn_delay", "key"], + "$comment": "this is a mark for our injected plugin schema", + "type": "object" + }, + "priority": 1003 + }, + "ip-restriction": { + "version": 0.1, + "schema": { + "properties": { + "message": { + "default": "Your IP address is not allowed", + "maxLength": 1024, + "minLength": 1, + "type": "string" + }, + "_meta": { + "properties": { + "error_response": { + "oneOf": [{ "type": "string" }, { "type": "object" }] + }, + "disable": { "type": "boolean" }, + "filter": { + "type": "array", + "description": "filter determines whether the plugin needs to be executed at runtime" + }, + "priority": { + "type": "integer", + "description": "priority of plugins by customized order" + } + }, + "type": "object" + }, + "whitelist": { + "items": { + "anyOf": [ + { "format": "ipv4", "title": "IPv4", "type": "string" }, + { + "pattern": "^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([12]?[0-9]|3[0-2])$", + "title": "IPv4/CIDR", + "type": "string" + }, + { "format": "ipv6", "title": "IPv6", "type": "string" }, + { + "pattern": "^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$", + "title": "IPv6/CIDR", + "type": "string" + } + ] + }, + "minItems": 1, + "type": "array" + }, + "blacklist": { + "items": { + "anyOf": [ + { "format": "ipv4", "title": "IPv4", "type": "string" }, + { + "pattern": "^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([12]?[0-9]|3[0-2])$", + "title": "IPv4/CIDR", + "type": "string" + }, + { "format": "ipv6", "title": "IPv6", "type": "string" }, + { + "pattern": "^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$", + "title": "IPv6/CIDR", + "type": "string" + } + ] + }, + "minItems": 1, + "type": "array" + } + }, + "$comment": "this is a mark for our injected plugin schema", + "oneOf": [{ "required": ["whitelist"] }, { "required": ["blacklist"] }], + "type": "object" + }, + "priority": 3000 + } + } +} diff --git a/lib/common/constants/constants.dart b/lib/common/constants/constants.dart index 822e623..4cd9186 100644 --- a/lib/common/constants/constants.dart +++ b/lib/common/constants/constants.dart @@ -3,5 +3,5 @@ abstract class AppConstants { static const apiEndpointCrypto = "https://api.coinpaprika.com/"; static const host = '127.0.0.1'; -static const port = 9081; +static const port = 9080; } diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..e1132b6 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,638 @@ +{ + "name": "grpc_with_envoy_and_apisix", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "@grpc/grpc-js": "^1.9.12", + "@grpc/proto-loader": "^0.7.10", + "assert": "^2.1.0", + "async": "^3.2.5", + "lodash": "^4.17.21" + } + }, + "node_modules/@grpc/grpc-js": { + "version": "1.9.12", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.12.tgz", + "integrity": "sha512-Um5MBuge32TS3lAKX02PGCnFM4xPT996yLgZNb5H03pn6NyJ4Iwn5YcPq6Jj9yxGRk7WOgaZFtVRH5iTdYBeUg==", + "dependencies": { + "@grpc/proto-loader": "^0.7.8", + "@types/node": ">=12.12.47" + }, + "engines": { + "node": "^8.13.0 || >=10.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.7.10", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.10.tgz", + "integrity": "sha512-CAqDfoaQ8ykFd9zqBDn4k6iWT9loLAlc2ETmDFS9JCD70gDcnA4L3AFEo2iV7KyAtAAHFW9ftq1Fz+Vsgq80RQ==", + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.2.4", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, + "node_modules/@types/node": { + "version": "20.10.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.0.tgz", + "integrity": "sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/assert": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-2.1.0.tgz", + "integrity": "sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==", + "dependencies": { + "call-bind": "^1.0.2", + "is-nan": "^1.3.2", + "object-is": "^1.1.5", + "object.assign": "^4.1.4", + "util": "^0.12.5" + } + }, + "node_modules/async": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==" + }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", + "dependencies": { + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", + "dependencies": { + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "dependencies": { + "get-intrinsic": "^1.2.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-nan": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", + "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "dependencies": { + "which-typed-array": "^1.1.11" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/protobufjs": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz", + "integrity": "sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/set-function-length": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", + "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "dependencies": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", + "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.4", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..ccfdf88 --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@grpc/grpc-js": "^1.9.12", + "@grpc/proto-loader": "^0.7.10", + "assert": "^2.1.0", + "async": "^3.2.5", + "lodash": "^4.17.21" + } +}