Package org.tynamo.security.shiro.authz
Class SslFilter
java.lang.Object
org.apache.shiro.web.servlet.ServletContextSupport
org.apache.shiro.web.servlet.AbstractFilter
org.apache.shiro.web.servlet.NameableFilter
org.apache.shiro.web.servlet.OncePerRequestFilter
org.apache.shiro.web.servlet.AdviceFilter
org.tynamo.security.shiro.AccessControlFilter
org.tynamo.security.shiro.authz.AuthorizationFilter
org.tynamo.security.shiro.authz.PortFilter
org.tynamo.security.shiro.authz.SslFilter
- All Implemented Interfaces:
jakarta.servlet.Filter,org.apache.shiro.lang.util.Nameable
A copy of Shiro's 1.2.0 SslFilter that works with tapestry-security 0.4.x
Filter which requires a request to be over SSL. Access is allowed if the request is received on the configured
server
port and the
request.isSecure(). If either condition is false,
the filter chain will not continue.
The port property defaults to 443 and also additionally guarantees that the
request scheme is always 'https' (except for port 80, which retains the 'http' scheme).- Since:
- 0.4.1
-
Field Summary
FieldsFields inherited from class org.tynamo.security.shiro.authz.PortFilter
DEFAULT_HTTP_PORT, HTTP_SCHEMEFields inherited from class org.tynamo.security.shiro.AccessControlFilter
GET_METHOD, LOGIN_URL, pathMatcher, POST_METHOD, REDIRECT_TO_SAVED_URL, SUCCESS_URL, TAPESTRY_VERSION, UNAUTHORIZED_URLFields inherited from class org.apache.shiro.web.servlet.OncePerRequestFilter
ALREADY_FILTERED_SUFFIXFields inherited from class org.apache.shiro.web.servlet.AbstractFilter
filterConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected booleanisAccessAllowed(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, Object mappedValue) Retains the parent method's port-matching behavior but additionally guarantees that theServletRequest.isSecure().Methods inherited from class org.tynamo.security.shiro.authz.PortFilter
getPort, onAccessDenied, setPort, toPortMethods inherited from class org.tynamo.security.shiro.authz.AuthorizationFilter
getUnauthorizedUrl, onAccessDenied, setUnauthorizedUrlMethods inherited from class org.tynamo.security.shiro.AccessControlFilter
addConfig, getLoginContextService, getLoginUrl, getSubject, getSuccessUrl, isLoginRequest, isRedirectToSavedUrl, onPreHandle, preHandle, redirectToLogin, saveRequest, saveRequestAndRedirectToLogin, setConfig, setLoginUrl, setRedirectToSavedUrl, setSuccessUrlMethods inherited from class org.apache.shiro.web.servlet.AdviceFilter
afterCompletion, cleanup, doFilterInternal, executeChain, postHandleMethods inherited from class org.apache.shiro.web.servlet.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, isEnabled, isEnabled, isFilterOncePerRequest, setEnabled, setFilterOncePerRequest, shouldNotFilterMethods inherited from class org.apache.shiro.web.servlet.NameableFilter
getName, setName, toStringBuilderMethods inherited from class org.apache.shiro.web.servlet.AbstractFilter
destroy, getFilterConfig, getInitParam, init, onFilterConfigSet, setFilterConfigMethods inherited from class org.apache.shiro.web.servlet.ServletContextSupport
getContextAttribute, getContextInitParam, getServletContext, removeContextAttribute, setContextAttribute, setServletContext, toString
-
Field Details
-
DEFAULT_HTTPS_PORT
public static final int DEFAULT_HTTPS_PORT- See Also:
-
HTTPS_SCHEME
- See Also:
-
-
Constructor Details
-
SslFilter
-
-
Method Details
-
getScheme
- Overrides:
getSchemein classPortFilter
-
isAccessAllowed
protected boolean isAccessAllowed(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, Object mappedValue) throws Exception Retains the parent method's port-matching behavior but additionally guarantees that theServletRequest.isSecure(). If the port does not match or the request is not secure, access is denied.- Overrides:
isAccessAllowedin classPortFilter- Parameters:
request- the incomingServletRequestresponse- the outgoingServletResponse- ignored in this implementationmappedValue- the filter-specific config value mapped to this filter in the URL rules mappings - ignored by this implementation.- Returns:
trueif the request is received on an expected SSL port and therequest.isSecure(),falseotherwise.- Throws:
Exception- if the call tosuper.isAccessAllowedthrows an exception.- Since:
- 0.4.1
-