public class SanitizingGadgetRewriter extends DomWalker.Rewriter
| Modifier and Type | Class and Description |
|---|---|
static interface |
SanitizingGadgetRewriter.AllowedAttributes |
static interface |
SanitizingGadgetRewriter.AllowedTags |
static class |
SanitizingGadgetRewriter.Bypass |
| Constructor and Description |
|---|
SanitizingGadgetRewriter(Set<String> allowedTags,
Set<String> allowedAttributes,
ContentRewriterFeature.Factory rewriterFeatureFactory,
CajaCssSanitizer cssSanitizer,
ProxyUriManager proxyUriManager) |
| Modifier and Type | Method and Description |
|---|---|
static void |
bypassSanitization(Element element,
boolean includingChildren)
Marks that an element and all its attributes are trusted content.
|
static SanitizingGadgetRewriter.Bypass |
canBypassSanitization(Element element) |
static boolean |
isSanitizedRenderingRequest(Gadget gadget)
Is the Gadget to be rendered sanitized?
|
void |
rewrite(Gadget gadget,
MutableContent content)
Performs the DomWalker rewrite operation described in class javadoc.
|
makeVisitors, rewrite@Inject public SanitizingGadgetRewriter(Set<String> allowedTags, Set<String> allowedAttributes, ContentRewriterFeature.Factory rewriterFeatureFactory, CajaCssSanitizer cssSanitizer, ProxyUriManager proxyUriManager)
public static boolean isSanitizedRenderingRequest(Gadget gadget)
public static void bypassSanitization(Element element, boolean includingChildren)
Node.cloneNode(boolean) calls. Be
extremely careful when using this, especially with includingChildren
set to true, as untrusted content that gets inserted (e.g, via
os:RenderAll in templating) would become trusted.element - the trusted elementincludingChildren - if true, children of this element will are also
trusted. Never set this to true on an element that will ever have
untrusted children inserted (e.g., if it contains or may contain os:Render).public void rewrite(Gadget gadget, MutableContent content) throws RewritingException
DomWalker.Rewriterrewrite in interface GadgetRewriterrewrite in class DomWalker.Rewritergadget - Gadget to rewrite.content - the content of the gadget to be manipulated.RewritingExceptionpublic static SanitizingGadgetRewriter.Bypass canBypassSanitization(Element element)
Copyright © 2007-2012. All Rights Reserved.