This is an automated email from the ASF dual-hosted git repository. tballison pushed a commit to branch TIKA-476x-merge-conflicts in repository https://gitbox.apache.org/repos/asf/tika.git
commit 4d91c53f28ac180ba3c3b92aa9d862e58890c269 Author: tallison <[email protected]> AuthorDate: Fri Jun 26 14:29:37 2026 -0400 TIKA-4764 and TIKA-4763 merge conflicts --- .../java/org/apache/tika/server/core/TikaServerProcess.java | 13 ++++++------- .../org/apache/tika/server/core/TikaServerProcessTest.java | 10 +++++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java b/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java index 7803e0a519..d5d9d859a3 100644 --- a/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java +++ b/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java @@ -398,13 +398,12 @@ public class TikaServerProcess { } // /pipes and /async fork processes and read/write via fetchers/emitters: never expose them - // unless the operator opted into unsecure features, even when explicitly listed. (The - // zero-endpoints branch only enables them when unsecure is on, so this won't false-fire.) - if ((addPipesResource || addAsyncResource) && !tikaServerConfig.isEnableUnsecureFeatures()) { - throw new TikaConfigException("The pipes/async endpoints require " + - "<enableUnsecureFeatures>true</enableUnsecureFeatures> in the server config: " + - "they fork processes and read/write via configured fetchers and emitters, so " + - "they are disabled by default even when explicitly listed as endpoints."); + // unless the operator set allowPipes, even when explicitly listed. (The zero-endpoints + // branch only enables them when allowPipes is set, so this won't false-fire.) + if ((addPipesResource || addAsyncResource) && !tikaServerConfig.isAllowPipes()) { + throw new TikaConfigException("The pipes/async endpoints require 'allowPipes' to be true " + + "in the server config: they fork processes and read/write via configured fetchers " + + "and emitters, so they are disabled by default even when explicitly listed as endpoints."); } if (addAsyncResource) { diff --git a/tika-server/tika-server-core/src/test/java/org/apache/tika/server/core/TikaServerProcessTest.java b/tika-server/tika-server-core/src/test/java/org/apache/tika/server/core/TikaServerProcessTest.java index 14cf63e48b..bfc52a4f80 100644 --- a/tika-server/tika-server-core/src/test/java/org/apache/tika/server/core/TikaServerProcessTest.java +++ b/tika-server/tika-server-core/src/test/java/org/apache/tika/server/core/TikaServerProcessTest.java @@ -28,17 +28,17 @@ import org.apache.tika.exception.TikaConfigException; public class TikaServerProcessTest { - private static TikaServerConfig config(boolean unsecure, String... endpoints) { + private static TikaServerConfig config(boolean allowPipes, String... endpoints) { TikaServerConfig c = new TikaServerConfig(); c.setEndpoints(new ArrayList<>(List.of(endpoints))); - c.setEnableUnsecureFeatures(unsecure); + c.setAllowPipes(allowPipes); return c; } @Test - public void pipesAndAsyncRequireUnsecureFeatures() { + public void pipesAndAsyncRequireAllowPipes() { // The pipes/async endpoints fork processes and read/write via fetchers/emitters; the - // start-guard must refuse them unless enableUnsecureFeatures is set, even when listed. + // start-guard must refuse them unless allowPipes is set, even when listed. assertThrows(TikaConfigException.class, () -> TikaServerProcess.loadCoreProviders(config(false, "pipes"), null)); assertThrows(TikaConfigException.class, @@ -46,7 +46,7 @@ public class TikaServerProcessTest { } @Test - public void ordinaryEndpointIsAllowedWithoutUnsecureFeatures() { + public void ordinaryEndpointIsAllowedWithoutAllowPipes() { // The guard must not false-fire on a non-forking endpoint. assertDoesNotThrow( () -> TikaServerProcess.loadCoreProviders(config(false, "meta"), null));
