[apisix] branch master updated: chore: move try_read_attr function into table.lua (#2257) (#2566)

2020-10-30 Thread spacewander
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 68cf301  chore: move try_read_attr function into table.lua (#2257) 
(#2566)
68cf301 is described below

commit 68cf301ed447a8d1ab112f1adb7a7ba1304da3db
Author: Peter Zhu 
AuthorDate: Sat Oct 31 09:13:20 2020 +0800

chore: move try_read_attr function into table.lua (#2257) (#2566)

Co-authored-by: YuanSheng Wang 
---
 apisix/core/table.lua | 16 
 apisix/plugins/hmac-auth.lua  | 21 +++--
 apisix/plugins/log-rotate.lua | 21 +++--
 apisix/plugins/skywalking.lua | 21 +++--
 t/core/table.t| 26 ++
 5 files changed, 51 insertions(+), 54 deletions(-)

diff --git a/apisix/core/table.lua b/apisix/core/table.lua
index 6b77b42..10bfaa7 100644
--- a/apisix/core/table.lua
+++ b/apisix/core/table.lua
@@ -60,6 +60,22 @@ function _M.set(tab, ...)
 end
 
 
+function _M.try_read_attr(tab, ...)
+local count = select('#', ...)
+
+for i = 1, count do
+local attr = select(i, ...)
+if type(tab) ~= "table" then
+return nil
+end
+
+tab = tab[attr]
+end
+
+return tab
+end
+
+
 function _M.array_find(array, val)
 for i, v in ipairs(array) do
 if v == val then
diff --git a/apisix/plugins/hmac-auth.lua b/apisix/plugins/hmac-auth.lua
index 9f6e6d1..b85390e 100644
--- a/apisix/plugins/hmac-auth.lua
+++ b/apisix/plugins/hmac-auth.lua
@@ -16,7 +16,6 @@
 --
 local ngx= ngx
 local type   = type
-local select = select
 local abs= math.abs
 local ngx_time   = ngx.time
 local ngx_re = require("ngx.re")
@@ -99,21 +98,6 @@ local hmac_funcs = {
 }
 
 
-local function try_attr(t, ...)
-local tbl = t
-local count = select('#', ...)
-for i = 1, count do
-local attr = select(i, ...)
-tbl = tbl[attr]
-if type(tbl) ~= "table" then
-return false
-end
-end
-
-return true
-end
-
-
 local function array_to_map(arr)
 local map = core.table.new(0, #arr)
 for _, v in ipairs(arr) do
@@ -328,8 +312,9 @@ local function get_params(ctx)
 local date_key = DATE_KEY
 local signed_headers_key = SIGNED_HEADERS_KEY
 
-if try_attr(local_conf, "plugin_attr", "hmac-auth") then
-local attr = local_conf.plugin_attr["hmac-auth"]
+local attr = core.table.try_read_attr(local_conf, "plugin_attr",
+  "hmac-auth")
+if attr then
 access_key = attr.access_key or access_key
 signature_key = attr.signature_key or signature_key
 algorithm_key = attr.algorithm_key or algorithm_key
diff --git a/apisix/plugins/log-rotate.lua b/apisix/plugins/log-rotate.lua
index 22d38b1..6287b55 100644
--- a/apisix/plugins/log-rotate.lua
+++ b/apisix/plugins/log-rotate.lua
@@ -23,8 +23,6 @@ local lfs = require("lfs")
 local io = io
 local os = os
 local table = table
-local select = select
-local type = type
 local string = string
 local local_conf
 
@@ -152,26 +150,13 @@ local function scan_log_folder()
 end
 
 
-local function try_attr(t, ...)
-local count = select('#', ...)
-for i = 1, count do
-local attr = select(i, ...)
-t = t[attr]
-if type(t) ~= "table" then
-return false
-end
-end
-
-return true
-end
-
-
 local function rotate()
 local local_conf = core.config.local_conf()
 local interval = INTERVAL
 local max_kept = MAX_KEPT
-if try_attr(local_conf, "plugin_attr", "log-rotate") then
-local attr = local_conf.plugin_attr["log-rotate"]
+local attr = core.table.try_read_attr(local_conf, "plugin_attr",
+  "log-rotate")
+if attr then
 interval = attr.interval or interval
 max_kept = attr.max_kept or max_kept
 end
diff --git a/apisix/plugins/skywalking.lua b/apisix/plugins/skywalking.lua
index 26aeb60..c62ba8a 100644
--- a/apisix/plugins/skywalking.lua
+++ b/apisix/plugins/skywalking.lua
@@ -19,8 +19,6 @@ local core = require("apisix.core")
 local process = require("ngx.process")
 local ngx = ngx
 local math = math
-local select = select
-local type = type
 local require = require
 
 local plugin_name = "skywalking"
@@ -103,28 +101,15 @@ function _M.log(conf, ctx)
 end
 
 
-local function try_read_attr(t, ...)
-local count = select('#', ...)
-for i = 1, count do
-local attr = select(i, ...)
-if type(t) ~= "table" then
-return nil
-end
-t = t[attr]
-end
-
-return t
-end
-
-
 function _M.init()
 if process.type() ~= "worker" and process.type() ~= "single" then
 return
 end
 
 local local_conf = core.config.local_conf()
-local 

[apisix] branch master updated: doc(api-breaker): add doc in README and plugin list (#2580)

2020-10-30 Thread membphis
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 735240f  doc(api-breaker): add doc in README and plugin list  (#2580)
735240f is described below

commit 735240fd77f1cf6df34f1da8ca74d033d812f732
Author: tashiya-menuri <73444151+tashiya-men...@users.noreply.github.com>
AuthorDate: Sat Oct 31 05:00:06 2020 +0530

doc(api-breaker): add doc in README and plugin list  (#2580)

Fix #2529
---
 doc/README.md   | 1 +
 doc/zh-cn/README.md | 1 +
 2 files changed, 2 insertions(+)

diff --git a/doc/README.md b/doc/README.md
index 443bb0b..9a1c2c3 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -76,6 +76,7 @@ Plugins
 * [proxy-cache](plugins/proxy-cache.md): Provides the ability to cache 
upstream response data.
 * [request-validation](plugins/request-validation.md): Validates requests 
before forwarding to upstream.
 * [proxy-mirror](plugins/proxy-mirror.md): Provides the ability to mirror 
client requests.
+* [api-breaker](plugins/api-breaker.md): Circuit Breaker for API that stops 
requests forwarding to upstream in case of unhealthy state.
 
 **Monitoring**
 * [prometheus](plugins/prometheus.md): Expose metrics related to APISIX and 
proxied upstream services in Prometheus exposition format, which can be scraped 
by a Prometheus Server.
diff --git a/doc/zh-cn/README.md b/doc/zh-cn/README.md
index 2cc935f..b6ddbb2 100644
--- a/doc/zh-cn/README.md
+++ b/doc/zh-cn/README.md
@@ -70,6 +70,7 @@
 * [uri-blocker](plugins/uri-blocker.md): 根据 URI 拦截用户请求。
 * [oauth](plugins/openid-connect.md): 提供 OAuth 2 身份验证和自省。
 * [log-rotate](plugins/log-rotate.md): 日志文件定期切分。
+* [api-breaker](plugins/api-breaker.md): API的断路器,在状态不正常的情况下停止将请求转发到上游。
 
 部署
 ===



[apisix] branch master updated: doc: add grpc-proxy.md link in `doc/README.md` (#2525)

2020-10-30 Thread membphis
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 acaae91  doc: add grpc-proxy.md link in `doc/README.md` (#2525)
acaae91 is described below

commit acaae9140a369fd1923e83201985ba74995433b4
Author: tashiya-menuri <73444151+tashiya-men...@users.noreply.github.com>
AuthorDate: Sat Oct 31 04:58:42 2020 +0530

doc: add grpc-proxy.md link in `doc/README.md` (#2525)

Fix #2327
---
 doc/README.md   | 1 +
 doc/zh-cn/README.md | 1 +
 2 files changed, 2 insertions(+)

diff --git a/doc/README.md b/doc/README.md
index 8323ea0..443bb0b 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -31,6 +31,7 @@ Reference Documentation
 * [Router radixtree](router-radixtree.md)
 * [Stand Alone Model](stand-alone.md): Supports to load route rules from local 
yaml file, it is more friendly such as under the kubernetes(k8s).
 * [Stream Proxy](stream-proxy.md)
+* [gRPC Proxy](grpc-proxy.md)
 * [Admin API](admin-api.md)
 * [Changelog](../CHANGELOG.md)
 * [Code Style](../CODE_STYLE.md)
diff --git a/doc/zh-cn/README.md b/doc/zh-cn/README.md
index 2c45511..2cc935f 100644
--- a/doc/zh-cn/README.md
+++ b/doc/zh-cn/README.md
@@ -29,6 +29,7 @@
 * [路由 radixtree](../router-radixtree.md)
 * [独立运行模型](stand-alone.md): 支持从本地 yaml 格式的配置文件启动,更适合 Kubernetes(k8s) 体系。
 * [TCP/UDP 动态代理](stream-proxy.md)
+* [gRPC 代理](grpc-proxy.md)
 * [管理 API](admin-api.md)
 * [变更日志](../../CHANGELOG_CN.md)
 * [代码风格](../../CODE_STYLE_CN.md)



[apisix] branch master updated: bugfix(redirect): fix typo name of redirect plugin.

2020-10-30 Thread membphis
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 18bae7b  bugfix(redirect): fix typo name of redirect plugin.
18bae7b is described below

commit 18bae7b75e4626d1a9ad24222a2a41f6678de838
Author: cscfamily001 <52036399+cscfamily...@users.noreply.github.com>
AuthorDate: Fri Oct 30 21:59:13 2020 +0800

bugfix(redirect): fix typo name of redirect plugin.
---
 apisix/plugins/redirect.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apisix/plugins/redirect.lua b/apisix/plugins/redirect.lua
index 1dec732..a325130 100644
--- a/apisix/plugins/redirect.lua
+++ b/apisix/plugins/redirect.lua
@@ -40,7 +40,7 @@ local schema = {
 }
 
 
-local plugin_name = "rewrite"
+local plugin_name = "redirect"
 
 local _M = {
 version = 0.1,



[apisix] branch master updated: feat: implement `array_find` in `apisix.core.table` (#2564)

2020-10-30 Thread vinci
This is an automated email from the ASF dual-hosted git repository.

vinci 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 45216a2  feat: implement `array_find` in `apisix.core.table` (#2564)
45216a2 is described below

commit 45216a25f2dc07949c963d989d21d3e3a8dd6270
Author: 罗泽轩 
AuthorDate: Fri Oct 30 20:51:44 2020 +0800

feat: implement `array_find` in `apisix.core.table` (#2564)

Close #2486
---
 apisix/core/table.lua  | 12 
 apisix/plugins/api-breaker.lua | 19 ---
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/apisix/core/table.lua b/apisix/core/table.lua
index 4ad92ca..6b77b42 100644
--- a/apisix/core/table.lua
+++ b/apisix/core/table.lua
@@ -20,6 +20,7 @@ local setmetatable = setmetatable
 local select   = select
 local new_tab  = require("table.new")
 local nkeys= require("table.nkeys")
+local ipairs   = ipairs
 local pairs= pairs
 local type = type
 local ngx_re   = require("ngx.re")
@@ -59,6 +60,17 @@ function _M.set(tab, ...)
 end
 
 
+function _M.array_find(array, val)
+for i, v in ipairs(array) do
+if v == val then
+return i
+end
+end
+
+return nil
+end
+
+
 -- only work under lua51 or luajit
 function _M.setmt__gc(t, mt)
 local prox = newproxy(true)
diff --git a/apisix/plugins/api-breaker.lua b/apisix/plugins/api-breaker.lua
index d97577d..f144a06 100644
--- a/apisix/plugins/api-breaker.lua
+++ b/apisix/plugins/api-breaker.lua
@@ -20,7 +20,6 @@ local plugin_name = "api-breaker"
 local ngx = ngx
 local math = math
 local error = error
-local ipairs = ipairs
 
 local shared_buffer = ngx.shared['plugin-'.. plugin_name]
 if not shared_buffer then
@@ -90,18 +89,6 @@ local schema = {
 }
 
 
--- todo: we can move this into `core.talbe`
-local function array_find(array, val)
-for i, v in ipairs(array) do
-if v == val then
-return i
-end
-end
-
-return nil
-end
-
-
 local function gen_healthy_key(ctx)
 return "healthy-" .. core.request.get_host(ctx) .. ctx.var.uri
 end
@@ -188,7 +175,9 @@ function _M.log(conf, ctx)
 end
 
 -- unhealth process
-if array_find(conf.unhealthy.http_statuses, upstream_status) then
+if core.table.array_find(conf.unhealthy.http_statuses,
+ upstream_status)
+then
 local unhealthy_count, err = shared_buffer:incr(unhealthy_key, 1, 0)
 if err then
 core.log.warn("failed to incr unhealthy_key: ", unhealthy_key,
@@ -212,7 +201,7 @@ function _M.log(conf, ctx)
 end
 
 -- health process
-if not array_find(conf.healthy.http_statuses, upstream_status) then
+if not core.table.array_find(conf.healthy.http_statuses, upstream_status) 
then
 return
 end
 



[apisix] branch master updated: feature: support multiple service discovery (#2556)

2020-10-30 Thread vinci
This is an automated email from the ASF dual-hosted git repository.

vinci 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 fff4d14  feature: support multiple service discovery (#2556)
fff4d14 is described below

commit fff4d14a0dcbd6a9854782d7ff22d09b27a19082
Author: shoogoome <34764574+shoogo...@users.noreply.github.com>
AuthorDate: Fri Oct 30 20:34:10 2020 +0800

feature: support multiple service discovery (#2556)

support multiple service discovery,then we can switch it in upstream
---
 apisix/balancer.lua | 10 +++-
 apisix/discovery/eureka.lua | 18 +++---
 apisix/discovery/init.lua   | 18 ++
 apisix/schema_def.lua   |  4 
 conf/config-default.yaml| 23 +-
 doc/discovery.md| 47 
 doc/zh-cn/discovery.md  | 58 +
 t/discovery/eureka.t| 26 ++--
 8 files changed, 121 insertions(+), 83 deletions(-)

diff --git a/apisix/balancer.lua b/apisix/balancer.lua
index f2eec90..4eba0bb 100644
--- a/apisix/balancer.lua
+++ b/apisix/balancer.lua
@@ -164,7 +164,15 @@ local function pick_server(route, ctx)
 if not discovery then
 return nil, "discovery is uninitialized"
 end
-up_conf.nodes = discovery.nodes(up_conf.service_name)
+if not up_conf.discovery_type then
+return nil, "discovery server need appoint"
+end
+
+local dis = discovery[up_conf.discovery_type]
+if not dis then
+return nil, "discovery is uninitialized"
+end
+up_conf.nodes = dis.nodes(up_conf.service_name)
 end
 
 local nodes_count = up_conf.nodes and #up_conf.nodes or 0
diff --git a/apisix/discovery/eureka.lua b/apisix/discovery/eureka.lua
index d4b4368..179d763 100644
--- a/apisix/discovery/eureka.lua
+++ b/apisix/discovery/eureka.lua
@@ -66,7 +66,8 @@ local _M = {
 
 
 local function service_info()
-local host = local_conf.eureka and local_conf.eureka.host
+local host = local_conf.discovery and
+local_conf.discovery.eureka and local_conf.discovery.eureka.host
 if not host then
 log.error("do not set eureka.host")
 return
@@ -84,8 +85,8 @@ local function service_info()
 url = protocol .. other
 basic_auth = "Basic " .. ngx.encode_base64(user_and_password)
 end
-if local_conf.eureka.prefix then
-url = url .. local_conf.eureka.prefix
+if local_conf.discovery.eureka.prefix then
+url = url .. local_conf.discovery.eureka.prefix
 end
 if string_sub(url, #url) ~= "/" then
 url = url .. "/"
@@ -117,7 +118,7 @@ local function request(request_uri, basic_auth, method, 
path, query, body)
 end
 
 local httpc = http.new()
-local timeout = local_conf.eureka.timeout
+local timeout = local_conf.discovery.eureka.timeout
 local connect_timeout = timeout and timeout.connect or 2000
 local send_timeout = timeout and timeout.send or 2000
 local read_timeout = timeout and timeout.read or 5000
@@ -231,19 +232,20 @@ end
 
 
 function _M.init_worker()
-if not local_conf.eureka or not local_conf.eureka.host or 
#local_conf.eureka.host == 0 then
+if not local_conf.discovery.eureka or
+not local_conf.discovery.eureka.host or 
#local_conf.discovery.eureka.host == 0 then
 error("do not set eureka.host")
 return
 end
 
-local ok, err = core.schema.check(schema, local_conf.eureka)
+local ok, err = core.schema.check(schema, local_conf.discovery.eureka)
 if not ok then
 error("invalid eureka configuration: " .. err)
 return
 end
-default_weight = local_conf.eureka.weight or 100
+default_weight = local_conf.discovery.eureka.weight or 100
 log.info("default_weight:", default_weight, ".")
-local fetch_interval = local_conf.eureka.fetch_interval or 30
+local fetch_interval = local_conf.discovery.eureka.fetch_interval or 30
 log.info("fetch_interval:", fetch_interval, ".")
 ngx_timer_at(0, fetch_full_registry)
 ngx_timer_every(fetch_interval, fetch_full_registry)
diff --git a/apisix/discovery/init.lua b/apisix/discovery/init.lua
index 16aafe6..10e7aa1 100644
--- a/apisix/discovery/init.lua
+++ b/apisix/discovery/init.lua
@@ -17,15 +17,25 @@
 
 local log  = require("apisix.core.log")
 local local_conf   = require("apisix.core.config_local").local_conf()
+local pairs= pairs
 
-local discovery_type = local_conf.apisix and local_conf.apisix.discovery
-local discovery
+local discovery_type = local_conf.discovery
+local discovery = {}
 
 if discovery_type then
-log.info("use discovery: ", discovery_type)
-discovery = require("apisix.discovery." .. discovery_type)
+for discovery_name, _ in pairs(discovery_type) do
+

[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


juzhiyuan commented on pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#issuecomment-719478498


   Wow! All tests have passed, could we merge 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-dashboard] gy09535 edited a comment on issue #648: feat: Should apisix dashboard support multi-tenancy function?

2020-10-30 Thread GitBox


gy09535 edited a comment on issue #648:
URL: 
https://github.com/apache/apisix-dashboard/issues/648#issuecomment-719474821


   In my environment  has more then 2000 apis , some apis is for transaction, 
they are core function , we should split it in different cluster,  cluster 
count is related with your business. I think we should has a service discovery 
to  register different cluster and we can  monitoring it and manage it such as 
restart stop upgrade and so on.



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] gy09535 edited a comment on issue #648: feat: Should apisix dashboard support multi-tenancy function?

2020-10-30 Thread GitBox


gy09535 edited a comment on issue #648:
URL: 
https://github.com/apache/apisix-dashboard/issues/648#issuecomment-719474821


   In my environment  has more then 2000 apis , some apis is for transaction, 
they are core function , we should split it in different cluster,  cluster 
count is related with your business. I think we should has a service discovery 
to  register different cluster and we can  monitoring it and manage to such as 
restart stop upgrade and so on.



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] gy09535 edited a comment on issue #648: feat: Should apisix dashboard support multi-tenancy function?

2020-10-30 Thread GitBox


gy09535 edited a comment on issue #648:
URL: 
https://github.com/apache/apisix-dashboard/issues/648#issuecomment-719474821


   In my environment  has more then 2000 apis , some apis is for transaction, 
they are core function , we should split it in different cluster,  cluster 
count is related with your business. 



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] gy09535 commented on issue #648: feat: Should apisix dashboard support multi-tenancy function?

2020-10-30 Thread GitBox


gy09535 commented on issue #648:
URL: 
https://github.com/apache/apisix-dashboard/issues/648#issuecomment-719474821


   In my environment  has more the 2000 apis , some apis is for transaction, 
they are core function , we should split it in different cluster,  cluster 
count is related with your business. 



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] ShiningRush commented on issue #648: feat: Should apisix dashboard support multi-tenancy function?

2020-10-30 Thread GitBox


ShiningRush commented on issue #648:
URL: 
https://github.com/apache/apisix-dashboard/issues/648#issuecomment-719471139


   I think this is a useful feature, such as using a dashboard to manage API 
gateways and streaming gateways, but the priority can be lowered.
   Because usually the number of gateway clusters is not too much, even if per 
gateway uses a dashboard, it will not bring too much burden to users.
   BTW: The reason why the k8s cluster needs federation here is because there 
are indeed many clusters, especially for cloud platforms



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] idbeta opened a new issue #2577: proposal: chaos test

2020-10-30 Thread GitBox


idbeta opened a new issue #2577:
URL: https://github.com/apache/apisix/issues/2577


   1. Background
 In the real world, various faults may occur anytime and anywhere, such 
as sudden disk write failure, or sudden network disconnection in the computer 
room, etc. In order to more easily verify APISIX's tolerance for various 
faults, we need to perform chaos testing.
   2. Purpose
Check whether APISIX can work normally in the case of various external 
faults.
   3. Method
Thanks to @Yiyiyimu for recommending a good testing tool that can 
simulate various system 
failures--[chaos-mesh](https://github.com/chaos-mesh/chaos-mesh), we can add a 
separate action to combine 
[chaos-mesh](https://github.com/chaos-mesh/chaos-mesh) to perform chaos testing 
on APISXI.



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] moonming commented on issue #648: feat: Should apisix dashboard support multi-tenancy function?

2020-10-30 Thread GitBox


moonming commented on issue #648:
URL: 
https://github.com/apache/apisix-dashboard/issues/648#issuecomment-719468894


   @gxthrj @spacewander 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] gy09535 edited a comment on issue #2533: request help: failed to set server peer [some-k8s-svc.default.svc.cluster.local:5202] err: no host allowed

2020-10-30 Thread GitBox


gy09535 edited a comment on issue #2533:
URL: https://github.com/apache/apisix/issues/2533#issuecomment-719466474


   Another problem is apisix how to support all dns resolve rules , now can 
just support name server , I think when the host is not find ,we should search 
another domain such as   "service.name.apisix.svc.cluster.local" and 
"service.name.cluster.local" etc... I think we can support this.
   ```
   nameserver xx
   search apisix.svc.cluster.local svc.cluster.local cluster.local
   options ndots:5
   ```



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 #2533: request help: failed to set server peer [some-k8s-svc.default.svc.cluster.local:5202] err: no host allowed

2020-10-30 Thread GitBox


gy09535 commented on issue #2533:
URL: https://github.com/apache/apisix/issues/2533#issuecomment-719466474


   another problem is apisix how to support all dns resolve rules , now can 
just support name server , I think when the host is not find ,we should search 
another domain such as   "service.name.apisix.svc.cluster.local" and 
"service.name.cluster.local"  etc 
   ```
   nameserver xx
   search apisix.svc.cluster.local svc.cluster.local cluster.local
   options ndots:5
   ```



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] idbeta commented on pull request #619: feat: added e2e test for Login page

2020-10-30 Thread GitBox


idbeta commented on pull request #619:
URL: https://github.com/apache/apisix-dashboard/pull/619#issuecomment-719463169


   It’s really a good example. It’s better if there is a public function for 
logging in. 
   For other test cases, just calling it is equivalent to logging in to the 
dashboard.



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] gy09535 edited a comment on issue #648: feat: Should apisix dashboard Multi-tenancy function?

2020-10-30 Thread GitBox


gy09535 edited a comment on issue #648:
URL: 
https://github.com/apache/apisix-dashboard/issues/648#issuecomment-719458230


   > @gy09535 I think you want to manager Apache APISIX clusters in one 
dashboard, right?
   
   yeah,I am  now  consider  how to manage api with different department , for  
this case  may have more  apisix cluster and I get some ideal from k8s 
federation ref: 
https://kubernetes.io/blog/2018/12/12/kubernetes-federation-evolution/



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] moonming commented on pull request #2576: bugfix: fix typo name of redirect plugin.

2020-10-30 Thread GitBox


moonming commented on pull request #2576:
URL: https://github.com/apache/apisix/pull/2576#issuecomment-719461651


   it will better if you can add test case for 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] cscfamily001 opened a new pull request #2576: 插件名字修改

2020-10-30 Thread GitBox


cscfamily001 opened a new pull request #2576:
URL: https://github.com/apache/apisix/pull/2576


   插件名字修改
   
   ### What this PR does / why we need it:
   
   
   
   ### Pre-submission checklist:
   
   * [ ] 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?
   * [ ] 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] gy09535 commented on issue #648: feat: Should apisix dashboard Multi-tenancy function?

2020-10-30 Thread GitBox


gy09535 commented on issue #648:
URL: 
https://github.com/apache/apisix-dashboard/issues/648#issuecomment-719458230


   > @gy09535 I think you want to manager Apache APISIX clusters in one 
dashboard, right?
   
   yeah



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 edited a comment on pull request #651: WIP: feat: support get plugin schema based on schema_type

2020-10-30 Thread GitBox


nic-chen edited a comment on pull request #651:
URL: https://github.com/apache/apisix-dashboard/pull/651#issuecomment-719452996


   @liuxiran 
   
   1. please refer to:
   
https://github.com/apache/apisix-dashboard/blob/master/api/internal/handler/consumer/consumer.go#L76-L87
   
   2.
   add  
   ```lua
   ngx.shared = {
   ["plugin-api-breaker"] = {}
   }
   ```
   to line 81 in `schema-sync.lua` and have a try.
   
   



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] uptree closed pull request #2305: fix: kafka-logger plugin sent to the same partition everytime

2020-10-30 Thread GitBox


uptree closed pull request #2305:
URL: https://github.com/apache/apisix/pull/2305


   



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 pull request #651: WIP: feat: support get plugin schema based on schema_type

2020-10-30 Thread GitBox


nic-chen commented on pull request #651:
URL: https://github.com/apache/apisix-dashboard/pull/651#issuecomment-719452996


   @liuxiran 
   
   1. please refer to:
   
https://github.com/apache/apisix-dashboard/blob/master/api/internal/handler/consumer/consumer.go#L76-L87
   
   2.
   add  
   ```lua
   ngx.shared = {
   "plugin-api-breaker" = {}
   }
   ```
   to line 81 in `schema-sync.lua` and have a try.
   
   



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 closed issue #652: docker-compose up

2020-10-30 Thread GitBox


juzhiyuan closed issue #652:
URL: https://github.com/apache/apisix-dashboard/issues/652


   



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 #652: docker-compose up

2020-10-30 Thread GitBox


juzhiyuan commented on issue #652:
URL: 
https://github.com/apache/apisix-dashboard/issues/652#issuecomment-719449887


   I will close this issue because there exists a duplicated issue #647 



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 #652: docker-compose up

2020-10-30 Thread GitBox


juzhiyuan commented on issue #652:
URL: 
https://github.com/apache/apisix-dashboard/issues/652#issuecomment-719449630


   Hi, @jinpy666 , sorry to lead you confusion, the docker compose is not 
stable both in the master branch and v2.0 branch, so we remove the Docker way 
from v2.0, and we are working on how to build Docker more smoothly and easily. 
This issue would be resolved in 2.0 RC3 soon.



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 #623: apisix-dashboard 403 Forbidden

2020-10-30 Thread GitBox


juzhiyuan commented on issue #623:
URL: 
https://github.com/apache/apisix-dashboard/issues/623#issuecomment-719447778


   > haha, Why don't modify the link in project page ?
   > it's old version deploy guide: 
https://github.com/apache/apisix-dashboard/blob/master/docs/deploy.md
   
   Because 2.0 is still in RC3, not a stable release, we are waiting for the 
release of RC3 :)



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 pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


nic-chen commented on pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#issuecomment-719443334


   > Is it necessary to add a test case for `TestRoute_Host`: create a route 
without both host and hosts ?
   
   done. thanks!



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 a change in pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


nic-chen commented on a change in pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#discussion_r514966671



##
File path: api/test/e2e/base.go
##
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+package e2e
+
+import (
+   "bytes"
+   "fmt"
+   "io/ioutil"
+   "net/http"
+   "testing"
+
+   "github.com/gavv/httpexpect/v2"
+   "github.com/tidwall/gjson"
+)
+
+var token string
+
+func init() {
+   //login to get auth token
+   requestBody := []byte(`{
+"username": "admin",

Review comment:
   thanks.





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] cleverpig commented on issue #623: apisix-dashboard 403 Forbidden

2020-10-30 Thread GitBox


cleverpig commented on issue #623:
URL: 
https://github.com/apache/apisix-dashboard/issues/623#issuecomment-719443239


   haha, Why don't modify the link in project page ?
   it's old version deploy guide: 
https://github.com/apache/apisix-dashboard/blob/master/docs/deploy.md



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] jinpy666 opened a new issue #652: docker-compose up

2020-10-30 Thread GitBox


jinpy666 opened a new issue #652:
URL: https://github.com/apache/apisix-dashboard/issues/652


   
   
![image](https://user-images.githubusercontent.com/5868671/97685532-08535500-1ad4-11eb-895e-2f142b5e94fe.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 commented on pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


liuxiran commented on pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#issuecomment-719435033


   Is it necessary to add a test case for `TestRoute_Host`: create a route 
without both host and hosts ?



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 a change in pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


liuxiran commented on a change in pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#discussion_r514955038



##
File path: api/test/e2e/base.go
##
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+package e2e
+
+import (
+   "bytes"
+   "fmt"
+   "io/ioutil"
+   "net/http"
+   "testing"
+
+   "github.com/gavv/httpexpect/v2"
+   "github.com/tidwall/gjson"
+)
+
+var token string
+
+func init() {
+   //login to get auth token
+   requestBody := []byte(`{
+"username": "admin",

Review comment:
   Please adjust the indentation :)





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 a change in pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


liuxiran commented on a change in pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#discussion_r514954657



##
File path: api/test/docker/manager-api-conf.json
##
@@ -0,0 +1,32 @@
+{
+"conf": {
+  "syslog": {
+"host": "127.0.0.1"
+  },
+  "listen": {
+"host": "",
+"port": 8080
+  },
+  "dag-lib-path": "",
+  "etcd": {
+"endpoints": 
"172.16.238.100:2379,172.16.238.101:2379,172.16.238.102:2379"
+  }
+},
+"authentication": {
+  "session": {
+"secret": "secret",
+"expireTime": 3600
+  },
+  "user": [
+{
+  "username": "admin",
+  "password": "admin"
+},
+{
+  "username": "user",
+  "password": "user"
+}
+  ]
+}
+  }
+  

Review comment:
   new line here





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 #646: request help: let custom plugin show in dashboard

2020-10-30 Thread GitBox


nic-chen commented on issue #646:
URL: 
https://github.com/apache/apisix-dashboard/issues/646#issuecomment-719430552


   @thekingofworld 
   
   need to re-generate json schema for your custom plugin.
   
   here is how to use the tool to generate json schema:
   
   
https://github.com/apache/apisix-dashboard/blob/v2.0/docs/develop.md#sync-jsonschema
   



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 a change in pull request #619: feat: added e2e test for Login page

2020-10-30 Thread GitBox


liuxiran commented on a change in pull request #619:
URL: https://github.com/apache/apisix-dashboard/pull/619#discussion_r514950221



##
File path: frontend/src/e2e/README.zh-CN.md
##
@@ -0,0 +1,41 @@
+
+
+### 本地书写测试案例

Review comment:
   书写 -> 编写 :)





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] tokers commented on a change in pull request #2395: improve: refactor apisix command line tool

2020-10-30 Thread GitBox


tokers commented on a change in pull request #2395:
URL: https://github.com/apache/apisix/pull/2395#discussion_r514948544



##
File path: apisix/cli/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.cli.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"
+local pkg_cpath = apisix_home .. "/deps/lib64/lua/5.1/?.so;"
+  .. apisix_home .. "/deps/lib/lua/5.1/?.so;;"
+local pkg_path  = apisix_home .. "/deps/share/lua/5.1/?.lua;;"
+
+
+-- only for developer, use current folder as working space
+local is_root_path = false
+local script_path = arg[0]
+if script_path:sub(1, 2) == './' then
+apisix_home = trim(execute_cmd("pwd"))
+if not apisix_home then
+error("failed to fetch current path")
+end
+
+if str_match(apisix_home .. "/", '^/root/') then

Review comment:
   OK.





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 pull request #651: WIP: feat: support get plugin schema based on schema_type

2020-10-30 Thread GitBox


liuxiran commented on pull request #651:
URL: https://github.com/apache/apisix-dashboard/pull/651#issuecomment-719424201


   > The Sync schema issue needs @nic-chen’s help :) Please be patient
   
   ok, and I will deal with the ci error after the Q1 be solved :)



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] moonming commented on issue #648: feat: Should apisix dashboard Multi-tenancy function?

2020-10-30 Thread GitBox


moonming commented on issue #648:
URL: 
https://github.com/apache/apisix-dashboard/issues/648#issuecomment-719423035


   @gy09535 I think you want to manager Apache APISIX clusters in one 
dashboard, right?



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 #648: feat: Should apisix dashboard Multi-tenancy function?

2020-10-30 Thread GitBox


juzhiyuan commented on issue #648:
URL: 
https://github.com/apache/apisix-dashboard/issues/648#issuecomment-719420197


   cc @membphis @moonming @ShiningRush 



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 #648: feat: Should apisix dashboard Multi-tenancy function?

2020-10-30 Thread GitBox


juzhiyuan commented on issue #648:
URL: 
https://github.com/apache/apisix-dashboard/issues/648#issuecomment-719418907


   Ya This is a good feature, we may support it one day. BTW, would you have 
interests to draft a proposal about how to implement this feature?



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 (f2f5ab9 -> 37a0792)

2020-10-30 Thread membphis
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 f2f5ab9  feat: support `json` encoding escape for access logs (#2269)
 add 37a0792  bugfix: fix zipkin plugin error when used with limit count 
plugin (#2499)

No new revisions were added by this update.

Summary of changes:
 apisix/plugins/zipkin.lua | 15 +++
 t/admin/plugins.t |  2 +-
 t/debug/debug-mode.t  |  2 +-
 t/plugin/zipkin.t | 45 +
 4 files changed, 58 insertions(+), 6 deletions(-)



[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #651: WIP: feat: support get plugin schema based on schema_type

2020-10-30 Thread GitBox


juzhiyuan commented on pull request #651:
URL: https://github.com/apache/apisix-dashboard/pull/651#issuecomment-719414657


   The Sync schema issue needs @nic-chen’s help :) Please be patient  



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 (f2f5ab9 -> 37a0792)

2020-10-30 Thread membphis
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 f2f5ab9  feat: support `json` encoding escape for access logs (#2269)
 add 37a0792  bugfix: fix zipkin plugin error when used with limit count 
plugin (#2499)

No new revisions were added by this update.

Summary of changes:
 apisix/plugins/zipkin.lua | 15 +++
 t/admin/plugins.t |  2 +-
 t/debug/debug-mode.t  |  2 +-
 t/plugin/zipkin.t | 45 +
 4 files changed, 58 insertions(+), 6 deletions(-)



[GitHub] [apisix-dashboard] liuxiran opened a new pull request #651: WIP: feat: support get plugin schema based on schema_type

2020-10-30 Thread GitBox


liuxiran opened a new pull request #651:
URL: https://github.com/apache/apisix-dashboard/pull/651


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   
   - Related issues
   https://github.com/apache/apisix-dashboard/issues/605
   
   here I have two requests for help
   
   1. after checked the lib `github.com/shiningrush/droplet`, it seems that 
**there is  no api to get query from request url**, so there is a `TODO mark` 
in 

https://github.com/liuxiran/apisix-dashboard/blob/47348773e1e7c90250a0145053a1c3ee29c30e54/api/internal/handler/plugin/plugin.go#L51
   needs @ShiningRush `s help when you are free ,many thx~!
   
   1. An error occurred while running `api/build-tools/schema-sync.sh master` 
to update schema.json, here is the error msg
   ```shell
   lua: ./apisix/plugins/api-breaker.lua:25: attempt to index a nil value 
(field 'shared')
   stack traceback:
./apisix/plugins/api-breaker.lua:25: in main chunk
[C]: in function 'require'
schema-sync.lua:128: in main chunk
[C]: in ?
   sync success:
   /home/liuxiran/product/apisix-dashboard/api/conf/schema.json
   ```
   and the `api-break.lua:25` is 
   
https://github.com/apache/apisix/blob/f2f5ab97663805509baf3355c37336ffa557b68c/apisix/plugins/api-breaker.lua#L25
   it seems  to be due to a lack of ngx dependency, so how to add this 
dependency?
   needs @nic-chen `s help, when you are free, 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




[GitHub] [apisix] membphis closed issue #2377: bug:Use zipkin plugin and limit-req plugin together, zipkin plugin can not work when is limit

2020-10-30 Thread GitBox


membphis closed issue #2377:
URL: https://github.com/apache/apisix/issues/2377


   



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 #2499: bugfix: fix zipkin plugin error when used with limit count plugin

2020-10-30 Thread GitBox


membphis merged pull request #2499:
URL: https://github.com/apache/apisix/pull/2499


   



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 #646: request help: let custom plugin show in dashboard

2020-10-30 Thread GitBox


juzhiyuan commented on issue #646:
URL: 
https://github.com/apache/apisix-dashboard/issues/646#issuecomment-719399674


   Ok then this issue is not because of frontend, let’s cc @nic-chen @membphis 
to have more discussions with 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-dashboard] nic-chen commented on a change in pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


nic-chen commented on a change in pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#discussion_r514931895



##
File path: .github/workflows/e2e-test-backend.yml
##
@@ -0,0 +1,52 @@
+name: Backend E2E Test
+
+on:
+  push:
+branches:
+  - master
+  pull_request:
+branches:
+  - master
+  - v2.0
+
+jobs:
+  run-test:
+runs-on: ubuntu-latest
+
+steps:
+  - uses: actions/checkout@v2
+
+  - name: install runtime
+run: |
+  sudo apt-get update
+  sudo add-apt-repository ppa:longsleep/golang-backports
+  sudo apt update
+  export GO111MOUDULE=on
+  sudo apt install golang-1.14-go
+
+  - name: build manager api
+working-directory: ./api
+run: |
+  docker build -t managerapi:ci .
+
+  - name: run docker compose
+working-directory: ./api/test/docker
+run: |
+  docker-compose up -d
+  sleep 5
+  docker logs managerapi
+
+  # - name: run manager api

Review comment:
   will remove when CI pass





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 a change in pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


juzhiyuan commented on a change in pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#discussion_r514930872



##
File path: .github/workflows/e2e-test-backend.yml
##
@@ -0,0 +1,52 @@
+name: Backend E2E Test
+
+on:
+  push:
+branches:
+  - master
+  pull_request:
+branches:
+  - master
+  - v2.0
+
+jobs:
+  run-test:
+runs-on: ubuntu-latest
+
+steps:
+  - uses: actions/checkout@v2
+
+  - name: install runtime
+run: |
+  sudo apt-get update
+  sudo add-apt-repository ppa:longsleep/golang-backports
+  sudo apt update
+  export GO111MOUDULE=on
+  sudo apt install golang-1.14-go
+
+  - name: build manager api
+working-directory: ./api
+run: |
+  docker build -t managerapi:ci .
+
+  - name: run docker compose
+working-directory: ./api/test/docker
+run: |
+  docker-compose up -d
+  sleep 5
+  docker logs managerapi
+
+  # - name: run manager api

Review comment:
   Remove those commented lines or uncomment them, please.





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 issue #650: requirement: support different config for APISIX and manager api in e2e test

2020-10-30 Thread GitBox


nic-chen opened a new issue #650:
URL: https://github.com/apache/apisix-dashboard/issues/650


   detail:
   
- [ ]  support different config for APISIX  in e2e test
   
- [ ]  support different config for manager api in e2e test
   

   I think matrix for github actions is good for this case. or we could do it 
using shell script. 
   
   ---
   
   For background and description, please see:
   
   https://github.com/apache/apisix-dashboard/issues/607
   
   



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 #2266: feat: support `json` encoding escape for access logs

2020-10-30 Thread GitBox


membphis closed issue #2266:
URL: https://github.com/apache/apisix/issues/2266


   



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 #2269: feat: support `json` encoding escape for access logs

2020-10-30 Thread GitBox


membphis merged pull request #2269:
URL: https://github.com/apache/apisix/pull/2269


   



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: support `json` encoding escape for access logs (#2269)

2020-10-30 Thread membphis
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 f2f5ab9  feat: support `json` encoding escape for access logs (#2269)
f2f5ab9 is described below

commit f2f5ab97663805509baf3355c37336ffa557b68c
Author: YuanSheng Wang 
AuthorDate: Fri Oct 30 16:07:24 2020 +0800

feat: support `json` encoding escape for access logs (#2269)

fix #2266 .
---
 .travis/apisix_cli_test.sh | 31 +++
 bin/apisix |  2 +-
 conf/config-default.yaml   |  1 +
 3 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/.travis/apisix_cli_test.sh b/.travis/apisix_cli_test.sh
index 091ff92..5f88ecd 100755
--- a/.travis/apisix_cli_test.sh
+++ b/.travis/apisix_cli_test.sh
@@ -441,3 +441,34 @@ if [ $count -ne 1 ]; then
 fi
 
 echo "passed: using env to set worker processes"
+
+# access log with JSON format
+
+echo '
+nginx_config:
+  http:
+access_log_format: |-
+  {"@timestamp": "$time_iso8601", "client_ip": "$remote_addr", "status": 
"$status"}
+access_log_format_escape: json
+' > conf/config.yaml
+
+make init
+make run
+sleep 0.1
+curl http://127.0.0.1:9080/hello2
+sleep 4
+tail -n 1 logs/access.log > output.log
+
+if [ `grep -c '"client_ip": "127.0.0.1"' output.log` -eq '0' ]; then
+echo "failed: invalid JSON log in access log"
+exit 1
+fi
+
+if [ `grep -c 'main escape=json' conf/nginx.conf` -eq '0' ]; then
+echo "failed: not found \"escape=json\" in conf/nginx.conf"
+exit 1
+fi
+
+make stop
+
+echo "passed: access log with JSON format"
diff --git a/bin/apisix b/bin/apisix
index 2e72a31..d600d2b 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -239,7 +239,7 @@ http {
 lua_regex_match_limit 10;
 lua_regex_cache_max_entries 8192;
 
-log_format main '{* http.access_log_format *}';
+log_format main escape={* http.access_log_format_escape *} '{* 
http.access_log_format *}';
 
 access_log {* http.access_log *} main buffer=16384 flush=3;
 open_file_cache  max=1000 inactive=60;
diff --git a/conf/config-default.yaml b/conf/config-default.yaml
index ef9331f..f94bda9 100644
--- a/conf/config-default.yaml
+++ b/conf/config-default.yaml
@@ -126,6 +126,7 @@ nginx_config: # config for render the 
template to genarate n
   http:
 access_log: "logs/access.log"
 access_log_format: "$remote_addr - $remote_user [$time_local] $http_host 
\"$request\" $status $body_bytes_sent $request_time \"$http_referer\" 
\"$http_user_agent\" $upstream_addr $upstream_status $upstream_response_time"
+access_log_format_escape: default   # allows setting json or default 
characters escaping in variables
 keepalive_timeout: 60s # timeout during which a keep-alive client 
connection will stay open on the server side.
 client_header_timeout: 60s # timeout for reading client request 
header, then 408 (Request Time-out) error is returned to the client
 client_body_timeout: 60s   # timeout for reading client request body, 
then 408 (Request Time-out) error is returned to the client



[apisix] branch master updated: chore: update CODE_STYLE to catch up with the reality (#2570)

2020-10-30 Thread membphis
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 e67dee1  chore: update CODE_STYLE to catch up with the reality (#2570)
e67dee1 is described below

commit e67dee137a3db78c877fad9dca99048d027a5ddd
Author: 罗泽轩 
AuthorDate: Fri Oct 30 16:06:21 2020 +0800

chore: update CODE_STYLE to catch up with the reality (#2570)

Currently we already have the line length style check in lj-releng. The
length we chose is 100.

Close #2569.
---
 CODE_STYLE.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CODE_STYLE.md b/CODE_STYLE.md
index 71c2134..079c3e4 100644
--- a/CODE_STYLE.md
+++ b/CODE_STYLE.md
@@ -135,7 +135,7 @@ end
 
 ## Maximum length per line
 
-Each line cannot exceed 80 characters. If it exceeds, you need to wrap and 
align:
+Each line cannot exceed 100 characters. If it exceeds, you need to wrap and 
align:
 
 ```lua
 --No



[GitHub] [apisix] membphis merged pull request #2570: chore: update CODE_STYLE to catch up with the reality

2020-10-30 Thread GitBox


membphis merged pull request #2570:
URL: https://github.com/apache/apisix/pull/2570


   



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 #2569: CI: line is too line

2020-10-30 Thread GitBox


membphis closed issue #2569:
URL: https://github.com/apache/apisix/issues/2569


   



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 #2569: CI: line is too line

2020-10-30 Thread GitBox


membphis commented on issue #2569:
URL: https://github.com/apache/apisix/issues/2569#issuecomment-719386887


   > The length we chose is 100.
   
   I think `100` is fine.
   
   https://github.com/apache/apisix/blob/master/.luacheckrc#L4
   
   we checked it by `luacheck` too.
   



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 issue #2565: support include other nginx config in the apisix(lua file)

2020-10-30 Thread GitBox


tzssangglass commented on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-719385640


   > @tzssangglass
   > Configure `lua_shared_dict` is already supported:
   > 
   > 
https://github.com/apache/apisix/blob/1fb000c92e9252c5872a83278cb44652ebdfe4d5/conf/config-default.yaml#L142
   > 
   > Why do you think this feature can't be supported via snippets?
   
   Good. I had misconceptions about snippets before. I'm not sure if all the 
configurations can be translated from `yaml` to the final `nginx.conf`, so I 
thought if the ability to load extend.conf could be provided, there could be a 
back up plan.



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 pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


nic-chen commented on pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#issuecomment-719375169


   > some cases, we need to set different `api/test/docker/apisix_config.yaml`.
   > 
   > how to support this case?
   
   I think `matrix` for github actions is good for this case. or we could do it 
use shell script. we should do this in a separate 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-dashboard] nic-chen commented on pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


nic-chen commented on pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#issuecomment-719366751


   > Where can we get the code coverage?
   
   we could run for it in an other 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-dashboard] nic-chen commented on pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


nic-chen commented on pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#issuecomment-719365741


   > If running a test case fails, does the error message contain the key 
information of the test case? For example, the title.
   
   yes.
   
   it provide test function name, file name and which line failed. like:
   
   ```
Error Trace:reporter.go:23
chain.go:21
response.go:585
response.go:151
route_test.go:79
Error:
expected status equal to:
 "200 OK"
   
but got:
 "400 Bad Request"
Test:   TestRoute_Host
   ```
   



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 issue #649: requirement: add golangci-lint CI for `manager api`

2020-10-30 Thread GitBox


nic-chen opened a new issue #649:
URL: https://github.com/apache/apisix-dashboard/issues/649


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [ ] Bug
   - [x] Requirements
   - [ ] Feature or performance improvement
   - [ ] Other
   
   
   



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 a change in pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


nic-chen commented on a change in pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#discussion_r514912142



##
File path: api/test/e2e/route_test.go
##
@@ -0,0 +1,164 @@
+/*
+ * 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.
+ */
+package e2e
+
+import (
+   "net/http"
+   "testing"
+   "time"
+)
+
+func TestRoute_Host(t *testing.T) {
+
+   //create route use hosts
+MangerApiExpect(t).PUT("/apisix/admin/routes/r1").WithText(`{
+"uri": "/hello_",
+"hosts": ["foo.com", "*.bar.com"],
+"upstream": {
+"nodes": {
+"172.16.238.120:1980": 1
+},
+"type": "roundrobin"
+}
+}`).
+   WithHeader("Authorization", accessToken).
+   Expect().
+   Status(http.StatusOK)
+
+   //sleep
+   time.Sleep(time.Duration(100) * time.Millisecond)
+
+   //hit route -- not found
+   APISIXExpect(t).GET("/not_found").
+   Expect().
+   Status(http.StatusNotFound)
+
+   //hit route -- not found, wrong host
+   APISIXExpect(t).GET("/hello_").
+   WithHeader("Host", "not_found.com").
+   Expect().
+   Status(http.StatusNotFound)
+
+   //hit route - ok
+   APISIXExpect(t).GET("/hello_").
+   WithHeader("Host", "foo.com").
+   Expect().
+   Status(http.StatusOK)
+
+   //create route  -- invalid hosts
+   MangerApiExpect(t).PUT("/apisix/admin/routes/r2").WithText(`{
+"uri": "/hello_",
+"hosts": ["$%$foo.com", "*.bar.com"],
+"upstream": {
+"nodes": {
+"172.16.238.120:1980": 1
+},
+"type": "roundrobin"
+}
+}`).

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] dyingbleed closed issue #2562: bug: APISIX 2.0 run failed on CentOS 7 missing package lua-tinyyaml and lua-resty-template

2020-10-30 Thread GitBox


dyingbleed closed issue #2562:
URL: https://github.com/apache/apisix/issues/2562


   



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 opened a new pull request #2575: change: make lrucache lock optional

2020-10-30 Thread GitBox


spacewander opened a new pull request #2575:
URL: https://github.com/apache/apisix/pull/2575


   ### What this PR does / why we need it:
   
   
   
   ### Pre-submission checklist:
   
   * [ ] 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?
   * [ ] Is this PR backward compatible?
   
   Close #2520 



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 #2565: support include other nginx config in the apisix(lua file)

2020-10-30 Thread GitBox


spacewander commented on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-71933


   @tzssangglass 
   Configure `lua_shared_dict` is already supported: 
https://github.com/apache/apisix/blob/1fb000c92e9252c5872a83278cb44652ebdfe4d5/conf/config-default.yaml#L142
   
   Why do you think this feature can't be supported via snippets?



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] tokers commented on issue #2520: bug: "failed to acquire the lock: timeout" in logs/error.log when setuping route at the first time

2020-10-30 Thread GitBox


tokers commented on issue #2520:
URL: https://github.com/apache/apisix/issues/2520#issuecomment-719332941


   > Only a few plugins which interact with other services like Redis need the 
protection. I think we can make this optional and bypass the lock by default.
   
   Agreed.



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 #2520: bug: "failed to acquire the lock: timeout" in logs/error.log when setuping route at the first time

2020-10-30 Thread GitBox


spacewander commented on issue #2520:
URL: https://github.com/apache/apisix/issues/2520#issuecomment-719332121


   Only a few plugins which interact with other services like Redis need the 
protection. I think we can make this optional and bypass the lock by default.



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 a change in pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


nic-chen commented on a change in pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#discussion_r514907337



##
File path: .github/workflows/deploy-api.yml
##
@@ -0,0 +1,60 @@
+name: Deploy API to Azure
+
+on:

Review comment:
   deleted. It's brought from branch master.





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] gewei2000 commented on issue #2574: request help: new plugin feature

2020-10-30 Thread GitBox


gewei2000 commented on issue #2574:
URL: https://github.com/apache/apisix/issues/2574#issuecomment-719331366


   > When you create `lru` object, you can enable the option `invalid_stale`.
   > 
   > 
https://github.com/apache/apisix/blob/9b63fd5710427820a9002920f8b48cb43bf06cd8/apisix/init.lua#L118
   
   thks



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 #2574: request help: new plugin feature

2020-10-30 Thread GitBox


membphis commented on issue #2574:
URL: https://github.com/apache/apisix/issues/2574#issuecomment-719322181


   When you create `lru` object, you can enable the option `invalid_stale`.
   
   
https://github.com/apache/apisix/blob/9b63fd5710427820a9002920f8b48cb43bf06cd8/apisix/init.lua#L118
   
   



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] gy09535 opened a new issue #648: feat: Should apisix dashboard Multi-tenancy function?

2020-10-30 Thread GitBox


gy09535 opened a new issue #648:
URL: https://github.com/apache/apisix-dashboard/issues/648


   Sometimes  we can split apis to different  apisix cluster for reduce risk , 
dashboard can manage more then one   apisix cluster. 
   
   - Why do you submit this issue?
   - [x] Question or discussion
   - [ ] Bug
   - [x] Requirements
   - [x] Feature or performance improvement
   - [ ] Other
   
   ___
   ### Question
   - What do you want to know?
   
   ___
   ### Bug
   - Which version of Apache APISIX Dashboard, OS, and Browser?
   
   - What happened?
   If possible, provide a way to reproduce the error.
   
   ___
   ### Requirements 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-dashboard] nic-chen commented on a change in pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


nic-chen commented on a change in pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#discussion_r514904437



##
File path: api/go.sum
##
@@ -1,43 +1,14 @@
-cloud.google.com/go v0.34.0/go.mod 
h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=

Review comment:
   yes. I remove some dependency lib and It's auto generated by `Go 
Module`. and e2e run as an independent project.
   





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] thekingofworld edited a comment on issue #646: request help: let custom plugin show in dashboard

2020-10-30 Thread GitBox


thekingofworld edited a comment on issue #646:
URL: 
https://github.com/apache/apisix-dashboard/issues/646#issuecomment-719306037


   @justinmclean  not found my custom plugin.
   
![image](https://user-images.githubusercontent.com/8169665/97669576-5f9afa80-1abf-11eb-9058-3d8b7ce7e40f.png)
   
   ```
   
{"code":0,"message":"","data":["limit-count","kafka-logger","request-validation","referer-restriction","zipkin","example-plugin","request-id","node-status","grpc-transcode","wolf-rbac","basic-auth","syslog","consumer-restriction","cors","openid-connect","hmac-auth","udp-logger","proxy-cache","fault-injection","proxy-mirror","proxy-rewrite","key-auth","log-rotate","response-rewrite","prometheus","tcp-logger","http-logger","authz-keycloak","limit-conn","uri-blocker","skywalking","redirect","batch-requests","limit-req","jwt-auth","echo","ip-restriction"],"request_id":"26dc294c-6e4f-480d-8763-322b136f0553"}
   ```



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] thekingofworld commented on issue #646: request help: let custom plugin show in dashboard

2020-10-30 Thread GitBox


thekingofworld commented on issue #646:
URL: 
https://github.com/apache/apisix-dashboard/issues/646#issuecomment-719306037


   
![image](https://user-images.githubusercontent.com/8169665/97669576-5f9afa80-1abf-11eb-9058-3d8b7ce7e40f.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] thekingofworld edited a comment on issue #646: request help: let custom plugin show in dashboard

2020-10-30 Thread GitBox


thekingofworld edited a comment on issue #646:
URL: 
https://github.com/apache/apisix-dashboard/issues/646#issuecomment-719306037


   @justinmclean  not found my custom plugin.
   
![image](https://user-images.githubusercontent.com/8169665/97669576-5f9afa80-1abf-11eb-9058-3d8b7ce7e40f.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] gewei2000 opened a new issue #2574: request help: new plugin feature

2020-10-30 Thread GitBox


gewei2000 opened a new issue #2574:
URL: https://github.com/apache/apisix/issues/2574


   ### Issue description
   I want to develop a plugin, the plugin is to get the specified key (such as 
user id) from the cookie, then go to redis to read a json through this key, put 
it in the cache, let it automatically expire after 10 minute,  do we have this 
cache components?
   @membphis @moonming 



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 edited a comment on pull request #2499: bugfix: fix zipkin plugin error when used with limit count plugin

2020-10-30 Thread GitBox


gy09535 edited a comment on pull request #2499:
URL: https://github.com/apache/apisix/pull/2499#issuecomment-719263049


   yeah, change default priority and also add some judge code is better. 
Because If we just add judge code  when  zipkin plugin executed  after 
limit-count then the access span  will be lost, we should avoid this condition, 
so we can set the  default priority to  reduce risk .



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 a change in pull request #619: feat: added e2e test for Login page

2020-10-30 Thread GitBox


juzhiyuan commented on a change in pull request #619:
URL: https://github.com/apache/apisix-dashboard/pull/619#discussion_r514894927



##
File path: src/e2e/Login.e2e.js
##
@@ -1,33 +1,69 @@
+/*
+ * 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.
+ */
+
 /* eslint-disable import/no-extraneous-dependencies */
 const puppeteer = require('puppeteer');
 
 let browser;
+const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
+const domSelectors = {
+  inputUserName: '#control-ref_username',
+  inputPassWord: '#control-ref_password',
+  buttonLogin: '.ant-btn-lg',
+  notificationNotice: '.ant-notification-notice',
+  notificationLogin: '.ant-notification-notice-description',
+};
+const loginFailedDatas = {
+  userName: 'admin',
+  passWord: '123456',

Review comment:
   BEM: http://getbem.com/introduction/





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 #2499: bugfix: fix zipkin plugin error when used with limit count plugin

2020-10-30 Thread GitBox


gy09535 commented on pull request #2499:
URL: https://github.com/apache/apisix/pull/2499#issuecomment-719263049


   yeah, change default priority and also add some judge code is 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-dashboard] moonming commented on a change in pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


moonming commented on a change in pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#discussion_r514890091



##
File path: api/test/e2e/route_test.go
##
@@ -0,0 +1,164 @@
+/*
+ * 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.
+ */
+package e2e
+
+import (
+   "net/http"
+   "testing"
+   "time"
+)
+
+func TestRoute_Host(t *testing.T) {
+
+   //create route use hosts
+MangerApiExpect(t).PUT("/apisix/admin/routes/r1").WithText(`{
+"uri": "/hello_",
+"hosts": ["foo.com", "*.bar.com"],
+"upstream": {
+"nodes": {
+"172.16.238.120:1980": 1
+},
+"type": "roundrobin"
+}
+}`).
+   WithHeader("Authorization", accessToken).
+   Expect().
+   Status(http.StatusOK)
+
+   //sleep
+   time.Sleep(time.Duration(100) * time.Millisecond)
+
+   //hit route -- not found
+   APISIXExpect(t).GET("/not_found").
+   Expect().
+   Status(http.StatusNotFound)
+
+   //hit route -- not found, wrong host
+   APISIXExpect(t).GET("/hello_").
+   WithHeader("Host", "not_found.com").
+   Expect().
+   Status(http.StatusNotFound)
+
+   //hit route - ok
+   APISIXExpect(t).GET("/hello_").
+   WithHeader("Host", "foo.com").
+   Expect().
+   Status(http.StatusOK)
+
+   //create route  -- invalid hosts
+   MangerApiExpect(t).PUT("/apisix/admin/routes/r2").WithText(`{
+"uri": "/hello_",
+"hosts": ["$%$foo.com", "*.bar.com"],
+"upstream": {
+"nodes": {
+"172.16.238.120:1980": 1
+},
+"type": "roundrobin"
+}
+}`).

Review comment:
   > We may use some tools to lint those files automatically, cc @nic-chen
   > 
   > [1] https://golangci-lint.run/
   
   we can add to this linter to CI too.





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 issue #2565: support include other nginx config in the apisix(lua file)

2020-10-30 Thread GitBox


tzssangglass commented on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-719252079


   I doubt this will solve the renaming configuration, e.g. I want to configure 
multiple `lua_shared_dict` 



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 a change in pull request #612: test: add e2e test for field hosts in `route` api

2020-10-30 Thread GitBox


juzhiyuan commented on a change in pull request #612:
URL: https://github.com/apache/apisix-dashboard/pull/612#discussion_r51473



##
File path: api/test/e2e/route_test.go
##
@@ -41,126 +41,136 @@ func TestRoute_Host(t *testing.T) {
 Expect().
 Status(http.StatusOK)
 
-   //sleep
-   time.Sleep(time.Duration(100) * time.Millisecond)
+//sleep
+time.Sleep(time.Duration(100) * time.Millisecond)
 
//hit route -- not found
 APISIXExpect(t).GET("/not_found").
 Expect().
 Status(http.StatusNotFound)
 
-   //hit route -- not found, wrong host
-   APISIXExpect(t).GET("/hello_").
-   WithHeader("Host", "not_found.com").
-   Expect().
-   Status(http.StatusNotFound)
-
-   //hit route - ok
-   APISIXExpect(t).GET("/hello_").
-   WithHeader("Host", "foo.com").
-   Expect().
-   Status(http.StatusOK)
-
-   //create route  -- invalid hosts
-   MangerApiExpect(t).PUT("/apisix/admin/routes/r2").WithText(`{
-"uri": "/hello_",
-"hosts": ["$%$foo.com", "*.bar.com"],
-"upstream": {
+//hit route -- not found, wrong host
+APISIXExpect(t).GET("/hello_").
+WithHeader("Host", "not_found.com").
+Expect().
+Status(http.StatusNotFound)
+
+//hit route - ok
+APISIXExpect(t).GET("/hello_").
+WithHeader("Host", "foo.com").
+Expect().
+Status(http.StatusOK)
+
+//create route  -- invalid hosts
+MangerApiExpect(t).
+PUT("/apisix/admin/routes/r2").
+WithText(`{
+"uri": "/hello_",
+"hosts": ["$%$foo.com", "*.bar.com"],
+"upstream": {
+"nodes": {
+"172.16.238.120:1980": 1
+},
+"type": "roundrobin"
+}
+}`).
+WithHeader("Authorization", accessToken).
+Expect().
+Status(http.StatusBadRequest)
+
+//create route  -- invalid type for hosts
+MangerApiExpect(t).
+PUT("/apisix/admin/routes/r2").
+WithText(`{
+"uri": "/hello_",
+"hosts": [1, "*.bar.com"],
+"upstream": {
 "nodes": {
-"172.16.238.120:1980": 1
+"172.16.238.120:1980": 1
 },
 "type": "roundrobin"
-}
-}`).
-   WithHeader("Authorization", accessToken).
-   Expect().
-   Status(http.StatusBadRequest)
-
-   //create route  -- invalid type for hosts
-   MangerApiExpect(t).PUT("/apisix/admin/routes/r2").WithText(`{
-"uri": "/hello_",
-"hosts": [1, "*.bar.com"],
-"upstream": {
-"nodes": {
-"172.16.238.120:1980": 1
-},
-"type": "roundrobin"
-}
-}`).
-   WithHeader("Authorization", accessToken).
-   Expect().
-   //Status(http.StatusBadRequest)
-   JSON().Object().ValueNotEqual("code", 0)
+}
+}`).
+WithHeader("Authorization", accessToken).

Review comment:
   `accessToken` is not a good name IMO, `token` would be more clearer and 
without ambiguity.





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 #623: apisix-dashboard 403 Forbidden

2020-10-30 Thread GitBox


juzhiyuan commented on issue #623:
URL: 
https://github.com/apache/apisix-dashboard/issues/623#issuecomment-719243493


   Glad to know that, kindly leave any questions in GitHub issues.



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 #646: request help: let custom plugin show in dashboard

2020-10-30 Thread GitBox


juzhiyuan commented on issue #646:
URL: 
https://github.com/apache/apisix-dashboard/issues/646#issuecomment-719239031


   OK then, this error is returned from 2.0 RC2 may be, let's visit the 
dashboard then check this API:
   
   
![image](https://user-images.githubusercontent.com/2106987/97666230-2743ee00-1ab8-11eb-9567-e5059f35ba03.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