From 1969b812d5a6aa60464cf6a6d9fc79465072cd78 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Tue, 1 Sep 2026 17:33:09 +0200 Subject: [PATCH] CAMEL-24422: docs - add the camel-docling input-source note to the 4.22 and 4.18 upgrade guides The camel-docling change shipped on three lines - 4.23.0, and by backport 4.22.1 and 4.18.5 - but only the 4_23 guide carried the note. The guides for every line live on main, so the 4.22.1 and 4.18.5 sections were missing a migration note for a changed default that affects them. Adds the same note to the "Upgrading from 4.22.0 to 4.22.1" and "Upgrading from 4.18.4 to 4.18.5" sections. The text applies verbatim to both lines: allowUrlSource, allowFilePathSource, inputBaseDirectory, the ungated header and typed bodies, the batch path containment and the File not found failure all behave the same there as on main. Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Andrea Cosentino --- .../pages/camel-4x-upgrade-guide-4_18.adoc | 30 +++++++++++++++++++ .../pages/camel-4x-upgrade-guide-4_22.adoc | 30 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc index 773d6e0c0297f..168d382da4566 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc @@ -13,6 +13,36 @@ See the xref:camel-upgrade-recipes-tool.adoc[documentation] page for details. == Upgrading from 4.18.4 to 4.18.5 +=== camel-docling + +A `String` message body is no longer interpreted as a location by default. Previously the producer +inspected the body and, when it started with `http://` or `https://`, handed it to Docling as a remote +URL to fetch; when it started with `/` or contained `\`, it read it from the local filesystem; otherwise +it converted it as document content. + +The two location readings must now be enabled explicitly: + +* `allowUrlSource` (default `false`) - interpret a body starting with `http://` or `https://` as a URL. +* `allowFilePathSource` (default `false`) - interpret a body starting with `/`, or containing `\`, as a + local file path. This also covers the single directory-or-file `String` body accepted by the batch + operations. + +A route that passes the document itself in the body is unaffected. A route that passes a URL or a path in +the body must set the matching option, otherwise the exchange fails with an `IllegalArgumentException` +naming the option to enable. + +The `CamelDoclingInputFilePath` header is unchanged and still accepts a path without any opt-in, as are +`File`, `byte[]` and `InputStream` bodies and the explicit path collections (`List`, `String[]`, +`List`, `File[]`) used by the batch operations. + +A new `inputBaseDirectory` option is also available. When set, every local input path - from the header, +from a file path body, and from the batch operations - must resolve inside that directory once normalized. +It is unset by default, which keeps the previous behaviour of accepting any path. + +Additionally, a local input path that does not exist is now reported as a `File not found` `IOException` +before Docling is invoked. Previously the size check silently skipped a path that resolved to nothing and +the failure surfaced later, from the Docling process or API call. + === camel-ftp, camel-sftp, camel-ftps, camel-mina-sftp, camel-azure-files, camel-smb The remote-file consumers now ensure the path resolved for a polled file stays within the directory being diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc index 91118ac92bf5b..181e07e3f4a4d 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc @@ -13,6 +13,36 @@ See the xref:camel-upgrade-recipes-tool.adoc[documentation] page for details. == Upgrading from 4.22.0 to 4.22.1 +=== camel-docling + +A `String` message body is no longer interpreted as a location by default. Previously the producer +inspected the body and, when it started with `http://` or `https://`, handed it to Docling as a remote +URL to fetch; when it started with `/` or contained `\`, it read it from the local filesystem; otherwise +it converted it as document content. + +The two location readings must now be enabled explicitly: + +* `allowUrlSource` (default `false`) - interpret a body starting with `http://` or `https://` as a URL. +* `allowFilePathSource` (default `false`) - interpret a body starting with `/`, or containing `\`, as a + local file path. This also covers the single directory-or-file `String` body accepted by the batch + operations. + +A route that passes the document itself in the body is unaffected. A route that passes a URL or a path in +the body must set the matching option, otherwise the exchange fails with an `IllegalArgumentException` +naming the option to enable. + +The `CamelDoclingInputFilePath` header is unchanged and still accepts a path without any opt-in, as are +`File`, `byte[]` and `InputStream` bodies and the explicit path collections (`List`, `String[]`, +`List`, `File[]`) used by the batch operations. + +A new `inputBaseDirectory` option is also available. When set, every local input path - from the header, +from a file path body, and from the batch operations - must resolve inside that directory once normalized. +It is unset by default, which keeps the previous behaviour of accepting any path. + +Additionally, a local input path that does not exist is now reported as a `File not found` `IOException` +before Docling is invoked. Previously the size check silently skipped a path that resolved to nothing and +the failure surfaced later, from the Docling process or API call. + === camel-exec `allowControlHeaders` is now annotated `security = "insecure:dev"`.