-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Applying a Plugin with a variety of global and specific properties #505
Comments
should also be by response attributes, e.g.:
plugins that could leverage response attributes are ones like rate limiting, logging, etc ... |
+1 My team is also in support of this. To clarify our use-case, we would like to be able to install a global rate limit that spans all API's with and without consumer authentication / differentiation. So, it doesn't matter who the consumer is or which API is being consumed, each consumption use contributes to the global use_count which is checked against the limit. |
+1. we have a user service that handles registration (unauthenticated, obviously) but also other user requests like updating and retrieving user data. the latter requests are authenticated, but the former is not. i don't have any ideas for a workaround for this, so i would love suggestions while waiting on this feature |
+1 - and per group if ACL plugin is enabled. |
Adding requirement:
|
👍 This would allow for the following scenario (although somewhat convoluted): I have three groups of consumers:
I would like:
Correct me if I am mistaken, but this would require setting up three separate ACL plugins in three various ways? I.E.
So for |
as per the discussion on #462 ... if the concern is performance in allowing same plugin enabled multiple times, then at least I should be able to have multiple configs per plugin ... which is really the same end result if you think about it ... another key point in making this happen is programmatic priority setting for plugins ... which are currently hardcoded |
+1 |
+1, any update on the expected release date? |
+1 |
To clarify my company's interest, we're specifically interested in routing based on the Accept header. This is a fairly common REST pattern for specifying versions in the Accept header, and we would want to target the appropriate upstream server. For example:
|
+1 |
I made a first implementation using headers for versioning that suit my use case, take a look if you want! The commit history is not very good, I was short on time and unable to setup a pretty good dev environment on my mac 😅 https://github.com/vinceferro/kong/commits/versioning |
Thanks @vinceferro. I've found setting up a dev environment on my Mac to be fiendishly difficult. Never have been able to get the test suite to run all the way through, even on just the master branch. |
The new router in #1970 allows for API matching via HTTP methods, and thus partially addresses this, if one adds a plugin to an API matched via HTTP method. |
Is there any ETA for when a plugin could be customized per HTTP method, endpoint, or request header (number 3 in the description)? Thanks for all the work done so far on this issue. |
It can be done now: method, URI, host header or any combination of those (including multiple values)
… On Nov 21, 2017, at 6:27 AM, Jacob Wallace ***@***.***> wrote:
Is there any ETA for when a plugin could be customized per HTTP method, endpoint, or request header (number 3 in the description)? Thanks for all the work done so far on this issue.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@thefosk do we already have docs for this? edit: I guess this would be done in the api resource and not in the plugin resource by defining the |
@dudadornelles The proxy reference has existed since Kong 0.5.0 and documents hosts, uris and methods: https://getkong.org/docs/0.11.x/proxy/
This is correct as of today, applying plugins for particular routes means creating those routes (APIs), and applying plugins on them. We do have plans to improve this in the future, making plugins lighter and more flexible in their triggering rules. |
Sorry but I can't see anywhere in those docs which supports routing on request headers (except host header). |
@FBryant87 Hi, Routing by arbitrary request header is not yet supported. Pull requests welcome! |
Can you give me example? I have service
The alpha services refer to upstream I set two routes on service
However, accessing How can I set Kong to enable authentication only to |
A general update on this issue: Regarding item 3 above, now that we have complete Routes and Services separation, and all three of method-based, endpoint-based and header-based routing, you split these different plugin configurations as different routes for the same service. Header-based routing was the last piece of that puzzle, so this is possible since Kong 1.3. |
@subnetmarco, I think @hishamhm explained it above that it is possible, so I am closing this. Please reopen perhaps with a more limited scope if there are still things missing. |
Currently a plugin can be applied per
api_id
, and optionally perapi_id
andconsumer_id
.We want a more flexible schema to apply plugins, that will allow us to:
Customize a global plugin for every API, without specifying any specificapi_id
.(Closed with Feature/global plugins #1369)
Customize a global plugin for every consumer, without specifying(Closed with Feature/global plugins #1369)api_id
andconsumer_id
.Customize a plugin per:HTTP Method (method
)Endpoint (endpoint
, with regex support)By Request Header (Accept
,Content-Type
,User-Agent
, etc...)Lower priority:
api_id
,consumer_id
,method
,endpoint
, etc.This issue deprecates #160, #295 and #486.
The text was updated successfully, but these errors were encountered: