[GitHub] [apisix] tokers commented on pull request #2437: change: read 8bytes from /dev/urandom as the random seed for better randomness
tokers commented on pull request #2437: URL: https://github.com/apache/apisix/pull/2437#issuecomment-709863340 @moonming @membphis Need your help to re-run the CI checks. ``` Reading package lists... E: Failed to fetch https://packages.microsoft.com/ubuntu/18.04/prod/dists/bionic/main/binary-amd64/Packages.bz2 File has unexpected size (141364 != 141252). Mirror sync in progress? [IP: 13.90.21.104 443] Hashes of expected file: - Filesize:141252 [weak] - SHA512:dffbaf15f537ae643df110b279248993b2828e99352dff51a5df9648cf39531ffb7022ec2f0d9e553287c9889addcb5e734d9df95f749c456db04fd328a67ef4 - SHA256:6757f7f09fb2a0491657aac899faa29bd67fe7b9dfd849844f7fafca9afcc33e - SHA1:37be76673db70e808db91294af54fddf476aae7f [weak] - MD5Sum:ecc0d5d8d9373eee7aeceda58d7be8f9 [weak] Release file created at: Tue, 13 Oct 2020 22:35:00 + E: Some index files failed to download. They have been ignored, or old ones used instead. ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #2388: bug: 2020/10/11 11:29:46 [error] 24#24: *18483 [lua] config_etcd.lua:433: failed to fetch data from etcd: /apisix/routes is not a dir, etcd key
spacewander commented on issue #2388: URL: https://github.com/apache/apisix/issues/2388#issuecomment-709864690 Closed this issue as the author doesn't response anymore. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander closed issue #2388: bug: 2020/10/11 11:29:46 [error] 24#24: *18483 [lua] config_etcd.lua:433: failed to fetch data from etcd: /apisix/routes is not a dir, etcd key: /api
spacewander closed issue #2388: URL: https://github.com/apache/apisix/issues/2388 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #2381: Proposal: sync plugin/plugin attr to node
spacewander commented on issue #2381: URL: https://github.com/apache/apisix/issues/2381#issuecomment-709866098 Done. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander closed issue #2381: Proposal: sync plugin/plugin attr to node
spacewander closed issue #2381: URL: https://github.com/apache/apisix/issues/2381 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #2434: CI: split the current test case.
spacewander commented on issue #2434: URL: https://github.com/apache/apisix/issues/2434#issuecomment-709866460 Solved by #2435? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix] branch master updated: style: move localized require in front of directives which calling it. (#2414)
This is an automated email from the ASF dual-hosted git repository. spacewander pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git The following commit(s) were added to refs/heads/master by this push: new 1afa8f7 style: move localized require in front of directives which calling it. (#2414) 1afa8f7 is described below commit 1afa8f77272e6099d2c54e4f703f6a70adb16f72 Author: RocFang AuthorDate: Fri Oct 16 15:16:09 2020 +0800 style: move localized require in front of directives which calling it. (#2414) --- apisix/admin/init.lua| 3 +-- apisix/admin/plugins.lua | 2 +- apisix/debug.lua | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apisix/admin/init.lua b/apisix/admin/init.lua index 68f9233..5aaafa4 100644 --- a/apisix/admin/init.lua +++ b/apisix/admin/init.lua @@ -14,7 +14,7 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- - +local require = require local core = require("apisix.core") local route = require("resty.radixtree") local plugin = require("apisix.plugin") @@ -22,7 +22,6 @@ local ngx = ngx local get_method = ngx.req.get_method local tonumber = tonumber local str_lower = string.lower -local require = require local reload_event = "/apisix/admin/plugins/reload" local ipairs = ipairs local events diff --git a/apisix/admin/plugins.lua b/apisix/admin/plugins.lua index 262b361..7cfe30e 100644 --- a/apisix/admin/plugins.lua +++ b/apisix/admin/plugins.lua @@ -14,13 +14,13 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local core = require("apisix.core") local local_plugins = require("apisix.plugin").plugins_hash local stream_local_plugins = require("apisix.plugin").stream_plugins_hash local pairs = pairs local ipairs= ipairs local pcall = pcall -local require = require local type = type local table_remove = table.remove local table_sort = table.sort diff --git a/apisix/debug.lua b/apisix/debug.lua index 7f458fe..b0ab038 100644 --- a/apisix/debug.lua +++ b/apisix/debug.lua @@ -14,6 +14,7 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +local require = require local yaml = require("tinyyaml") local log = require("apisix.core.log") local json = require("apisix.core.json") @@ -25,7 +26,6 @@ local ngx = ngx local re_find = ngx.re.find local type = type local pairs= pairs -local require = require local setmetatable = setmetatable local pcall= pcall local ipairs = ipairs
[GitHub] [apisix] spacewander merged pull request #2414: style: move localized require in front of directives which calling it.
spacewander merged pull request #2414: URL: https://github.com/apache/apisix/pull/2414 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #2421: feat:limit-count plugin supports consumer name field
Firstsawyou commented on a change in pull request #2421: URL: https://github.com/apache/apisix/pull/2421#discussion_r506117488 ## File path: doc/plugins/limit-count.md ## @@ -37,7 +37,7 @@ Limit request rate by a fixed number of requests in a given time window. | -- | --- | | --- | | --- | | count | integer | required | | [0,...] | the specified number of requests threshold. | | time_window| integer | required | | [0,...] | the time window in seconds before the request count is reset. | -| key| string | required | | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for"] | the user specified key to limit the rate. | +| key| string | required | | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for", "consumer_name"] | the user specified key to limit the rate. | Review comment: nice This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #2421: feat:limit-count plugin supports consumer name field
Firstsawyou commented on a change in pull request #2421: URL: https://github.com/apache/apisix/pull/2421#discussion_r506123488 ## File path: doc/plugins/limit-count.md ## @@ -37,7 +37,7 @@ Limit request rate by a fixed number of requests in a given time window. | -- | --- | | --- | | --- | | count | integer | required | | [0,...] | the specified number of requests threshold. | | time_window| integer | required | | [0,...] | the time window in seconds before the request count is reset. | -| key| string | required | | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for"] | the user specified key to limit the rate. | +| key| string | required | | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for", "consumer_name"] | to limit the number of requests. For example, one can use the host name (or server zone) as the key so that we limit the number of requests per host name. Otherwise, we can also use the client address as a key, so that we can avoid a single client connecting to our service too many times. Now accept those as key: "remote_addr"(client's IP), "server_addr"(server's IP), "X-Forwarded-For/X-Real-IP" in request header, "consumer_name"(consumer's username). | Review comment: I think the description of `”one can use the host name (or server zone) as the key so that we limit the number of requests per host name.“` is unreasonable. Because in the `key` we support, except `consumer_name`, the ip address is obtained in other cases This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #2395: improve: refactor apisix command line tool
spacewander commented on a change in pull request #2395: URL: https://github.com/apache/apisix/pull/2395#discussion_r506123444 ## File path: apisix/cmd/env.lua ## @@ -0,0 +1,77 @@ +-- +-- 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 util = require "apisix.cmd.util" + +local execute_cmd = util.execute_cmd +local trim = util.trim +local pcall = pcall +local error = error +local str_match = string.match +local pkg_cpath_org = package.cpath +local pkg_path_org = package.path +local apisix_home = "/usr/local/apisix" Review comment: Style: constant definition should not be here. ## File path: apisix/cmd/ops.lua ## @@ -0,0 +1,294 @@ +-- +-- 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 env = require "apisix.cmd.env" +local etcd = require "apisix.cmd.etcd" +local file = require "apisix.cmd.file" +local util = require "apisix.cmd.util" +local ngx_tpl = require "apisix.cmd.ngx_tpl" +local template = require "resty.template" + +local type = type +local pairs = pairs +local print = print +local ipairs = ipairs +local tonumber = tonumber +local tostring = tostring +local str_find = string.find +local str_sub = string.sub +local max = math.max +local popen = io.popen +local execute = os.execute +local error = error +local stderr = io.stderr +local openresty_args = [[openresty -p ]] .. env.apisix_home .. [[ -c ]] Review comment: Style: constant definition should be put a few lines after here. ## File path: apisix/cmd/file.lua ## @@ -0,0 +1,130 @@ +-- +-- 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 yaml = require "tinyyaml" +local env = require "apisix.cmd.env" +local profile = require "apisix.core.profile" + +local pairs = pairs +local type = type +local open = io.open +local str_find = string.find +local str_gmatch = string.gmatch +local _M = {} Review comment: Need blank lines before `_M`. ## File path: apisix/cmd/ops.lua ## @@ -0,0 +1,294 @@ +-- +-- 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 e
[apisix-dashboard] branch fe-refactor updated (0f2647b -> 05fee37)
This is an automated email from the ASF dual-hosted git repository. juzhiyuan pushed a change to branch fe-refactor in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git. from 0f2647b fix: create button missing add 05fee37 feat: update plugin & pluginchart No new revisions were added by this update. Summary of changes: package.json | 4 ++-- yarn.lock| 20 2 files changed, 18 insertions(+), 6 deletions(-)
[apisix-dashboard] branch fe-refactor updated (05fee37 -> 43af140)
This is an automated email from the ASF dual-hosted git repository. juzhiyuan pushed a change to branch fe-refactor in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git. from 05fee37 feat: update plugin & pluginchart add 85b0b20 feat: adjust codes order add 43af140 feat: codes clean No new revisions were added by this update. Summary of changes: .asf.yaml | 34 .github/apisix-config.yaml | 6 +- .github/workflows/api_ci.yml | 94 +++--- .github/workflows/api_cicd.yml | 87 ++-- .github/workflows/deploy.yml | 21 +++-- .github/workflows/license_ci.yml | 11 +-- .github/workflows/multiple-node-build.yml | 4 +- CONTRIBUTING.md| 31 +++ api/docker-compose.yml | 2 +- compose/apisix_conf/config.yaml| 19 +++-- compose/docker-compose.yml | 40 - .../dashboards/apisix_http_prometheus.json | 33 ++-- .../grafana_conf/provisioning/dashboards/all.yaml | 16 ++-- .../grafana_conf/provisioning/datasources/all.yaml | 16 ++-- compose/prometheus_conf/prometheus.yml | 12 +-- manager-api.md | 1 - src/pages/Consumer/List.tsx| 4 +- src/pages/Metrics/index.ts | 1 - src/pages/Route/List.tsx | 2 +- .../Route/components/Step2/RequestRewriteView.tsx | 9 ++- src/pages/Upstream/List.tsx| 2 +- src/pages/document.ejs | 17 ++-- src/service-worker.js | 4 +- 23 files changed, 215 insertions(+), 251 deletions(-)
[apisix-dashboard] 01/01: feat: sync apis
This is an automated email from the ASF dual-hosted git repository. juzhiyuan pushed a commit to branch feat-fe-refactor-sync in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git commit 1819a2e3c98c6343476ab2918570155c4404fbe4 Merge: 43af140 061d9a2 Author: juzhiyuan AuthorDate: Fri Oct 16 17:25:03 2020 +0800 feat: sync apis .actions/ASF-Release.cfg |5 + .github/workflows/api_ci.yml | 82 +- .github/workflows/api_cicd.yml | 32 +- api/Dockerfile | 14 + api/build-tools/json.lua | 400 api/build-tools/schema-sync.lua| 133 ++ api/conf/conf.go | 65 +- api/conf/schema.json | 2203 api/errno/error.go | 170 -- api/filter/authentication.go | 32 +- api/filter/logging.go |5 +- api/filter/request_id.go |1 + api/go.mod | 22 +- api/go.sum | 402 +++- api/internal/core/entity/entity.go | 182 ++ api/internal/core/entity/query.go | 153 ++ api/internal/core/storage/etcd.go | 138 ++ .../copy.go => internal/core/storage/storage.go} | 44 +- api/internal/core/storage/storage_mock.go | 116 ++ api/internal/core/store/query.go | 151 ++ api/internal/core/store/selector.go| 144 ++ api/internal/core/store/selector_test.go | 285 +++ api/internal/core/store/store.go | 326 +++ api/internal/core/store/store_test.go | 763 +++ api/internal/core/store/storehub.go| 145 ++ api/internal/core/store/test_case.json | 19 + api/internal/core/store/validate.go| 155 ++ api/internal/core/store/validate_mock.go | 24 + api/internal/core/store/validate_test.go | 140 ++ .../handler/authentication/authentication.go | 78 + .../handler/authentication/authentication_test.go | 67 + api/internal/handler/consumer/consumer.go | 149 ++ api/internal/handler/consumer/consumer_test.go | 200 ++ .../base_test.go => internal/handler/handler.go} | 10 +- api/{route => internal/handler/healthz}/healthz.go | 28 +- api/internal/handler/plugin/plugin.go | 65 + .../handler/plugin/plugin_test.go} | 47 +- api/internal/handler/route/route.go| 345 +++ api/internal/handler/route/route_test.go | 847 api/internal/handler/service/service.go| 175 ++ api/internal/handler/service/service_test.go | 152 ++ api/internal/handler/ssl/ssl.go| 373 api/{route => internal/handler/ssl}/ssl_test.go| 132 +- api/internal/handler/upstream/upstream.go | 252 +++ api/internal/handler/upstream/upstream_test.go | 183 ++ api/{route/base.go => internal/route.go} | 39 +- api/{route/healthz.go => internal/utils/closer.go} | 27 +- .../utils/consts/api_error.go} | 38 +- .../utils/consts/error.go} | 25 +- api/internal/utils/utils.go| 79 + .../base_test.go => internal/utils/utils_test.go} | 29 +- api/log/log.go | 55 + api/main.go| 28 +- api/route/authentication.go| 68 - api/route/authentication_test.go | 52 - api/route/consumer.go | 143 -- api/route/consumer_test.go | 98 - api/route/plugin.go| 59 - api/route/route.go | 631 -- api/route/route_group.go | 233 --- api/route/route_group_test.go | 131 -- api/route/route_test.go| 229 -- api/route/ssl.go | 197 -- api/route/upstream.go | 384 api/script/db/schema.sql | 71 - api/service/base.go| 49 - api/service/consumer.go| 349 api/service/consumer_test.go | 133 -- api/service/plugin.go | 62 - api/service/route.go | 652 -- api/service/route_group.go | 155 -- api/service/route_group_test.go| 120 -- api/service/route_test.go | 329 --- api/service/ssl.go | 589 -- api/service/ssl_
[GitHub] [apisix-dashboard] juzhiyuan opened a new pull request #559: feat: sync APIs from api refactor
juzhiyuan opened a new pull request #559: URL: https://github.com/apache/apisix-dashboard/pull/559 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix-dashboard] branch feat-fe-refactor-sync created (now 1819a2e)
This is an automated email from the ASF dual-hosted git repository. juzhiyuan pushed a change to branch feat-fe-refactor-sync in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git. at 1819a2e feat: sync apis This branch includes the following new commits: new 1819a2e feat: sync apis The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[GitHub] [apisix-dashboard] juzhiyuan closed pull request #559: feat: sync APIs from api refactor
juzhiyuan closed pull request #559: URL: https://github.com/apache/apisix-dashboard/pull/559 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix-dashboard] branch backup-1.5-latest created (now 6375d15)
This is an automated email from the ASF dual-hosted git repository. juzhiyuan pushed a change to branch backup-1.5-latest in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git. at 6375d15 fix(i18n): update error key in requestConfigView.tsx (#526) No new revisions were added by this update.
[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #521: feat: Refactor Frondend with Admin API
juzhiyuan commented on pull request #521: URL: https://github.com/apache/apisix-dashboard/pull/521#issuecomment-709940591 @moonming Please check if there have any License issues. @liuxiran @bzp2010 Please take a looks at those code changes. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] juzhiyuan edited a comment on pull request #521: feat: Refactor Frondend with Admin API
juzhiyuan edited a comment on pull request #521: URL: https://github.com/apache/apisix-dashboard/pull/521#issuecomment-709940591 @moonming Please check if there have any License issues. @liuxiran @bzp2010 Please take a looks at those code changes. This PR is going to merge into the master branch. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] gy09535 commented on pull request #2177: feature: support plugin for aliyun log service
gy09535 commented on pull request #2177: URL: https://github.com/apache/apisix/pull/2177#issuecomment-709949841 any update? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] gy09535 commented on issue #2425: bug: zipkin plugin can not work with new config when plugin config is change
gy09535 commented on issue #2425: URL: https://github.com/apache/apisix/issues/2425#issuecomment-709950481 please confirm This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] jealone opened a new issue #560: apisix升级问题
jealone opened a new issue #560: URL: https://github.com/apache/apisix-dashboard/issues/560 Please answer these questions before submitting your issue. - Why do you submit this issue? - [x] Question or discussion - [ ] Bug - [ ] Requirements - [ ] Feature or performance improvement - [ ] Other 问一下,如果现有服务用的apisix1.4版本,但是没有部署基于mysql的dashboard,如果要升级到新的dashboard 1. 是否需要升级apisix? 2. dashboard是否会拉取原有的etcd数据作为管理数据? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] Caelebs commented on issue #2224: request help: k8s部署日志提示failed to read `apisix` field from yaml file
Caelebs commented on issue #2224: URL: https://github.com/apache/apisix/issues/2224#issuecomment-709955274 @banlangen123 你得挂载一下config.yaml文件,还得检查一下这个文件有没有问题,我之前是因为文件内容有问题,我给你贴一个我现在的配置哈 ``` apisix: node_listen: 9080 # APISIX listening port enable_heartbeat: true enable_admin: true enable_admin_cors: true # Admin API support CORS response headers. enable_debug: false enable_dev_mode: false # Sets nginx worker_processes to 1 if set to true enable_reuseport: true # Enable nginx SO_REUSEPORT switch if set to true. enable_ipv6: true config_center: etcd # etcd: use etcd to store the config value # yaml: fetch the config value from local yaml file `/your_path/conf/apisix.yaml` #proxy_protocol: # Proxy Protocol configuration # listen_http_port: 9181# The port with proxy protocol for http, it differs from node_listen and port_admin. # This port can only receive http request with proxy protocol, but node_listen & port_admin # can only receive http request. If you enable proxy protocol, you must use this port to # receive http request with proxy protocol # listen_https_port: 9182 # The port with proxy protocol for https # enable_tcp_pp: true # Enable the proxy protocol for tcp proxy, it works for stream_proxy.tcp option # enable_tcp_pp_to_upstream: true # Enables the proxy protocol to the upstream server proxy_cache: # Proxy Caching configuration cache_ttl: 10s # The default caching time if the upstream does not specify the cache time zones: # The parameters of a cache - name: disk_cache_one # The name of the cache, administrator can be specify # which cache to use by name in the admin api memory_size: 50m # The size of shared memory, it's used to store the cache index disk_size: 1G# The size of disk, it's used to store the cache data disk_path: "/tmp/disk_cache_one" # The path to store the cache data cache_levels: "1:2" # The hierarchy levels of a cache # - name: disk_cache_two #memory_size: 50m #disk_size: 1G #disk_path: "/tmp/disk_cache_two" #cache_levels: "1:2" allow_admin: # http://nginx.org/en/docs/http/ngx_http_access_module.html#allow - 127.0.0.0/24 # If we don't set any IP list, then any IP access is allowed by default. - 172.17.0.0/24 - 10.10.0.0/24 - 10.10.16.0/24 - 10.10.11.0/24 - 10.20.0.0/24 - all # port_admin: 9180 # use a separate port # - "::/64" # Default token when use API to call for Admin API. # *NOTE*: Highly recommended to modify this value to protect APISIX's Admin API. # Disabling this configuration item means that the Admin API does not # require any authentication. admin_key: - name: "admin" key: edd1c9f034335f136f87ad84b625c8f1 role: admin # admin: manage all configuration data # viewer: only can view configuration data - name: "viewer" key: 4054f7cf07e344346cd3f287985e76a2 role: viewer router: http: 'radixtree_uri' # radixtree_uri: match route by uri(base on radixtree) # radixtree_host_uri: match route by host + uri(base on radixtree) ssl: 'radixtree_sni' # radixtree_sni: match route by SNI(base on radixtree) # stream_proxy: # TCP/UDP proxy # tcp:# TCP proxy port list # - 9100 # - 9101 # udp:# UDP proxy port list # - 9200 # - 9211 dns_resolver: # default DNS resolver, with disable IPv6 and enable local DNS - 127.0.0.11 - 114.114.114.114 - 223.5.5.5 - 1.1.1.1 - 8.8.8.8 - 10.20.0.88 dns_resolver_valid: 30 # valid time for dns result 30 seconds resolver_timeout: 5 # resolver timeout ssl: enable: true enable_http2: true listen_port: 9443 ssl_protocols: "TLSv1 TLSv1.1 TLSv1.2 TLSv1.3" ssl_ciphers: "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE
[GitHub] [apisix] Jaycean commented on a change in pull request #2421: feat:limit-count plugin supports consumer name field
Jaycean commented on a change in pull request #2421: URL: https://github.com/apache/apisix/pull/2421#discussion_r506278639 ## File path: doc/plugins/limit-count.md ## @@ -37,7 +37,7 @@ Limit request rate by a fixed number of requests in a given time window. | -- | --- | | --- | | --- | | count | integer | required | | [0,...] | the specified number of requests threshold. | | time_window| integer | required | | [0,...] | the time window in seconds before the request count is reset. | -| key| string | required | | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for"] | the user specified key to limit the rate. | +| key| string | required | | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for", "consumer_name"] | to limit the number of requests. For example, one can use the host name (or server zone) as the key so that we limit the number of requests per host name. Otherwise, we can also use the client address as a key, so that we can avoid a single client connecting to our service too many times. Now accept those as key: "remote_addr"(client's IP), "server_addr"(server's IP), "X-Forwarded-For/X-Real-IP" in request header, "consumer_name"(consumer's username). | Review comment: At present, my understanding of the project can only be translated into this way. Do you have any good suggestions? Thank you. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis commented on issue #2433: feature: add managed fields in jsonschema for resources, such as create_time and update_time
membphis commented on issue #2433: URL: https://github.com/apache/apisix/issues/2433#issuecomment-709977324 agree to add the new field ^_^ This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen opened a new pull request #561: feat: compatible with PUT method of `admin api` and nodes of upstream
nic-chen opened a new pull request #561: URL: https://github.com/apache/apisix-dashboard/pull/561 Please answer these questions before submitting a pull request - Why submit this pull request? - [ ] Bug fix - [x] New feature provided - [ ] Improve performance ___ ### New feature or improvement compatible with PUT method of `admin api` and nodes of upstream This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on issue #507: can not config basic-auth plugin with ‘work with consumer object’ option
liuxiran commented on issue #507: URL: https://github.com/apache/apisix-dashboard/issues/507#issuecomment-710003642 Accoring to the [basic-auth doc](https://github.com/apache/apisix/blob/master/doc/plugins/basic-auth.md) : config basic-auth plugin only needs to config username(required) and password(required) ### now the current schema of basic-auth:(update apisix to latest master branch) ```json { "additionalProperties": false, "properties": { "disable": { "type": "boolean" } }, "title": "work with route or service object", "type": "object" } ``` with the plugin page looks: ![2020-10-16 19-51-55屏幕截图](https://user-images.githubusercontent.com/2561857/96255210-193a9b80-0fe9-11eb-8b7e-70e27ff14326.png) --- ### the expected schema should be: ```json { "type": "object", "required": [ "username", "password" ], "properties": { "username": { "type": "string", "title": "Username" }, "password": { "type": "string", "title": "Password" } } } with the plugin page looks: ![2020-10-16 20-00-45屏幕截图](https://user-images.githubusercontent.com/2561857/96256000-7256ff00-0fea-11eb-8bbc-be7817c89730.png) ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on issue #507: can not config basic-auth plugin with ‘work with consumer object’ option
liuxiran edited a comment on issue #507: URL: https://github.com/apache/apisix-dashboard/issues/507#issuecomment-710003642 Accoring to the [basic-auth doc](https://github.com/apache/apisix/blob/master/doc/plugins/basic-auth.md) : config basic-auth plugin only needs to config username(required) and password(required) ### now the current schema of basic-auth:(update apisix to latest master branch) ```json { "additionalProperties": false, "properties": { "disable": { "type": "boolean" } }, "title": "work with route or service object", "type": "object" } ``` with the plugin page looks: ![2020-10-16 19-51-55屏幕截图](https://user-images.githubusercontent.com/2561857/96255210-193a9b80-0fe9-11eb-8b7e-70e27ff14326.png) --- ### the expected schema should be: ```json { "type": "object", "required": [ "username", "password" ], "properties": { "username": { "type": "string", "title": "Username" }, "password": { "type": "string", "title": "Password" } } } ``` with the plugin page looks: ![2020-10-16 20-00-45屏幕截图](https://user-images.githubusercontent.com/2561857/96256000-7256ff00-0fea-11eb-8bbc-be7817c89730.png) ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] liuxiran opened a new issue #2439: can not config basic-auth plugin with ‘work with consumer object’ option
liuxiran opened a new issue #2439: URL: https://github.com/apache/apisix/issues/2439 Please answer these questions before submitting your issue. - Why do you submit this issue? - [x] Question or discussion - [x] Bug - [ ] Requirements - [ ] Feature or performance improvement - [ ] Other ___ ### Question - What do you want to know? What is the purpose of SELECT item? ![image](https://user-images.githubusercontent.com/2561857/93974652-ba4a8380-fda8-11ea-927c-66918099437a.png) ___ ### Bug - Which version of Apache APISIX Dashboard, OS, and Browser? - What happened? If possible, provide a way to reproduce the error. 1. config basic-auth plugin for a route 1. select `work with consumer object`, and then click [ok]button 1. action failed , and got an validate error in the console ![image](https://user-images.githubusercontent.com/2561857/93974925-2927dc80-fda9-11ea-9b1f-d0ee3d44feae.png) ___ ### Requirement or improvement - Please describe your requirements or improvement suggestions. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] liuxiran edited a comment on issue #2439: can not config basic-auth plugin with ‘work with consumer object’ option
liuxiran edited a comment on issue #2439: URL: https://github.com/apache/apisix/issues/2439#issuecomment-710003642 Part of https://github.com/apache/apisix/issues/2082 Accoring to the [basic-auth doc](https://github.com/apache/apisix/blob/master/doc/plugins/basic-auth.md) : config basic-auth plugin only needs to config username(required) and password(required) ### current schema of basic-auth:(update apisix to latest master branch) ```json { "additionalProperties": false, "properties": { "disable": { "type": "boolean" } }, "title": "work with route or service object", "type": "object" } ``` with the plugin page looks: ![2020-10-16 19-51-55屏幕截图](https://user-images.githubusercontent.com/2561857/96255210-193a9b80-0fe9-11eb-8b7e-70e27ff14326.png) --- ### the expected schema should be: ```json { "type": "object", "required": [ "username", "password" ], "properties": { "username": { "type": "string", "title": "Username" }, "password": { "type": "string", "title": "Password" } } } ``` with the plugin page looks: ![2020-10-16 20-00-45屏幕截图](https://user-images.githubusercontent.com/2561857/96256000-7256ff00-0fea-11eb-8bbc-be7817c89730.png) ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] Jaycean opened a new pull request #2440: plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
Jaycean opened a new pull request #2440: URL: https://github.com/apache/apisix/pull/2440 ### What this PR does / why we need it: - fix: #2402 ### Pre-submission checklist: * [x] Did you explain what problem does this PR solve? Or what new features have been added? * [x] Have you added corresponding test cases? * [ ] Have you modified the corresponding document? * [x] Is this PR backward compatible? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] liuxiran opened a new issue #2441: plugin(hmac-auth): update the schema
liuxiran opened a new issue #2441: URL: https://github.com/apache/apisix/issues/2441 Part of https://github.com/apache/apisix/issues/2082 ### Current schema ```json { "additionalProperties": false, "properties": { "disable": { "type": "boolean" } }, "title": "work with route or service object", "type": "object" } ``` the plugin page looks: ![2020-10-16 20-39-49屏幕截图](https://user-images.githubusercontent.com/2561857/96259158-c3b5bd00-0fef-11eb-8375-b631eecead37.png) --- ### Expected schema according to the [doc](https://github.com/apache/apisix/blob/master/doc/zh-cn/plugins/hmac-auth.md#%E5%B1%9E%E6%80%A7) and [test case](https://github.com/apache/apisix/blob/1afa8f77272e6099d2c54e4f703f6a70adb16f72/t/plugin/hmac-auth.t#L27) ```json { "type": "object", "required": [ "access_key", "secret_key" ], "properties": { "access_key": { "type": "string", "title": "Accesskey" }, "secret_key": { "type": "string", "title": "Secretkey" }, "algorithm": { "type": "string", "enum": [ "hmac-sha1", "hmac-sha256", "hmac-sha512" ], "default": "hmac-sha256", "title": "Algorithm" }, "clock_skew": { "type": "number", "title": "clockskew", "default": 0 }, "signed_headers": { "type": "array", "title": "A list of strings", "items": { "type": "string", "default": "bazinga" } } } } ``` the form looks: ![2020-10-16 21-06-48屏幕截图](https://user-images.githubusercontent.com/2561857/96261849-8b17e280-0ff3-11eb-8243-de6d4fca3691.png) ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema
liuxiran commented on issue #2082: URL: https://github.com/apache/apisix/issues/2082#issuecomment-710036230 Added for tracking #2441 - [ ] hmac-auth This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis commented on a change in pull request #2421: feat:limit-count plugin supports consumer name field
membphis commented on a change in pull request #2421: URL: https://github.com/apache/apisix/pull/2421#discussion_r506428902 ## File path: doc/zh-cn/plugins/limit-count.md ## @@ -30,7 +30,7 @@ | -- | --- | | --- | | --- | | count | integer | 必须 | | [0,...] | 指定时间窗口内的请求数量阈值 | | time_window| integer | 必须 | | [0,...] | 时间窗口的大小(以秒为单位),超过这个时间就会重置 | -| key| string | 必须 | | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for"] | 用来做请求计数的依据 | +| key| string | 必须 | | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for", "consumer_name"] | 用户指定的限制请求次数的关键字,可以是客户端IP、服务端IP,请求头中的"X-Forwarded-For" 或 "X-Real-IP",以及"consumer_name"。例如,可以使用主机名(或服务器区域)作为关键字,以便限制每个主机名规定时间内的请求次数。我们也可以使用客户端地址作为关键字,这样我们就可以避免单个客户端规定时间内多次的连接我们的服务。当前接受的 key 有:"remote_addr"(客户端IP地址), "server_addr"(服务端 IP 地址), 请求头中的"X-Forwarded-For" 或 "X-Real-IP","consumer_name"(consumer 的 username)。 | Review comment: agree ^_^ This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis commented on pull request #2395: improve: refactor apisix command line tool
membphis commented on pull request #2395: URL: https://github.com/apache/apisix/pull/2395#issuecomment-710051556 @tokers please rebase your branch This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis commented on pull request #2177: feature: support plugin for aliyun log service
membphis commented on pull request #2177: URL: https://github.com/apache/apisix/pull/2177#issuecomment-710052211 > any update? you can rebase your branch first. conflicted This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis commented on pull request #2368: add uri fuzzing test
membphis commented on pull request #2368: URL: https://github.com/apache/apisix/pull/2368#issuecomment-710066589 > 2\. and it is also very simple for python to monitor the resource occupation of the specified components, and long-term testing is easy for it too. do we have implemented this feature in this test case? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis edited a comment on pull request #2368: add uri fuzzing test
membphis edited a comment on pull request #2368: URL: https://github.com/apache/apisix/pull/2368#issuecomment-710066589 > 2\. and it is also very simple for python to monitor the resource occupation of the specified components, and long-term testing is easy for it too. do we have implemented this feature in this test case? if we not, I think we can use Lua to implement the fuzzy test. The Lua can do the same thing. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis closed issue #2434: CI: split the current test case.
membphis closed issue #2434: URL: https://github.com/apache/apisix/issues/2434 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis commented on issue #2434: CI: split the current test case.
membphis commented on issue #2434: URL: https://github.com/apache/apisix/issues/2434#issuecomment-710069588 haha, yes, let me close this issue ^_^ This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis commented on pull request #2177: feature: support plugin for aliyun log service
membphis commented on pull request #2177: URL: https://github.com/apache/apisix/pull/2177#issuecomment-710071721 @gy09535 I think we need to way to confirm this plugin can work fine with aliyun. if we can check this in the test, it should be great. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis commented on issue #1873: doc: The `doc/admin-api.md#consumer` & `doc/zh-cn/admin-api.md#consumer` doc, the consumer 'id' meaning confused.
membphis commented on issue #1873: URL: https://github.com/apache/apisix/issues/1873#issuecomment-710073001 > the key length not less than 6 byte for security on internet exposure area. welcome PR, add this limitation. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis commented on issue #2423: request help: radixtree_host_uri does not consider routing priority
membphis commented on issue #2423: URL: https://github.com/apache/apisix/issues/2423#issuecomment-710074433 @haifeng9414 many thx for your report. would you like to fix this issue? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis commented on pull request #2438: style: fixed some code style problems
membphis commented on pull request #2438: URL: https://github.com/apache/apisix/pull/2438#issuecomment-710075240 @tokers many thx This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix] branch master updated (1afa8f7 -> 7cb9563)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git. from 1afa8f7 style: move localized require in front of directives which calling it. (#2414) add 7cb9563 style: fixed some code style problems (#2438) No new revisions were added by this update. Summary of changes: apisix/plugins/jwt-auth.lua | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-)
[GitHub] [apisix] membphis merged pull request #2438: style: fixed some code style problems
membphis merged pull request #2438: URL: https://github.com/apache/apisix/pull/2438 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] juzhiyuan commented on pull request #2440: plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
juzhiyuan commented on pull request #2440: URL: https://github.com/apache/apisix/pull/2440#issuecomment-710094623 @Jaycean Please have a look at CI. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on issue #540: feature: [refactor] support json schema check
nic-chen commented on issue #540: URL: https://github.com/apache/apisix-dashboard/issues/540#issuecomment-710100714 done. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen closed issue #540: feature: [refactor] support json schema check
nic-chen closed issue #540: URL: https://github.com/apache/apisix-dashboard/issues/540 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen closed issue #538: bug: authentication security issue
nic-chen closed issue #538: URL: https://github.com/apache/apisix-dashboard/issues/538 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on issue #538: bug: authentication security issue
nic-chen commented on issue #538: URL: https://github.com/apache/apisix-dashboard/issues/538#issuecomment-710100886 fixed. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] nic-chen commented on a change in pull request #1917: add nacos support
nic-chen commented on a change in pull request #1917: URL: https://github.com/apache/apisix/pull/1917#discussion_r506529675 ## File path: doc/zh-cn/discovery-nacos.md ## @@ -0,0 +1,71 @@ + + + 支持在apisix中使用nacos注册中心 + 1. 参考官方euruka.lua实现 + 2. 未对注册到nacos的实例做健康判断 + 3. 只支持指定的namespace与group + 4. 支持在nacos中配置元数据从而不注册到的apisix + + + + + 如何使用nacos提供服务发现功能 + +[1] 在 `conf/config.yaml` 文件中增加如下配置,以选择注册中心的类型: + +```yaml +apisix: + discovery: nacos +``` + +[2] 在 `conf/config.yaml` 增加如下格式的配置: + +```yaml +nacos: + host: +- "http://nacos:nacos@127.0.0.1:8848"; //用户名和密码使用冒号分隔 + prefix: "/nacos/" + namespace: public //默认命名空间 + group: DEFAULT_GROUP //默认分组 + fetch_interval: 30 + weight: 100 + timeout: +connect: 2000 +send: 2000 +read: 5000 + Review comment: Could you give an example of configuring a specific service, please? Including `route` and `upstream` config. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] nic-chen commented on issue #2426: bug:enable openid-connect plugin without redirect_uri got 500 error
nic-chen commented on issue #2426: URL: https://github.com/apache/apisix/issues/2426#issuecomment-710109807 @membphis I think it's a schema defined bug. `redirect_uri` should be required according to the error log. @liuxiran Could you solve it together, please? It looks like you are solving issues of other plugins's schema 😄 https://github.com/apache/apisix/blob/master/apisix/plugins/openid-connect.lua#L45 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] Jaycean commented on pull request #2440: plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
Jaycean commented on pull request #2440: URL: https://github.com/apache/apisix/pull/2440#issuecomment-710121446 > @Jaycean Please have a look at CI. OK, I'll take a look at the reason. It passed the local test This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tzssangglass opened a new pull request #2442: Issue no1574
tzssangglass opened a new pull request #2442: URL: https://github.com/apache/apisix/pull/2442 ### What this PR does / why we need it: Prometheus plugin `apisix_http_status` metric `route` tag Improve recognition. Originally, the `/apisix/prometheus/metrics` endpoint only showed the `id` of the `router`. However, if the route has `uris` or `hosts` parameters, the user does not know the number of times an element in `uris` or `hosts` has been matched, the collection of coarse granularity, and in Grafana to display the `id` of the `route` is not friendly enough. This PR adds two elements, `matched_uri` and `matched_host`, to the `apisix_http_status` property of the `/apisix/prometheus/metrics` endpoint to show in detail the elements that are matched in the `uris` or `hosts`. Note: I added the parameter `curr_req_matched_record` to the `api_ctx` to keep track of the `route` record for the current request match. The `apisix_http_status` will look like this ``` apisix_http_status{code="200",route="",matched_uri="",matched_host="",service="localhost",node=""} 5 apisix_http_status{code="200",route="1",matched_uri="/hello",matched_host="",service="",node=""} 6 apisix_http_status{code="200",route="1",matched_uri="/hello",matched_host="",service="",node="127.0.0.1"} 20 apisix_http_status{code="200",route="2",matched_uri="/hello1",matched_host="",service="1",node="127.0.0.1"} 6 apisix_http_status{code="404",route="",matched_uri="",matched_host="",service="localhost",node=""} 6 apisix_http_status{code="404",route="3",matched_uri="/hello3",matched_host="",service="",node="127.0.0.1"} 2 ``` https://github.com/apache/apisix/issues/1574 ### Pre-submission checklist: * [x] Did you explain what problem does this PR solve? Or what new features have been added? * [ ] Have you added corresponding test cases? * [ ] Have you modified the corresponding document? * [x] Is this PR backward compatible? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] Jaycean commented on pull request #2440: WIP:plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
Jaycean commented on pull request #2440: URL: https://github.com/apache/apisix/pull/2440#issuecomment-710316191 According to the previous JSON schema data format, without changing the logic, the current writing method is not the same as the data obtained by the front end. I need to discuss with @liuxiran again tomorrow This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] Jaycean edited a comment on pull request #2440: WIP:plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
Jaycean edited a comment on pull request #2440: URL: https://github.com/apache/apisix/pull/2440#issuecomment-710316191 According to the previous JSON schema data format, without changing the logic, the current writing method is not the same as the data obtained by apisix-dashboard. I need to discuss with @liuxiran again tomorrow This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] sshniro commented on issue #2428: request help: failure to authenticate using the `authz-keycloak` plugin
sshniro commented on issue #2428: URL: https://github.com/apache/apisix/issues/2428#issuecomment-710362912 If you can rephrase is EN I can help you with this. 🙂 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tzssangglass closed pull request #2442: feature: prometheus plugin `apisix_http_status` metric `route` tag Improve recognition
tzssangglass closed pull request #2442: URL: https://github.com/apache/apisix/pull/2442 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tzssangglass opened a new pull request #2443: feature: prometheus plugin `apisix_http_status` metric `route` tag Im…
tzssangglass opened a new pull request #2443: URL: https://github.com/apache/apisix/pull/2443 …prove recognition (#1574) fix #1574 ### What this PR does / why we need it: Prometheus plugin `apisix_http_status` metric `route` tag Improve recognition. Originally, the `/apisix/prometheus/metrics` endpoint only showed the `id` of the `router`. However, if the route has `uris` or `hosts` parameters, the user does not know the number of times an element in `uris` or `hosts` has been matched, the collection of coarse granularity, and in Grafana to display the `id` of the `route` is not friendly enough. This PR adds two elements, `matched_uri` and `matched_host`, to the `apisix_http_status` property of the `/apisix/prometheus/metrics` endpoint to show in detail the elements that are matched in the `uris` or `hosts`. Note: I added the parameter `curr_req_matched_record` to the `api_ctx` to keep track of the `route` record for the current request match. The `apisix_http_status` will look like this ``` apisix_http_status{code="200",route="",matched_uri="",matched_host="",service="localhost",node=""} 5 apisix_http_status{code="200",route="1",matched_uri="/hello",matched_host="",service="",node=""} 6 apisix_http_status{code="200",route="1",matched_uri="/hello",matched_host="",service="",node="127.0.0.1"} 20 apisix_http_status{code="200",route="2",matched_uri="/hello1",matched_host="",service="1",node="127.0.0.1"} 6 apisix_http_status{code="404",route="",matched_uri="",matched_host="",service="localhost",node=""} 6 apisix_http_status{code="404",route="3",matched_uri="/hello3",matched_host="",service="",node="127.0.0.1"} 2 ``` [#1574](https://github.com/apache/apisix/issues/1574) ### Pre-submission checklist: * [x] Did you explain what problem does this PR solve? Or what new features have been added? * [ ] Have you added corresponding test cases? * [ ] Have you modified the corresponding document? * [x] Is this PR backward compatible? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen closed issue #555: bug: when etcd had dirty data, API Server start fail
nic-chen closed issue #555: URL: https://github.com/apache/apisix-dashboard/issues/555 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on issue #555: bug: when etcd had dirty data, API Server start fail
nic-chen commented on issue #555: URL: https://github.com/apache/apisix-dashboard/issues/555#issuecomment-710686713 fix This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis closed issue #638: feature: supported cluster limit-req with redis server.
membphis closed issue #638: URL: https://github.com/apache/apisix/issues/638 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis merged pull request #2406: feature: plugin `limit-count` support to use `redis` cluster
membphis merged pull request #2406: URL: https://github.com/apache/apisix/pull/2406 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix] branch master updated: feature: plugin `limit-count` support to use `redis` cluster (#2406)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git The following commit(s) were added to refs/heads/master by this push: new c65f5c9 feature: plugin `limit-count` support to use `redis` cluster (#2406) c65f5c9 is described below commit c65f5c9465d2c0ad212545382adc57d90edea674 Author: YuanSheng Wang AuthorDate: Sat Oct 17 08:21:47 2020 +0800 feature: plugin `limit-count` support to use `redis` cluster (#2406) fix #638 Co-authored-by: liuheng --- .github/workflows/build.yml| 19 ++ apisix/plugins/limit-count.lua | 37 ++- ...unt-redis.lua => limit-count-redis-cluster.lua} | 84 ++--- apisix/plugins/limit-count/limit-count-redis.lua | 5 +- bin/apisix | 1 + doc/plugins/limit-count.md | 37 ++- doc/zh-cn/plugins/limit-count.md | 58 +++- rockspec/apisix-master-0.rockspec | 1 + t/APISIX.pm| 5 + t/plugin/limit-count-redis-cluster.t | 363 + 10 files changed, 544 insertions(+), 66 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c46c97f..bfc72ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,25 @@ jobs: if: matrix.platform == 'ubuntu-18.04' run: sudo ./.travis/${{ matrix.os_name }}_runner.sh before_install + - name: Install Redis Cluster +if: matrix.os_name == 'linux_openresty' +uses: vishnudxb/redis-cluster@1.0.5 +with: + master1-port: 5000 + master2-port: 5001 + master3-port: 5002 + slave1-port: 5003 + slave2-port: 5004 + slave3-port: 5005 + + - name: Running Redis Cluster Test +if: matrix.os_name == 'linux_openresty' +run: | + sudo apt-get install -y redis-tools + docker ps -a + redis-cli -h 127.0.0.1 -p 5000 ping + redis-cli -h 127.0.0.1 -p 5000 cluster nodes + - name: Linux Install if: matrix.platform == 'ubuntu-18.04' run: sudo ./.travis/${{ matrix.os_name }}_runner.sh do_install diff --git a/apisix/plugins/limit-count.lua b/apisix/plugins/limit-count.lua index 216b82d..94adc56 100644 --- a/apisix/plugins/limit-count.lua +++ b/apisix/plugins/limit-count.lua @@ -17,10 +17,14 @@ local limit_local_new = require("resty.limit.count").new local core = require("apisix.core") local plugin_name = "limit-count" +local limit_redis_cluster_new local limit_redis_new do local redis_src = "apisix.plugins.limit-count.limit-count-redis" limit_redis_new = require(redis_src).new + +local cluster_src = "apisix.plugins.limit-count.limit-count-redis-cluster" +limit_redis_cluster_new = require(cluster_src).new end @@ -40,7 +44,7 @@ local schema = { }, policy = { type = "string", -enum = {"local", "redis"}, +enum = {"local", "redis", "redis-cluster"}, default = "local", } }, @@ -70,11 +74,31 @@ local schema = { type = "string", minLength = 0, }, redis_timeout = { -type = "integer", minimum = 1, -default = 1000, +type = "integer", minimum = 1, default = 1000, }, }, required = {"redis_host"}, +}, +{ +properties = { +policy = { +enum = {"redis-cluster"}, +}, +redis_cluster_nodes = { +type = "array", +minItems = 2, +items = { +type = "string", minLength = 2, maxLength = 100 +}, +}, +redis_password = { +type = "string", minLength = 0, +}, +redis_timeout = { +type = "integer", minimum = 1, default = 1000, +}, +}, +required = {"redis_cluster_nodes"}, } } } @@ -83,7 +107,7 @@ local schema = { local _M = { -version = 0.3, +version = 0.4, priority = 1002, name = plugin_name, schema = schema, @@ -119,6 +143,11 @@ local function create_limit_obj(conf) conf.count, conf.time_window, conf) end +if conf.policy == "redis-cluster" then +return limit_
[GitHub] [apisix] membphis commented on pull request #2340: feature: limit-count use redis cluster
membphis commented on pull request #2340: URL: https://github.com/apache/apisix/pull/2340#issuecomment-710707653 https://github.com/apache/apisix/pull/2406 has been merged. so we can close this PR. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis closed pull request #2340: feature: limit-count use redis cluster
membphis closed pull request #2340: URL: https://github.com/apache/apisix/pull/2340 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] nic-chen opened a new pull request #2444: feature: add managed fields in json schema for resources, such as create_time and update_time
nic-chen opened a new pull request #2444: URL: https://github.com/apache/apisix/pull/2444 ### What this PR does / why we need it: add managed fields in json schema for resources, such as create_time and update_time ### Pre-submission checklist: * [x] Did you explain what problem does this PR solve? Or what new features have been added? * [x] Have you added corresponding test cases? * [ ] Have you modified the corresponding document? * [x] Is this PR backward compatible? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] nic-chen commented on pull request #2444: feature: add managed fields in json schema for resources, such as create_time and update_time
nic-chen commented on pull request #2444: URL: https://github.com/apache/apisix/pull/2444#issuecomment-710716402 add to milestone 2.0 because need these fields to work with new `manager api` #2444 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] juzhiyuan commented on pull request #2440: WIP:plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
juzhiyuan commented on pull request #2440: URL: https://github.com/apache/apisix/pull/2440#issuecomment-710719221 > > @Jaycean Please have a look at CI. > > OK, I'll take a look at the reason. It passed the local test Well, I will convert this PR to draft. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] juzhiyuan commented on a change in pull request #2444: feature: add managed fields in json schema for resources, such as create_time and update_time
juzhiyuan commented on a change in pull request #2444: URL: https://github.com/apache/apisix/pull/2444#discussion_r506778540 ## File path: t/admin/consumers.t ## @@ -322,3 +322,67 @@ GET /t {"error_msg":"not supported `POST` method for consumer"} --- no_error_log [error] + + + +=== TEST 10: add consumer with create_time and update_time(pony) +--- config +location /t { +content_by_lua_block { +local t = require("lib.test_admin").test +local code, body = t('/apisix/admin/consumers', +ngx.HTTP_PUT, +[[{ + "username":"pony", + "desc": "new consumer", + "create_time": 1602883670, Review comment: So this means the manager api will append create_time & update_time to those POST/PUT requests sent from frontend? ## File path: t/admin/routes.t ## @@ -2326,3 +2326,77 @@ GET /t {"error_msg":"invalid configuration: property \"labels\" validation failed: failed to validate env (matching \".*\"): wrong type: expected string, got table"} --- no_error_log [error] + + + +=== TEST 63: create route with create_time and update_time(id : 1) +--- config +location /t { +content_by_lua_block { +local t = require("lib.test_admin").test +local code, body = t('/apisix/admin/routes/1', +ngx.HTTP_PUT, +[[{ +"upstream": { +"nodes": { +"127.0.0.1:8080": 1 +}, +"type": "roundrobin" +}, +"uri": "/index.html", +"create_time": 1602883670, +"update_time": 1602893670 +}]], +[[{ +"node": { +"value": { +"uri": "/index.html", +"upstream": { +"nodes": { +"127.0.0.1:8080": 1 +}, +"type": "roundrobin" +}, +"create_time": 1602883670, +"update_time": 1602893670 +}, +"key": "/apisix/routes/1" +}, +"action": "set" +}]] +) + +ngx.status = code +ngx.say(body) +} +} +--- request +GET /t +--- response_body +passed +--- no_error_log +[error] + + + +=== TEST 64: delete test route(id : 1) +--- config +location /t { +content_by_lua_block { +local t = require("lib.test_admin").test +local code, message = t('/apisix/admin/routes/1', + ngx.HTTP_DELETE, + nil, + [[{ +"action": "delete" +}]] Review comment: Codes format This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] nic-chen commented on a change in pull request #2444: feature: add managed fields in json schema for resources, such as create_time and update_time
nic-chen commented on a change in pull request #2444: URL: https://github.com/apache/apisix/pull/2444#discussion_r506780230 ## File path: t/admin/routes.t ## @@ -2326,3 +2326,77 @@ GET /t {"error_msg":"invalid configuration: property \"labels\" validation failed: failed to validate env (matching \".*\"): wrong type: expected string, got table"} --- no_error_log [error] + + + +=== TEST 63: create route with create_time and update_time(id : 1) +--- config +location /t { +content_by_lua_block { +local t = require("lib.test_admin").test +local code, body = t('/apisix/admin/routes/1', +ngx.HTTP_PUT, +[[{ +"upstream": { +"nodes": { +"127.0.0.1:8080": 1 +}, +"type": "roundrobin" +}, +"uri": "/index.html", +"create_time": 1602883670, +"update_time": 1602893670 +}]], +[[{ +"node": { +"value": { +"uri": "/index.html", +"upstream": { +"nodes": { +"127.0.0.1:8080": 1 +}, +"type": "roundrobin" +}, +"create_time": 1602883670, +"update_time": 1602893670 +}, +"key": "/apisix/routes/1" +}, +"action": "set" +}]] +) + +ngx.status = code +ngx.say(body) +} +} +--- request +GET /t +--- response_body +passed +--- no_error_log +[error] + + + +=== TEST 64: delete test route(id : 1) +--- config +location /t { +content_by_lua_block { +local t = require("lib.test_admin").test +local code, message = t('/apisix/admin/routes/1', + ngx.HTTP_DELETE, + nil, + [[{ +"action": "delete" +}]] Review comment: It's common used in APISIX. ## File path: t/admin/consumers.t ## @@ -322,3 +322,67 @@ GET /t {"error_msg":"not supported `POST` method for consumer"} --- no_error_log [error] + + + +=== TEST 10: add consumer with create_time and update_time(pony) +--- config +location /t { +content_by_lua_block { +local t = require("lib.test_admin").test +local code, body = t('/apisix/admin/consumers', +ngx.HTTP_PUT, +[[{ + "username":"pony", + "desc": "new consumer", + "create_time": 1602883670, Review comment: sure. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tzssangglass commented on pull request #2443: feature: prometheus plugin `apisix_http_status` metric `route` tag Im…
tzssangglass commented on pull request #2443: URL: https://github.com/apache/apisix/pull/2443#issuecomment-710727878 @membphis please take a look at this CI error:https://github.com/apache/apisix/pull/2443/checks?check_run_id=1266120426#step:6:153 and so on my commit did not change the code associated with this test case I don't know what this error has to do with `prove -Itest-nginx/lib -r t`. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] vcoolwind commented on issue #527: wolf-rbac can't add to plugin page
vcoolwind commented on issue #527: URL: https://github.com/apache/apisix-dashboard/issues/527#issuecomment-710729030 @juzhiyuan What time does wolf-rbac can be show in dashboard as default? This feature is urgently needed. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] liuxiran commented on pull request #2440: WIP:plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
liuxiran commented on pull request #2440: URL: https://github.com/apache/apisix/pull/2440#issuecomment-710740234 > According to the previous JSON schema data format, without changing the logic, the current writing method is not the same as the data obtained by apisix-dashboard. I need to discuss with @liuxiran again tomorrow @Jaycean with the newest json schema ```json { "oneOf": [{ "properties": { "blacklist": { "items": { "type": "string" }, "minItems": 1, "type": "array" }, "rejected_code": { "default": 403, "minimum": 200, "type": "integer" }, "type": { "default": "consumer_name", "enum": ["consumer_name", "service_id"], "type": "string" } }, "required": ["blacklist"], "title": "blacklist" }, { "properties": { "rejected_code": { "default": 403, "minimum": 200, "type": "integer" }, "type": { "default": "consumer_name", "enum": ["consumer_name", "service_id"], "type": "string" }, "whitelist": { "items": { "type": "string" }, "minItems": 1, "type": "array" } }, "required": ["whitelist"], "title": "whitelist" }], "properties": { "disable": { "type": "boolean" } }, "type": "object" } ``` dashboard can create a route with `key-auth` plugin and `consumer-restriction` plugin successfully. and the `consumer-restriction` plugin can work correctly with the configuration. If you can change the keys **order** in properties one from current: `blacklist, rejected_code, type` to expected `rejected_code, type, blacklist`, that would be better :) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] liuxiran edited a comment on pull request #2440: WIP:plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
liuxiran edited a comment on pull request #2440: URL: https://github.com/apache/apisix/pull/2440#issuecomment-710740234 > According to the previous JSON schema data format, without changing the logic, the current writing method is not the same as the data obtained by apisix-dashboard. I need to discuss with @liuxiran again tomorrow @Jaycean with your newest json schema ```json { "oneOf": [{ "properties": { "blacklist": { "items": { "type": "string" }, "minItems": 1, "type": "array" }, "rejected_code": { "default": 403, "minimum": 200, "type": "integer" }, "type": { "default": "consumer_name", "enum": ["consumer_name", "service_id"], "type": "string" } }, "required": ["blacklist"], "title": "blacklist" }, { "properties": { "rejected_code": { "default": 403, "minimum": 200, "type": "integer" }, "type": { "default": "consumer_name", "enum": ["consumer_name", "service_id"], "type": "string" }, "whitelist": { "items": { "type": "string" }, "minItems": 1, "type": "array" } }, "required": ["whitelist"], "title": "whitelist" }], "properties": { "disable": { "type": "boolean" } }, "type": "object" } ``` dashboard can create a route with `key-auth` plugin and `consumer-restriction` plugin successfully. and the `consumer-restriction` plugin can work correctly with the configuration. If you can change the keys **order** in properties one from current: `blacklist, rejected_code, type` to expected `rejected_code, type, blacklist`, that would be better :) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] liuxiran edited a comment on pull request #2440: WIP:plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
liuxiran edited a comment on pull request #2440: URL: https://github.com/apache/apisix/pull/2440#issuecomment-710740234 > According to the previous JSON schema data format, without changing the logic, the current writing method is not the same as the data obtained by apisix-dashboard. I need to discuss with @liuxiran again tomorrow @Jaycean with your newest json schema ```json { "oneOf": [{ "properties": { "blacklist": { "items": { "type": "string" }, "minItems": 1, "type": "array" }, "rejected_code": { "default": 403, "minimum": 200, "type": "integer" }, "type": { "default": "consumer_name", "enum": ["consumer_name", "service_id"], "type": "string" } }, "required": ["blacklist"], "title": "blacklist" }, { "properties": { "rejected_code": { "default": 403, "minimum": 200, "type": "integer" }, "type": { "default": "consumer_name", "enum": ["consumer_name", "service_id"], "type": "string" }, "whitelist": { "items": { "type": "string" }, "minItems": 1, "type": "array" } }, "required": ["whitelist"], "title": "whitelist" }], "properties": { "disable": { "type": "boolean" } }, "type": "object" } ``` dashboard can create a route with `key-auth` plugin and `consumer-restriction` plugin successfully. and the `consumer-restriction` plugin can work correctly with the configuration. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] liuxiran edited a comment on pull request #2440: WIP:plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
liuxiran edited a comment on pull request #2440: URL: https://github.com/apache/apisix/pull/2440#issuecomment-710740234 > According to the previous JSON schema data format, without changing the logic, the current writing method is not the same as the data obtained by apisix-dashboard. I need to discuss with @liuxiran again tomorrow @Jaycean with your newest json schema ```json { "oneOf": [{ "properties": { "blacklist": { "items": { "type": "string" }, "minItems": 1, "type": "array" }, "rejected_code": { "default": 403, "minimum": 200, "type": "integer" }, "type": { "default": "consumer_name", "enum": ["consumer_name", "service_id"], "type": "string" } }, "required": ["blacklist"], "title": "blacklist" }, { "properties": { "rejected_code": { "default": 403, "minimum": 200, "type": "integer" }, "type": { "default": "consumer_name", "enum": ["consumer_name", "service_id"], "type": "string" }, "whitelist": { "items": { "type": "string" }, "minItems": 1, "type": "array" } }, "required": ["whitelist"], "title": "whitelist" }], "properties": { "disable": { "type": "boolean" } }, "type": "object" } ``` dashboard can create a route with `key-auth` plugin and `consumer-restriction` plugin successfully. and the `consumer-restriction` plugin can work correctly with the configuration. And what is the purpose of the disable property below, which is not mentioned both in the [doc](https://github.com/apache/apisix/blob/master/doc/zh-cn/plugins/consumer-restriction.md) and in [test cases](https://github.com/apache/apisix/blob/master/t/plugin/consumer-restriction.t). it would be better to remove if it is no use:) ```json "properties": { "disable": { "type": "boolean" } } ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] liuxiran edited a comment on pull request #2440: WIP:plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
liuxiran edited a comment on pull request #2440: URL: https://github.com/apache/apisix/pull/2440#issuecomment-710740234 > According to the previous JSON schema data format, without changing the logic, the current writing method is not the same as the data obtained by apisix-dashboard. I need to discuss with @liuxiran again tomorrow @Jaycean with your newest json schema ```json { "oneOf": [{ "properties": { "blacklist": { "items": { "type": "string" }, "minItems": 1, "type": "array" }, "rejected_code": { "default": 403, "minimum": 200, "type": "integer" }, "type": { "default": "consumer_name", "enum": ["consumer_name", "service_id"], "type": "string" } }, "required": ["blacklist"], "title": "blacklist" }, { "properties": { "rejected_code": { "default": 403, "minimum": 200, "type": "integer" }, "type": { "default": "consumer_name", "enum": ["consumer_name", "service_id"], "type": "string" }, "whitelist": { "items": { "type": "string" }, "minItems": 1, "type": "array" } }, "required": ["whitelist"], "title": "whitelist" }], "properties": { "disable": { "type": "boolean" } }, "type": "object" } ``` dashboard can create a route with `key-auth` plugin and `consumer-restriction` plugin successfully. and the `consumer-restriction` plugin can work correctly with the configuration. And what is the purpose of the disable property below, which is not mentioned both in the [doc](https://github.com/apache/apisix/blob/master/doc/zh-cn/plugins/consumer-restriction.md) and in [test cases](https://github.com/apache/apisix/blob/master/t/plugin/consumer-restriction.t). it would be better to remove if it is no use:) cc @juzhiyuan @membphis ```json "properties": { "disable": { "type": "boolean" } } ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] juzhiyuan commented on pull request #2440: WIP:plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
juzhiyuan commented on pull request #2440: URL: https://github.com/apache/apisix/pull/2440#issuecomment-710752368 > > According to the previous JSON schema data format, without changing the logic, the current writing method is not the same as the data obtained by apisix-dashboard. I need to discuss with @liuxiran again tomorrow > > @Jaycean > with your newest json schema > > ```json > { >"oneOf": [{ >"properties": { >"blacklist": { >"items": { >"type": "string" >}, >"minItems": 1, >"type": "array" >}, >"rejected_code": { >"default": 403, >"minimum": 200, >"type": "integer" >}, >"type": { >"default": "consumer_name", >"enum": ["consumer_name", "service_id"], >"type": "string" >} >}, >"required": ["blacklist"], >"title": "blacklist" >}, { >"properties": { >"rejected_code": { >"default": 403, >"minimum": 200, >"type": "integer" >}, >"type": { >"default": "consumer_name", >"enum": ["consumer_name", "service_id"], >"type": "string" >}, >"whitelist": { >"items": { >"type": "string" >}, >"minItems": 1, >"type": "array" >} >}, >"required": ["whitelist"], >"title": "whitelist" >}], >"properties": { >"disable": { >"type": "boolean" >} >}, >"type": "object" > } > ``` > > dashboard can create a route with `key-auth` plugin and `consumer-restriction` plugin successfully. and the `consumer-restriction` plugin can work correctly with the configuration. > > And what is the purpose of the disable property below, which is not mentioned both in the [doc](https://github.com/apache/apisix/blob/master/doc/zh-cn/plugins/consumer-restriction.md) and in [test cases](https://github.com/apache/apisix/blob/master/t/plugin/consumer-restriction.t). it would be better to remove if it is no use:) > cc @juzhiyuan @membphis > > ```json > "properties": { >"disable": { >"type": "boolean" >} >} > ``` hi please see here https://github.com/apache/apisix-dashboard/issues/495 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] haifeng9414 commented on issue #2423: request help: radixtree_host_uri does not consider routing priority
haifeng9414 commented on issue #2423: URL: https://github.com/apache/apisix/issues/2423#issuecomment-710752441 > @haifeng9414 many thx for your report. would you like to fix this issue? Yes, I would This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] juzhiyuan commented on issue #527: wolf-rbac can't add to plugin page
juzhiyuan commented on issue #527: URL: https://github.com/apache/apisix-dashboard/issues/527#issuecomment-710752801 should be added when releasing 1.6, 1 week currently, This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis merged pull request #2424: feat: In dns parse, when the parameter `resolvers` is empty, the local dns is used as `resolvers` by default
membphis merged pull request #2424: URL: https://github.com/apache/apisix/pull/2424 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix] branch master updated: feat: In dns parse, when the parameter `resolvers` is empty, the local dns is used as `resolvers` by default (#2424)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git The following commit(s) were added to refs/heads/master by this push: new d1729c0 feat: In dns parse, when the parameter `resolvers` is empty, the local dns is used as `resolvers` by default (#2424) d1729c0 is described below commit d1729c0af3bc416a88904568b4d2718c99a1982d Author: Firstsawyou <52862365+firstsaw...@users.noreply.github.com> AuthorDate: Sat Oct 17 13:44:53 2020 +0800 feat: In dns parse, when the parameter `resolvers` is empty, the local dns is used as `resolvers` by default (#2424) fix #2422 --- apisix/core/utils.lua | 10 -- apisix/init.lua| 4 +++- t/core/utils.t | 47 ++ t/node/upstream-node-dns.t | 16 4 files changed, 66 insertions(+), 11 deletions(-) diff --git a/apisix/core/utils.lua b/apisix/core/utils.lua index 9e8fc1e..e29784f 100644 --- a/apisix/core/utils.lua +++ b/apisix/core/utils.lua @@ -69,7 +69,8 @@ function _M.split_uri(uri) end -local function dns_parse(resolvers, domain) +local function dns_parse(domain, resolvers) +resolvers = resolvers or _M.resolvers local r, err = resolver:new{ nameservers = table.clone(resolvers), retrans = 5, -- 5 retransmissions on receive timeout @@ -100,11 +101,16 @@ local function dns_parse(resolvers, domain) return nil, "unsupport DNS answer" end -return dns_parse(resolvers, answer.cname) +return dns_parse(answer.cname, resolvers) end _M.dns_parse = dns_parse +function _M.set_resolver(resolvers) +_M.resolvers = resolvers +end + + local function rfind_char(s, ch, idx) local b = str_byte(ch) for i = idx or #s, 1, -1 do diff --git a/apisix/init.lua b/apisix/init.lua index 3beec45..de51cd3 100644 --- a/apisix/init.lua +++ b/apisix/init.lua @@ -45,6 +45,7 @@ local ver_header= "APISIX/" .. core.version.VERSION local function parse_args(args) dns_resolver = args and args["dns_resolver"] +core.utils.set_resolver(dns_resolver) core.log.info("dns resolver", core.json.delay_encode(dns_resolver, true)) end @@ -177,7 +178,7 @@ end local function parse_domain(host) -local ip_info, err = core.utils.dns_parse(dns_resolver, host) +local ip_info, err = core.utils.dns_parse(host) if not ip_info then core.log.error("failed to parse domain: ", host, ", error: ",err) return nil, err @@ -219,6 +220,7 @@ local function parse_domain_for_nodes(nodes) return new_nodes end + local function compare_upstream_node(old_t, new_t) if type(old_t) ~= "table" then return false diff --git a/t/core/utils.t b/t/core/utils.t index 9c19f29..25b0419 100644 --- a/t/core/utils.t +++ b/t/core/utils.t @@ -68,3 +68,50 @@ qr/random seed \d+\ntwice: false/ GET /t --- no_error_log [error] + + + +=== TEST 3: specify resolvers +--- config +location /t { +content_by_lua_block { +local core = require("apisix.core") +local resolvers = {"8.8.8.8"} +core.utils.set_resolver(resolvers) +local ip_info, err = core.utils.dns_parse("github.com", resolvers) +if not ip_info then +core.log.error("failed to parse domain: ", host, ", error: ",err) +end +ngx.say(core.json.encode(ip_info)) +} +} +--- request +GET /t +--- response_body eval +qr/"address":.+,"name":"github.com"/ +--- no_error_log +[error] + + + +=== TEST 4: default resolvers +--- config +location /t { +content_by_lua_block { +local core = require("apisix.core") +local ip_info, err = core.utils.dns_parse("github.com") +if not ip_info then +core.log.error("failed to parse domain: ", host, ", error: ",err) +end +core.log.info("ip_info: ", core.json.encode(ip_info)) +ngx.say("resolvers: ", core.json.encode(core.utils.resolvers)) +} +} +--- request +GET /t +--- response_body +resolvers: ["8.8.8.8","114.114.114.114"] +--- error_log eval +qr/"address":.+,"name":"github.com"/ +--- no_error_log +[error] diff --git a/t/node/upstream-node-dns.t b/t/node/upstream-node-dns.t index ef15dc2..b539873 100644 --- a/t/node/upstream-node-dns.t +++ b/t/node/upstream-node-dns.t @@ -79,7 +79,7 @@ passed apisix.http_init() local utils = require("apisix.core.utils") -utils.dns_parse = function (resolvers, domain) -- mock: DNS parser +utils.dns_parse = function (domain, resolvers) -- mock: DNS parser if domain == "test.com" then return {address = "127.0.0.2"} end @@ -104,7 +104,7 @@ hello world local utils = require("apisix.core.utils") local count = 0 -utils.dns_parse = function (resolvers, domain) -- mock: DNS parse
[GitHub] [apisix] membphis closed issue #2422: feat: In dns parse, when the parameter `resolvers` is empty, will use the default `resolvers`
membphis closed issue #2422: URL: https://github.com/apache/apisix/issues/2422 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] liuxiran commented on pull request #2440: WIP:plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
liuxiran commented on pull request #2440: URL: https://github.com/apache/apisix/pull/2440#issuecomment-710756225 > hi please see here apache/apisix-dashboard#495 so you means apisix should not return disable filed until get request when FE needed? @juzhiyuan it seems that when the schema of the plugin does not have a `properties` property in the first level of the json schema, the interface returns the data with `disable` field. related code: https://github.com/membphis/apisix/blob/133b52ec78665b7292af62bab6af6bf981363a42/apisix/plugin.lua#L81 which doesn't seem reasonable, especially after json schema changed from draft5 to draft7. in json schema draft7, the `oneof` `anyof` and `allof` type of schema e.g the schema in pr https://github.com/apache/apisix/pull/2440,whice does not contain `properties` in first level cc @Jaycean the https://github.com/apache/apisix/issues/2439 may also have something to do with it. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] imjoey opened a new issue #2445: request help(prometheus): Add consumer_id dimension in http metrics for prometheus plugin
imjoey opened a new issue #2445: URL: https://github.com/apache/apisix/issues/2445 ### Issue description For now, there has no `consumer_id` dimension in http metrics, so we cannot get the data such as: - HTTP status returned by each route accessed by each consumer - HTTP request count sent from each consumer to each route Let's take `apisix_http_status` for example, an additional label `consumer="joey"` is exported, as the following: ``` apisix_http_status{code="200",route="77f32992-4fe8-4888-9553-84d7e1240734",service="",consumer="joey",node="8.8.8.8"} 5487 ``` Any feedback is welcome. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] juzhiyuan commented on pull request #2440: WIP:plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.
juzhiyuan commented on pull request #2440: URL: https://github.com/apache/apisix/pull/2440#issuecomment-710761426 > > hi please see here [apache/apisix-dashboard#495](https://github.com/apache/apisix-dashboard/issues/495) > > so you means apisix should not return disable filed until get request when FE needed? @juzhiyuan > > it seems that when the schema of the plugin does not have a `properties` property in the first level of the json schema, the interface returns the data with `disable` field. > related code: https://github.com/membphis/apisix/blob/133b52ec78665b7292af62bab6af6bf981363a42/apisix/plugin.lua#L81 > which doesn't seem reasonable, especially after json schema changed from draft5 to draft7. > in json schema draft7, the `oneof` `anyof` and `allof` type of schema e.g the schema in pr #2440 does not contain `properties` in first level > cc @Jaycean > > the #2439 may also have something to do with it. hi @membphis, What do you think? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tzssangglass commented on pull request #2443: feature: prometheus plugin `apisix_http_status` metric `route` tag Im…
tzssangglass commented on pull request #2443: URL: https://github.com/apache/apisix/pull/2443#issuecomment-710762002 @membphis @moonming @nic-chen please help me, take a look at CI error:https://github.com/apache/apisix/pull/2443/checks?check_run_id=1266120426#step:6:417 I don't think my changes have anything to do with the failure of these test cases. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] haifeng9414 opened a new pull request #2446: bugfix(radixtree_host_uri): set route priority.
haifeng9414 opened a new pull request #2446: URL: https://github.com/apache/apisix/pull/2446 Fix: [#2423](https://github.com/apache/apisix/issues/2423). ### Pre-submission checklist: * [x] Did you explain what problem does this PR solve? Or what new features have been added? * [x] Have you added corresponding test cases? * [ ] Have you modified the corresponding document? * [x] Is this PR backward compatible? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org