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/11/30 11:34:54 UTC

[GitHub] [apisix] ProSkater12 opened a new issue, #8435: consumer-restriction with 2 identical routes

ProSkater12 opened a new issue, #8435:
URL: https://github.com/apache/apisix/issues/8435

   ### Description
   
   Hello, I have a problem with the consumer-restriction plugin.
   
    I have a microservice accessed via APISIX. I need 2 routes for this microservice to combine 2 projects. they have the same functionality and paths, the difference is only in authorization. I chose to use the consumer-restriction plugin in consumer to only allow 1 route. But now when I try to make a request, I get an error:
   
   ```
   {
     "message": "The route_id is forbidden."
   }
   ```
   
   consumer settings - consumer-restricton plugin (id for example):
   `"consumer-restriction": {
         "disable": false,
         "type": "route_id",
         "whitelist": [
           "2222"
         ]
       },`
   
   I have 2 routes with the same path that I want to use (this is route IDs):
   1)1111
   2)2222 (I want to use this one)
   The first one (which shouldn't be allowed) is higher in the apisix route list and I think the request is going to it.
   Can I somehow specify which route the request should go to if there are identical paths?
   
   P.s. i also tried to change route path, but proxy-rewrite plugin doesn't working, it does not change the path to another one either through regexp or through static path
   
   ### Environment
   
   - APISIX version (run `apisix version`):
   - Operating system (run `uname -a`): Linux [api-gateway01-t.corp.skbbank.ru](http://api-gateway01-t.corp.skbbank.ru/) 3.10.0-1160.62.1.el7.x86_64 #1 SMP Tue Apr 5 16:57:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`): 3.4.0
   - APISIX Dashboard version, if relevant: 2.15.0
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
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.apache.org

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


[GitHub] [apisix] ProSkater12 closed issue #8435: consumer-restriction with 2 identical routes

Posted by GitBox <gi...@apache.org>.
ProSkater12 closed issue #8435: consumer-restriction with 2 identical routes
URL: https://github.com/apache/apisix/issues/8435


-- 
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] ProSkater12 commented on issue #8435: consumer-restriction with 2 identical routes

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

   I messed up a bit in the text of the case:
   APISIX version: 2.15.0
   APISIX Dashboard version: 2.13.0
   
   I'm not sure what configuration you need, I attached the archive:
   1) consumer.json - consumer configuration
   2) route1.json - route configuration. This one should be unavailable
   3) route2.json - route configuration. This one should be available
   4) config.yaml - apisix config file
   [apisix.zip](https://github.com/apache/apisix/files/10129941/apisix.zip)
   


-- 
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] ProSkater12 commented on issue #8435: consumer-restriction with 2 identical routes

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

   > > Can I somehow specify which route the request should go to if there are identical paths?
   > 
   > If the two routes are the same, it is not possible to define which route is hit by the request.
   
   Okay, I got it, thanks. I will look for another way


-- 
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] tzssangglass commented on issue #8435: consumer-restriction with 2 identical routes

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

   > 4\. apisix.zip
   
   Please give the text directly in the issue, do not use zip files


-- 
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] tokers commented on issue #8435: consumer-restriction with 2 identical routes

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

   Please:
   
   1. Tell us the APISIX version;
   2. Show the configurations and you can hide some sensitive information;


-- 
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] tzssangglass commented on issue #8435: consumer-restriction with 2 identical routes

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

   > Can I somehow specify which route the request should go to if there are identical paths?
   
   If the two routes are the same, it is not possible to define which route is hit by the request.


-- 
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] tokers commented on issue #8435: consumer-restriction with 2 identical routes

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

   So which request you sent to APISIX was rejected due to the route id is forbidden? I think the problem might be caused due to your API request being hit another route (which is forbidden in the consumer-restriction plugin).


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