@Service(value={org.osgi.service.event.EventHandler.class,XSSFilter.class})
@Property(name="event.topics",
value="org/apache/sling/api/resource/Resource/*")
public class XSSFilterImpl
extends Object
implements XSSFilter, org.osgi.service.event.EventHandler
XSSFilter using the Antisamy XSS protection library found at
http://code.google.com/p/owaspantisamy/.DEFAULT_CONTEXT| Constructor and Description |
|---|
XSSFilterImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate() |
boolean |
check(ProtectionContext context,
String src)
Indicates whether or not a given source string contains XSS policy violations.
|
boolean |
check(ProtectionContext context,
String src,
String policy) |
String |
filter(ProtectionContext context,
String src)
Protects the given source string from containing XSS stuff.
|
String |
filter(ProtectionContext context,
String src,
String policy) |
String |
filter(String src)
Prevents the given source string from containing XSS stuff.
|
void |
handleEvent(org.osgi.service.event.Event event) |
boolean |
hasPolicy(String policyName) |
void |
loadPolicy(String policyName,
InputStream policyStream) |
void |
resetDefaultPolicy() |
void |
setDefaultPolicy(InputStream policyStream) |
void |
unloadPolicy(String policyName) |
public void handleEvent(org.osgi.service.event.Event event)
handleEvent in interface org.osgi.service.event.EventHandlerpublic boolean check(ProtectionContext context, String src)
XSSFilterpublic String filter(String src)
XSSFilterpublic String filter(ProtectionContext context, String src)
XSSFilter@Activate protected void activate()
public boolean check(ProtectionContext context, String src, String policy)
public String filter(ProtectionContext context, String src, String policy)
public void setDefaultPolicy(InputStream policyStream) throws Exception
Exceptionpublic void resetDefaultPolicy()
public void loadPolicy(String policyName, InputStream policyStream) throws Exception
Exceptionpublic void unloadPolicy(String policyName)
public boolean hasPolicy(String policyName)
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.