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

Allow insertion of custom filters #5

Open
duvy opened this issue May 4, 2014 · 3 comments
Open

Allow insertion of custom filters #5

duvy opened this issue May 4, 2014 · 3 comments

Comments

@duvy
Copy link

duvy commented May 4, 2014

With the current interface, there is a filter chain of optional built-in filters, that we can append to with custom filters. But we cannot add insert custom filters at specific points in the chain. For example, we may want to add Jetty's QOS Filter fairly high up in the chain.

It would be good to have an option of inserting filters at specific points in the foundations's filter chain before starting the server (maybe using enums like BEFORE_AVAILABILITY_FILTER).

Alternatively, there could be an option to define the complete chain beforehand, picking which of the foundation built-in filters to use, and ordering them as desired together with the custom filters. Then the assembled chain can be used when starting the server. This solution seems more robust, but allows for misuse by not ordering the foundation filters properly.

@yairogen
Copy link
Contributor

yairogen commented May 5, 2014

In your mind would exposing the filter list in a configuration set resolve your issue? You would then be able to inherit a default set, but you can override the chain partially or fully.

@duvy
Copy link
Author

duvy commented May 8, 2014

Sounds good. Can you show an example of what you have in mind?

@yairogen
Copy link
Contributor

Something of this sort:
.filter.1.name
.filter.1.path
.filter.1.className

className is optional as if you reference in the "name" a Foundation known filter (e.g. "FlowContextFilter") we will know the class-name internally. If you want to add a custom filter you can use both name and class name and the index in this array will represent the location in the filter chain.

Would that work?

Naturally will be build the current hard-coded list into the default configuration for transparency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants