tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Request for comments: Apache-like allow/deny remote host filtering
Date Tue, 04 Oct 2011 19:02:32 GMT
Hash: SHA1


On 10/4/2011 2:50 PM, Francis GALIEGUE wrote:
> Patch attached. I didn't know Bugzilla would treat patches this
> way...

Can you give us a link to the bug?

> I implemented those two interfaces again, since the existing
> abstract class wouldn't fit the bill (it only tried regexes). Or
> maybe I don't understand what you actually mean?

I'll have to look at the base classes... I seem to recall a great deal
of extending and overriding in that package.

> Well, I need help precisely on the above... I have a hard time 
> figuring out how TestRemoteIP{Filter,Valve} work at all... But
> I've been only having a superficial glance at them so far.

The good thing is that you only have to do a very simple test harness.
Something like this:

FilterConfig config = .. // mock-up the filter config
FilterChain chain = .. // mock-up the filter chain
Filter filter = new RemoteAddrFilter();

HttpServletRequest request = ... // mock-up request
HttpServletResponse response = ... // mock-up response

foreach(ip in test_ips) {
  // request.setRemoteAddr(ip);
  filter.doFilter(request, response, chain);

  assertEquals(expected_status_code, response.getStatusCode());

Of course, you'll have to do some significant work to make sure that
the filter chain is mocked-up correctly and that your request object
can be programmed appropriately.

Perhaps that's what you were hoping to get some help doing? :)

If so, I'll keep going.

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message