You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/08/05 03:11:43 UTC

[GitHub] [apisix] spacewander commented on a change in pull request #4756: fix(admin): check username for updating consumer

spacewander commented on a change in pull request #4756:
URL: https://github.com/apache/apisix/pull/4756#discussion_r683095935



##########
File path: t/admin/consumers2.t
##########
@@ -151,3 +151,32 @@ __DATA__
     }
 --- response_body
 {"action":"get","count":0,"node":{"dir":true,"key":"/apisix/consumers","nodes":{}}}
+
+
+
+=== TEST 5: mismatched username, PUT
+--- config
+    location /t {
+        content_by_lua_block {
+            local json = require("toolkit.json")
+            local t = require("lib.test_admin").test
+
+            local code, message, res = t('/apisix/admin/consumers/jack1',
+                ngx.HTTP_PUT,
+                [[{
+                     "username":"jack"
+                }]]
+            )
+
+            ngx.status = code
+            if code >= 300 and code ~= 400 then
+                ngx.say(message)
+                return
+            end
+
+            ngx.say(message)

Review comment:
       ```suggestion
               ngx.print(message)
   ```

##########
File path: t/admin/consumers2.t
##########
@@ -151,3 +151,32 @@ __DATA__
     }
 --- response_body
 {"action":"get","count":0,"node":{"dir":true,"key":"/apisix/consumers","nodes":{}}}
+
+
+
+=== TEST 5: mismatched username, PUT
+--- config
+    location /t {
+        content_by_lua_block {
+            local json = require("toolkit.json")
+            local t = require("lib.test_admin").test
+
+            local code, message, res = t('/apisix/admin/consumers/jack1',
+                ngx.HTTP_PUT,
+                [[{
+                     "username":"jack"
+                }]]
+            )
+
+            ngx.status = code
+            if code >= 300 and code ~= 400 then

Review comment:
       this block can be removed now?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org