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 2020/03/13 11:50:04 UTC

[GitHub] [incubator-apisix] juzhiyuan commented on a change in pull request #1251: bugfix: the plugin basic-auth needs required field

juzhiyuan 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_r392181697
 
 

 ##########
 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:
   Do we need print?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services