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



##########
File path: t/plugin/basic-auth.t
##########
@@ -356,3 +356,55 @@ GET /t
 GET /t
 --- no_error_log
 [error]
+
+
+
+=== TEST 15: enable basic auth plugin using admin api, set hide_credentials = 
true
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/routes/1',
+                ngx.HTTP_PUT,
+                [[{
+                    "plugins": {
+                        "basic-auth": {
+                            "hide_credentials": true
+                        }
+                    },
+                    "upstream": {
+                        "nodes": {
+                            "127.0.0.1:1980": 1
+                        },
+                        "type": "roundrobin"
+                    },
+                    "uri": "/hello"
+                }]]
+                )
+
+            if code >= 300 then
+                ngx.status = code
+            end
+            ngx.say(body)
+        }
+    }
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 16: verify

Review comment:
       Can we strengthen this case that we can make sure the header is really 
removed, rather than just checking out the log.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to