You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "cverdela (via GitHub)" <gi...@apache.org> on 2023/04/17 02:15:09 UTC
[GitHub] [apisix] cverdela opened a new issue, #9317: bug:
cverdela opened a new issue, #9317:
URL: https://github.com/apache/apisix/issues/9317
### Current Behavior
I want to use proxy rewrite to write consumer group information to the header, and then use casbin to confirm permissions. Upstream users can also obtain header information。
I added the header as the ID of the consumer group using proxy rewrite, and verified the header using casbin. Surprisingly, the header. add implemented my idea, but the header. set failed
two consumer_groups :
PUT /apisix/admin/consumer_groups/1000
{
"plugins": {
}
}
PUT /apisix/admin/consumer_groups/2080
{
"plugins": {
}
}
{
"username": "tom",
"plugins": {
"key-auth": {
"key": "192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf"
}
},
"group_id":"1000"
}
two consumer:
{
"username": "jack",
"plugins": {
"key-auth": {
"key": "QinPGTd7Ulec03lar0vkI9ojqmXsuw4VOyirnC5NuvEdJSCwLwesmknNygXITunT"
}
},
"group_id":"2080"
}
1 router:
{
"name": "web1-rewrite",
"status": 1,
"methods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"OPTIONS",
"CONNECT",
"TRACE",
"PURGE"
],
"priority": 0,
"labels": {},
"uri": "/web1/*",
"plugins": {
"proxy-rewrite": {
"_meta": {
"priority": 1
},
"headers": {
"set": {
"tenant": "$consumer_group_id"
}
}
},
"key-auth": {
"_meta": {
"priority": 2
}
},
"authz-casbin": {
"_meta": {
"priority": 0
},
"model": "[request_definition]
r = sub, obj, act
[policy_definition]
p = sub, obj, act
[role_definition]
g = _, _
[policy_effect]
e = some(where (p.eft == allow))
[matchers]
m = (g(r.sub, p.sub) || keyMatch(r.sub, p.sub)) && keyMatch(r.obj, p.obj) && keyMatch(r.act, p.act)",
"policy": "p, *, web1, GET
p, admin, *, *
g, 2080, admin",
"username": "tenant"
}
},
"upstream_id": "452002436731634371"
}
access :
POST /web1/ HTTP/1.1
HEADER
apikey: QinPGTd7Ulec03lar0vkI9ojqmXsuw4VOyirnC5NuvEdJSCwLwesmknNygXITunT
{"message":"Access Denied"}
POST /web1/ HTTP/1.1
HEADER
apikey: 192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf
{"message":"Access Denied"}
changed
```
"proxy-rewrite": {
"_meta": {
"priority": 1
},
"headers": {
"add": {
"tenant": "$consumer_group_id"
}
}
},
```
access :
POST /web1/ HTTP/1.1
HEADER
apikey: QinPGTd7Ulec03lar0vkI9ojqmXsuw4VOyirnC5NuvEdJSCwLwesmknNygXITunT
hello web1
POST /web1/ HTTP/1.1
HEADER
apikey: 192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf
{"message":"Access Denied"}
### Expected Behavior
```
"proxy-rewrite": {
"_meta": {
"priority": 1
},
"headers": {
"set": {
"tenant": "$consumer_group_id"
}
}
},
```
POST /web1/ HTTP/1.1
HEADER
apikey: QinPGTd7Ulec03lar0vkI9ojqmXsuw4VOyirnC5NuvEdJSCwLwesmknNygXITunT
hello web1
POST /web1/ HTTP/1.1
HEADER
apikey: 192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf
{"message":"Access Denied"}
### Error Logs
no error
### Steps to Reproduce
two consumer_groups :
PUT /apisix/admin/consumer_groups/1000
{
"plugins": {
}
}
PUT /apisix/admin/consumer_groups/2080
{
"plugins": {
}
}
{
"username": "tom",
"plugins": {
"key-auth": {
"key": "192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf"
}
},
"group_id":"1000"
}
two consumer:
{
"username": "jack",
"plugins": {
"key-auth": {
"key": "QinPGTd7Ulec03lar0vkI9ojqmXsuw4VOyirnC5NuvEdJSCwLwesmknNygXITunT"
}
},
"group_id":"2080"
}
1 router:
{
"name": "web1-rewrite",
"status": 1,
"methods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"OPTIONS",
"CONNECT",
"TRACE",
"PURGE"
],
"priority": 0,
"labels": {},
"uri": "/web1/*",
"plugins": {
"proxy-rewrite": {
"_meta": {
"priority": 1
},
"headers": {
"set": {
"tenant": "$consumer_group_id"
}
}
},
"key-auth": {
"_meta": {
"priority": 2
}
},
"authz-casbin": {
"_meta": {
"priority": 0
},
"model": "[request_definition]
r = sub, obj, act
[policy_definition]
p = sub, obj, act
[role_definition]
g = _, _
[policy_effect]
e = some(where (p.eft == allow))
[matchers]
m = (g(r.sub, p.sub) || keyMatch(r.sub, p.sub)) && keyMatch(r.obj, p.obj) && keyMatch(r.act, p.act)",
"policy": "p, *, web1, GET
p, admin, *, *
g, 2080, admin",
"username": "tenant"
}
},
"upstream_id": "452002436731634371"
}
access :
POST /web1/ HTTP/1.1
HEADER
apikey: QinPGTd7Ulec03lar0vkI9ojqmXsuw4VOyirnC5NuvEdJSCwLwesmknNygXITunT
{"message":"Access Denied"}
POST /web1/ HTTP/1.1
HEADER
apikey: 192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf
{"message":"Access Denied"}
changed
```
"proxy-rewrite": {
"_meta": {
"priority": 1
},
"headers": {
"add": {
"tenant": "$consumer_group_id"
}
}
},
```
access :
POST /web1/ HTTP/1.1
HEADER
apikey: QinPGTd7Ulec03lar0vkI9ojqmXsuw4VOyirnC5NuvEdJSCwLwesmknNygXITunT
hello web1
POST /web1/ HTTP/1.1
HEADER
apikey: 192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf
{"message":"Access Denied"}
### Environment
- APISIX version (run `apisix version`):3.2.0
- Operating system (run `uname -a`):win docker example
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
- etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
- APISIX Dashboard version, if relevant:
- 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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515883000
#set#
POST /web1/ HTTP/1.1
HEADER
apikey: QinPGTd7Ulec03lar0vkI9ojqmXsuw4VOyirnC5NuvEdJSCwLwesmknNygXITunT
{"message":"Access Denied"}
POST /web1/ HTTP/1.1
HEADER
apikey: 192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf
{"message":"Access Denied"}
#add#
POST /web1/ HTTP/1.1
HEADER
apikey: QinPGTd7Ulec03lar0vkI9ojqmXsuw4VOyirnC5NuvEdJSCwLwesmknNygXITunT
hello web1
POST /web1/ HTTP/1.1
HEADER
apikey: 192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf
{"message":"Access Denied"}
--
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] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1545252668
@cverdela APISIX v3.3. has been released. https://github.com/apache/apisix/releases/tag/3.3.0
I have verified that this issue has been fixed. I will close this one. Thanks for your report.
If you have any follow-up comments regarding this issue, please continue to add comments.
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515888829
my current actual test result
All steps can be replicated at the top
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517128894
the configuration for Casbin is in the configuration of router
--
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] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517132138
In simple terms, what is your upstream? What configuration does it contain?
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517128678
no Casbin server
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517099806
What information is insufficient to fully reproduce this problem.
that‘s all my steps’
--
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] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515982162
So how did you get your test results now?
Simply using the information you provided above is not enough to fully reproduce this issue.
--
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] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515886630
Is this your current actual test result? From here, it appears that 'set' and 'add' have the same value. Therefore, they should produce the same outcome.
--
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] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517356166
I need to dig into the code to do some checks
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517358310
Where can I see the main code design of Apisix
--
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] tao12345666333 closed issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 closed issue #9317: bug: something wrong with casbin
URL: https://github.com/apache/apisix/issues/9317
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517097953
>
?
I use this
![image](https://user-images.githubusercontent.com/21302251/233514106-cfd5000c-7d8e-4c90-8f34-a9d69816e6f1.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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517136328
This was created through the management console, I forgot it
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515778226
To avoid consumers adding this header header themselves, I would prefer to use set instead of add
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515895348
> Is there any configuration for Casbin?
no other configuration
--
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] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515937445
@cverdela Did you directly use the Casbin server's Docker image? In order to reproduce more efficiently, could you provide a minimal reproduction step including the part of Casbin? Thank you.
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515975600
> @cverdela Did you directly use the Casbin server's Docker image? In order to reproduce more efficiently, could you provide a minimal reproduction step including the part of Casbin? Thank you.
I haven't tried yet, I'm currently designing a solution
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515826932
![image](https://user-images.githubusercontent.com/21302251/233288900-b38c99b2-a046-4d06-9d20-e5210f85562b.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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515654545
hi, @cverdela `headers.add` will append the header, while `headers.set` will overwrite it.
https://github.com/apache/apisix/issues/9317#issuecomment-1514050071 It seems that your problem has already been resolved.
--
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] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515893108
Is there any configuration for Casbin?
--
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] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517289751
I can confirm this issue.
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515776716
hi, @tao12345666333 ,not resolved
If header is not exist, headers.set will add it.
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517134585
sorry
upsteam
`{"id":"452002436731634371","create_time":1678944046,"update_time":1678944740,"nodes":{"web1:80":1},"timeout":{"connect":6,"send":6,"read":6},"type":"roundrobin","scheme":"http","pass_host":"pass","name":"web1","desc":"web1","keepalive_pool":{"idle_timeout":60,"requests":1000,"size":320}}`
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517272506
now everything is in https://github.com/apache/apisix/issues/9317#issue-1670283656
I deleted the etcd data file and redo it again
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1514050071
Additional instructions:
when I changed like this set->add
```
"proxy-rewrite": {
"_meta": {
"priority": 1
},
"headers": {
"add": {
"tenant": "$consumer_group_id"
}
}
},
```
It meets expectations
--
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] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1514039053
Please format your issue contents, thanks.
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1514048210
@tao12345666333 sorry,like this?
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517100903
![image](https://user-images.githubusercontent.com/21302251/233514578-6e95c2e4-7070-4759-a0f0-6bf934905232.png)
the configuration for Casbin is in the configuration of router
--
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] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1519055559
FYI: https://github.com/apache/apisix/blob/1434335041c6e054f7b6afb0401aea0a069b0ad7/apisix/plugins/proxy-rewrite.lua#L232-L259
@cverdela
--
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] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517128299
> > @cverdela Did you directly use the Casbin server's Docker image? In order to reproduce more efficiently, could you provide a minimal reproduction step including the part of Casbin? Thank you.
>
>
>
> I haven't tried yet, I'm currently designing a solution
In the steps you provided only include the configuration in APISIX. Does not contain Casbin server or application related configuration.
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517133095
https://apisix.apache.org/docs/apisix/installation-guide/
This is the environment you provided, with two upstreams, web1 and web2
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1517350910
thanks
--
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] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515876838
Can you provide its complete request and response headers?
Use `set`, `add`, or don‘t use this method separately.
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515889396
### Steps to Reproduce
create two consumer_groups :
PUT /apisix/admin/consumer_groups/1000
{
"plugins": {
}
}
PUT /apisix/admin/consumer_groups/2080
{
"plugins": {
}
}
create two consumer:
{
"username": "tom",
"plugins": {
"key-auth": {
"key": "192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf"
}
},
"group_id":"1000"
}
{
"username": "jack",
"plugins": {
"key-auth": {
"key": "QinPGTd7Ulec03lar0vkI9ojqmXsuw4VOyirnC5NuvEdJSCwLwesmknNygXITunT"
}
},
"group_id":"2080"
}
create 1 router:
{
"name": "web1-rewrite",
"status": 1,
"methods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"OPTIONS",
"CONNECT",
"TRACE",
"PURGE"
],
"priority": 0,
"labels": {},
"uri": "/web1/*",
"plugins": {
"proxy-rewrite": {
"_meta": {
"priority": 1
},
"headers": {
"set": {
"tenant": "$consumer_group_id"
}
}
},
"key-auth": {
"_meta": {
"priority": 2
}
},
"authz-casbin": {
"_meta": {
"priority": 0
},
"model": "[request_definition]
r = sub, obj, act
[policy_definition]
p = sub, obj, act
[role_definition]
g = _, _
[policy_effect]
e = some(where (p.eft == allow))
[matchers]
m = (g(r.sub, p.sub) || keyMatch(r.sub, p.sub)) && keyMatch(r.obj, p.obj) && keyMatch(r.act, p.act)",
"policy": "p, *, web1, GET
p, admin, *, *
g, 2080, admin",
"username": "tenant"
}
},
"upstream_id": "452002436731634371"
}
--
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] tao12345666333 commented on issue #9317: bug: something wrong with casbin
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515893634
Can you provide the complete steps to reproduce? Thank you.
--
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] cverdela commented on issue #9317: bug: something wrong with casbin
Posted by "cverdela (via GitHub)" <gi...@apache.org>.
cverdela commented on issue #9317:
URL: https://github.com/apache/apisix/issues/9317#issuecomment-1515894687
https://github.com/apache/apisix/issues/9317#issuecomment-1515889396
complete steps
--
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