Skip to content

Commit afcec06

Browse files
committed
Merge remote-tracking branch 'origin/main' into TIKA-4816-metadata-key-api
2 parents ffcbacc + 9c29b46 commit afcec06

117 files changed

Lines changed: 2696 additions & 2117 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main-jdk17-build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,7 @@ jobs:
6565
java-version: ${{ matrix.java }}
6666
cache: 'maven'
6767
- name: Run E2E Tests
68-
run: mvn -pl tika-e2e-tests -am clean verify -Pe2e -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
68+
# -pl must name the leaf modules: tika-e2e-tests is an aggregator pom, and Maven
69+
# does not pull in a selected aggregator's children, so this job built two pom-only
70+
# modules and ran zero tests while reporting green.
71+
run: mvn -pl :tika-e2e-tests-server,:tika-grpc-e2e-test -am clean verify -Pe2e -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"

CHANGES.txt

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,79 @@ Release 4.0.0 - ???
3030
API cleanups (cf: prefix, writelimiter package, smaller removals) are
3131
enumerated in the migration guide, migrating-to-4x.adoc (TIKA-4816).
3232

33+
* tika-server: the /translate endpoints have been removed (TIKA-4809).
34+
35+
* tika-server: /detect/stream and /language/stream and /language/string have
36+
been collapsed into /detect and /language (TIKA-4809).
37+
38+
* tika-server: caller errors now map to accurate HTTP status codes instead of
39+
always returning 200 or 500. A saturated worker pool returns 429, a
40+
crashed/timed-out/OOM worker returns 503, an unknown or reserved
41+
fetcher/emitter or bad handler returns 400, and an over-limit body returns
42+
413; the 429 and 503 responses carry a Retry-After header (TIKA-4809).
43+
44+
* tika-server: the bare /tika endpoint now returns Markdown too (was XHTML),
45+
completing the Markdown default (TIKA-4663); use /tika/xml for XHTML (TIKA-4809).
46+
47+
* tika-server: request bodies are now capped by maxRequestSizeBytes,
48+
defaulting to 1 GiB; larger requests are rejected with 413, including
49+
over-limit chunked uploads, which previously surfaced as an empty 500
50+
(TIKA-4809).
51+
52+
* tika-server: a /meta request with no Accept header now returns JSON;
53+
3.x returned CSV. CSV is still available via Accept: text/csv (TIKA-4809).
54+
55+
* tika-server: the raw /tika family's 422 responses carry the extracted
56+
content only; the exception is no longer appended to the body -- use
57+
/rmeta for the structured exception (TIKA-4809).
58+
59+
* tika-server: /async validates fetcher/emitter ids at POST time (400),
60+
rejects a batch larger than the queue's total capacity with 400 instead
61+
of throttling it, and one bad tuple no longer stops the async workers
62+
(TIKA-4809).
63+
64+
* tika-server: /pipes returns 400 with the reason for a malformed request
65+
body and rejects emit strategies other than EMIT_ALL, whose passed-back
66+
data the /pipes response cannot carry (TIKA-4809).
67+
68+
* tika-server: the 'endpoints' allowlist now also gates SPI-provided
69+
resources; a discovered resource binds only when its root endpoint is
70+
enabled (TIKA-4809).
71+
72+
* FetchEmitTuple JSON now names the per-tuple parse context "parse-context"
73+
(was "parseContext") and rejects unknown tuple fields with an error naming
74+
the field (TIKA-4809).
75+
76+
* The pipes config keys staleFetcherTimeoutSeconds and
77+
staleFetcherDelaySeconds have been removed; a config still carrying them
78+
fails startup (TIKA-4809).
79+
80+
* ExceptionUtils.trimMessage has been removed from tika-core; it moved into
81+
tika-eval-core (TIKA-4809).
82+
83+
* BasicContentHandlerFactory.parseHandlerType now throws
84+
IllegalArgumentException for an unrecognized handler name instead of
85+
silently returning the supplied default (TIKA-4809).
86+
87+
* HttpClientFactory's inert redirect-host allowlist accessors
88+
(get/setAllowedHostsForRedirect) have been removed (TIKA-4809).
89+
90+
* TimeoutLimits: progressTimeoutMillis of 0 combined with a positive
91+
totalTaskTimeoutMillis is now rejected at config load; it would kill
92+
every task immediately (TIKA-4809).
93+
94+
* The http-fetcher now verifies TLS certificates and hostnames by default;
95+
set verifySsl:false to opt out (TIKA-4809).
96+
97+
* tika-server: /pipes returns the same JSON body as /tika/rmeta/unpack --
98+
{"status":<RESULT_STATUS>,"message":...} -- instead of a /pipes-only
99+
{"status":"ok"|"process_crash",...} shape (TIKA-4809).
100+
101+
* tika-server: POST /async requires an object body {"tuples":[...]} instead of
102+
a bare JSON array (TIKA-4809).
103+
104+
* tika-server: the tika-server-client module has been removed (TIKA-4809).
105+
33106
NEW FEATURES
34107

35108
* Content-based detection of ASN.1/DER crypto containers at parse time. An
@@ -41,6 +114,13 @@ Release 4.0.0 - ???
41114
* MagicDetector now compiles its regular expression once, in the
42115
constructor, instead of recompiling it on every match (TIKA-4796).
43116

117+
* Unified timeout model across the library, pipes, and server: a total-task
118+
budget plus a progress/stall timeout, composed recursively over embedded
119+
documents (TIKA-4813).
120+
121+
* tika-server: /meta now runs through the same pipes-backed parser as the
122+
other extraction endpoints (TIKA-4809).
123+
44124
* tika-grpc's fetchAndParseServerSideStreaming now completes the call
45125
after delivering its reply, instead of leaving the client waiting
46126
for a terminal signal that never came (TIKA-4804).

docs/modules/ROOT/pages/advanced/integration-testing/run-uat-script.adoc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ release-tools/uat/
3636

3737
== What it covers
3838

39-
Roughly 25 REST endpoint checks across the default-mode endpoints, header
39+
Roughly 30 REST endpoint checks across the default-mode endpoints, header
4040
behavior, and error handling — the same surface enumerated in the manual
4141
walkthrough at xref:advanced/integration-testing/tika-server.adoc[Tika-Server
4242
Integration Testing], translated to bash + curl assertions.
4343

4444
Coverage includes:
4545

4646
* `/version`, `/parsers`, `/detectors`, `/mime-types` (introspection)
47-
* `/detect/stream` (mime detection)
47+
* `/detect` (mime detection)
4848
* `/tika`, `/tika/text`, `/tika/xml`, `/tika/json` (parse)
4949
* `/meta`, `/meta/\{field}` (metadata)
5050
* `/rmeta`, `/rmeta/text` (recursive metadata)
5151
* `/unpack/all` (embedded extraction; verifies the response is a valid zip)
52-
* `/language/stream`
52+
* `/language`
5353
* `/meta/form`, `/rmeta/form` (multipart variants)
5454
* `allowPerRequestConfig=false` gating, both enforcement points: the path-based
5555
filter (`/meta/config`, `/rmeta/config`, `/tika/config`, `/unpack/all/config` all
@@ -59,6 +59,14 @@ Coverage includes:
5959
* `/status` is not registered by default (returns 404 unless explicitly listed
6060
under `endpoints`)
6161
* `X-Tika-OCRskipOcr` header
62+
* Handler selection: `/tika/text` is body-only (no `<title>` in the output),
63+
`/tika/json` with no handler named matches `/tika/json/md` (markdown is the
64+
default), and an unrecognized handler name returns 400 rather than silently
65+
falling back
66+
* `/meta` with `Accept: application/rdf+xml` returns XMP -- content negotiation,
67+
not a distinct path. Worth a smoke check because this shipped broken in
68+
4.0.0-alpha-1 and beta-1: the resource failed to load and the endpoint 406'd
69+
* Removed endpoints stay removed (`/translate/*` returns 404)
6270
* 404 / 405 error handling
6371
* OCR (`PUT /tika/text` of an image whose text only exists as pixels): skipped when the
6472
server has no tesseract (the minimal image / a plain `java -jar` server), and a hard

docs/modules/ROOT/pages/advanced/integration-testing/tika-app.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ Create `/tmp/tika-app-test/my-config.json`:
244244
"basic-content-handler-factory": {
245245
"type": "TEXT",
246246
"writeLimit": 100000,
247-
"throwOnWriteLimitReached": false
247+
"throwOnWriteLimit": false
248248
}
249249
},
250250
"parsers": [

docs/modules/ROOT/pages/advanced/integration-testing/tika-server.adoc

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ curl -s http://localhost:9998/version
5757

5858
*Expected:* `Apache Tika X.X.X`
5959

60-
=== Test 2: PUT /detect/stream
60+
=== Test 2: PUT /detect
6161

6262
[source,bash]
6363
----
64-
curl -s -X PUT -T testPDF.pdf http://localhost:9998/detect/stream
64+
curl -s -X PUT -T testPDF.pdf http://localhost:9998/detect
6565
----
6666

6767
*Expected:* `application/pdf`
@@ -118,7 +118,8 @@ curl -s -X PUT -H "Accept: application/json" -T testPDF.pdf http://localhost:999
118118
curl -s -X PUT -T testPDF.pdf http://localhost:9998/meta/Content-Type
119119
----
120120

121-
*Expected:* `Content-Type,application/pdf`
121+
*Expected:* JSON containing only the requested field: `{"Content-Type":"application/pdf"}`
122+
(the header-less default is JSON; add `-H "Accept: text/csv"` for `Content-Type,application/pdf`)
122123

123124
=== Test 9: PUT /rmeta
124125

@@ -138,11 +139,11 @@ curl -s -X PUT -T test_recursive_embedded.docx http://localhost:9998/rmeta/text
138139

139140
*Expected:* JSON array with ToTextContentHandler content.
140141

141-
=== Test 11: PUT /language/stream
142+
=== Test 11: PUT /language
142143

143144
[source,bash]
144145
----
145-
curl -s -X PUT -T testPDF.pdf http://localhost:9998/language/stream
146+
curl -s -X PUT -T testPDF.pdf http://localhost:9998/language
146147
----
147148

148149
*Expected:* Two-letter language code (e.g., `en`, `th`).
@@ -155,7 +156,8 @@ curl -s -X PUT -T test_recursive_embedded.docx http://localhost:9998/unpack/all
155156
unzip -l /tmp/unpack.zip
156157
----
157158

158-
*Expected:* ZIP file containing extracted embedded files plus `__TEXT__` and `__METADATA__` files.
159+
*Expected:* ZIP file containing the extracted embedded files, a `*.metadata.json` entry
160+
per file, and the original container document.
159161

160162
=== Test 13: GET /parsers
161163

@@ -406,7 +408,7 @@ The following endpoints were tested and verified working:
406408
|Endpoint |Method |Status
407409

408410
|`/version` |GET |PASS
409-
|`/detect/stream` |PUT |PASS
411+
|`/detect` |PUT |PASS
410412
|`/tika` |PUT |PASS
411413
|`/tika/text` |PUT |PASS
412414
|`/tika/html` |PUT |PASS
@@ -416,7 +418,7 @@ The following endpoints were tested and verified working:
416418
|`/meta/\{field}` |PUT |PASS
417419
|`/rmeta` |PUT |PASS
418420
|`/rmeta/text` |PUT |PASS
419-
|`/language/stream` |PUT |PASS
421+
|`/language` |PUT |PASS
420422
|`/unpack/all` |PUT |PASS
421423
|`/parsers` |GET |PASS
422424
|`/detectors` |GET |PASS
@@ -445,7 +447,7 @@ The following endpoints were tested and verified working:
445447

446448
=== Issue 1: Language Detection Accuracy
447449

448-
Short texts may not be detected reliably. The `/language/stream` endpoint works best with substantial text content.
450+
Short texts may not be detected reliably. The `/language` endpoint works best with substantial text content.
449451

450452
== Quick Reference
451453

@@ -478,7 +480,7 @@ curl -X PUT -T file.docx http://localhost:9998/rmeta/text
478480
=== Detection
479481
[source,bash]
480482
----
481-
curl -X PUT -T file.pdf http://localhost:9998/detect/stream
483+
curl -X PUT -T file.pdf http://localhost:9998/detect
482484
----
483485

484486
=== Extract Embedded Files

0 commit comments

Comments
 (0)