mscb402 commented on code in PR #8904:
URL: https://github.com/apache/apisix/pull/8904#discussion_r1115164187


##########
apisix/consumer.lua:
##########
@@ -88,6 +88,11 @@ function _M.attach_consumer(ctx, consumer, conf)
     ctx.consumer_ver = conf.conf_version
 end
 
+-- attach chosen consumer to the request headers, used in auth plugin
+function _M.attach_consumer_to_request(ctx, req, consumer)
+    req.set_header(ctx, "X-Consumer-Name", consumer.consumer_name)
+    req.set_header(ctx, "X-Consumer-Group-ID", consumer.group_id)

Review Comment:
   Not all users think that they can go through proxy-rewrite to add the 
consumer name to the header. This method is too tricky



-- 
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: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to