Kong / kong

🦍 The Cloud-Native API Gateway and AI Gateway.
https://konghq.com/install/#kong-community
Apache License 2.0
39.22k stars 4.81k forks source link

Support plugins on a per endpoint (and HTTP method?) basis #160

Closed nijikokun closed 9 years ago

nijikokun commented 9 years ago

Right now plugins encompass the entire API, meaning that they are invoked for every endpoint.

An amazing feature would be to allow specifying specific endpoints that the plugin works for, should no endpoints be specified it encompasses the entire API.

This shouldn't be done on a per plugin basis as that is not a DRY approach and would require each plugin to do additional work. The check should happen before the plugin is invoked.

sonicaghi commented 9 years ago

should be in the KONG RESTful interface?

nijikokun commented 9 years ago

This also means allowing to configure the same plugin for the same API multiple times.

Examples:

montanaflynn commented 9 years ago

+1

nijikokun commented 9 years ago

I should also add that certain plugins could also be per method as well.

sonicaghi commented 9 years ago

@thefosk is this happening in the coming 0.3?

subnetmarco commented 9 years ago

Not in 0.3.0, but could happen in 0.3.1or subsequent release

sonicaghi commented 9 years ago

+1

morphomatt commented 9 years ago

+1

subnetmarco commented 9 years ago

This feature should also enable plugins not just per endpoint, but per HTTP method too. Like:

curl 127.0.0.1:8001/apis/test.com/plugins/
     -d "name=keyauth" \
     -d "path=/hello/*/world/*" \
     -d "method=POST, DELETE"
montanaflynn commented 9 years ago

What's the status on this? I see it was removed from the 0.3.1 milestone, is it still a planned feature?

One more thing to be brought up is support for wildcards or regex when applying to endpoints.

sonicaghi commented 9 years ago

@montanaflynn the milestones are here now: https://github.com/Mashape/kong/wiki

subnetmarco commented 9 years ago

Closed in favor of #505.