|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.security.filters.FilterManager
The primary purpose of this class is to filer out particular characters from a HTTP respone. The reason for this is that codes can be in- serted into a string that gets returned to a web browser, and these codes can cause the web browser to act on them in a way that is not as the site author inteded, and may be a breach of security. For more on these see: Understanding Malicious Content Mitigation for Web Developers
The Filtermanager implements filtering based upon a particular characterset. It maintains a list of all filters that have been used since the initialization of the class. When a particular filter is requested, the manager checks to see if that particular filter has been loaded. If not, it loads it and stores a reference to it in filterList. Since the number of different charactersets are actually probably fairly small for most applications, this list is never cleaned out until the class is gc'ed. If this becomes a problem, we can implement a caching system that clears out the least frequently used characterset filters.
| Field Summary | |
static String |
RAW_FILTER
Don't do anything |
static String |
STANDARD_FILTER
Replace control characters with appropriate values, protect against XSS attacks |
static String |
STRIP_FILTER
Strip out any unwanted characters, but do not replace them with anything |
| Constructor Summary | |
FilterManager()
Manager for filters. |
|
| Method Summary | |
String |
filterString(String data,
Class filterClass,
String filterMethod)
The method that does the actual string filtering. |
static FilterManager |
getInstance()
The singleton implementation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String STANDARD_FILTER
public static final String STRIP_FILTER
public static final String RAW_FILTER
| Constructor Detail |
public FilterManager()
Filter| Method Detail |
public static FilterManager getInstance()
public String filterString(String data,
Class filterClass,
String filterMethod)
throws IllegalArgumentException,
Exception
data - The string to filter.filterClass - the class implementing Filter; class name will be used to hash an instance of this filter within FilterManager; use NULL to get default filteringfilterMethod - one of three filter methods, supported by all filters: IllegalArgumentException - if there is a problem with the Method's
parameters
Exception - for any other exception related to loading the specific
filter class
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||