use of com.yahoo.jdisc.http.server.jetty.FilterInvoker in project vespa by vespa-engine.
the class JDiscFilterForServletTest method bindings.
private Module bindings(BindingRepository<RequestFilter> requestFilters, BindingRepository<ResponseFilter> responseFilters) {
return Modules.combine(new AbstractModule() {
@Override
protected void configure() {
bind(FilterBindings.class).toInstance(new FilterBindings(requestFilters, responseFilters));
bind(FilterInvoker.class).toInstance(new FilterInvoker() {
@Override
public HttpServletRequest invokeRequestFilterChain(RequestFilter requestFilter, URI uri, HttpServletRequest httpRequest, ResponseHandler responseHandler) {
TestRequestFilter filter = (TestRequestFilter) requestFilter;
filter.runAsSecurityFilter(httpRequest, responseHandler);
return httpRequest;
}
@Override
public void invokeResponseFilterChain(ResponseFilter responseFilter, URI uri, HttpServletRequest request, HttpServletResponse response) {
TestResponseFilter filter = (TestResponseFilter) responseFilter;
filter.runAsSecurityFilter(request, response);
}
});
}
}, guiceModule());
}
Aggregations