membphis commented on a change in pull request #1251: bugfix: the plugin 
basic-auth needs required field
URL: https://github.com/apache/incubator-apisix/pull/1251#discussion_r392188149
 
 

 ##########
 File path: t/plugin/basic-auth.t
 ##########
 @@ -196,3 +196,34 @@ Authorization: Basic Zm9vOmJhcg==
 hello world
 --- no_error_log
 [error]
+
+
+
+=== TEST 9: invalid schema, only one field `username`
+--- 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": "foo",
+                    "plugins": {
+                        "basic-auth": {
+                            "username": "foo"
+                        }
+                    }
+                }]]
+                )
+
+            ngx.status = code
+            ngx.print(body)
 
 Review comment:
   Yes, we need to confirm that the error message is the same as expected.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to