Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request help: how does the consumer work? #6557

Closed
soulbird opened this issue Mar 9, 2022 · 6 comments
Closed

request help: how does the consumer work? #6557

soulbird opened this issue Mar 9, 2022 · 6 comments
Labels

Comments

@soulbird
Copy link
Contributor

soulbird commented Mar 9, 2022

Issue description

s described in the documentation
creates a consumer object:

curl http://127.0.0.1:9080/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
    "username": "jack",
    "plugins": {
        "key-auth": {
            "key": "auth-one"
        }
    }
}'

creates a route or service object

curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
    "methods": ["GET"],
    "uri": "/index.html",
    "id": 1,
    "plugins": {
        "key-auth": {}
    },
    "upstream": {
        "type": "roundrobin",
        "nodes": {
            "127.0.0.1:1980": 1
        }
    }
}'

From the created parameters, I didn't find any related parameters between consumer and route.
The processing of the request in my understanding is:

1、recvive a request
2、match router
3、find related consumer obj
4、load plugins

Is that so? And how does the consumer work?Each consumer object does not have a unique representation, how is step three done?

Environment

  • apisix version (cmd: apisix version):
  • OS (cmd: uname -a):
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V):
  • etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API):
  • apisix-dashboard version, if have:
  • the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
  • luarocks version, if the issue is about installation (cmd: luarocks --version):
@liangliang4ward
Copy link
Contributor

need consumer-restriction plugin

@tokers
Copy link
Contributor

tokers commented Mar 9, 2022

@soulbird APISIX find consumers according to some plugins written in the Route (like auth plugins).

@tzssangglass
Copy link
Member

1、recvive a request
2、match router
3、find related consumer obj
4、load plugins

you can track the consumer's processing from this PR: #6502 (comment)

@soulbird
Copy link
Contributor Author

1、recvive a request
2、match router
3、find related consumer obj
4、load plugins

you can track the consumer's processing from this PR: #6502 (comment)

Think you, I will take a look

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Mar 3, 2023
@github-actions
Copy link

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants