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



##########
File path: apisix/plugins/basic-auth.lua
##########
@@ -125,7 +125,7 @@ do
     end
 end
 
-function _M.access(conf, ctx)
+function _M.rewrite(conf, ctx)

Review comment:
       You can add a stub:
   ```diff
   diff --git apisix/init.lua apisix/init.lua
   index 7333dd1..411cdd4 100644
   --- apisix/init.lua
   +++ apisix/init.lua
   @@ -514,6 +514,10 @@ function _M.http_access_phase()
                    api_ctx.consumer,
                    api_ctx
                )
   +
   +            core.log.info("find consumer ", api_ctx.consumer.username,
   +                          ", config changed: ", changed)
   +
                if changed then
                    core.table.clear(api_ctx.plugins)
                    api_ctx.plugins = plugin.filter(route, api_ctx.plugins)
   ```
   
   And then check it in:
   
https://github.com/apache/apisix/blob/e66dd9a314e0b545e412f806b8b8d98f3b1a8f2d/t/plugin/basic-auth.t#L192
   
   Add something like:
   ```
   --- error_log
   find consumer foo
   ```




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


Reply via email to