public class HostFilter extends AuthorizationFilter
Modifier and Type | Field and Description |
---|---|
static Pattern |
IPV4_PATTERN |
static String |
IPV4_QUAD_REGEX |
static String |
IPV4_REGEX |
static String |
PRIVATE_CLASS_A_REGEX |
static String |
PRIVATE_CLASS_B_REGEX |
static String |
PRIVATE_CLASS_B_SUBSET |
static String |
PRIVATE_CLASS_C_REGEX |
DEFAULT_LOGIN_URL, GET_METHOD, POST_METHOD
appliedPaths, pathMatcher
ALREADY_FILTERED_SUFFIX
filterConfig
Constructor and Description |
---|
HostFilter() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isAccessAllowed(ServletRequest request,
ServletResponse response,
Object mappedValue)
Returns
true if the request is allowed to proceed through the filter normally, or false
if the request should be handled by the
onAccessDenied(request,response,mappedValue)
method instead. |
protected boolean |
isIpv4Candidate(String host) |
void |
setAuthorizedHosts(String authorizedHosts) |
void |
setDeniedHosts(String deniedHosts) |
getUnauthorizedUrl, onAccessDenied, setUnauthorizedUrl
getLoginUrl, getSubject, isLoginRequest, onAccessDenied, onPreHandle, redirectToLogin, saveRequest, saveRequestAndRedirectToLogin, setLoginUrl
getPathWithinApplication, isEnabled, pathsMatch, pathsMatch, preHandle, processPathConfig
afterCompletion, cleanup, doFilterInternal, executeChain, postHandle
doFilter, getAlreadyFilteredAttributeName, isEnabled, isEnabled, setEnabled, shouldNotFilter
getName, setName, toStringBuilder
destroy, getFilterConfig, getInitParam, init, onFilterConfigSet, setFilterConfig
getContextAttribute, getContextInitParam, getServletContext, removeContextAttribute, setContextAttribute, setServletContext, toString
public static final String IPV4_QUAD_REGEX
public static final String IPV4_REGEX
public static final Pattern IPV4_PATTERN
public static final String PRIVATE_CLASS_B_SUBSET
public static final String PRIVATE_CLASS_A_REGEX
public static final String PRIVATE_CLASS_B_REGEX
public static final String PRIVATE_CLASS_C_REGEX
public HostFilter()
public void setAuthorizedHosts(String authorizedHosts)
public void setDeniedHosts(String deniedHosts)
protected boolean isIpv4Candidate(String host)
protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception
AccessControlFilter
true
if the request is allowed to proceed through the filter normally, or false
if the request should be handled by the
onAccessDenied(request,response,mappedValue)
method instead.isAccessAllowed
in class AccessControlFilter
request
- the incoming ServletRequest
response
- the outgoing ServletResponse
mappedValue
- the filter-specific config value mapped to this filter in the URL rules mappings.true
if the request should proceed through the filter normally, false
if the
request should be processed by this filter's
AccessControlFilter.onAccessDenied(ServletRequest,ServletResponse,Object)
method instead.Exception
- if an error occurs during processing.Copyright © 2004–2017 The Apache Software Foundation. All rights reserved.