Examples of Whitelist


Examples of com.google.caja.config.WhiteList

  private static Pair<CssSchema, List<Message>> defaultSchema;
  public static CssSchema getDefaultCss21Schema(MessageQueue mq) {
    if (defaultSchema == null) {
      SimpleMessageQueue cacheMq = new SimpleMessageQueue();
      WhiteList propDefs, fnDefs;
      try {
        propDefs = ConfigUtil.loadWhiteListFromJson(
            defaultPropWhitelistURL, ConfigUtil.RESOURCE_RESOLVER, cacheMq);
        fnDefs = ConfigUtil.loadWhiteListFromJson(
            defaultFnWhitelistURL, ConfigUtil.RESOURCE_RESOLVER, cacheMq);
View Full Code Here

Examples of com.google.caja.config.WhiteList

              Namespaces.HTML_NAMESPACE_URI, BODY_CLASS.localName);
          if (classAttr != null) {
            el.removeAttributeNode(classAttr);
            String identifiers = classAttr.getValue().trim();
            if (!"".equals(identifiers)) {
              WhiteList wl = WhiteList.Factory.empty();
              HtmlAttributeRewriter rw = new HtmlAttributeRewriter(
                  jobs.getPluginMeta(), new CssSchema(wl, wl),
                  htmlSchema, Maps.<Attr, EmbeddedContent>newHashMap(),
                  jobs.getMessageQueue());
              HtmlAttributeRewriter.SanitizedAttr sanitized
View Full Code Here

Examples of com.google.caja.config.WhiteList

      mq.addMessage(MessageType.IO_ERROR, src);
    } catch (ParseException ex) {
      ex.toMessageQueue(mq);
    }
    // Return a Null instance if unable to load.
    return new WhiteList() {
        public Set<String> allowedItems() {
          return Collections.<String>emptySet();
        }
        public Map<String, TypeDefinition> typeDefinitions() {
          return Collections.<String, TypeDefinition>emptyMap();
View Full Code Here

Examples of com.google.caja.config.WhiteList

      SimpleMessageQueue cacheMq = new SimpleMessageQueue();
      URI fnSrc = URI.create(
              "resource:///com/google/caja/lang/css/css-extensions-fns.json"),
          propSrc = URI.create(
              "resource:///com/google/caja/lang/css/css-extensions.json");
      WhiteList propDefs, fnDefs;
      try {
        propDefs = ConfigUtil.loadWhiteListFromJson(
            propSrc, ConfigUtil.RESOURCE_RESOLVER, cacheMq);
        fnDefs = ConfigUtil.loadWhiteListFromJson(
            fnSrc, ConfigUtil.RESOURCE_RESOLVER, cacheMq);
View Full Code Here

Examples of com.google.test.metric.WhiteList

    checkResultsAreOk();
  }

  private void runTestabilityExplorer() {
    List<String> entries = Arrays.asList(model.getFilter());
    WhiteList packageWhiteList = new RegExpWhiteList(model.getWhiteList());
    final ReportOptions options = setOptions();
    final JavaTestabilityModule module = new JavaTestabilityModule(entries,
        model.getErrorPrintStream(), model.getPrintDepth(), ReportFormat.valueOf(model.getPrint()));
    AbstractModule configModule = new AbstractModule() {
      @Override
View Full Code Here

Examples of kafka.consumer.Whitelist

        final int numThreads = configuration.getInt(CK_THREADS);
        final ConsumerConfig consumerConfig = new ConsumerConfig(props);
        cc = Consumer.createJavaConsumerConnector(consumerConfig);

        final TopicFilter filter = new Whitelist(configuration.getString(CK_TOPIC_FILTER));

        final List<KafkaStream<byte[], byte[]>> streams = cc.createMessageStreamsByFilter(filter, numThreads);
        final ExecutorService executor = new InstrumentedExecutorService(Executors.newFixedThreadPool(numThreads), metricRegistry);

        // this is being used during shutdown to first stop all submitted jobs before committing the offsets back to zookeeper
View Full Code Here

Examples of kafka.consumer.Whitelist

        mConfig = config;
        mOffsetTracker = offsetTracker;

        mConsumerConnector = Consumer.createJavaConsumerConnector(createConsumerConfig());

        TopicFilter topicFilter = new Whitelist(mConfig.getKafkaTopicFilter());
        List<KafkaStream<byte[], byte[]>> streams =
            mConsumerConnector.createMessageStreamsByFilter(topicFilter);
        KafkaStream<byte[], byte[]> stream = streams.get(0);
        mIterator = stream.iterator();
        mLastAccessTime = new HashMap<TopicPartition, Long>();
View Full Code Here

Examples of org.jsoup.safety.Whitelist

   *
   * https://github.com/github/markup/tree/master#html-sanitization
   * @return a loose HTML whitelist
   */
  protected Whitelist getRelaxedWhiteList() {
    return new Whitelist()
        .addTags(
                "a", "b", "blockquote", "br", "caption", "cite", "code", "col",
                "colgroup", "dd", "del", "div", "dl", "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr",
                "i", "img", "ins", "kbd", "li", "ol", "p", "pre", "q", "samp", "small", "strike", "strong",
                "sub", "sup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "tt", "u",
View Full Code Here

Examples of org.jsoup.safety.Whitelist

   *
   * @param options Specified options to use on this instance.  See the docs for the Options class for common options sets.
   */
  public Remark(Options options) {
    this.options = options.getCopy();
    Whitelist whitelist = Whitelist.basicWithImages()
                    .addTags("div",
                                              "h1", "h2", "h3", "h4", "h5", "h6",
                                              "table", "tbody", "td", "tfoot", "th", "thead", "tr",
                                              "hr",
                                              "span", "font")
                    .addAttributes("th", "colspan", "align", "style")
                    .addAttributes("td", "colspan", "align", "style")
                    .addAttributes(":all", "title", "style");
        if(options.preserveRelativeLinks) {
            whitelist.preserveRelativeLinks(true);
        }
    if(options.abbreviations) {
      whitelist.addTags("abbr", "acronym");
    }
    if(options.headerIds) {
      for(int i=1; i<=6; i++) {
        whitelist.addAttributes("h"+i, "id");
      }
    }
    for(final IgnoredHtmlElement el : options.getIgnoredHtmlElements()) {
      whitelist.addTags(el.getTagName());
            if(!el.getAttributes().isEmpty()) {
                whitelist.addAttributes(el.getTagName(), el.getAttributes().toArray(new String[el.getAttributes().size()]));
            }
    }
    cleaner = new Cleaner(whitelist);

    if(options.getTables().isLeftAsHtml()) {
View Full Code Here

Examples of org.jsoup.safety.Whitelist

    return Jsoup.clean(html, Whitelist.relaxed());
  }
 
  //只允许指定的html标签
  public static String clearTags(String html, String ...tags) {
    Whitelist wl = new Whitelist();
    return Jsoup.clean(html, wl.addTags(tags));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.