src.java.org.codehaus.groovy.grails.plugins.springsecurity
Class IpAddressFilter

Blocks access to protected resources based on IP address. Sends 404 rather than reporting error to hide visibility of the resources.
Supports either Ant-style patterns (e.g. 10.**) or masked patterns (e.g. 192.168.1.0/24 or 202.24.0.0/14).

author:
Burt Beckwith

Field Summary
 Logger _log
           
 AntPathMatcher _pathMatcher
           
 Map _restrictions
           
 
Constructor Summary
IpAddressFilter()
           
 
Method Summary
void afterPropertiesSet()
          
void doFilterHttp(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
          
int getOrder()
          
boolean isAllowed(String ip, String requestURI)
          
boolean matchesUsingMask(String ipPattern, String ip)
          
InetAddress parseAddress(String address)
          
void setIpRestrictions(Map restrictions)
           Dependency injection for the ip/pattern restriction map.
 

Constructor Detail

IpAddressFilter

IpAddressFilter()


Method Detail

afterPropertiesSet

public void afterPropertiesSet()


doFilterHttp

void doFilterHttp(HttpServletRequest request, HttpServletResponse response, FilterChain chain)


getOrder

public int getOrder()


isAllowed

boolean isAllowed(String ip, String requestURI)


matchesUsingMask

boolean matchesUsingMask(String ipPattern, String ip)


parseAddress

InetAddress parseAddress(String address)


setIpRestrictions

public void setIpRestrictions(Map restrictions)
Dependency injection for the ip/pattern restriction map.
param:
restrictions the map