|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jsecurity.config.ResourceConfiguration
org.jsecurity.config.TextConfiguration
org.jsecurity.config.IniConfiguration
org.jsecurity.web.config.IniWebConfiguration
public class IniWebConfiguration
A WebConfiguration that supports configuration via the
.ini format.
| Field Summary | |
|---|---|
protected Map<String,List<Filter>> |
chains
|
protected FilterConfig |
filterConfig
|
static String |
FILTERS
|
protected PatternMatcher |
pathMatcher
|
static String |
URLS
|
| Fields inherited from class org.jsecurity.config.IniConfiguration |
|---|
configUrl, DEFAULT_INI_RESOURCE_PATH, ignoreResourceNotFound, iniResource, MAIN, SESSION_MODE_PROPERTY_NAME |
| Fields inherited from class org.jsecurity.config.ResourceConfiguration |
|---|
securityManager |
| Constructor Summary | |
|---|---|
IniWebConfiguration()
|
|
| Method Summary | |
|---|---|
protected void |
afterSecurityManagerSet(Map<String,Map<String,String>> sections)
This implementation: First builds the filter instances by processing the [filters] section Builds a collection filter chains according to the definitions in the [urls] section Initializes the filter instances in the order in which they were defined |
protected void |
assertFilter(String name,
Object o)
|
protected void |
assertFilters(Map<String,?> map)
|
protected FilterChain |
createChain(List<Filter> filters,
FilterChain originalChain)
Creates a new FilterChain based on the specified configured url filter chain and original chain. |
Map<String,List<Filter>> |
createChains(Map<String,String> urls,
Map<String,Filter> filters)
|
protected Map<String,Filter> |
createDefaultFilters()
|
FilterChain |
getChain(ServletRequest request,
ServletResponse response,
FilterChain originalChain)
Returns the filter chain that should be executed for the given request, or null if the
original chain should be used. |
protected FilterChain |
getChain(String chainUrl,
FilterChain originalChain)
Returns the FilterChain to use for the specified application path, or null if the
original FilterChain should be used. |
FilterConfig |
getFilterConfig()
Returns the FilterConfig provided by the Servlet container at webapp startup. |
protected Map<String,Filter> |
getFilters(Map<String,String> section)
|
PatternMatcher |
getPathMatcher()
Returns the PatternMatcher used when determining if an incoming request's path
matches a configured filter chain path in the [urls] section. |
protected String |
getPathWithinApplication(ServletRequest request)
Merely returns WebUtils. |
protected void |
initFilter(Filter filter)
Initializes the filter by calling filter.init( . |
protected void |
initFilters(Map<String,List<Filter>> chains)
|
protected RealmSecurityManager |
newSecurityManagerInstance()
Creates a new, uninitialized SecurityManager instance that will be used to build up
the JSecurity environment for the web application. |
protected boolean |
pathMatches(String pattern,
String path)
Returns true if an incoming request's path (the path argument)
matches a configured filter chain path in the [urls] section (the pattern argument),
false otherwise. |
void |
setFilterConfig(FilterConfig filterConfig)
Sets the FilterConfig provided by the Servlet container at webapp startup. |
void |
setPathMatcher(PatternMatcher pathMatcher)
Sets the PatternMatcher used when determining if an incoming request's path
matches a configured filter chain path in the [urls] section. |
| Methods inherited from class org.jsecurity.config.IniConfiguration |
|---|
createDefaultSecurityManager, createSecurityManager, createSecurityManagerForSection, getConfigUrl, init, load, load, load, load, process, processIni, setConfigUrl |
| Methods inherited from class org.jsecurity.config.TextConfiguration |
|---|
getConfig, loadTextConfig, setConfig |
| Methods inherited from class org.jsecurity.config.ResourceConfiguration |
|---|
getSecurityManager, setSecurityManager |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jsecurity.mgt.SecurityManagerFactory |
|---|
getSecurityManager |
| Field Detail |
|---|
public static final String FILTERS
public static final String URLS
protected FilterConfig filterConfig
protected Map<String,List<Filter>> chains
protected PatternMatcher pathMatcher
| Constructor Detail |
|---|
public IniWebConfiguration()
| Method Detail |
|---|
public PatternMatcher getPathMatcher()
PatternMatcher used when determining if an incoming request's path
matches a configured filter chain path in the [urls] section. Unless overridden, the
default implementation is an AntPathMatcher.
PatternMatcher used when determining if an incoming request's path
matches a configured filter chain path in the [urls] section.public void setPathMatcher(PatternMatcher pathMatcher)
PatternMatcher used when determining if an incoming request's path
matches a configured filter chain path in the [urls] section. Unless overridden, the
default implementation is an AntPathMatcher.
pathMatcher - the PatternMatcher used when determining if an incoming request's path
matches a configured filter chain path in the [urls] section.public FilterConfig getFilterConfig()
FilterConfig provided by the Servlet container at webapp startup.
FilterConfig provided by the Servlet container at webapp startup.public void setFilterConfig(FilterConfig filterConfig)
FilterConfig provided by the Servlet container at webapp startup.
filterConfig - the FilterConfig provided by the Servlet container at webapp startup.
public FilterChain getChain(ServletRequest request,
ServletResponse response,
FilterChain originalChain)
WebConfigurationnull if the
original chain should be used.
This method allows a Configuration implementation to define arbitrary security Filter
chains for any given request or URL pattern.
getChain in interface WebConfigurationrequest - the incoming ServletRequestresponse - the outgoing ServletResponseoriginalChain - the original FilterChain intercepted by the JSecurityFilter.
null if the
original chain should be used.
protected FilterChain getChain(String chainUrl,
FilterChain originalChain)
FilterChain to use for the specified application path, or null if the
original FilterChain should be used.
The default implementation simply calls this.chains.get(chainUrl) to acquire the configured
List<Filter> filter chain. If that configured chain is non-null and not empty, it is
returned, otherwise null is returned to indicate that the originalChain should be
used instead.
chainUrl - the configured filter chain urloriginalChain - the original FilterChain given by the Servlet container.
FilterChain to use for the specified application path, or null if the
original FilterChain should be used.
protected FilterChain createChain(List<Filter> filters,
FilterChain originalChain)
getChain(chainUrl,originalChain) implementation that
calls this method.
The default implementation merely returns
new FilterChainWrapper(filters, originalChain),
and can be overridden by subclasses for custom creation.
filters - the configured filter chain for the incoming request application pathoriginalChain - the original FilterChain given by the Servlet container.
protected boolean pathMatches(String pattern,
String path)
true if an incoming request's path (the path argument)
matches a configured filter chain path in the [urls] section (the pattern argument),
false otherwise.
Simply delegates to
getPathMatcher().matches(pattern,path),
but can be overridden by subclasses for custom matching behavior.
pattern - the pattern to match againstpath - the value to match with the specified pattern
true if the request path matches the specified filter chain url pattern,
false otherwise.protected String getPathWithinApplication(ServletRequest request)
WebUtils.getPathWithinApplication(request)
and can be overridden by subclasses for custom request-to-application-path resolution behavior.
request - the incoming ServletRequest
protected RealmSecurityManager newSecurityManagerInstance()
SecurityManager instance that will be used to build up
the JSecurity environment for the web application.
The default implementation simply returns
new DefaultWebSecurityManager();
newSecurityManagerInstance in class IniConfigurationSecurityManager instance that will be used to build up
the JSecurity environment for the web application.protected void afterSecurityManagerSet(Map<String,Map<String,String>> sections)
afterSecurityManagerSet in class IniConfigurationsections - the configured .ini sections where the key is the section name (without [] brackets)
and the value is the key/value pairs inside that section.protected void initFilters(Map<String,List<Filter>> chains)
protected void initFilter(Filter filter)
filter.init( getFilterConfig() );.
filter - the filter to initialize with the FilterConfig.protected Map<String,Filter> getFilters(Map<String,String> section)
protected void assertFilters(Map<String,?> map)
protected void assertFilter(String name,
Object o)
throws ConfigurationException
ConfigurationExceptionprotected Map<String,Filter> createDefaultFilters()
public Map<String,List<Filter>> createChains(Map<String,String> urls,
Map<String,Filter> filters)
|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||