Apache Solr open-source search software
SOLR-14853: enableRemoteStreaming and enableStreamBody are now global (#1615)
David Smileyffedc5bb680e
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex d7d9265ea5d..9d43480f709 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -120,6 +120,9 @@ Improvements`DELETE /api/collections/cName/shards/sName/replicas?count=123`, and deletion of multiple replicas from all shards now uses`PUT /api/collections/cName/scale {"count": 123"}` (Jason Gerlowski)+* SOLR-14853: Security: Converted enableRemoteStreaming and enableStreamBody solrconfig options into system properties and env vars.+ Attempts to set them the old way are no-op and log a warning. (David Smiley, janhoy, Ishan Chattopadhyaya)+Optimizations---------------------diff --git a/solr/bin/solr b/solr/bin/solrindex dd5b175ce1d..8c1c19b8f26 100644--- a/solr/bin/solr+++ b/solr/bin/solr@@ -1850,6 +1850,14 @@ if [[ -n "${SOLR_PLACEMENTPLUGIN_DEFAULT:-}" ]] ; thenSOLR_OPTS+=("-Dsolr.placementplugin.default=$SOLR_PLACEMENTPLUGIN_DEFAULT")fi+# Remote streaming and stream body+if [ "${SOLR_ENABLE_REMOTE_STREAMING:-false}" == "true" ]; then+ SOLR_OPTS+=("-Dsolr.enableRemoteStreaming=true")+fi+if [ "${SOLR_ENABLE_STREAM_BODY:-false}" == "true" ]; then+ SOLR_OPTS+=("-Dsolr.enableStreamBody=true")+fi+: ${SOLR_SERVER_DIR:=$DEFAULT_SERVER_DIR}if [ ! -e "$SOLR_SERVER_DIR" ]; thendiff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmdindex 4174560c577..b6613cabe32 100755--- a/solr/bin/solr.cmd+++ b/solr/bin/solr.cmd@@ -993,6 +993,14 @@ IF DEFINED SOLR_PLACEMENTPLUGIN_DEFAULT (set "SOLR_OPTS=%SOLR_OPTS% -Dsolr.placementplugin.default=%SOLR_PLACEMENTPLUGIN_DEFAULT%")+REM Remote streaming and stream body+IF "%SOLR_ENABLE_REMOTE_STREAMING%"=="true" (+ set "SOLR_OPTS=%SOLR_OPTS% -Dsolr.enableRemoteStreaming=true"+)+IF "%SOLR_ENABLE_STREAM_BODY%"=="true" (+ set "SOLR_OPTS=%SOLR_OPTS% -Dsolr.enableStreamBody=true"+)+IF "%SOLR_SERVER_DIR%"=="" set "SOLR_SERVER_DIR=%DEFAULT_SERVER_DIR%"IF NOT EXIST "%SOLR_SERVER_DIR%" (diff --git a/solr/core/src/java/org/apache/solr/core/SolrConfig.java b/solr/core/src/java/org/apache/solr/core/SolrConfig.javaindex e6aca9310af..fd9b05f86cf 100644--- a/solr/core/src/java/org/apache/solr/core/SolrConfig.java+++ b/solr/core/src/java/org/apache/solr/core/SolrConfig.java@@ -128,9 +128,6 @@ public class SolrConfig implements MapSerializable {private int formUploadLimitKB;- private boolean enableRemoteStreams;- private boolean enableStreamBody;-private boolean handleSelect;private boolean addHttpRequestToContext;@@ -360,27 +357,25 @@ public class SolrConfig implements MapSerializable {updateHandlerInfo = loadUpdatehandlerInfo();+ final var requestParsersNode = get("requestDispatcher").get("requestParsers");+multipartUploadLimitKB =- get("requestDispatcher")- .get("requestParsers")- .intAttr("multipartUploadLimitInKB", Integer.MAX_VALUE);+ requestParsersNode.intAttr("multipartUploadLimitInKB", Integer.MAX_VALUE);if (multipartUploadLimitKB == -1) multipartUploadLimitKB = Integer.MAX_VALUE;- formUploadLimitKB =- get("requestDispatcher")- .get("requestParsers")- .intAttr("formdataUploadLimitInKB", Integer.MAX_VALUE);+ formUploadLimitKB = requestParsersNode.intAttr("formdataUploadLimitInKB", Integer.MAX_VALUE);if (formUploadLimitKB == -1) formUploadLimitKB = Integer.MAX_VALUE;- enableRemoteStreams =- get("requestDispatcher").get("requestParsers").boolAttr("enableRemoteStreaming", false);+ if (requestParsersNode.attr("enableRemoteStreaming") != null) {+ log.warn("Ignored deprecated enableRemoteStreaming in config; use sys-prop");+ }- enableStreamBody =- get("requestDispatcher").get("requestParsers").boolAttr("enableStreamBody", false);+ if (requestParsersNode.attr("enableStreamBody") != null) {+ log.warn("Ignored deprecated enableStreamBody in config; use sys-prop");+ }handleSelect = get("requestDispatcher").boolAttr("handleSelect", false);- addHttpRequestToContext =- get("requestDispatcher").get("requestParsers").boolAttr("addHttpRequestToContext", false);+ addHttpRequestToContext = requestParsersNode.boolAttr("addHttpRequestToContext", false);List<PluginInfo> argsInfos = getPluginInfos(InitParams.class.getName());if (argsInfos != null) {@@ -998,14 +993,6 @@ public class SolrConfig implements MapSerializable {return addHttpRequestToContext;}- public boolean isEnableRemoteStreams() {- return enableRemoteStreams;- }-- public boolean isEnableStreamBody() {- return enableStreamBody;- }-@Overridepublic Map<String, Object> toMap(Map<String, Object> result) {if (znodeVersion > -1) result.put(ZNODEVER, znodeVersion);diff --git a/solr/core/src/java/org/apache/solr/handler/DumpRequestHandler.java b/solr/core/src/java/org/apache/solr/handler/DumpRequestHandler.javaindex e69ff0d5d2c..b08367f11cb 100644--- a/solr/core/src/java/org/apache/solr/handler/DumpRequestHandler.java+++ b/solr/core/src/java/org/apache/solr/handler/DumpRequestHandler.java@@ -127,7 +127,7 @@ public class DumpRequestHandler extends RequestHandlerBase implements SolrCoreAw@Overridepublic Name getPermissionName(AuthorizationContext request) {- if (solrCore != null && solrCore.getSolrConfig().isEnableRemoteStreams()) {+ if (solrCore != null && solrCore.getSolrConfig().getRequestParsers().isEnableRemoteStreams()) {log.warn("Dump request handler requires config-read permission when remote streams are enabled");return Name.CONFIG_READ_PERM;diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java b/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.javaindex 2e61901ccc3..af293d6a96e 100644--- a/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java+++ b/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java@@ -113,8 +113,9 @@ public class SolrRequestParsers {formUploadLimitKB = globalConfig.getFormUploadLimitKB();- enableRemoteStreams = globalConfig.isEnableRemoteStreams();- enableStreamBody = globalConfig.isEnableStreamBody();+ // security risks; disabled by default+ enableRemoteStreams = Boolean.getBoolean("solr.enableRemoteStreaming");+ enableStreamBody = Boolean.getBoolean("solr.enableStreamBody");// Let this filter take care of /select?xxx formathandleSelect = globalConfig.isHandleSelect();@@ -525,6 +526,10 @@ public class SolrRequestParsers {this.addHttpRequestToContext = addRequestHeadersToContext;}+ public boolean isEnableRemoteStreams() {+ return enableRemoteStreams;+ }+// -----------------------------------------------------------------// -----------------------------------------------------------------diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-analytics-query.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-analytics-query.xmlindex ba195778369..cda45dfe364 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-analytics-query.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-analytics-query.xml@@ -211,7 +211,7 @@</searchComponent><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-collapseqparser.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-collapseqparser.xmlindex d896666f185..8d242f46a54 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-collapseqparser.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-collapseqparser.xml@@ -214,7 +214,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-components-name.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-components-name.xmlindex 870596afe3b..6a14a8cc91c 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-components-name.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-components-name.xml@@ -51,7 +51,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-delaying-component.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-delaying-component.xmlindex fcb0140fb80..cfb812fa25b 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-delaying-component.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-delaying-component.xml@@ -35,7 +35,7 @@</requestHandler><requestDispatcher >- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /><httpCaching never304="true" /></requestDispatcher>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-doctransformers.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-doctransformers.xmlindex 8511e8918f8..72393f82f98 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-doctransformers.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-doctransformers.xml@@ -40,7 +40,7 @@<requestHandler name="/select" class="solr.SearchHandler"/><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /></requestDispatcher></config>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xmlindex 4f40711a839..d814a538a50 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml@@ -114,7 +114,7 @@</requestHandler>--><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-follower.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-follower.xmlindex 217d56898b3..fc0298ef5fd 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-follower.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-follower.xml@@ -50,7 +50,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1"/>+ <requestParsers multipartUploadLimitInKB="-1"/><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-follower1.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-follower1.xmlindex 26821b4e578..71f4157ccb2 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-follower1.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-follower1.xml@@ -43,7 +43,7 @@<requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1"/>+ <requestParsers multipartUploadLimitInKB="-1"/><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-hash.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-hash.xmlindex 9c2e9f35820..44173b84cba 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-hash.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-hash.xml@@ -47,7 +47,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /></requestDispatcher><requestHandler name="/select" class="solr.SearchHandler" />diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader-throttled.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader-throttled.xmlindex 1a37f3f4339..edfa045e184 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader-throttled.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader-throttled.xml@@ -57,7 +57,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1"/>+ <requestParsers multipartUploadLimitInKB="-1"/><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader.xmlindex 3893a944a96..89c06ad3a54 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader.xml@@ -61,7 +61,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1"/>+ <requestParsers multipartUploadLimitInKB="-1"/><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader1-keepOneBackup.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader1-keepOneBackup.xmlindex 101ba30f351..36065b43ae7 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader1-keepOneBackup.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader1-keepOneBackup.xml@@ -40,7 +40,7 @@<requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1"/>+ <requestParsers multipartUploadLimitInKB="-1"/><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader1.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader1.xmlindex 0c3eb860fe3..4e4e3999224 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader1.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader1.xml@@ -59,7 +59,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1"/>+ <requestParsers multipartUploadLimitInKB="-1"/><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader2.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader2.xmlindex 5eca4621bfd..f6c2a77dde3 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader2.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader2.xml@@ -57,7 +57,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1"/>+ <requestParsers multipartUploadLimitInKB="-1"/><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader3.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader3.xmlindex 5d97350e558..49d1ed31b5a 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader3.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-leader3.xml@@ -58,7 +58,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1"/>+ <requestParsers multipartUploadLimitInKB="-1"/><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xmlindex e00b0c10de8..50518e15d07 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml@@ -30,8 +30,7 @@<codecFactory class="solr.SchemaCodecFactory"/><requestDispatcher>- <!-- Tests rely on stream.body -->- <requestParsers enableStreamBody="true" />+ <requestParsers /></requestDispatcher><query>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-minhash.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-minhash.xmlindex fd90b8d8917..e23b30b62c1 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-minhash.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-minhash.xml@@ -419,7 +419,7 @@</searchComponent><requestDispatcher>- <requestParsers enableRemoteStreaming="true" enableStreamBody="true" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-nocache.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-nocache.xmlindex 137c519bdc4..fb891f822fd 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-nocache.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-nocache.xml@@ -35,7 +35,7 @@<requestHandler name="/select" class="solr.SearchHandler" /><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /><httpCaching never304="true" /></requestDispatcher>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-plugcollector.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-plugcollector.xmlindex a9544b2ad88..34636cd6cfd 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-plugcollector.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-plugcollector.xml@@ -424,7 +424,7 @@</searchComponent><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-repeater.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-repeater.xmlindex 160bc4e8564..f5571f9827f 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-repeater.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-repeater.xml@@ -52,7 +52,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1"/>+ <requestParsers multipartUploadLimitInKB="-1"/><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-replication-legacy.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-replication-legacy.xmlindex c2f25ba77f0..43c42ffb089 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-replication-legacy.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-replication-legacy.xml@@ -53,7 +53,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1"/>+ <requestParsers multipartUploadLimitInKB="-1"/><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-schemaless.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-schemaless.xmlindex 51079d19afd..d1334c51966 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-schemaless.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-schemaless.xml@@ -36,7 +36,7 @@</updateHandler><requestDispatcher>- <requestParsers enableStreamBody="true" />+ <requestParsers /></requestDispatcher><requestHandler name="/select" class="solr.SearchHandler">diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-sql.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-sql.xmlindex 35e56aa4574..d9efb26fa81 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-sql.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-sql.xml@@ -45,7 +45,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /></requestDispatcher><requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xmlindex 6d5ed8474d6..5203031c456 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml@@ -31,7 +31,7 @@</directoryFactory><schemaFactory class="ClassicIndexSchemaFactory"/><requestDispatcher>- <requestParsers enableStreamBody="true" />+ <requestParsers /></requestDispatcher><dataDir>${solr.data.dir:}</dataDir>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig.xmlindex 44d64e1e119..9b66df4cc0e 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml@@ -437,7 +437,7 @@</searchComponent><requestDispatcher>- <requestParsers enableRemoteStreaming="true" enableStreamBody="true" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig_perf.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig_perf.xmlindex 29fbd3d6f97..f2b5ef8a381 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig_perf.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig_perf.xml@@ -58,8 +58,7 @@</query><requestDispatcher>- <!--Make sure your system has some authentication before enabling remote streaming! -->- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /><httpCaching lastModifiedFrom="openTime"etagSeed="Solr"></httpCaching>diff --git a/solr/core/src/test-files/solr/crazy-path-to-config.xml b/solr/core/src/test-files/solr/crazy-path-to-config.xmlindex ccc0e87997f..b4e729f1787 100644--- a/solr/core/src/test-files/solr/crazy-path-to-config.xml+++ b/solr/core/src/test-files/solr/crazy-path-to-config.xml@@ -38,7 +38,7 @@</query><requestDispatcher>- <requestParsers enableStreamBody="true" />+ <requestParsers/></requestDispatcher><requestHandler name="/select" class="solr.SearchHandler" />diff --git a/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java b/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.javaindex 5f9da169a9a..e36fbb1969c 100644--- a/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java+++ b/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java@@ -35,7 +35,6 @@ import org.apache.solr.common.SolrException;import org.apache.solr.common.SolrException.ErrorCode;import org.apache.solr.common.SolrInputDocument;import org.apache.solr.embedded.JettySolrRunner;-import org.junit.AfterClass;import org.junit.Before;import org.junit.BeforeClass;import org.junit.Test;@@ -48,15 +47,14 @@ public class TestRemoteStreaming extends SolrJettyTestBase {@BeforeClasspublic static void beforeTest() throws Exception {+ System.setProperty("solr.enableRemoteStreaming", "true");+ System.setProperty("solr.enableStreamBody", "true");// this one has handleSelect=true which a test here needsFile solrHomeDirectory = createTempDir(LuceneTestCase.getTestClass().getSimpleName()).toFile();setupJettyTestHome(solrHomeDirectory, "collection1");jettySolrRunner = createAndStartJetty(solrHomeDirectory.getAbsolutePath());}- @AfterClass- public static void afterTest() {}-@Beforepublic void doBefore() throws IOException, SolrServerException {// add document and commit, and ensure it's therediff --git a/solr/core/src/test/org/apache/solr/request/TestStreamBody.java b/solr/core/src/test/org/apache/solr/request/TestStreamBody.javaindex 6981d812bc1..e495353b613 100644--- a/solr/core/src/test/org/apache/solr/request/TestStreamBody.java+++ b/solr/core/src/test/org/apache/solr/request/TestStreamBody.java@@ -16,8 +16,6 @@*/package org.apache.solr.request;-import static org.apache.solr.core.TestSolrConfigHandler.runConfigCommand;-import java.io.File;import java.lang.invoke.MethodHandles;import java.util.SortedMap;@@ -28,10 +26,8 @@ import org.apache.solr.client.solrj.request.QueryRequest;import org.apache.solr.common.SolrException;import org.apache.solr.common.params.CommonParams;import org.apache.solr.util.RestTestBase;-import org.apache.solr.util.RestTestHarness;import org.eclipse.jetty.servlet.ServletHolder;import org.junit.After;-import org.junit.Before;import org.junit.Test;import org.slf4j.Logger;import org.slf4j.LoggerFactory;@@ -41,8 +37,7 @@ public class TestStreamBody extends RestTestBase {private static final String collection = "collection1";- @Before- public void before() throws Exception {+ public void startSolr() throws Exception {File tmpSolrHome = createTempDir().toFile();FileUtils.copyDirectory(new File(TEST_HOME()), tmpSolrHome.getAbsoluteFile());@@ -84,7 +79,9 @@ public class TestStreamBody extends RestTestBase {// SOLR-3161@Testpublic void testQtUpdateFails() throws Exception {- enableStreamBody();+ System.setProperty("solr.enableStreamBody", "true");+ startSolr();+SolrQuery query = new SolrQuery();query.setQuery("*:*"); // for anythingquery.add("echoHandler", "true");@@ -109,9 +106,10 @@ public class TestStreamBody extends RestTestBase {}}- // Tests that stream.body is disabled by default, and can be edited through Config API+ // Tests that stream.body is disabled by default@Test- public void testStreamBodyDefaultAndConfigApi() throws Exception {+ public void testStreamBodyDefault() throws Exception {+ startSolr();SolrQuery query = new SolrQuery();query.add(CommonParams.STREAM_BODY, "<delete><query>*:*</query></delete>");query.add("commit", "true");@@ -126,15 +124,5 @@ public class TestStreamBody extends RestTestBase {SolrException se =expectThrows(SolrException.class, () -> queryRequest.process(getSolrClient()));assertTrue(se.getMessage(), se.getMessage().contains("Stream Body is disabled"));- enableStreamBody();- queryRequest.process(getSolrClient());- }-- // Enables stream.body through Config API- private void enableStreamBody() throws Exception {- RestTestHarness harness = restTestHarness;- String payload =- "{ 'set-property' : { 'requestDispatcher.requestParsers.enableStreamBody':" + true + "} }";- runConfigCommand(harness, "/config?wt=json", payload);}}diff --git a/solr/core/src/test/org/apache/solr/search/TestSmileRequest.java b/solr/core/src/test/org/apache/solr/search/TestSmileRequest.javaindex 273c24ce7f0..a5f59890854 100644--- a/solr/core/src/test/org/apache/solr/search/TestSmileRequest.java+++ b/solr/core/src/test/org/apache/solr/search/TestSmileRequest.java@@ -41,6 +41,7 @@ public class TestSmileRequest extends SolrTestCaseJ4 {@BeforeClasspublic static void beforeTests() throws Exception {systemSetPropertySolrDisableUrlAllowList("true");+ System.setProperty("solr.enableStreamBody", "true");JSONTestUtil.failRepeatedKeys = true;initCore("solrconfig-tlog.xml", "schema_latest.xml");}diff --git a/solr/core/src/test/org/apache/solr/search/json/TestJsonRequest.java b/solr/core/src/test/org/apache/solr/search/json/TestJsonRequest.javaindex d834f4f87e1..fe259dcd473 100644--- a/solr/core/src/test/org/apache/solr/search/json/TestJsonRequest.java+++ b/solr/core/src/test/org/apache/solr/search/json/TestJsonRequest.java@@ -51,6 +51,7 @@ public class TestJsonRequest extends SolrTestCaseHS {@BeforeClasspublic static void beforeTests() throws Exception {systemSetPropertySolrDisableUrlAllowList("true");+ System.setProperty("solr.enableStreamBody", "true");JSONTestUtil.failRepeatedKeys = true;initCore("solrconfig-tlog.xml", "schema_latest.xml");}diff --git a/solr/core/src/test/org/apache/solr/servlet/CacheHeaderTest.java b/solr/core/src/test/org/apache/solr/servlet/CacheHeaderTest.javaindex 179eef4c7cb..2aaa5c4b788 100644--- a/solr/core/src/test/org/apache/solr/servlet/CacheHeaderTest.java+++ b/solr/core/src/test/org/apache/solr/servlet/CacheHeaderTest.java@@ -29,7 +29,6 @@ import org.apache.http.client.methods.HttpRequestBase;import org.apache.http.impl.cookie.DateUtils;import org.apache.solr.common.params.CommonParams;import org.apache.solr.common.util.SuppressForbidden;-import org.junit.AfterClass;import org.junit.BeforeClass;import org.junit.Test;@@ -38,14 +37,13 @@ public class CacheHeaderTest extends CacheHeaderTestBase {@BeforeClasspublic static void beforeTest() throws Exception {+ System.setProperty("solr.enableRemoteStreaming", "true"); // needed for testCacheVetoHandler+File solrHomeDirectory = createTempDir().toFile();setupJettyTestHome(solrHomeDirectory, "collection1");createAndStartJetty(solrHomeDirectory.getAbsolutePath());}- @AfterClass- public static void afterTest() {}-protected static final String CONTENTS = "id\n100\n101\n102";@Testdiff --git a/solr/core/src/test/org/apache/solr/servlet/DirectSolrConnectionTest.java b/solr/core/src/test/org/apache/solr/servlet/DirectSolrConnectionTest.javaindex bc097280459..33c04688009 100644--- a/solr/core/src/test/org/apache/solr/servlet/DirectSolrConnectionTest.java+++ b/solr/core/src/test/org/apache/solr/servlet/DirectSolrConnectionTest.java@@ -25,6 +25,7 @@ public class DirectSolrConnectionTest extends SolrTestCaseJ4 {@BeforeClasspublic static void beforeClass() throws Exception {+ System.setProperty("solr.enableStreamBody", "true");initCore("solr/crazy-path-to-config.xml", "solr/crazy-path-to-schema.xml");}diff --git a/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java b/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.javaindex dcf217dfe50..e86e6c12c4b 100644--- a/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java+++ b/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java@@ -64,6 +64,8 @@ public class SolrRequestParserTest extends SolrTestCaseJ4 {@BeforeClasspublic static void beforeClass() throws Exception {assumeWorkingMockito();+ System.setProperty("solr.enableRemoteStreaming", "true");+ System.setProperty("solr.enableStreamBody", "true");initCore("solrconfig.xml", "schema.xml");parser = new SolrRequestParsers(h.getCore().getSolrConfig());}diff --git a/solr/modules/extraction/src/test-files/extraction/solr/collection1/conf/solrconfig.xml b/solr/modules/extraction/src/test-files/extraction/solr/collection1/conf/solrconfig.xmlindex e1238a8edb3..b35a27fac39 100644--- a/solr/modules/extraction/src/test-files/extraction/solr/collection1/conf/solrconfig.xml+++ b/solr/modules/extraction/src/test-files/extraction/solr/collection1/conf/solrconfig.xml@@ -192,7 +192,7 @@<requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/modules/langid/src/test-files/langid/solr/collection1/conf/solrconfig-languageidentifier.xml b/solr/modules/langid/src/test-files/langid/solr/collection1/conf/solrconfig-languageidentifier.xmlindex 19581fb4322..f03387a170b 100644--- a/solr/modules/langid/src/test-files/langid/solr/collection1/conf/solrconfig-languageidentifier.xml+++ b/solr/modules/langid/src/test-files/langid/solr/collection1/conf/solrconfig-languageidentifier.xml@@ -48,7 +48,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-ltr.xml b/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-ltr.xmlindex 31ed2631ea0..172a0bca6a8 100644--- a/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-ltr.xml+++ b/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-ltr.xml@@ -22,7 +22,7 @@<schemaFactory class="ClassicIndexSchemaFactory" /><requestDispatcher>- <requestParsers enableStreamBody="true" />+ <requestParsers /></requestDispatcher><!-- Query parser used to rerank top docs with a provided model -->diff --git a/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-ltr_Th10_10.xml b/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-ltr_Th10_10.xmlindex f40110d59a2..7aca7e10db5 100644--- a/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-ltr_Th10_10.xml+++ b/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-ltr_Th10_10.xml@@ -19,7 +19,7 @@<schemaFactory class="ClassicIndexSchemaFactory" /><requestDispatcher>- <requestParsers enableStreamBody="true" />+ <requestParsers /></requestDispatcher><!-- Query parser used to rerank top docs with a provided model -->diff --git a/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-multiseg.xml b/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-multiseg.xmlindex 53d607be4fe..c5db8670234 100644--- a/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-multiseg.xml+++ b/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-multiseg.xml@@ -19,7 +19,7 @@<schemaFactory class="ClassicIndexSchemaFactory" /><requestDispatcher>- <requestParsers enableStreamBody="true" />+ <requestParsers /></requestDispatcher><!-- Query parser used to rerank top docs with a provided model -->diff --git a/solr/server/solr/configsets/_default/conf/solrconfig.xml b/solr/server/solr/configsets/_default/conf/solrconfig.xmlindex 9eb29ab91e4..4af39219816 100644--- a/solr/server/solr/configsets/_default/conf/solrconfig.xml+++ b/solr/server/solr/configsets/_default/conf/solrconfig.xml@@ -618,9 +618,6 @@what restrictions may be placed on the ContentStreams fromthose requests- enableRemoteStreaming - enables use of the stream.file- and stream.url parameters for specifying remote streams.-multipartUploadLimitInKB - specifies the max size (in KiB) ofMultipart File Uploads that Solr will allow in a Request.@@ -636,12 +633,7 @@Solr components, but may be useful when developing customplugins.- *** WARNING ***- Before enabling remote streaming, you should make sure your- system has authentication enabled.-- <requestParsers enableRemoteStreaming="false"- multipartUploadLimitInKB="-1"+ <requestParsers multipartUploadLimitInKB="-1"formdataUploadLimitInKB="-1"addHttpRequestToContext="false"/>-->diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xmlindex 32ea98950da..00d161978b1 100644--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml@@ -638,12 +638,6 @@what restrictions may be placed on the ContentStreams fromthose requests- enableRemoteStreaming - enables use of the stream.file- and stream.url parameters for specifying remote streams.-- enableStreamBody - This attribute controls whether streaming- content from the HTTP parameter stream.body is allowed.-multipartUploadLimitInKB - specifies the max size (in KiB) ofMultipart File Uploads that Solr will allow in a Request.@@ -658,13 +652,8 @@key "httpRequest". It will not be used by any of the existingSolr components, but may be useful when developing customplugins.-- *** WARNING ***- Before enabling remote streaming, you should make sure your- system has authentication enabled.-->- <requestParsers enableRemoteStreaming="true"- enableStreamBody="true"+ <requestParsersmultipartUploadLimitInKB="-1"formdataUploadLimitInKB="-1"addHttpRequestToContext="false"/>diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adocindex be7fee07718..cf12269d9be 100644--- a/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc+++ b/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc@@ -227,8 +227,6 @@ See xref:deployment-guide:circuit-breakers.adoc[] for more detailsSee xref:requestdispatcher.adoc[] for defaults and acceptable values for these settings.* `requestDispatcher.handleSelect`-* `requestDispatcher.requestParsers.enableRemoteStreaming`-* `requestDispatcher.requestParsers.enableStreamBody`* `requestDispatcher.requestParsers.multipartUploadLimitInKB`* `requestDispatcher.requestParsers.formdataUploadLimitInKB`* `requestDispatcher.requestParsers.addHttpRequestToContext`diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/requestdispatcher.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/requestdispatcher.adocindex d706d5856aa..8e9b154f823 100644--- a/solr/solr-ref-guide/modules/configuration-guide/pages/requestdispatcher.adoc+++ b/solr/solr-ref-guide/modules/configuration-guide/pages/requestdispatcher.adoc@@ -48,32 +48,6 @@ See the section xref:requesthandlers-searchcomponents.adoc[] for more informatioThe `<requestParsers>` sub-element controls values related to parsing requests.This is an empty XML element that doesn't have any content, only attributes.-`enableRemoteStreaming`::-+-[%autowidth,frame=none]-|===-|Optional |Default: `false`-|===-+-Controls whether remote streaming of content is allowed.-When set to `false`, streaming will not be allowed.-Setting it to `true` lets you specify the location of content to be streamed using `stream.file` or `stream.url` parameters.--`enableStreamBody`::-+-[%autowidth,frame=none]-|===-|Optional |Default: `false`-|===-+-This attribute controls whether streaming content from the HTTP parameter `stream.body` is allowed.-When set to `false`, streaming will not be allowed.-Setting it to `true` lets you pass data in the `stream.body` parameter.-+-If you enable remote streaming, be sure that you have authentication enabled.-Otherwise, someone could potentially gain access to your content by accessing arbitrary URLs.-It's also a good idea to place Solr behind a firewall to prevent it from being accessed from untrusted clients.-`multipartUploadLimitInKB`::+[%autowidth,frame=none]@@ -107,45 +81,11 @@ This `HttpServletRequest` is not used by any Solr component, but may be useful w[source,xml]-----<requestParsers enableRemoteStreaming="false"- enableStreamBody="false"- multipartUploadLimitInKB="2048"+<requestParsers multipartUploadLimitInKB="2048"formdataUploadLimitInKB="2048"addHttpRequestToContext="false" />-----The below command is an example of how to enable RemoteStreaming and BodyStreaming through the xref:config-api.adoc#commands-for-common-properties[Config API]:--[.dynamic-tabs]----[example.tab-pane#v1enablestreaming]-====-[.tab-label]*V1 API*-[source,bash]------curl -H 'Content-type:application/json' -d '{"set-property": {"requestDispatcher.requestParsers.enableRemoteStreaming": true}, "set-property": {"requestDispatcher.requestParsers.enableStreamBody": true}}' http://localhost:8983/solr/gettingstarted/config------====--[example.tab-pane#v2enablestreaming]-====-[.tab-label]*V2 API User-Managed / Single-Node*-[source,bash]------curl -H 'Content-type:application/json' -d '{"set-property": {"requestDispatcher.requestParsers.enableRemoteStreaming": true}, "set-property":{"requestDispatcher.requestParsers.enableStreamBody": true}}' http://localhost:8983/api/cores/gettingstarted/config------====--[example.tab-pane#v2enablestreamingcloud]-====-[.tab-label]*V2 API SolrCloud*-[source,bash]------curl -H 'Content-type:application/json' -d '{"set-property": {"requestDispatcher.requestParsers.enableRemoteStreaming": true}, "set-property":{"requestDispatcher.requestParsers.enableStreamBody": true}}' http://localhost:8983/api/collections/gettingstarted/config------====----== httpCaching ElementThe `<httpCaching>` element controls HTTP cache control headers.diff --git a/solr/solr-ref-guide/modules/indexing-guide/pages/content-streams.adoc b/solr/solr-ref-guide/modules/indexing-guide/pages/content-streams.adocindex 55411b018d5..c5c53a8209a 100644--- a/solr/solr-ref-guide/modules/indexing-guide/pages/content-streams.adoc+++ b/solr/solr-ref-guide/modules/indexing-guide/pages/content-streams.adoc@@ -29,7 +29,9 @@ Currently request handlers can get content streams in a variety of ways:* For POST requests where the content-type is not `application/x-www-form-urlencoded`, the raw POST body is passed as a stream.The full POST body is parsed as parameters and included in the Solr parameters.* The contents of parameter `stream.body` is passed as a stream.-* If remote streaming is enabled and URL content is called for during request handling, the contents of each `stream.url` and `stream.file` parameters are fetched and passed as a stream.+Requires `SOLR_ENABLE_STREAM_BODY=true`.+* Each `stream.url` and `stream.file` parameters is resolved / fetched and passed as a stream.+Requires `SOLR_ENABLE_REMOTE_STREAMING=true`.By default, curl sends a `contentType="application/x-www-form-urlencoded"` header.If you need to test a SolrContentHeader content stream, you will need to set the content type with curl's `-H` flag.@@ -42,48 +44,14 @@ You could use remote streaming to send a remote or local file to an update plugiRemote streaming is disabled by default.Enabling it is not recommended in a production situation without additional security between you and untrusted remote clients.-In `solrconfig.xml`, you can enable it by changing the following `enableRemoteStreaming` parameter to `true`:--[source,xml]------ *** WARNING ***- Before enabling remote streaming, you should make sure your- system has authentication enabled.-- <requestParsers enableRemoteStreaming="false" />-------When `enableRemoteStreaming` is not specified in `solrconfig.xml`, the default behavior is to _not_ allow remote streaming (i.e., `enableRemoteStreaming="false"`).--Remote streaming can also be enabled through the xref:configuration-guide:config-api.adoc[] as follows:--[.dynamic-tabs]----[example.tab-pane#v1setconfigprop]-====-[.tab-label]*V1 API*-[source,bash]------curl -H 'Content-type:application/json' -d '{"set-property": {"requestDispatcher.requestParsers.enableRemoteStreaming":true}}' 'http://localhost:8983/solr/techproducts/config'------====--[example.tab-pane#v2setconfigprop]-====-[.tab-label]*V2 API*-[source,bash]------curl -X POST -H 'Content-type: application/json' -d '{"set-property": {"requestDispatcher.requestParsers.enableRemoteStreaming":true}}' 'http://localhost:8983/api/collections/techproducts/config'------====----[IMPORTANT]====-If `enableRemoteStreaming="true"` is used, be aware that this allows _anyone_ to send a request to any URL or local file.-If the <<Debugging Requests,DumpRequestHandler>> is enabled, it will allow anyone to view any file on your system.+If remote streaming is used, be aware that this allows _anyone_ to send a request to any URL or local file.+And with the <<Debugging Requests,DumpRequestHandler>> anyone can view what Solr has access to.====+Enable it with this environment variable: `SOLR_ENABLE_REMOTE_STREAMING=true`+The source of the data can be compressed using gzip, and Solr will generally detect this.The detection is based on either the presence of a `Content-Encoding: gzip` HTTP header or the file ending with .gz or .gzip.Gzip doesn't apply to `stream.body`.diff --git a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adocindex 250ae993d7e..ac21c45698c 100644--- a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc+++ b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc@@ -74,9 +74,14 @@ Please refer to the https://solr.apache.org/downloads.html[Solr Downloads] site* Solr now provides an xref:deployment-guide:shard-management.adoc#installsharddata["Install Shard"] API to allow users who have built (per-shard) indices offline to import them into SolrCloud shards.== Solr 9.3-=== Improvements to Solr CLI+=== Solr CLI* the bin/solr -i and bin/solr -info removed in favour of bin/solr status command.+=== Security+* Use of `stream.file`, `stream.url` and `stream.body` params are no longer enabled via configuration in solrconfig.xml, nor dynamic equivalents with the config API.+Older configuration now does nothing.+Instead, set an env var: SOLR_ENABLE_REMOTE_STREAMING or SOLR_ENABLE_STREAM_BODY or system property equivalents.+== Solr 9.2=== Upgrade to Jetty 10.x* Solr upgraded to Jetty 10.x from 9.x due to Jetty 9.x is now end of life. Jetty 10.x has a Java 11 minimum and matches Solr 9 minimum Java version. Jetty logging has been replaced with slf4j again matching Solr. See https://webtide.com/jetty-10-and-11-have-arrived/ for additional Jetty 10.x highlights.diff --git a/solr/solrj-streaming/src/test-files/solrj/solr/configsets/ml/conf/solrconfig.xml b/solr/solrj-streaming/src/test-files/solrj/solr/configsets/ml/conf/solrconfig.xmlindex dab985bb68e..78fb661213d 100644--- a/solr/solrj-streaming/src/test-files/solrj/solr/configsets/ml/conf/solrconfig.xml+++ b/solr/solrj-streaming/src/test-files/solrj/solr/configsets/ml/conf/solrconfig.xml@@ -37,7 +37,7 @@<requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /></requestDispatcher><requestHandler name="/select" class="solr.SearchHandler"/>diff --git a/solr/solrj-streaming/src/test-files/solrj/solr/configsets/streaming/conf/solrconfig.xml b/solr/solrj-streaming/src/test-files/solrj/solr/configsets/streaming/conf/solrconfig.xmlindex 69eb458d741..1ed5e84819c 100644--- a/solr/solrj-streaming/src/test-files/solrj/solr/configsets/streaming/conf/solrconfig.xml+++ b/solr/solrj-streaming/src/test-files/solrj/solr/configsets/streaming/conf/solrconfig.xml@@ -42,7 +42,7 @@</updateRequestProcessorChain><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /></requestDispatcher><requestHandler name="/select" class="solr.SearchHandler"/>diff --git a/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-follower1.xml b/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-follower1.xmlindex a68ac11ae08..ab2773d6eb4 100644--- a/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-follower1.xml+++ b/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-follower1.xml@@ -48,7 +48,7 @@<requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1"/>+ <requestParsers multipartUploadLimitInKB="-1"/><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>diff --git a/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-sql.xml b/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-sql.xmlindex f455443c2ed..5877db80888 100644--- a/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-sql.xml+++ b/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-sql.xml@@ -45,7 +45,7 @@</requestHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /></requestDispatcher><requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />diff --git a/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig.xml b/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig.xmlindex 3d3643d468a..bce00fec07a 100644--- a/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig.xml+++ b/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig.xml@@ -36,7 +36,7 @@</updateHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /></requestDispatcher><requestHandler name="/select" class="solr.SearchHandler"/>diff --git a/solr/solrj/src/test-files/solrj/solr/configsets/ml/conf/solrconfig.xml b/solr/solrj/src/test-files/solrj/solr/configsets/ml/conf/solrconfig.xmlindex dab985bb68e..78fb661213d 100644--- a/solr/solrj/src/test-files/solrj/solr/configsets/ml/conf/solrconfig.xml+++ b/solr/solrj/src/test-files/solrj/solr/configsets/ml/conf/solrconfig.xml@@ -37,7 +37,7 @@<requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /></requestDispatcher><requestHandler name="/select" class="solr.SearchHandler"/>diff --git a/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/solrconfig.xml b/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/solrconfig.xmlindex 7dffd915c85..11ea52b8da2 100644--- a/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/solrconfig.xml+++ b/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/solrconfig.xml@@ -36,7 +36,7 @@</updateHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /></requestDispatcher><requestHandler name="/select" class="solr.SearchHandler"/>diff --git a/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/solrconfig.xml b/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/solrconfig.xmlindex 69eb458d741..1ed5e84819c 100644--- a/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/solrconfig.xml+++ b/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/solrconfig.xml@@ -42,7 +42,7 @@</updateRequestProcessorChain><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /></requestDispatcher><requestHandler name="/select" class="solr.SearchHandler"/>diff --git a/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/solrconfig.xml b/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/solrconfig.xmlindex aab8d2787cd..15b73df7a87 100644--- a/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/solrconfig.xml+++ b/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/solrconfig.xml@@ -58,7 +58,7 @@</updateHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" formdataUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" formdataUploadLimitInKB="-1" /></requestDispatcher><requestHandler name="/select" class="solr.SearchHandler"/>diff --git a/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/solrconfig.xml b/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/solrconfig.xmlindex 99a57867247..53dab46b7c9 100644--- a/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/solrconfig.xml+++ b/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/solrconfig.xml@@ -58,7 +58,7 @@</updateHandler><requestDispatcher>- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="-1" formdataUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" formdataUploadLimitInKB="-1" /></requestDispatcher><requestHandler name="/select" class="solr.SearchHandler"/>diff --git a/solr/test-framework/src/java/org/apache/solr/util/RestTestHarness.java b/solr/test-framework/src/java/org/apache/solr/util/RestTestHarness.javaindex 6935a04cd11..05e56207b95 100644--- a/solr/test-framework/src/java/org/apache/solr/util/RestTestHarness.java+++ b/solr/test-framework/src/java/org/apache/solr/util/RestTestHarness.java@@ -18,7 +18,6 @@ package org.apache.solr.util;import java.io.Closeable;import java.io.IOException;-import java.net.URLEncoder;import java.nio.charset.StandardCharsets;import javax.xml.xpath.XPathConstants;import javax.xml.xpath.XPathExpressionException;@@ -209,7 +208,10 @@ public class RestTestHarness extends BaseTestHarness implements Closeable {@Overridepublic String update(String xml) {try {- return query("/update?stream.body=" + URLEncoder.encode(xml, "UTF-8"));+ HttpPost httpPost = new HttpPost(getBaseURL() + "/update");+ httpPost.setEntity(+ new StringEntity(xml, ContentType.create("application/xml", StandardCharsets.UTF_8)));+ return getResponse(httpPost);} catch (Exception e) {throw new RuntimeException(e);}diff --git a/solr/test-framework/src/test-files/solr/collection1/conf/solrconfig.xml b/solr/test-framework/src/test-files/solr/collection1/conf/solrconfig.xmlindex 44d64e1e119..9b66df4cc0e 100644--- a/solr/test-framework/src/test-files/solr/collection1/conf/solrconfig.xml+++ b/solr/test-framework/src/test-files/solr/collection1/conf/solrconfig.xml@@ -437,7 +437,7 @@</searchComponent><requestDispatcher>- <requestParsers enableRemoteStreaming="true" enableStreamBody="true" multipartUploadLimitInKB="-1" />+ <requestParsers multipartUploadLimitInKB="-1" /><httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"><cacheControl>max-age=30, public</cacheControl></httpCaching>