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 2022/03/29 09:18:58 UTC

[GitHub] [apisix] starsz opened a new issue #6748: feat: As a user, I want to run limit-req plugins twice (on consumer and route) , so that wen can control the limit on the consumer side and route side

starsz opened a new issue #6748:
URL: https://github.com/apache/apisix/issues/6748


   ### Description
   
   Hello, the situation is as follows:
   
   I want to do the rate limit on Apache APISIX.
   First, I create a route with a count (3) like this:
   ```
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "methods": ["GET"],
       "uri": "/*",
       "plugins": {
           "limit-count": {
               "count": 3,
               "time_window": 60,
               "rejected_code": 503,
               "key_type": "var",
               "key": "remote_addr"
           },
           "key-auth": {}
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "httpbin.org": 1
           }
       }
   }'
   ```
   
   
   And create a consumer named peter with a count (5)
   ```
   curl http://127.0.0.1:9080/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "username": "peter",
       "plugins": {
           "key-auth": {
               "key": "auth-two"
           },
           "limit-count": {
               "count": 5,
               "time_window": 60,
               "rejected_code": 503,
               "key_type": "var",
               "key": "remote_addr"
           }
       }
   }
   ```
   
   I use curl to do the request.
   ```
   curl http://127.0.0.1:9080/get -H 'apikey: auth-two' 
   ```
   After 5 times, it returns 503. But what I expect is that after 3 times, I can get the 503.
   
   
   


-- 
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-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] spacewander commented on issue #6748: feat: As a user, I want to run limit-count plugins twice (on consumer and route) , so that wen can control the limit on the consumer side and route side

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #6748:
URL: https://github.com/apache/apisix/issues/6748#issuecomment-1082533441


   By design, the configuration from consumer should override the one from route.


-- 
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-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] jagerzhang commented on issue #6748: feat: As a user, I want to run limit-count plugins twice (on consumer and route) , so that wen can control the limit on the consumer side and route side

Posted by GitBox <gi...@apache.org>.
jagerzhang commented on issue #6748:
URL: https://github.com/apache/apisix/issues/6748#issuecomment-1085389761


   It feels similar to my previous scene: https://zhang.ge/5158.html


-- 
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-unsubscribe@apisix.apache.org

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