From b4246c780665439166af877bc0924ead635c3e70 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Wed, 2 Dec 2020 20:06:06 -0500 Subject: [PATCH] remove dependency on commons-collections4, trim down jar file --- bubble-server/pom.xml | 116 +++++++++++++++++- .../cloud/auth/AuthenticationDriver.java | 4 +- .../rule/bblock/BubbleBlockRuleDriver.java | 4 +- bubble-web | 2 +- utils/cobbzilla-utils | 2 +- utils/cobbzilla-wizard | 2 +- 6 files changed, 120 insertions(+), 10 deletions(-) diff --git a/bubble-server/pom.xml b/bubble-server/pom.xml index 8984de42..b8f21394 100644 --- a/bubble-server/pom.xml +++ b/bubble-server/pom.xml @@ -327,16 +327,126 @@ - *:* + META-INF/*.SF META-INF/*.DSA META-INF/*.RSA + + + org.mongodb:* + com.github.jmkgreen.morphia:* + org.elasticsearch:* + fr.opensagres.xdocreport:* + com.codeborne:* + jtidy:* + xalan:* + net.sf.saxon:* + org.apache.ant:* + + + META-INF/maven/** + META-INF/services/fr.opensagres** + aj/org/objectweb/** + com/ctc/wstx/api/EmptyElementHandler.class + com/ctc/wstx/api/InvalidCharHandler.class + com/ctc/wstx/api/ValidatorConfig.class + com/ctc/wstx/api/WstxOutputProperties.class + com/ctc/wstx/cfg/ErrorConsts.class + com/ctc/wstx/cfg/XmlConsts.class + com/ctc/wstx/compat/QNameCreator.class + com/ctc/wstx/dom/** + com/ctc/wstx/dtd/** + com/ctc/wstx/msv/** + com/ctc/wstx/osgi/** + com/ctc/wstx/sax/** + com/ctc/wstx/shaded/msv/org_isorelax/catalog/** + com/ctc/wstx/shaded/msv/org_isorelax/dispatcher/** + com/ctc/wstx/shaded/msv/org_isorelax/jaxp/** + com/ctc/wstx/shaded/msv/org_isorelax/verifier/** + com/ctc/wstx/shaded/msv/org_jp_gr_xml/** + com/ctc/wstx/shaded/msv/relaxng_datatype/** + com/ctc/wstx/shaded/msv/xsd_util/** + com/ctc/wstx/shaded/msv_core/datatype/** + com/ctc/wstx/shaded/msv_core/driver/** + com/ctc/wstx/shaded/msv_core/grammar/** + com/ctc/wstx/shaded/msv_core/reader/** + com/ctc/wstx/shaded/msv_core/reader/trex/classic/** + com/ctc/wstx/shaded/msv_core/relaxns/** + com/ctc/wstx/shaded/msv_core/scanner/** + com/ctc/wstx/shaded/msv_core/util/xml/** + com/ctc/wstx/shaded/msv_core/verifier/** + com/ctc/wstx/shaded/msv_core/writer/** + com/github/jmkgreen/** + com/google/common/collect/** + com/mongodb/** + com/opencsv/** + com/twilio/rest/** + fr/opensagres/** + io/jsonwebtoken/** + javax/servlet/descriptor/** + javax/servlet/http/** + lib/README.txt/** + lib/darwin-x86-amd64/** + lombok/bytecode/** + lombok/core/** + lombok/delombok/** + lombok/eclipse/** + lombok/experimental/** + lombok/extern/** + lombok/installer/** + lombok/javac/** + lombok/launch/** + net/fortuna/** + net/sf/saxon/** + org/apache/commons/math3/** + org/apache/fontbox/** + org/apache/pdfbox/** + org/apache/poi/** + org/apache/tools/ant/** + org/apache/velocity/** + org/apache/xalan/** + org/apache/xmlbeans/** + org/eclipse/jetty/client/** + org/eclipse/jetty/favicon.ico/** + org/eclipse/jetty/http/** + org/eclipse/jetty/io/** + org/eclipse/jetty/proxy/** + org/eclipse/jetty/security/** + org/eclipse/jetty/server/handler/** + org/eclipse/jetty/server/jmx/** + org/eclipse/jetty/server/nio/** + org/eclipse/jetty/server/resource/** + org/eclipse/jetty/server/session/** + org/eclipse/jetty/servlet/** + org/eclipse/jetty/util/annotation/** + org/eclipse/jetty/util/compression/** + org/eclipse/jetty/util/log/** + org/eclipse/jetty/util/preventers/** + org/eclipse/jetty/util/resource/** + org/eclipse/jetty/util/security/** + org/eclipse/jetty/util/ssl/** + org/eclipse/jetty/util/statistic/** + org/eclipse/jetty/util/thread/** + org/eclipse/jetty/version/** + org/eclipse/jetty/webapp/** + org/eclipse/jetty/xml/** + org/hibernate/internal/jaxb/** + org/openqa/selenium/** + org/openxmlformats/** + org/springframework/orm/hibernate3/** + org/springframework/orm/hibernate5/** + org/springframework/orm/jdo/** + schemaorg_apache_xmlbeans/** + schemasMicrosoftComOfficeExcel/** + schemasMicrosoftComOfficeOffice/** + schemasMicrosoftComOfficePowerpoint/** + schemasMicrosoftComOfficeWord/** + schemasMicrosoftComVml/** + w3c/mathml/** diff --git a/bubble-server/src/main/java/bubble/cloud/auth/AuthenticationDriver.java b/bubble-server/src/main/java/bubble/cloud/auth/AuthenticationDriver.java index ad22d0d3..7335a2c9 100644 --- a/bubble-server/src/main/java/bubble/cloud/auth/AuthenticationDriver.java +++ b/bubble-server/src/main/java/bubble/cloud/auth/AuthenticationDriver.java @@ -30,8 +30,8 @@ import bubble.server.BubbleConfiguration; import bubble.service.account.StandardAccountMessageService; import bubble.service.message.MessageService; import com.github.jknack.handlebars.Handlebars; -import org.apache.commons.collections4.map.SingletonMap; import org.apache.commons.lang3.ArrayUtils; +import org.cobbzilla.util.collection.MapBuilder; import org.cobbzilla.util.handlebars.HandlebarsUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -209,7 +209,7 @@ public interface AuthenticationDriver extends CloudServiceDriver { static String localePath(final String locale, String templatePath, Handlebars hbs) { final String key = locale+":"+templatePath; return _localePaths.computeIfAbsent(key, - k -> HandlebarsUtil.apply(hbs, templatePath, new SingletonMap<>(CTX_LOCALE, locale), '[', ']')); + k -> HandlebarsUtil.apply(hbs, templatePath, MapBuilder.build(CTX_LOCALE, locale), '[', ']')); } String HTML_MESSAGE_HBS = "htmlMessage.hbs"; diff --git a/bubble-server/src/main/java/bubble/rule/bblock/BubbleBlockRuleDriver.java b/bubble-server/src/main/java/bubble/rule/bblock/BubbleBlockRuleDriver.java index a18f168f..84ee613d 100644 --- a/bubble-server/src/main/java/bubble/rule/bblock/BubbleBlockRuleDriver.java +++ b/bubble-server/src/main/java/bubble/rule/bblock/BubbleBlockRuleDriver.java @@ -22,8 +22,8 @@ import bubble.service.stream.AppRuleHarness; import bubble.service.stream.ConnectionCheckResponse; import com.fasterxml.jackson.databind.JsonNode; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections4.map.SingletonMap; import org.cobbzilla.util.collection.ExpirationMap; +import org.cobbzilla.util.collection.MapBuilder; import org.cobbzilla.util.http.URIUtil; import org.cobbzilla.util.string.StringUtil; import org.glassfish.grizzly.http.server.Request; @@ -407,7 +407,7 @@ public class BubbleBlockRuleDriver extends TrafficAnalyticsRuleDriver // Now that we know the content type, re-check the BlockList final String contentType = filterRequest.getContentType(); final BlockDecision decision = getBlockList().getDecision(request.getFqdn(), request.getUri(), contentType, request.getReferer(), true); - final Map filterCtx = new SingletonMap<>(FILTER_CTX_DECISION, decision); + final Map filterCtx = MapBuilder.build(FILTER_CTX_DECISION, decision); if (log.isDebugEnabled()) log.debug(prefix+"preprocess decision was "+decision+", but now we know contentType="+contentType); switch (decision.getDecisionType()) { case block: diff --git a/bubble-web b/bubble-web index 4b0fbd0d..3c892f6b 160000 --- a/bubble-web +++ b/bubble-web @@ -1 +1 @@ -Subproject commit 4b0fbd0d37e7335d6b0d93cc9b65bea416e9d5ec +Subproject commit 3c892f6b4dc931c657a28f58f79330dd36273e75 diff --git a/utils/cobbzilla-utils b/utils/cobbzilla-utils index a765cf0a..8d694784 160000 --- a/utils/cobbzilla-utils +++ b/utils/cobbzilla-utils @@ -1 +1 @@ -Subproject commit a765cf0ac5e8000c381b5542d3b007600d2eda0a +Subproject commit 8d6947849d8522613f6f4d85438a7caf573940dc diff --git a/utils/cobbzilla-wizard b/utils/cobbzilla-wizard index 103dbe59..36035cd8 160000 --- a/utils/cobbzilla-wizard +++ b/utils/cobbzilla-wizard @@ -1 +1 @@ -Subproject commit 103dbe59235db53b06c251302dc839b24f480602 +Subproject commit 36035cd8abd4254e1c44a8672fd61ec0d74380e0