riskgod commented on issue #4002:
URL: https://github.com/apache/apisix/issues/4002#issuecomment-815390432


   
   #### I have set a auth-key named jack and the key is auth-one 
   ```
   {
      "action":"get",
      "node":{
         "key":"\/apisix\/consumers",
         "dir":true,
         "nodes":[
            {
               "modifiedIndex":60,
               "createdIndex":45,
               "value":{
                  "update_time":1617799994,
                  "create_time":1617796052,
                  "username":"jack",
                  "plugins":{
                     "key-auth":{
                        "key":"auth-one"
                     },
                     "limit-req":{
                        "key":"consumer_name",
                        "rejected_code":403,
                        "disable":false,
                        "rate":1,
                        "burst":0
                     }
                  },
                  "id":"jack"
               },
               "key":"\/apisix\/consumers\/jack"
            },
            {
               "modifiedIndex":43,
               "createdIndex":43,
               "value":{
                  "update_time":1617788738,
                  "create_time":1617788738,
                  "username":"jack_auth",
                  "plugins":{
                     "key-auth":{
                        "key":"auth-jack",
                        "disable":false
                     },
                     "limit-req":{
                        "key":"consumer_name",
                        "rejected_code":403,
                        "disable":false,
                        "rate":1,
                        "burst":1
                     }
                  },
                  "id":"jack_auth"
               },
               "key":"\/apisix\/consumers\/jack_auth"
            }
         ]
      },
      "count":"3"
   }
   ```
   
    #### So I init a new router now, enable the limit-req.
   ```
   curl http://127.0.0.1:9180/apisix/admin/routes/115 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "methods": ["GET"],
       "uri": "/testgrpc9",
       "plugins": {
           "grpc-transcode": {
               "proto_id": "1",
               "service": "helloworld.Greeter",
               "method": "SayHello"
           },
           "limit-req": {
               "rate": 1,
               "burst": 1,
               "rejected_code": 503,
               "key": "remote_addr"
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "taie-address-service.taie.svc.cluster.local:8081": 1
           }
       }
   }'
   
   ```
   #### I call this in several times hopes it return 503 or 403,  but it always 
return 200
   ```
   $ curl http://127.0.0.1:9080/testgrpc9?name=world -H 'apikey: auth-one' -i
   ```
   <img width="794" alt="Screen Shot 2021-04-08 at 09 58 48" 
src="https://user-images.githubusercontent.com/3436287/113956990-0646ac80-9851-11eb-93e1-f9adfdcb7a6f.png";>
   
   
   
   
   


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