[GitHub] [apisix] gy09535 commented on issue #2249: feat: build docker image with source code

2020-09-17 Thread GitBox


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


   I think it can not build code from local repos
   
   > is https://github.com/apache/apisix-docker good for you?
   
   I think it can not build images from  our private repository for secondary 
develop. If I change some code for our different logical, 
https://github.com/apache/apisix-docker can not work for me.



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] TigerGxl opened a new issue #2257: request help: http_to_https ret_code 307 not working

2020-09-17 Thread GitBox


TigerGxl opened a new issue #2257:
URL: https://github.com/apache/apisix/issues/2257


   ### Issue description
   
   
   ### Environment
   
   * apisix version (cmd: `apisix version`):1.5
   * OS:ubuntu16.04
   
   i use plugin http_to_https and set ret_code 307, like below.
   ```
   {
 "priority": 0,
 "plugins": {
   "redirect": {
 "ret_code": 307,
 "http_to_https": true
   }
 },
 "uris": [
   "/*"
 ],
 "id": "1a5f4337d",
 "hosts": [
   "demo-apisix.xxx.com"
 ],
 "upstream": {
   "nodes": {
 "172.16.3.2:80": 100
   },
   "hash_on": "vars",
   "type": "roundrobin"
 }
   }
   ```
   when client sends **POST** reqeust with **http**.it's not working, apisix 
should  return 307 and client sends a new request with https again, in fact, 
apisix return 301 and client sends a new request with **https** and the method 
is **GET**
   
   
![image](https://user-images.githubusercontent.com/32395903/93565351-cce64680-f9bd-11ea-9349-80cda6f3.png)
   
![image](https://user-images.githubusercontent.com/32395903/93565479-074fe380-f9be-11ea-953d-c884d6647f9b.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] moonming opened a new issue #2256: request: add the dependency of lua-resty-hmac

2020-09-17 Thread GitBox


moonming opened a new issue #2256:
URL: https://github.com/apache/apisix/issues/2256


   Now Apache APISIX does not declare the dependency on lua-resty-hmac, but 
implicitly installs it through 
[lua-resty-jwt](https://luarocks.org/modules/cdbattags/lua-resty-jwt). There 
are two problems with this approach:
   1. Lua-resty-hmac cannot be updated in time
   2. Implicit installation will cause confusion to users
   
   Therefore, we should:
   1. Update lua-resty-jwt to the latest version, and check whether other 
lua-resty-* is updated;
   2. Add dependency on[ 
lua-resty-hmac](https://github.com/jkeys089/lua-resty-hmac) in the luarocks of 
Apache APISIX



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 a change in pull request #2241: draft: `consumer` provides access to a collection of `service`

2020-09-17 Thread GitBox


moonming commented on a change in pull request #2241:
URL: https://github.com/apache/apisix/pull/2241#discussion_r490722963



##
File path: apisix/plugins/consumer-restriction.lua
##
@@ -67,26 +81,33 @@ function _M.check_schema(conf)
 return true
 end
 
+
 function _M.access(conf, ctx)
-if not ctx.consumer then
+if not conf.type then
 return 401, { message = "Missing authentication or identity 
verification." }
 end
 
+local value = fetch_val_funcs[conf.type](ctx)
+if not value then
+return 401, { message = "Failed to fetch value by value type: " .. 
conf.type }
+end
+core.log.info("value: ", value)
+
 local block = false
 if conf.blacklist and #conf.blacklist > 0 then
-if is_include(ctx.consumer.username, conf.blacklist) then
+if is_include(value, conf.blacklist) then
 block = true
 end
 end
 
 if conf.whitelist and #conf.whitelist > 0 then
-if not is_include(ctx.consumer.username, conf.whitelist) then
+if not is_include(value, conf.whitelist) then
 block = true
 end
 end
 
 if block then
-return 403, { message = "The consumer is not allowed" }
+return conf.rejected_code, { message = "The " .. conf.type .. " is not 
allowed" }

Review comment:
   No, just the words in message.





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 a change in pull request #2241: draft: `consumer` provides access to a collection of `service`

2020-09-17 Thread GitBox


moonming commented on a change in pull request #2241:
URL: https://github.com/apache/apisix/pull/2241#discussion_r490722729



##
File path: t/plugin/consumer-restriction.t
##
@@ -540,3 +540,256 @@ GET /hello
 hello world
 --- no_error_log
 [error]
+
+
+
+=== TEST 25: create service (id:1)
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/services/1',
+ ngx.HTTP_PUT,
+ [[{
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 001"
+}]],
+[[{
+"node": {
+"value": {
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 001"
+},
+"key": "/apisix/services/1"
+},
+"action": "set"
+}]]
+)
+
+ngx.status = code
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 26: create service (id:2)

Review comment:
   Please put the related tests together, I can’t understand the context of 
the current 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] moonming commented on issue #2255: request help: apisix upstream create failed: unsupported protocol scheme

2020-09-17 Thread GitBox


moonming commented on issue #2255:
URL: https://github.com/apache/apisix/issues/2255#issuecomment-694667634


   @nic-chen please take a look



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 issue #2254: [discuss] add a new field `name` to plugin schema

2020-09-17 Thread GitBox


moonming commented on issue #2254:
URL: https://github.com/apache/apisix/issues/2254#issuecomment-694667337


   I don't think so, which should be the job of dashboard, especially 
considering i18n



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 #2241: draft: `consumer` provides access to a collection of `service`

2020-09-17 Thread GitBox


Firstsawyou commented on a change in pull request #2241:
URL: https://github.com/apache/apisix/pull/2241#discussion_r490713892



##
File path: t/plugin/consumer-restriction.t
##
@@ -540,3 +540,256 @@ GET /hello
 hello world
 --- no_error_log
 [error]
+
+
+
+=== TEST 25: create service (id:1)
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/services/1',
+ ngx.HTTP_PUT,
+ [[{
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 001"
+}]],
+[[{
+"node": {
+"value": {
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 001"
+},
+"key": "/apisix/services/1"
+},
+"action": "set"
+}]]
+)
+
+ngx.status = code
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 26: create service (id:2)

Review comment:
   It is used to test whether the id of `service` is normal when it is not 
in the whitelist or blacklist. For example, there are service IDs 1 and 2, and 
the whitelist `service` id is 1. We need to use the `service` with id 2 to test 
whether it can be accessed.





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 #2241: draft: `consumer` provides access to a collection of `service`

2020-09-17 Thread GitBox


Firstsawyou commented on a change in pull request #2241:
URL: https://github.com/apache/apisix/pull/2241#discussion_r490688992



##
File path: apisix/plugins/consumer-restriction.lua
##
@@ -67,26 +81,33 @@ function _M.check_schema(conf)
 return true
 end
 
+
 function _M.access(conf, ctx)
-if not ctx.consumer then
+if not conf.type then
 return 401, { message = "Missing authentication or identity 
verification." }
 end
 
+local value = fetch_val_funcs[conf.type](ctx)
+if not value then
+return 401, { message = "Failed to fetch value by value type: " .. 
conf.type }
+end
+core.log.info("value: ", value)
+
 local block = false
 if conf.blacklist and #conf.blacklist > 0 then
-if is_include(ctx.consumer.username, conf.blacklist) then
+if is_include(value, conf.blacklist) then
 block = true
 end
 end
 
 if conf.whitelist and #conf.whitelist > 0 then
-if not is_include(ctx.consumer.username, conf.whitelist) then
+if not is_include(value, conf.whitelist) then
 block = true
 end
 end
 
 if block then
-return 403, { message = "The consumer is not allowed" }
+return conf.rejected_code, { message = "The " .. conf.type .. " is not 
allowed" }

Review comment:
   do you mean set `conf.rejected_cod` 405 (not allowed) 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] ShiningRush commented on issue #2006: bug(cors): attempt to concatenate field 'conf_id' (a nil value)

2020-09-17 Thread GitBox


ShiningRush commented on issue #2006:
URL: https://github.com/apache/apisix/issues/2006#issuecomment-694634705


   I think this is the same problem, the key point is related with [this 
comment](https://github.com/apache/apisix/issues/2006#issuecomment-669769777)



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 #2241: draft: `consumer` provides access to a collection of `service`

2020-09-17 Thread GitBox


Firstsawyou commented on a change in pull request #2241:
URL: https://github.com/apache/apisix/pull/2241#discussion_r490686675



##
File path: apisix/plugins/consumer-restriction.lua
##
@@ -67,26 +81,33 @@ function _M.check_schema(conf)
 return true
 end
 
+
 function _M.access(conf, ctx)
-if not ctx.consumer then
+if not conf.type then

Review comment:
   this is a good idea.





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 #2241: draft: `consumer` provides access to a collection of `service`

2020-09-17 Thread GitBox


membphis commented on a change in pull request #2241:
URL: https://github.com/apache/apisix/pull/2241#discussion_r490686228



##
File path: apisix/plugins/consumer-restriction.lua
##
@@ -67,26 +81,33 @@ function _M.check_schema(conf)
 return true
 end
 
+
 function _M.access(conf, ctx)
-if not ctx.consumer then
+if not conf.type then

Review comment:
   we can delete them: 
   
   
https://github.com/apache/apisix/pull/2241/files/cb760bfcce3f5ff99ce30e6ec98b1e43d65b439b#diff-b17a4724115a2cba44ff3590fbd926a9R86-R88





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 #2241: draft: `consumer` provides access to a collection of `service`

2020-09-17 Thread GitBox


Firstsawyou commented on a change in pull request #2241:
URL: https://github.com/apache/apisix/pull/2241#discussion_r490685981



##
File path: t/plugin/consumer-restriction.t
##
@@ -540,3 +540,256 @@ GET /hello
 hello world
 --- no_error_log
 [error]
+
+
+
+=== TEST 25: create service (id:1)
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/services/1',
+ ngx.HTTP_PUT,
+ [[{
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 001"
+}]],
+[[{
+"node": {
+"value": {
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 001"
+},
+"key": "/apisix/services/1"
+},
+"action": "set"
+}]]
+)
+
+ngx.status = code
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 26: create service (id:2)
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/services/2',
+ ngx.HTTP_PUT,
+ [[{
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 002"
+}]],
+[[{
+"node": {
+"value": {
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 002"
+},
+"key": "/apisix/services/2"
+},
+"action": "set"
+}]]
+)
+
+ngx.status = code
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 27: add consumer with plugin hmac-auth and consumer-restriction, and 
set whitelist
+--- 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": "jack",
+"plugins": {
+"hmac-auth": {
+"access_key": "my-access-key",
+"secret_key": "my-secret-key"
+},
+"consumer-restriction": {
+"type": "service_id",
+"whitelist": [ "1" ],
+"rejected_code": 401
+}
+}
+}]],
+[[{
+"node": {
+"value": {
+"username": "jack",
+"plugins": {
+"hmac-auth": {
+"access_key": "my-access-key",
+"secret_key": "my-secret-key",
+"algorithm": "hmac-sha256",
+"clock_skew": 300
+},
+"consumer-restriction": {
+"type": "service_id",
+"whitelist": [ "1" ],
+"rejected_code": 401
+}
+}
+}
+},
+"action": "set"
+}]]
+)
+
+ngx.status = code
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 28: Route binding `hmac-auth` plug-in and `service_id`
+--- config
+location /t {
+content_by_lua_block {
+lo

[GitHub] [apisix] moonming commented on issue #2249: feat: build docker image with source code

2020-09-17 Thread GitBox


moonming commented on issue #2249:
URL: https://github.com/apache/apisix/issues/2249#issuecomment-694633629


   is https://github.com/apache/apisix-docker good for 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] gxthrj commented on pull request #2239: feat: `hmac-auth` add signed headers to calculate signature

2020-09-17 Thread GitBox


gxthrj commented on pull request #2239:
URL: https://github.com/apache/apisix/pull/2239#issuecomment-694633423


   > @gxthrj do you have time to take a look at this PR?
   
   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] membphis commented on a change in pull request #2241: draft: `consumer` provides access to a collection of `service`

2020-09-17 Thread GitBox


membphis commented on a change in pull request #2241:
URL: https://github.com/apache/apisix/pull/2241#discussion_r490685703



##
File path: t/plugin/consumer-restriction.t
##
@@ -540,3 +540,256 @@ GET /hello
 hello world
 --- no_error_log
 [error]
+
+
+
+=== TEST 25: create service (id:1)
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/services/1',
+ ngx.HTTP_PUT,
+ [[{
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 001"
+}]],
+[[{
+"node": {
+"value": {
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 001"
+},
+"key": "/apisix/services/1"
+},
+"action": "set"
+}]]
+)
+
+ngx.status = code
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 26: create service (id:2)
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/services/2',
+ ngx.HTTP_PUT,
+ [[{
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 002"
+}]],
+[[{
+"node": {
+"value": {
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 002"
+},
+"key": "/apisix/services/2"
+},
+"action": "set"
+}]]
+)
+
+ngx.status = code
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 27: add consumer with plugin hmac-auth and consumer-restriction, and 
set whitelist
+--- 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": "jack",
+"plugins": {
+"hmac-auth": {
+"access_key": "my-access-key",
+"secret_key": "my-secret-key"
+},
+"consumer-restriction": {
+"type": "service_id",
+"whitelist": [ "1" ],
+"rejected_code": 401
+}
+}
+}]],
+[[{
+"node": {
+"value": {
+"username": "jack",
+"plugins": {
+"hmac-auth": {
+"access_key": "my-access-key",
+"secret_key": "my-secret-key",
+"algorithm": "hmac-sha256",
+"clock_skew": 300
+},
+"consumer-restriction": {
+"type": "service_id",
+"whitelist": [ "1" ],
+"rejected_code": 401
+}
+}
+}
+},
+"action": "set"
+}]]
+)
+
+ngx.status = code
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 28: Route binding `hmac-auth` plug-in and `service_id`
+--- config
+location /t {
+content_by_lua_block {
+local

[GitHub] [apisix] moonming commented on issue #2006: bug(cors): attempt to concatenate field 'conf_id' (a nil value)

2020-09-17 Thread GitBox


moonming commented on issue #2006:
URL: https://github.com/apache/apisix/issues/2006#issuecomment-694633467


   @membphis please take a look



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 #2239: feat: `hmac-auth` add signed headers to calculate signature

2020-09-17 Thread GitBox


membphis commented on pull request #2239:
URL: https://github.com/apache/apisix/pull/2239#issuecomment-694629791


   @gxthrj  do you have time to take a look at 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 commented on a change in pull request #2239: feat: `hmac-auth` add signed headers to calculate signature

2020-09-17 Thread GitBox


membphis commented on a change in pull request #2239:
URL: https://github.com/apache/apisix/pull/2239#discussion_r490681896



##
File path: apisix/plugins/hmac-auth.lua
##
@@ -182,13 +201,25 @@ local function generate_signature(ctx, secret_key, params)
 canonical_query_string = core.table.concat(query_tab, "&")
 end
 
-local req_body = core.request.get_body()
-req_body = req_body or ""
+local canonical_headers = ""
+
+core.log.info("all headers: ", core.json.encode(core.request.headers(), 
true))
+
+for _, h in pairs(params.signed_headers) do
+canonical_headers = canonical_headers .. (core.request.header(ctx, h) 
or "")

Review comment:
   I helped you fix it. you can take a look when you have time





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 a change in pull request #2241: draft: `consumer` provides access to a collection of `service`

2020-09-17 Thread GitBox


moonming commented on a change in pull request #2241:
URL: https://github.com/apache/apisix/pull/2241#discussion_r490671665



##
File path: apisix/plugins/consumer-restriction.lua
##
@@ -67,26 +81,33 @@ function _M.check_schema(conf)
 return true
 end
 
+
 function _M.access(conf, ctx)
-if not ctx.consumer then
+if not conf.type then

Review comment:
   why not add this check in schema?

##
File path: apisix/plugins/consumer-restriction.lua
##
@@ -67,26 +81,33 @@ function _M.check_schema(conf)
 return true
 end
 
+
 function _M.access(conf, ctx)
-if not ctx.consumer then
+if not conf.type then
 return 401, { message = "Missing authentication or identity 
verification." }
 end
 
+local value = fetch_val_funcs[conf.type](ctx)
+if not value then
+return 401, { message = "Failed to fetch value by value type: " .. 
conf.type }
+end
+core.log.info("value: ", value)
+
 local block = false
 if conf.blacklist and #conf.blacklist > 0 then
-if is_include(ctx.consumer.username, conf.blacklist) then
+if is_include(value, conf.blacklist) then
 block = true
 end
 end
 
 if conf.whitelist and #conf.whitelist > 0 then
-if not is_include(ctx.consumer.username, conf.whitelist) then
+if not is_include(value, conf.whitelist) then
 block = true
 end
 end
 
 if block then
-return 403, { message = "The consumer is not allowed" }
+return conf.rejected_code, { message = "The " .. conf.type .. " is not 
allowed" }

Review comment:
   `not allowed` -> `forbidden`

##
File path: t/plugin/consumer-restriction.t
##
@@ -540,3 +540,256 @@ GET /hello
 hello world
 --- no_error_log
 [error]
+
+
+
+=== TEST 25: create service (id:1)
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/services/1',
+ ngx.HTTP_PUT,
+ [[{
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 001"
+}]],
+[[{
+"node": {
+"value": {
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 001"
+},
+"key": "/apisix/services/1"
+},
+"action": "set"
+}]]
+)
+
+ngx.status = code
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 26: create service (id:2)
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/services/2',
+ ngx.HTTP_PUT,
+ [[{
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 002"
+}]],
+[[{
+"node": {
+"value": {
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 002"
+},
+"key": "/apisix/services/2"
+},
+"action": "set"
+}]]
+)
+
+ngx.status = code
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 27: add consumer with plugin hmac-auth and consumer-restriction, and 
set whitelist
+--- 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": "jack",
+"plugins": {
+"hmac-auth": {
+"access_key": "my-access-key",
+"secret_key": "my-secret-key"
+

[GitHub] [apisix] Caelebs opened a new issue #2255: request help: apisix upstream create failed: unsupported protocol scheme

2020-09-17 Thread GitBox


Caelebs opened a new issue #2255:
URL: https://github.com/apache/apisix/issues/2255


   ### Issue description
   K8s deploy apisix create upstream returns error code 500
   ```
   
{"app":"manager-api","level":"error","line":"route/upstream.go:162","msg":"apisix
 upstream create failed: Put 
//%2Fapisix-gw-lb%2Fupstreams%2Fed100851-0d96-4d9c-b082-bb95c21bf1b8/apisix-gw-lb/upstreams/ed100851-0d96-4d9c-b082-bb95c21bf1b8:
 unsupported protocol scheme \"\"","time":"2020-09-18T09:41:18+08:00"}
   ```
   
   ### Environment
   
   * apisix version (cmd: `apisix version`):1.5
   * OS:K8S
   



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 opened a new issue #2254: [discuss] add a new field `name` to plugin schema

2020-09-17 Thread GitBox


membphis opened a new issue #2254:
URL: https://github.com/apache/apisix/issues/2254


   this field is used for dashboard, it looks more user-friendly.
   
   For example, the `name` field of `limit-req` is `Rate Limiting`.
   



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 #2241: draft: `consumer` provides access to a collection of `service`

2020-09-17 Thread GitBox


membphis commented on a change in pull request #2241:
URL: https://github.com/apache/apisix/pull/2241#discussion_r490674241



##
File path: t/plugin/consumer-restriction.t
##
@@ -540,3 +541,256 @@ GET /hello
 hello world
 --- no_error_log
 [error]
+
+
+
+=== TEST 25: create service (id:1)
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/services/1',
+ ngx.HTTP_PUT,
+ [[{
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 001"
+}]],
+[[{
+"node": {
+"value": {
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 001"
+},
+"key": "/apisix/services/1"
+},
+"action": "set"
+}]]
+)
+
+ngx.status = code
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 26: create service (id:2)
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/services/2',
+ ngx.HTTP_PUT,
+ [[{
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 002"
+}]],
+[[{
+"node": {
+"value": {
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"desc": "new service 002"
+},
+"key": "/apisix/services/2"
+},
+"action": "set"
+}]]
+)
+
+ngx.status = code
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 27: add consumer with plugin hmac-auth and consumer-restriction, and 
set whitelist
+--- 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": "jack",
+"plugins": {
+"hmac-auth": {
+"access_key": "my-access-key",
+"secret_key": "my-secret-key"
+},
+"consumer-restriction": {
+"type": "service_id",
+"whitelist": [ "1" ],
+"rejected_code": 401
+}
+}
+}]],
+[[{
+"node": {
+"value": {
+"username": "jack",
+"plugins": {
+"hmac-auth": {
+"access_key": "my-access-key",
+"secret_key": "my-secret-key",
+"algorithm": "hmac-sha256",
+"clock_skew": 300
+},
+"consumer-restriction": {
+"type": "service_id",
+"whitelist": [ "1" ],
+"rejected_code": 401
+}
+}
+}
+},
+"action": "set"
+}]]
+)
+
+ngx.status = code
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 28: Route binding `hmac-auth` plug-in and `service_id`
+--- config
+location /t {
+content_by_lua_block {
+local

[GitHub] [apisix] membphis opened a new pull request #2253: test: before creating and deleting routes in batches, clear all routes first

2020-09-17 Thread GitBox


membphis opened a new pull request #2253:
URL: https://github.com/apache/apisix/pull/2253


   ### What this PR does / why we need it:
   
   
   
   the test case is unstable, it runs fail sometimes.
   
   current way: before creating and deleting routes in batches, clear all 
routes first.
   
   ### 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] juzhiyuan commented on issue #480: PluginModule v3

2020-09-17 Thread GitBox


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


   cc @LiteSun please set category for plugin orchestration



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 a change in pull request #484: chore: add structs

2020-09-17 Thread GitBox


ShiningRush commented on a change in pull request #484:
URL: https://github.com/apache/apisix-dashboard/pull/484#discussion_r490658451



##
File path: api/internal/core/entity/entity.go
##
@@ -11,16 +11,107 @@ type Route struct {
Hoststring  `json:"host,omitempty"`
Hosts   []string`json:"hosts,omitempty"`
RemoteAddr  string  `json:"remote_addr,omitempty"`
-   RemoteAddrs string  `json:"remote_addrs,omitempty"`
+   RemoteAddrs []string`json:"remote_addrs,omitempty"`
Varsstring  `json:"vars,omitempty"`
FilterFunc  string  `json:"filter_func,omitempty"`
Script  string  `json:"script,omitempty"`
Plugins interface{} `json:"plugins,omitempty"`
UpstreamUpstream`json:"upstream,omitempty"`
-   ServiceId   string  `json:"service_id,omitempty"`
-   UpstreamId  string  `json:"upstream_id,omitempty"`
+   ServiceID   string  `json:"service_id,omitempty"`
+   UpstreamID  string  `json:"upstream_id,omitempty"`
ServiceProtocol string  `json:"service_protocol,omitempty"`
 }
 
+type Timeout struct {
+   Connect int `json:"connect,omitempty"`
+   Sendint `json:"send,omitempty"`
+   Readint `json:"read,omitempty"`
+}
+
+type Node struct {
+   Host string  `json:"host,omitempty"`
+   Port int `json:"port,omitempty"`
+   Weight   int `json:"weight,omitempty"`
+   Metadata interface{} `json:"metadata,omitempty"`
+}
+
+type K8sInfo struct {
+   Namespace   string `json:"namespace,omitempty"`
+   DeployName  string `json:"deploy_name,omitempty"`
+   ServiceName string `json:"service_name,omitempty"`
+   Portint`json:"port,omitempty"`
+   BackendType string `json:"backend_type,omitempty"`
+}
+
+type Healthy struct {
+   HttpStatuses []int `json:"http_statuses,omitempty"`

Review comment:
   Missing `interval`

##
File path: api/internal/core/entity/entity.go
##
@@ -11,16 +11,107 @@ type Route struct {
Hoststring  `json:"host,omitempty"`
Hosts   []string`json:"hosts,omitempty"`
RemoteAddr  string  `json:"remote_addr,omitempty"`
-   RemoteAddrs string  `json:"remote_addrs,omitempty"`
+   RemoteAddrs []string`json:"remote_addrs,omitempty"`
Varsstring  `json:"vars,omitempty"`
FilterFunc  string  `json:"filter_func,omitempty"`
Script  string  `json:"script,omitempty"`
Plugins interface{} `json:"plugins,omitempty"`
UpstreamUpstream`json:"upstream,omitempty"`
-   ServiceId   string  `json:"service_id,omitempty"`
-   UpstreamId  string  `json:"upstream_id,omitempty"`
+   ServiceID   string  `json:"service_id,omitempty"`
+   UpstreamID  string  `json:"upstream_id,omitempty"`
ServiceProtocol string  `json:"service_protocol,omitempty"`
 }
 
+type Timeout struct {
+   Connect int `json:"connect,omitempty"`
+   Sendint `json:"send,omitempty"`
+   Readint `json:"read,omitempty"`
+}
+
+type Node struct {
+   Host string  `json:"host,omitempty"`
+   Port int `json:"port,omitempty"`
+   Weight   int `json:"weight,omitempty"`
+   Metadata interface{} `json:"metadata,omitempty"`
+}
+
+type K8sInfo struct {
+   Namespace   string `json:"namespace,omitempty"`
+   DeployName  string `json:"deploy_name,omitempty"`
+   ServiceName string `json:"service_name,omitempty"`
+   Portint`json:"port,omitempty"`
+   BackendType string `json:"backend_type,omitempty"`
+}
+
+type Healthy struct {
+   HttpStatuses []int `json:"http_statuses,omitempty"`
+   Successesint   `json:"successes,omitempty"`
+}
+
+type UnHealthy struct {

Review comment:
   Missing interval





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 #485: feat: Route debug

2020-09-17 Thread GitBox


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



##
File path: src/pages/Route/transform.ts
##
@@ -252,3 +252,131 @@ export const transformRouteData = (data: 
RouteModule.Body) => {
 step3Data,
   };
 };
+
+export const transformRouteDebugData = (data: RouteModule.Body) => {
+  const {
+name,
+desc,
+methods,
+uris,
+protocols,
+// hosts,
+vars,
+// redirect,
+url,
+  } = data;
+
+  const paths = {};
+  const tags: RouteModule.TagSchema[] = [
+{
+  name: `Route-${name}`,
+  description: desc,
+},
+  ];
+  const servers: RouteModule.Server[] = [];
+  const responses: RouteModule.ResponseSchema = {
+// default response code
+'200': {
+  description: 'successful operation',
+  content: {},
+},
+'400': {
+  description: 'Invalid parameter',
+  content: {},
+},
+'500': {
+  description: 'Internal Server Error',
+  content: {},
+},
+  };
+  const params = transformVarsToRules(vars);
+  const formatParams = params.map((param) => {
+const { position, operator } = param;
+let paramPostion;
+
+switch (position) {
+  case 'cookie':
+paramPostion = 'cookie';
+break;
+  case 'http':
+paramPostion = 'header';
+break;
+  case 'arg':
+paramPostion = 'query';
+break;
+  default:
+break;
+}
+return {
+  name: param.name,
+  in: paramPostion,
+  description: `default value should ${operator} ${param.value}`,
+  required: true,
+  type: 'string',
+};
+  });
+  const pathParams = {
+name: 'pathParam',
+in: 'path',
+description: `enter your path param`,
+required: true,
+type: 'string',
+  };
+  const requestBodyMethod = ['POST', 'PUT', 'PATCH'];
+
+  protocols.forEach((protocol) => {
+if (protocol !== 'websocket') {
+  servers.push({
+url: `${protocol}://${url}`,
+  });
+  // FIXME

Review comment:
   I'm not family with Docker, this issue could be discussed with @nic-chen 
@gxthrj @bzp2010 , if this trick way works, I think it's ok to use 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] huzhewei commented on issue #2248: request help: apisix start error:init_by_lua error : no pcre jit support found

2020-09-17 Thread GitBox


huzhewei commented on issue #2248:
URL: https://github.com/apache/apisix/issues/2248#issuecomment-694601507


   > Hi @huzhewei I think I met same problem before. I suggest to follow 
instructions in 
[doc/install-dependencies](https://github.com/apache/apisix/blob/master/doc/install-dependencies.md#centos-7)
 to install openresty, where you could avoid apisix dependencies missing.
   
   There is no internet in my environment, so I installed openresty-1.15.8.2 
through source code, and my pcre version is pcre-7.8-7.el6.x86_64 , pcre-devel 
version is  pcre-devel-7.8-7.el6.x86_64



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 #485: feat: Route debug

2020-09-17 Thread GitBox


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



##
File path: src/pages/Route/transform.ts
##
@@ -252,3 +252,131 @@ export const transformRouteData = (data: 
RouteModule.Body) => {
 step3Data,
   };
 };
+
+export const transformRouteDebugData = (data: RouteModule.Body) => {
+  const {
+name,
+desc,
+methods,
+uris,
+protocols,
+// hosts,
+vars,
+// redirect,
+url,
+  } = data;
+
+  const paths = {};
+  const tags: RouteModule.TagSchema[] = [
+{
+  name: `Route-${name}`,
+  description: desc,
+},
+  ];
+  const servers: RouteModule.Server[] = [];
+  const responses: RouteModule.ResponseSchema = {
+// default response code
+'200': {
+  description: 'successful operation',
+  content: {},
+},
+'400': {
+  description: 'Invalid parameter',
+  content: {},
+},
+'500': {
+  description: 'Internal Server Error',
+  content: {},
+},
+  };
+  const params = transformVarsToRules(vars);
+  const formatParams = params.map((param) => {
+const { position, operator } = param;
+let paramPostion;
+
+switch (position) {
+  case 'cookie':
+paramPostion = 'cookie';
+break;
+  case 'http':
+paramPostion = 'header';
+break;
+  case 'arg':
+paramPostion = 'query';
+break;
+  default:
+break;
+}
+return {
+  name: param.name,
+  in: paramPostion,
+  description: `default value should ${operator} ${param.value}`,
+  required: true,
+  type: 'string',
+};
+  });
+  const pathParams = {
+name: 'pathParam',
+in: 'path',
+description: `enter your path param`,
+required: true,
+type: 'string',
+  };
+  const requestBodyMethod = ['POST', 'PUT', 'PATCH'];
+
+  protocols.forEach((protocol) => {
+if (protocol !== 'websocket') {
+  servers.push({
+url: `${protocol}://${url}`,
+  });
+  // FIXME

Review comment:
   This is a place I want to discuss with you:
   
   In the docker environment, the apisix's url returned by the manager-api is 
the docker ip: 192.17.5.11, which is unavailable here, so I added a url got 
from `window. location` as a remedy. It's easy but  not flexible🤦‍♀️,
   looking forward to your proposal @juzhiyuan 
   
   





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 #2252: test: also lint the test helpers

2020-09-17 Thread GitBox


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


   Close #2215.
   
   ### What this PR does / why we need it:
   
   
   
   ### 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?
   * [ ] 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] juzhiyuan commented on a change in pull request #485: feat: Route debug

2020-09-17 Thread GitBox


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



##
File path: src/pages/Route/transform.ts
##
@@ -252,3 +252,131 @@ export const transformRouteData = (data: 
RouteModule.Body) => {
 step3Data,
   };
 };
+
+export const transformRouteDebugData = (data: RouteModule.Body) => {
+  const {
+name,
+desc,
+methods,
+uris,
+protocols,
+// hosts,
+vars,
+// redirect,
+url,
+  } = data;
+
+  const paths = {};
+  const tags: RouteModule.TagSchema[] = [
+{
+  name: `Route-${name}`,
+  description: desc,
+},
+  ];
+  const servers: RouteModule.Server[] = [];
+  const responses: RouteModule.ResponseSchema = {
+// default response code
+'200': {
+  description: 'successful operation',
+  content: {},
+},
+'400': {
+  description: 'Invalid parameter',
+  content: {},
+},
+'500': {
+  description: 'Internal Server Error',
+  content: {},
+},
+  };
+  const params = transformVarsToRules(vars);
+  const formatParams = params.map((param) => {
+const { position, operator } = param;
+let paramPostion;
+
+switch (position) {
+  case 'cookie':
+paramPostion = 'cookie';
+break;
+  case 'http':
+paramPostion = 'header';
+break;
+  case 'arg':
+paramPostion = 'query';
+break;
+  default:
+break;
+}
+return {
+  name: param.name,
+  in: paramPostion,
+  description: `default value should ${operator} ${param.value}`,
+  required: true,
+  type: 'string',
+};
+  });
+  const pathParams = {
+name: 'pathParam',
+in: 'path',
+description: `enter your path param`,
+required: true,
+type: 'string',
+  };
+  const requestBodyMethod = ['POST', 'PUT', 'PATCH'];
+
+  protocols.forEach((protocol) => {
+if (protocol !== 'websocket') {
+  servers.push({

Review comment:
   `push` will take some side effects, we would recommend using `concat` 
instead of `push`

##
File path: src/pages/Route/transform.ts
##
@@ -252,3 +252,131 @@ export const transformRouteData = (data: 
RouteModule.Body) => {
 step3Data,
   };
 };
+
+export const transformRouteDebugData = (data: RouteModule.Body) => {
+  const {
+name,
+desc,
+methods,
+uris,
+protocols,
+// hosts,
+vars,
+// redirect,
+url,
+  } = data;
+
+  const paths = {};
+  const tags: RouteModule.TagSchema[] = [
+{
+  name: `Route-${name}`,
+  description: desc,
+},
+  ];
+  const servers: RouteModule.Server[] = [];
+  const responses: RouteModule.ResponseSchema = {
+// default response code
+'200': {
+  description: 'successful operation',
+  content: {},
+},
+'400': {
+  description: 'Invalid parameter',
+  content: {},
+},
+'500': {
+  description: 'Internal Server Error',
+  content: {},
+},
+  };
+  const params = transformVarsToRules(vars);
+  const formatParams = params.map((param) => {
+const { position, operator } = param;
+let paramPostion;
+
+switch (position) {
+  case 'cookie':
+paramPostion = 'cookie';
+break;
+  case 'http':
+paramPostion = 'header';
+break;
+  case 'arg':
+paramPostion = 'query';
+break;
+  default:
+break;
+}
+return {
+  name: param.name,
+  in: paramPostion,
+  description: `default value should ${operator} ${param.value}`,
+  required: true,
+  type: 'string',
+};
+  });
+  const pathParams = {
+name: 'pathParam',
+in: 'path',
+description: `enter your path param`,
+required: true,
+type: 'string',
+  };
+  const requestBodyMethod = ['POST', 'PUT', 'PATCH'];
+
+  protocols.forEach((protocol) => {
+if (protocol !== 'websocket') {
+  servers.push({
+url: `${protocol}://${url}`,
+  });
+  // FIXME

Review comment:
   what happened here?

##
File path: src/pages/Route/transform.ts
##
@@ -252,3 +252,131 @@ export const transformRouteData = (data: 
RouteModule.Body) => {
 step3Data,
   };
 };
+
+export const transformRouteDebugData = (data: RouteModule.Body) => {
+  const {
+name,
+desc,
+methods,
+uris,
+protocols,
+// hosts,
+vars,
+// redirect,
+url,
+  } = data;
+
+  const paths = {};
+  const tags: RouteModule.TagSchema[] = [
+{
+  name: `Route-${name}`,
+  description: desc,
+},
+  ];
+  const servers: RouteModule.Server[] = [];
+  const responses: RouteModule.ResponseSchema = {
+// default response code
+'200': {

Review comment:
   could we use `ok` here? 
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200

##
File path: src/pages/Route/typing.d.ts
##
@@ -157,5 +157,70 @@ declare namespace RouteModule {
   [name: string]

[GitHub] [apisix-dashboard] liuxiran opened a new pull request #485: feat: Route debug

2020-09-17 Thread GitBox


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


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bug fix
   - [ ] New feature provided
   - [ ] Improve performance
   
   - Related issues
   fix #469 
   ___
   ### Bugfix
   - Description
   
   - How to fix?
   
   ___
   ### New feature or improvement
   - Describe the details and related test reports.
   



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] swayamraina commented on a change in pull request #2221: send file contents and not file name

2020-09-17 Thread GitBox


swayamraina commented on a change in pull request #2221:
URL: https://github.com/apache/apisix/pull/2221#discussion_r490512498



##
File path: apisix/utils/log-util.lua
##
@@ -64,7 +64,11 @@ local function get_full_log(ngx, conf)
 else
 local body_file = ngx.req.get_body_file()
 if body_file then
-log.request.body_file = body_file
+local lines = {}

Review comment:
   `if not file then return nil end`
   do we need this part of the code? if the body is not present then can we not 
assume the data will be present in the file?





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 #484: chore: add structs

2020-09-17 Thread GitBox


nic-chen opened a new pull request #484:
URL: https://github.com/apache/apisix-dashboard/pull/484


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   add structs
   
   



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] Yiyiyimu commented on issue #2248: request help: apisix start error:init_by_lua error : no pcre jit support found

2020-09-17 Thread GitBox


Yiyiyimu commented on issue #2248:
URL: https://github.com/apache/apisix/issues/2248#issuecomment-694282024


   Hi @huzhewei I think I met same problem before. I suggest to follow 
instructions in 
[doc/install-dependencies](https://github.com/apache/apisix/blob/master/doc/install-dependencies.md#centos-7)
 to install openresty, where you could avoid apisix dependencies missing.



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-docker] Yiyiyimu opened a new issue #75: fix: remove enable-v2=true in etcd config

2020-09-17 Thread GitBox


Yiyiyimu opened a new issue #75:
URL: https://github.com/apache/apisix-docker/issues/75


   Since apisix would not support etcd v2 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-dashboard] LiteSun opened a new pull request #483: feat: improve route

2020-09-17 Thread GitBox


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


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bug fix
   - [ ] New feature provided
   - [x] Improve performance
   
   - Related issues
   
   ___
   ### Bugfix
   - Description
   
   - How to fix?
   
   ___
   ### New feature or improvement
   - Describe the details and related test reports.
   



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: bugfix: independently check the "disabled" field to avoid `schema` ve… (#2099)

2020-09-17 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 4f90039  bugfix: independently check the "disabled" field to avoid 
`schema` ve… (#2099)
4f90039 is described below

commit 4f900390f90b3bdf181f5eb298a94cee3b437b0d
Author: YuanSheng Wang 
AuthorDate: Thu Sep 17 22:31:02 2020 +0800

bugfix: independently check the "disabled" field to avoid `schema` ve… 
(#2099)

* bugfix: independently check the "disabled" field to avoid `schema` 
verification
  with other parameters.
---
 apisix/admin/plugins.lua  | 41 --
 apisix/plugin.lua |  8 
 apisix/schema_def.lua |  5 +
 t/admin/plugins.t | 14 +++--
 t/admin/routes.t  | 32 +-
 t/admin/schema.t  | 20 +++
 t/node/merge-route.t  |  4 
 t/plugin/example.t| 50 +++
 t/plugin/ip-restriction.t | 35 +
 9 files changed, 169 insertions(+), 40 deletions(-)

diff --git a/apisix/admin/plugins.lua b/apisix/admin/plugins.lua
index 7b835e1..88aa6f6 100644
--- a/apisix/admin/plugins.lua
+++ b/apisix/admin/plugins.lua
@@ -26,18 +26,7 @@ local table_sort = table.sort
 local table_insert = table.insert
 
 
-local _M = {
-version = 0.1,
-}
-
-
-local disable_schema = {
-type = "object",
-properties = {
-disable = {type = "boolean", enum={true}}
-},
-required = {"disable"}
-}
+local _M = {}
 
 
 function _M.check_schema(plugins_conf)
@@ -50,14 +39,16 @@ function _M.check_schema(plugins_conf)
 end
 
 if plugin_obj.check_schema then
-local ok = core.schema.check(disable_schema, plugin_conf)
+local disable = plugin_conf.disable
+plugin_conf.disable = nil
+
+local ok, err = plugin_obj.check_schema(plugin_conf)
 if not ok then
-local ok, err = plugin_obj.check_schema(plugin_conf)
-if not ok then
-return false, "failed to check the configuration of plugin 
"
-  .. name .. " err: " .. err
-end
+return false, "failed to check the configuration of plugin "
+  .. name .. " err: " .. err
 end
+
+plugin_conf.disable = disable
 end
 end
 
@@ -75,14 +66,16 @@ function _M.stream_check_schema(plugins_conf)
 end
 
 if plugin_obj.check_schema then
-local ok = core.schema.check(disable_schema, plugin_conf)
+local disable = plugin_conf.disable
+plugin_conf.disable = nil
+
+local ok, err = plugin_obj.check_schema(plugin_conf)
 if not ok then
-local ok, err = plugin_obj.check_schema(plugin_conf)
-if not ok then
-return false, "failed to check the configuration of "
-  .. "stream plugin [" .. name .. "]: " .. err
-end
+return false, "failed to check the configuration of "
+  .. "stream plugin [" .. name .. "]: " .. err
 end
+
+plugin_conf.disable = disable
 end
 end
 
diff --git a/apisix/plugin.lua b/apisix/plugin.lua
index bcd5e35..8c49883 100644
--- a/apisix/plugin.lua
+++ b/apisix/plugin.lua
@@ -78,6 +78,14 @@ local function load_plugin(name, plugins_list, 
is_stream_plugin)
 return
 end
 
+if plugin.schema and plugin.schema.type == "object" then
+if not plugin.schema.properties or
+   core.table.nkeys(plugin.schema.properties) == 0
+then
+plugin.schema.properties = core.schema.plugin_disable_schema
+end
+end
+
 plugin.name = name
 core.table.insert(plugins_list, plugin)
 
diff --git a/apisix/schema_def.lua b/apisix/schema_def.lua
index 52a7f42..e8d4249 100644
--- a/apisix/schema_def.lua
+++ b/apisix/schema_def.lua
@@ -606,6 +606,11 @@ _M.stream_route = {
 _M.id_schema = id_schema
 
 
+_M.plugin_disable_schema = {
+disable = {type = "boolean"}
+}
+
+
 setmetatable(_M, {
 __index = schema,
 __newindex = function() error("no modification allowed") end,
diff --git a/t/admin/plugins.t b/t/admin/plugins.t
index fa69ec6..6ca86af 100644
--- a/t/admin/plugins.t
+++ b/t/admin/plugins.t
@@ -61,6 +61,16 @@ GET /apisix/admin/plugins/limit-req
 --- request
 GET /apisix/admin/plugins/node-status
 --- response_body
-{"additionalProperties":false,"type":"object"}
+{"properties":{"disable":{"type":"boolean"}},"additionalProperties":false,"type":"object"}
 --- no_error_log
-[error] 
+[error]
+
+
+
+=== TEST 5: get plugin prometheus schema
+--- request
+GET /apisix/admin/plugin

[GitHub] [apisix] membphis closed issue #2084: request help: Update plugin's schema prometheus & node-status

2020-09-17 Thread GitBox


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


   



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 #2099: bugfix: independently check the "disabled" field to avoid `schema` ve…

2020-09-17 Thread GitBox


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


   



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 #2244: bugfix(CLI): if the user used default token and allow any IP to acces…

2020-09-17 Thread GitBox


membphis commented on a change in pull request #2244:
URL: https://github.com/apache/apisix/pull/2244#discussion_r490290166



##
File path: bin/apisix
##
@@ -799,6 +799,8 @@ version:print the version of apisix
 ]])
 end
 
+
+local is_checked_admin_key

Review comment:
   `checked_admin_key`, any better name 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] membphis opened a new pull request #2251: chore: get the complete error stack when sync etcd data, it is very u…

2020-09-17 Thread GitBox


membphis opened a new pull request #2251:
URL: https://github.com/apache/apisix/pull/2251


   …seful when a
   
   serious error occurs.
   
   ### What this PR does / why we need it:
   
   
   
   chore: get the complete error stack when sync etcd data, it is very useful 
when a serious error occurs.
   
   ### 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] griffenliu edited a comment on issue #2006: bug(cors): attempt to concatenate field 'conf_id' (a nil value)

2020-09-17 Thread GitBox


griffenliu edited a comment on issue #2006:
URL: https://github.com/apache/apisix/issues/2006#issuecomment-694208133


   I want to use the prometheus plug-ins.
   But when I access http://localhost:9080/apisix/prometheus/metrics based on 
the document 
https://github.com/apache/apisix/blob/master/doc/zh-cn/plugins/prometheus.md.
   
   I got the following error too:
   ```
   2020/09/17 20:45:31 [error] 3087#3087: *11669858 failed to run 
header_filter_by_lua*: 
...user-center//deps/share/lua/5.1/apisix/core/lrucache.lua:202: attempt to 
concatenate
field 'conf_id' (a nil value)   


   stack traceback: 


   ...user-center//deps/share/lua/5.1/apisix/core/lrucache.lua:202: in 
function 'plugin_ctx'   
 
   ...-user-center//deps/share/lua/5.1/apisix/plugins/cors.lua:144: in 
function 'phase_fun'
 
   ...odes/dfy-user-center//deps/share/lua/5.1/apisix/init.lua:142: in 
function 'run_plugin'
   ...odes/dfy-user-center//deps/share/lua/5.1/apisix/init.lua:550: in 
function 'common_phase'
   ...odes/dfy-user-center//deps/share/lua/5.1/apisix/init.lua:561: in 
function 'http_header_filter_phase'
   header_filter_by_lua:2: in main chunk, client: 172.30.213.200, 
server: , request: "GET /apisix/prometheus/metrics HTTP/1.1", host: 
"172.30.212.70:9080"
   ```
   
   



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 opened a new pull request #2250: add docker file

2020-09-17 Thread GitBox


gy09535 opened a new pull request #2250:
URL: https://github.com/apache/apisix/pull/2250


   ### What this PR does / why we need it:
   fix:https://github.com/apache/apisix/issues/2249
   ### 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] gy09535 opened a new issue #2249: feat: build docker image with source code

2020-09-17 Thread GitBox


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


   ### Issue description
   Sometime we should add  some special logical for ourself business, we should 
build docker image with source code. So maybe we should add dockerfile in 
source code.
   ### Environment
   
   * apisix version (cmd: `apisix version`):
   * OS:
   



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] griffenliu edited a comment on issue #2006: bug(cors): attempt to concatenate field 'conf_id' (a nil value)

2020-09-17 Thread GitBox


griffenliu edited a comment on issue #2006:
URL: https://github.com/apache/apisix/issues/2006#issuecomment-694208133


   I want to use the prometheus plug-ins.
   But when I access http://localhost:9080/apisix/prometheus/metrics by 
document 
https://github.com/apache/apisix/blob/master/doc/zh-cn/plugins/prometheus.md.
   
   I got the following error too:
   ```
   2020/09/17 20:45:31 [error] 3087#3087: *11669858 failed to run 
header_filter_by_lua*: 
...user-center//deps/share/lua/5.1/apisix/core/lrucache.lua:202: attempt to 
concatenate
field 'conf_id' (a nil value)   


   stack traceback: 


   ...user-center//deps/share/lua/5.1/apisix/core/lrucache.lua:202: in 
function 'plugin_ctx'   
 
   ...-user-center//deps/share/lua/5.1/apisix/plugins/cors.lua:144: in 
function 'phase_fun'
 
   ...odes/dfy-user-center//deps/share/lua/5.1/apisix/init.lua:142: in 
function 'run_plugin'
   ...odes/dfy-user-center//deps/share/lua/5.1/apisix/init.lua:550: in 
function 'common_phase'
   ...odes/dfy-user-center//deps/share/lua/5.1/apisix/init.lua:561: in 
function 'http_header_filter_phase'
   header_filter_by_lua:2: in main chunk, client: 172.30.213.200, 
server: , request: "GET /apisix/prometheus/metrics HTTP/1.1", host: 
"172.30.212.70:9080"
   ```
   
   



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] griffenliu commented on issue #2006: bug(cors): attempt to concatenate field 'conf_id' (a nil value)

2020-09-17 Thread GitBox


griffenliu commented on issue #2006:
URL: https://github.com/apache/apisix/issues/2006#issuecomment-694208133


   I want to use the prometheus plug-ins.
   But when I access http://localhost:9080/apisix/prometheus/metrics by 
document 
https://github.com/apache/apisix/blob/master/doc/zh-cn/plugins/prometheus.md.
   
   I got the following error to:
   ```
   2020/09/17 20:45:31 [error] 3087#3087: *11669858 failed to run 
header_filter_by_lua*: 
...user-center//deps/share/lua/5.1/apisix/core/lrucache.lua:202: attempt to 
concatenate
field 'conf_id' (a nil value)   


   stack traceback: 


   ...user-center//deps/share/lua/5.1/apisix/core/lrucache.lua:202: in 
function 'plugin_ctx'   
 
   ...-user-center//deps/share/lua/5.1/apisix/plugins/cors.lua:144: in 
function 'phase_fun'
 
   ...odes/dfy-user-center//deps/share/lua/5.1/apisix/init.lua:142: in 
function 'run_plugin'
   ...odes/dfy-user-center//deps/share/lua/5.1/apisix/init.lua:550: in 
function 'common_phase'
   ...odes/dfy-user-center//deps/share/lua/5.1/apisix/init.lua:561: in 
function 'http_header_filter_phase'
   header_filter_by_lua:2: in main chunk, client: 172.30.213.200, 
server: , request: "GET /apisix/prometheus/metrics HTTP/1.1", host: 
"172.30.212.70:9080"
   ```
   
   



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 #2239: feat: `hmac-auth` add signed headers to calculate signature

2020-09-17 Thread GitBox


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



##
File path: apisix/plugins/hmac-auth.lua
##
@@ -182,13 +201,25 @@ local function generate_signature(ctx, secret_key, params)
 canonical_query_string = core.table.concat(query_tab, "&")
 end
 
-local req_body = core.request.get_body()
-req_body = req_body or ""
+local canonical_headers = ""
+
+core.log.info("all headers: ", core.json.encode(core.request.headers(), 
true))
+
+for _, h in pairs(params.signed_headers) do
+canonical_headers = canonical_headers .. (core.request.header(ctx, h) 
or "")

Review comment:
   not quite understand here, this is concatenating a string to generate a 
signature
   





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 #478: What is the default account password of the dashboard?

2020-09-17 Thread GitBox


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


   It looks working for you when using codes from the master branch, I will 
close this issue, feel free to reopen 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-dashboard] juzhiyuan closed issue #478: What is the default account password of the dashboard?

2020-09-17 Thread GitBox


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


   



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 #478: What is the default account password of the dashboard?

2020-09-17 Thread GitBox


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


   > 。。。
   > 
发现是apisix-dashboard-1.5这个包构建出来的manager-api和apisix1.5可能不配套,用当前最新代码重新构建了一下manager-api的镜像现在可以登录了,数据库的表多了一张。。。
   
   Yep, codes between the master and the 1.5 branches have a lot of changes, 
please use the latest codes on the master branch, a new version should release 
this month.



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 #458: bug: When creating a route, host should not be required

2020-09-17 Thread GitBox


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


   ping @LiteSun 



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-plugin updated (5b24ece -> 744af48)

2020-09-17 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a change to branch feat-plugin
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git.


from 5b24ece  fix: host should not be required (#479)
 add 744af48  feat: update plugin

No new revisions were added by this update.

Summary of changes:
 package.json  |  2 +-
 src/pages/Consumer/Create.tsx |  4 ++--
 src/pages/Consumer/components/Preview.tsx |  4 ++--
 yarn.lock | 19 +++
 4 files changed, 20 insertions(+), 9 deletions(-)



[apisix-dashboard] branch feat-plugin created (now 5b24ece)

2020-09-17 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a change to branch feat-plugin
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git.


  at 5b24ece  fix: host should not be required (#479)

No new revisions were added by this update.



[GitHub] [apisix] huzhewei edited a comment on issue #2248: request help: apisix start error:init_by_lua error : no pcre jit support found

2020-09-17 Thread GitBox


huzhewei edited a comment on issue #2248:
URL: https://github.com/apache/apisix/issues/2248#issuecomment-694120286


   我加了--with-pcre=../pcre-8.4.2后修复了此问题,但是抛出了新问题
   nginx[error]: init_by_lua error: ../lualib/ngx/re.lua:47 : missing 
declaration for symbol 'ngx_http_lua_ffi_exec_regex'



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 opened a new pull request #482: feat: update plugin

2020-09-17 Thread GitBox


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


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bug fix
   - [ ] New feature provided
   - [ ] Improve performance
   
   - Related issues
   
   ___
   ### Bugfix
   - Description
   
   - How to fix?
   
   ___
   ### New feature or improvement
   - Describe the details and related test reports.
   



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-plugin created (now f1c15e3)

2020-09-17 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a change to branch feat-plugin
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git.


  at f1c15e3  feat: update plugin

No new revisions were added by this update.



[apisix-dashboard] branch feat-plugin created (now f1c15e3)

2020-09-17 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a change to branch feat-plugin
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git.


  at f1c15e3  feat: update plugin

No new revisions were added by this update.



[GitHub] [apisix-dashboard] juzhiyuan closed pull request #481: Feat plugin

2020-09-17 Thread GitBox


juzhiyuan closed pull request #481:
URL: https://github.com/apache/apisix-dashboard/pull/481


   



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 opened a new pull request #481: Feat plugin

2020-09-17 Thread GitBox


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


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bug fix
   - [ ] New feature provided
   - [ ] Improve performance
   
   - Related issues
   
   ___
   ### Bugfix
   - Description
   
   - How to fix?
   
   ___
   ### New feature or improvement
   - Describe the details and related test reports.
   



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 #473: PluginModule: v2

2020-09-17 Thread GitBox


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


   



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 #473: PluginModule: v2

2020-09-17 Thread GitBox


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


   Sort the category has been implemented, waiting for Plugin's PR review.



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 #473: PluginModule: v2

2020-09-17 Thread GitBox


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


   Looks good for me
   
   琚致远 于2020年9月17日 周四下午6:21写道:
   
   >
   >
   > [image: image]
   > 

   >
   >
   >
   >
   > —
   > You are receiving this because you were assigned.
   > Reply to this email directly, view it on GitHub
   > 
,
   > or unsubscribe
   > 

   > .
   >
   >
   > --
   Thanks,
   Ming Wen
   Twitter: _WenMing
   



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 #473: PluginModule: v2

2020-09-17 Thread GitBox


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


   
![image](https://user-images.githubusercontent.com/2106987/93458190-956e9000-f912-11ea-8ea5-fae75b05c442.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] juzhiyuan opened a new issue #480: PluginModule v3

2020-09-17 Thread GitBox


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


   - [ ] Improve i18n
   - [ ] icon for plugins
   - [ ] Disable 
https://github.com/apache/apisix/pull/2099/files#diff-ed26f75979353d43aa8168d799d931d0R609



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] huzhewei commented on issue #2248: request help: apisix start error:init_by_lua error : no pcre jit support found

2020-09-17 Thread GitBox


huzhewei commented on issue #2248:
URL: https://github.com/apache/apisix/issues/2248#issuecomment-694120286


   我加了--with-pcre=../pcre-8.4.2后修复了此问题,但是抛出了新问题
   nginx[error]: init_by_lua error: ../lualib/ngx/re.lua:47 : missing 
declaration for symbol hnx_http_lua_ffi_exec_regex''



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] Caelebs commented on issue #478: What is the default account password of the dashboard?

2020-09-17 Thread GitBox


Caelebs commented on issue #478:
URL: 
https://github.com/apache/apisix-dashboard/issues/478#issuecomment-694116308


   。。。
   
发现是apisix-dashboard-1.5这个包构建出来的manager-api和apisix1.5可能不配套,用当前最新代码重新构建了一下manager-api的镜像现在可以登录了,数据库的表多了一张。。。



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] huzhewei opened a new issue #2248: request help: apisix start error:init_by_lua error : no pcre jit support found

2020-09-17 Thread GitBox


huzhewei opened a new issue #2248:
URL: https://github.com/apache/apisix/issues/2248


   ### Issue description
   apisix start出现no pcre jit support found,但我本地已经安装了pcre和pcre-devel了
   
   
   ### Environment
   
   * apisix version (cmd: `apisix version`):1.5
   * OS:centos6.9
   



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] Caelebs commented on issue #478: What is the default account password of the dashboard?

2020-09-17 Thread GitBox


Caelebs commented on issue #478:
URL: 
https://github.com/apache/apisix-dashboard/issues/478#issuecomment-694095697


   
我重新部署了一下,manager-api的镜像是基于**apisix-dashboard-1.5**这个包里面的/api目录下的Dockerfile构建的,运行起来之后/root/manager-api目录下的conf.json配置看起来应该是正常的
   ```
   {
 "conf": {
   "mysql":{
 "address": "apisix-mysql",
 "user": "root",
 "password": "123456",
 "maxConns": 50,
 "maxIdleConns": 25,
 "maxLifeTime": 10
   },
   "syslog": {
 "host": ""
   },
   "apisix": {
 "base_url": "apisix-gw-lb",
 "api_key": "edd1c9f034335f136f87ad84b625c8f1"
   }
 }
   }
   ```
   启动时的日志输出看起来也没有报错
   ```
   [GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in 
production.
   - using env: export GIN_MODE=release
   - using code:gin.SetMode(gin.ReleaseMode)
   [GIN-debug] GET /ping --> 
github.com/apisix/manager-api/route.healthzHandler.func1 (5 handlers)
   [GIN-debug] POST /apisix/admin/routes --> 
github.com/apisix/manager-api/route.createRoute (5 handlers)
   [GIN-debug] GET /apisix/admin/routes/:rid --> 
github.com/apisix/manager-api/route.findRoute (5 handlers)
   [GIN-debug] GET /apisix/admin/routes --> 
github.com/apisix/manager-api/route.listRoute (5 handlers)
   [GIN-debug] PUT /apisix/admin/routes/:rid --> 
github.com/apisix/manager-api/route.updateRoute (5 handlers)
   ```
   然后dashboard容器内nginx配置文件default.conf里边配置的proxy_pass地址是这样的
   ```
   location /apisix/admin {
   proxy_pass http://apisix-manager-api:8080/apisix/admin;
   }
   ```
   manager-api依赖的MySQL也是可用的,初始化的consumers、routes、ssls、upstreams四张表也创建好了的
   
我理解是apisix-dashboard指向apisix-manager-api:8080,apisix-manager-api指向后端apisix的base_url,不知道这样对不对?
   现在的情况就变成了dashboard登录的时候前台页面提示
   ```
   请求错误,错误码: 404
   发出的请求针对的是不存在的记录,服务器没有进行操作。
   ```
   ```
   10.20.0.0 - - [17/Sep/2020:08:48:32 +] "POST /apisix/admin/user/login 
HTTP/1.1" 404 18 
"http://10.10.16.250:30999/user/login?redirect=%2Fapisix%2Fdashboard%2F"; 
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) 
Chrome/61.0.3163.79 Safari/537.36 Maxthon/5.2.7.4000" "-"
   ```
   
   我不确定是我的部署方式有问题还是哪儿的配置有问题?
   apisix的版本和dashboard应该是配套的,都是用的1.5
   ```
   sh-4.2# apisix version
   1.5
   ```
   给整懵了
   @bzp2010 @juzhiyuan 
   
   
   
   
   



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 pull request #479: fix: host should not be required

2020-09-17 Thread GitBox


moonming commented on pull request #479:
URL: https://github.com/apache/apisix-dashboard/pull/479#issuecomment-694093851


   > create a route without host in on line demo: http://139.217.190.60/ has 
got an 500 error:
   > 
   > 
![image](https://user-images.githubusercontent.com/2561857/93443627-ed04ff80-f902-11ea-9679-e37686d5eb20.png)
   > 
   > 
![image](https://user-images.githubusercontent.com/2561857/93443930-027a2980-f903-11ea-8dde-b436d462071f.png)
   > 
   > 
![image](https://user-images.githubusercontent.com/2561857/93444090-0e65eb80-f903-11ea-93d3-ef946ed4b8e8.png)
   > 
   > 
   > 
   > Since the host is “” does not match the regular rules of apisix, when the 
host is not specified, the host in the submitData also needs to be processed to 
complete this modification 🤦‍♀️.  @LiteSun @juzhiyuan 
   > 
   > 
   > 
   > 
   
   Nice catch. @LiteSun we need add test cases for this or



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 pull request #2216: improve: use optimistic locking to avoid concurrency problem in admin…

2020-09-17 Thread GitBox


tokers commented on pull request #2216:
URL: https://github.com/apache/apisix/pull/2216#issuecomment-694089015


   @membphis @moonming Please help me to retry the checks 😂, it's weird that 
this failure only in linux_tengine.



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 #479: fix: host should not be required

2020-09-17 Thread GitBox


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


   create a route without host in on line demo: http://139.217.190.60/ has got 
an 500 error:
   
![image](https://user-images.githubusercontent.com/2561857/93443627-ed04ff80-f902-11ea-9679-e37686d5eb20.png)
   
![image](https://user-images.githubusercontent.com/2561857/93443930-027a2980-f903-11ea-8dde-b436d462071f.png)
   
![image](https://user-images.githubusercontent.com/2561857/93444090-0e65eb80-f903-11ea-93d3-ef946ed4b8e8.png)
   
   Since the host is “” does not match the regular rules of apisix, when the 
host is not specified, the host in the submitData also needs to be processed to 
complete this modification 🤦‍♀️.  @LiteSun @juzhiyuan 
   
   



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 #2099: bugfix: independently check the "disabled" field to avoid `schema` ve…

2020-09-17 Thread GitBox


juzhiyuan commented on a change in pull request #2099:
URL: https://github.com/apache/apisix/pull/2099#discussion_r490067745



##
File path: t/admin/plugins.t
##
@@ -61,6 +61,16 @@ GET /apisix/admin/plugins/limit-req
 --- request
 GET /apisix/admin/plugins/node-status
 --- response_body
-{"additionalProperties":false,"type":"object"}
+{"properties":{"disable":{"type":"boolean"}},"additionalProperties":false,"type":"object"}

Review comment:
   
![image](https://user-images.githubusercontent.com/2106987/93445031-669ced80-f903-11ea-8f87-d386cdddcd12.png)
   
   @membphis Not working 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-website] juzhiyuan commented on issue #74: Apache APISIX's official webpage is at risk of hijacking

2020-09-17 Thread GitBox


juzhiyuan commented on issue #74:
URL: https://github.com/apache/apisix-website/issues/74#issuecomment-694081497


   need to create an infra ticket if this issue should be 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-website] Miss-you opened a new issue #74: Apache APISIX's official webpage is at risk of hijacking

2020-09-17 Thread GitBox


Miss-you opened a new issue #74:
URL: https://github.com/apache/apisix-website/issues/74


   Apache APISIX's official webpage is at risk of hijacking
   
   Phenomena.
   1. search the Apache APISIX website through Baidu or Google, the default is 
to use the http protocol to access.
   
![image](https://user-images.githubusercontent.com/3816205/93440497-0fe2e400-f902-11ea-9563-506791b8d8d3.png)
   
   Solution.
   1. if it's an http request, reply to the 302 bounce response to jump to the 
https page
   2. add response header for all http responses: `Strict-Transport-Security: 
max-age=172800` to ensure that subsequent users accessing the apisix website 
will use the https protocol 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] juzhiyuan commented on issue #473: PluginModule: v2

2020-09-17 Thread GitBox


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


   
![image](https://user-images.githubusercontent.com/2106987/93438879-7830c600-f900-11ea-9356-d3fdbef19912.png)
   
   How about this one?



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 #473: PluginModule: v2

2020-09-17 Thread GitBox


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


   We can merge the switch and configuration together; or add the logo to the
   original description position
   
   Thanks,
   Ming Wen
   Twitter: _WenMing
   
   
   琚致远  于2020年9月17日周四 下午3:46写道:
   
   > [image: image]
   > 

   >
   > Very crowded I think if removed the description.
   >
   > —
   > You are receiving this because you were assigned.
   > Reply to this email directly, view it on GitHub
   > 
,
   > or unsubscribe
   > 

   > .
   >
   



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 #2175: bug: kafka-logger plugin comes with exception logs

2020-09-17 Thread GitBox


sshniro commented on issue #2175:
URL: https://github.com/apache/apisix/issues/2175#issuecomment-694064180


   @GBXing I assume the issue relies on the connectivity to the Kafka or a bug 
inside the logger. The batch processor is a standalone module that is used in 
other loggers and does not have an issue in batching and sending the requests.
   
   @moonming yes for default we can set max_retry count to zero as well.
   
   Please take a look at this PR as well: 
https://github.com/apache/apisix/pull/ , probably this might be the 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-dashboard] juzhiyuan commented on issue #473: PluginModule: v2

2020-09-17 Thread GitBox


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


   
![image](https://user-images.githubusercontent.com/2106987/93436105-e96e7a00-f8fc-11ea-944d-38e0cd66b322.png)
   
   Very crowded I think if removed the description.



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] ShiningRush commented on issue #2247: feat: `apisix-schema` tool can return the `jsonschema` of route, service, upstream and plugins

2020-09-17 Thread GitBox


ShiningRush commented on issue #2247:
URL: https://github.com/apache/apisix/issues/2247#issuecomment-694053177


   We maybe need a command to export all resources to a json file at once, such 
as 
   `./apisix-schem all`
   It will automatically write the schema into the default directory for easy 
dashboard import



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 opened a new issue #2247: feat: one tools can return the definition `jsonschema` of route, service, upstream and plugins

2020-09-17 Thread GitBox


membphis opened a new issue #2247:
URL: https://github.com/apache/apisix/issues/2247


   I write an example, @ShiningRush please take a look at this design.
   
   ```shell
   $ ./apisix-schema help
   route   # fetch route schema
   service # fetch service schema
   upstream# fetch upstream schema
   consumer# fetch consumer schema
   plugin***   # fetch the schema of plugin, *** means name of plugin
   
   # fetch schema of route
   ./apisix-schema route
   {...}
   
   # fetch schema of service
   ./apisix-schema service
   {...}
   
   # fetch schema of upstream
   ./apisix-schema upstream
   {...}
   
   # fetch schema of consumer
   ./apisix-schema consumer
   {...}
   
   # fetch schema of plugin basic-auth
   ./apisix-schema plugin basic-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] moonming opened a new pull request #2246: doc: removed qrcode of qq group.

2020-09-17 Thread GitBox


moonming opened a new pull request #2246:
URL: https://github.com/apache/apisix/pull/2246


   



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 a change in pull request #2244: bugfix(CLI): if the user used default token and allow any IP to acces…

2020-09-17 Thread GitBox


moonming commented on a change in pull request #2244:
URL: https://github.com/apache/apisix/pull/2244#discussion_r490027799



##
File path: bin/apisix
##
@@ -799,6 +799,8 @@ version:print the version of apisix
 ]])
 end
 
+
+local is_checked_admin_key

Review comment:
   `is_checked_admin_key` is confusing, please take a better name.





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 a change in pull request #2244: bugfix(CLI): if the user used default token and allow any IP to acces…

2020-09-17 Thread GitBox


moonming commented on a change in pull request #2244:
URL: https://github.com/apache/apisix/pull/2244#discussion_r490026730



##
File path: conf/config.yaml
##
@@ -21,3 +21,9 @@
 # host:
 #   - "http://127.0.0.1:2379";
 #
+apisix:
+  admin_key:
+-
+  name: "admin"
+  key: edd1c9f034335f136f87ad84b625c8f1 # please update the default token 
for safe

Review comment:
   `using fixed API token has security risk, please update it when you 
deploy to production environment`

##
File path: bin/apisix
##
@@ -812,6 +814,51 @@ local function init()
 end
 -- print("etcd: ", yaml_conf.etcd.host)
 
+-- check the Admin API token
+if yaml_conf.apisix.enable_admin and yaml_conf.apisix.allow_admin then
+for _, allow_ip in ipairs(yaml_conf.apisix.allow_admin) do
+if allow_ip == "127.0.0.0/24" then
+is_checked_admin_key = true
+end
+end
+end
+
+if yaml_conf.apisix.enable_admin and not is_checked_admin_key then
+is_checked_admin_key = true
+local help = [[
+
+%s
+Please set a new Admin API key and store it in the `conf/config.yaml` file.
+
+]]
+if type(yaml_conf.apisix.admin_key) ~= "table" or
+   #yaml_conf.apisix.admin_key == 0
+then
+io.stderr:write(help:format("ERROR: missing valid Admin API Key"))
+os.exit(1)
+end
+
+for _, admin in ipairs(yaml_conf.apisix.admin_key) do
+if type(admin.key) == "table" then
+admin.key = ""
+else
+admin.key = tostring(admin.key)
+end
+
+if admin.key == "" then
+io.stderr:write(help:format("ERROR: missing valid Admin API 
Key"), "\n")
+os.exit(1)
+end
+
+if admin.key == "edd1c9f034335f136f87ad84b625c8f1" then
+io.stderr:write(
+help:format("WARNING: using the default Key is very 
dangerous."),

Review comment:
   `using the default Key is very dangerous.` -> `using fixed API token has 
security risk, please modify "admin_key" in conf/config.yaml`





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 #2099: bugfix: independently check the "disabled" field to avoid `schema` ve…

2020-09-17 Thread GitBox


membphis commented on pull request #2099:
URL: https://github.com/apache/apisix/pull/2099#issuecomment-694025952


   @nic-chen do you have time to review 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] moonming merged pull request #2222: fix: return ok in kafka-logger

2020-09-17 Thread GitBox


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


   



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: fix: return ok in kafka-logger (#2222)

2020-09-17 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming 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 d050718  fix: return ok in kafka-logger (#)
d050718 is described below

commit d05071868d87662e10e392978faad3c0ed08a111
Author: Zhang Qiang 
AuthorDate: Thu Sep 17 15:17:51 2020 +0800

fix: return ok in kafka-logger (#)
---
 apisix/plugins/kafka-logger.lua |  2 ++
 t/plugin/kafka-logger.t | 10 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/apisix/plugins/kafka-logger.lua b/apisix/plugins/kafka-logger.lua
index fc7d90c..6377bf1 100644
--- a/apisix/plugins/kafka-logger.lua
+++ b/apisix/plugins/kafka-logger.lua
@@ -92,6 +92,8 @@ local function send_kafka_data(conf, log_message)
 if not ok then
 return nil, "failed to send data to Kafka topic" .. err
 end
+
+return true, nil
 end
 
 -- remove stale objects from the memory after timer expires
diff --git a/t/plugin/kafka-logger.t b/t/plugin/kafka-logger.t
index 4dfbe40..a4e0814 100644
--- a/t/plugin/kafka-logger.t
+++ b/t/plugin/kafka-logger.t
@@ -116,7 +116,9 @@ done
 "127.0.0.1":9092
   },
 "kafka_topic" : "test2",
-"key" : "key1"
+"key" : "key1",
+"timeout" : 1,
+"batch_max_size": 1
 }
 },
 "upstream": {
@@ -137,7 +139,9 @@ done
 "127.0.0.1":9092
   },
 "kafka_topic" : "test2",
-"key" : "key1"
+"key" : "key1",
+"timeout" : 1,
+"batch_max_size": 1
 }
 },
 "upstream": {
@@ -175,7 +179,7 @@ GET /hello
 hello world
 --- no_error_log
 [error]
 wait: 0.2
+--- wait: 2
 
 
 



[GitHub] [apisix] tokers commented on issue #2245: test: add test case

2020-09-17 Thread GitBox


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


   @membphis 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