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

Question: How to access all consumers plugins #2188

Closed
shavo007 opened this issue Mar 10, 2017 · 4 comments
Closed

Question: How to access all consumers plugins #2188

shavo007 opened this issue Mar 10, 2017 · 4 comments

Comments

@shavo007
Copy link

Summary

How to access consumers plugins?

Steps To Reproduce

  1. Create consumer
  2. Associate acl plugin group to consumer
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"-d '{
	"group": "PUBLIC"
}' "http://localhost:8001/consumers/493f42d0-79f7-4311-b064-7202b56b6418/acls"
  1. Now how to I retrieve all plugins for that consumer?
  2. curl -X GET -H "Cache-Control: no-cache" "http://localhost:8001/consumers/493f42d0-79f7-4311-b064-7202b56b6418/plugins"
    This does not work.

Additional Details & Logs

  • Kong version 0.10.0
  • Operating System OSX
@shavo007
Copy link
Author

I tried this uri and I get back empty list:

http://localhost:8001/plugins?consumer_id=493f42d0-79f7-4311-b064-7202b56b6418

{
  "data": [],
  "total": 0
}

@subnetmarco
Copy link
Member

Associate acl plugin group to consumer

The example you provided doesn't associate the plugin to the consumer. It associates an ACL Group the consumer, so maybe that's why it's not working. ACL Groups and ACL Plugin configuration are two separate entities.

Are you trying to retrieve all the ACL groups that have been created on the system and optionally filter that request with a specific consumer_id ?

@shavo007
Copy link
Author

Hi @thefosk , maybe its the terminology.

I regard acl and rate-limiting for example as plugins. They are defined in the plugin gallery aswell.
https://getkong.org/plugins/

Now if i enable these two "plugins" for a consumer, the above aforementioned URI returns the rate limiting details for the consumer, but not ACL.

http://localhost:8001/plugins?consumer_id=a3625fd7-a8ed-42ae-a3af-782e3f84e768

{
consumer_id: "a3625fd7-a8ed-42ae-a3af-782e3f84e768",
api_id: "82eade7c-6e2b-4411-9532-bc15647fb091",
id: "71baa810-f029-4698-9a05-c3d3a6764777",
created_at: 1492483476000,
enabled: true,
name: "rate-limiting",
config: {
limit_by: "consumer",
fault_tolerant: true,
redis_database: 0,
policy: "cluster",
hour: 10000,
redis_timeout: 2000,
redis_port: 6379
}
}

If i want acl I have to call a different endpoint:
http://localhost:8001/consumers/a3625fd7-a8ed-42ae-a3af-782e3f84e768/acls

If this is correct, can you please confirm?

If so, I will close this issue.

Thanks,
Shane.

@p0pr0ck5
Copy link
Contributor

p0pr0ck5 commented May 5, 2017

@shavo007 you are correct. GET /plugins returns a list of plugin objects that can be filtered by consumer ID. GET /consumers/{id}/acls returns a list of ACL objects associated with a consumer.

@p0pr0ck5 p0pr0ck5 closed this as completed May 5, 2017
thibaultcha pushed a commit that referenced this issue Nov 27, 2017
* `/acls/` to paginate through all acls for all consumers
* `/acls/:acl_id/consumer` to retrieve the Consumer
  associated with an acl

From #3039
Fix #2188
Supersedes #2371

Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants