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



##########
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:
       Need a test case to check if the `ctx.consumer` set by this plugin can 
be used by other plugin runs in access phase.

##########
File path: doc/plugin-develop.md
##########
@@ -168,8 +168,8 @@ local _M = {
 Determine which phase to run, generally access or rewrite. If you don't know 
the [Openresty life 
cycle](https://openresty-reference.readthedocs.io/en/latest/Directives/), it's
 recommended to know it in advance. For example key-auth is an authentication 
plugin, thus the authentication should be completed
 before forwarding the request to any upstream service. Therefore, the plugin 
can be executed in the rewrite and access phases.
-In APISIX, the authentication logic is implemented in the rewrite phase. 
Generally, IP access and interface
-permission are completed in the access phase.
+In APISIX, the authentication logic is implemented in the access phase. 
Generally, IP access and interface

Review comment:
       Remember to revert this change.




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