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 2021/04/19 03:38:01 UTC
[GitHub] [apisix] izayoi-akira opened a new issue #4078: request help:
izayoi-akira opened a new issue #4078:
URL: https://github.com/apache/apisix/issues/4078
### Issue description
关于jwt-auth,`/apisix/plugin/jwt/sign`可以获取token,并且访问成功
但是有个需求,是如何让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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on issue #4078: request help:
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #4078:
URL: https://github.com/apache/apisix/issues/4078#issuecomment-822154027
> 如何让apisix或者上游知道是哪个消费者访问的?
According to the existing configuration in the `consumer`, when you access authentication, it will be authenticated with the information configured in the consumer according to the token you use.
You can refer to the consumer-restriction plugin, through which you can do corresponding access restrictions.
--
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:
users@infra.apache.org
[GitHub] [apisix] spacewander closed issue #4078: request help:
Posted by GitBox <gi...@apache.org>.
spacewander closed issue #4078:
URL: https://github.com/apache/apisix/issues/4078
--
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:
users@infra.apache.org
[GitHub] [apisix] izayoi-akira removed a comment on issue #4078: request help:
Posted by GitBox <gi...@apache.org>.
izayoi-akira removed a comment on issue #4078:
URL: https://github.com/apache/apisix/issues/4078#issuecomment-822182578
Access Restrictions is not what I want, I want upstream to know witch consumer is accessing it.
for example:
There are two consumers: consumers1 and consumers2,they got token1 and token2 with `/apisix/plugin/jwt/sign`.
Then they both access the upstream api: `xxx.com/articel/add`,now xxx.com wants to know if it was consumers1 or consumers2 that access 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on issue #4078: request help:
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #4078:
URL: https://github.com/apache/apisix/issues/4078#issuecomment-822231019
> I want upstream to know witch consumer is accessing it.
You can try to use the proxy-rewrite plugin to add the consumer nam field to the request header and carry it upstream. like this:
```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"uri": "/route01",
"plugins": {
"jwt-auth": {},
"proxy-rewrite": {
"headers": {
"consumer-name": "$consumer_name"
}
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"127.0.0.1:1981": 1
}
}
}'
```
--
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:
users@infra.apache.org
[GitHub] [apisix] izayoi-akira commented on issue #4078: request help:
Posted by GitBox <gi...@apache.org>.
izayoi-akira commented on issue #4078:
URL: https://github.com/apache/apisix/issues/4078#issuecomment-822144824
How can I get the consumer message which requeset the upstream by upstream or 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] izayoi-akira commented on issue #4078: request help:
Posted by GitBox <gi...@apache.org>.
izayoi-akira commented on issue #4078:
URL: https://github.com/apache/apisix/issues/4078#issuecomment-822183015
> > 如何让apisix或者上游知道是哪个消费者访问的?
>
> According to the existing configuration in the `consumer`, when you access authentication, it will be authenticated with the information configured in the consumer according to the token you use.
>
> You can refer to the consumer-restriction plugin, through which you can do corresponding access restrictions.
Access Restrictions is not what I want, I want upstream to know witch consumer is accessing it.
for example:
There are two consumers: consumers1 and consumers2,they got token1 and token2 with /apisix/plugin/jwt/sign.
Then they both access the upstream api: xxx.com/articel/add,now xxx.com wants to know if it was consumers1 or consumers2 that access 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou edited a comment on issue #4078: request help:
Posted by GitBox <gi...@apache.org>.
Firstsawyou edited a comment on issue #4078:
URL: https://github.com/apache/apisix/issues/4078#issuecomment-822231019
> I want upstream to know witch consumer is accessing it.
You can try to use the proxy-rewrite plugin to add the `consumer nam` field to the request header and carry it upstream. like this:
```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"uri": "/route01",
"plugins": {
"jwt-auth": {},
"proxy-rewrite": {
"headers": {
"consumer-name": "$consumer_name"
}
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"127.0.0.1:1981": 1
}
}
}'
```
--
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:
users@infra.apache.org
[GitHub] [apisix] izayoi-akira commented on issue #4078: request help:
Posted by GitBox <gi...@apache.org>.
izayoi-akira commented on issue #4078:
URL: https://github.com/apache/apisix/issues/4078#issuecomment-822237924
> ```shell
> proxy-rewrite
> ```
Thanks a lot !!!
--
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:
users@infra.apache.org
[GitHub] [apisix] izayoi-akira commented on issue #4078: request help:
Posted by GitBox <gi...@apache.org>.
izayoi-akira commented on issue #4078:
URL: https://github.com/apache/apisix/issues/4078#issuecomment-822182578
Access Restrictions is not what I want, I want upstream to know witch consumer is accessing it.
for example:
There are two consumers: consumers1 and consumers2,they got token1 and token2 with `/apisix/plugin/jwt/sign`.
Then they both access the upstream api: `xxx.com/articel/add`,now xxx.com wants to know if it was consumers1 or consumers2 that access 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org