imprimatur 0.6.0-aarch64-linux-gnu → 0.6.1-aarch64-linux-gnu
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -5
- data/README.md +18 -7
- data/lib/imprimatur/4.0/imprimatur-render-worker +0 -0
- data/lib/imprimatur/4.0/imprimatur_native.so +0 -0
- data/lib/imprimatur/pdf_reader.rb +6 -4
- data/lib/imprimatur/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0c846ab26c3cce1cfd29ad57abec947eac5c8df63a8632edc28449b7130aa6ff
|
|
4
|
+
data.tar.gz: 9df791e2413c83d76620a696fb8f0a8b24c13504637ae08663f027fb695c90da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d889377347b347029cef45c2bdeb0d721b10bd9f7a67320a3358e7a49a83a92f3280b7dd43700f70cc33e9a773cf742cb61b88cfb4bc032821386720c8dbbd0b
|
|
7
|
+
data.tar.gz: 82311d23c3f95907dd1c3bf97e7da8c2e15c5faf466006d1250b950c2c5a33c5018e157f5479b50979426eea7b8766c74e1c78ca17cda66440163b9b63101fca
|
data/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
- Isolate PDF metadata and text reads in the bundled resource-limited Rust
|
|
6
|
+
worker, as rendering already is; all three accept `memory_bytes:`.
|
|
7
|
+
- On Linux/FreeBSD, re-exec the worker under its address-space limit before
|
|
8
|
+
reading the PDF, including tiny metadata-only reads.
|
|
9
|
+
- Preserve completed pages on worker termination and recover healthy neighbors
|
|
10
|
+
after page-local stream limits without renewing the overall deadline.
|
|
11
|
+
- Allow a bounded exit grace when macOS cannot inspect an exiting worker;
|
|
12
|
+
persistent monitor failures still terminate and reap a live worker.
|
|
13
|
+
|
|
14
|
+
## [0.6.1](https://github.com/seuros/imprimatur/compare/v0.6.0...v0.6.1) (2026-10-25)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **pdf:** isolate bounded reads and preserve page recovery ([fbfbbc5](https://github.com/seuros/imprimatur/commit/fbfbbc5e7e44768efae293b37be255b8b797f831))
|
|
10
20
|
|
|
11
21
|
## [0.6.0](https://github.com/seuros/imprimatur/compare/v0.5.0...v0.6.0) (2026-10-25)
|
|
12
22
|
|
data/README.md
CHANGED
|
@@ -362,20 +362,31 @@ before allocation (`max_pixels:`, 4 million) and encoded output
|
|
|
362
362
|
(`max_output_bytes:`, 8 MiB). Preflight rejects pages drawing more than 40 million
|
|
363
363
|
source-image pixels. Renderer warnings fail instead of silently dropping content.
|
|
364
364
|
The crate exposes `read::pdf::{info, pages, render_page}` (`render` feature) and
|
|
365
|
-
`read::pdf::isolation::render_page_isolated`
|
|
366
|
-
|
|
367
|
-
The gem bundles that worker and always
|
|
368
|
-
back to
|
|
365
|
+
`read::pdf::isolation::{info_isolated, pages_isolated, render_page_isolated}`
|
|
366
|
+
(`isolation` feature). These take an absolute path to the trusted
|
|
367
|
+
`imprimatur-render-worker` executable. The gem bundles that worker and always
|
|
368
|
+
isolates all three PDF operations; it never falls back to in-process parsing
|
|
369
|
+
or searches PATH.
|
|
369
370
|
|
|
370
|
-
All three accept the normal read limits
|
|
371
|
+
All three accept the normal read limits and `memory_bytes:`
|
|
371
372
|
(1 GiB by default): Linux/FreeBSD enforce an address-space cap; macOS uses a
|
|
372
373
|
sampled RSS watchdog, which can briefly overshoot. A worker is killed and reaped
|
|
373
|
-
on timeout, cancellation or supervisor failure.
|
|
374
|
+
on timeout, cancellation or supervisor failure. Each operation has a mandatory
|
|
374
375
|
60-second process ceiling even with `timeout: nil`; a shorter `timeout:` still
|
|
375
376
|
applies. CPU time, output files and core dumps are also limited.
|
|
376
377
|
|
|
378
|
+
The page worker flushes completed records as it goes. An exhausted stream
|
|
379
|
+
budget triggers individual-page recovery inside that worker: each attempt has
|
|
380
|
+
its own `max_inflated` allowance, while the original overall deadline, process
|
|
381
|
+
memory limit and aggregate text cap remain in force. An oversized page is
|
|
382
|
+
`failed`, not blank, without discarding healthy neighbors. A worker terminated
|
|
383
|
+
after metadata was read preserves completed pages and explicitly marks the
|
|
384
|
+
unreached pages; an expired overall deadline marks them `skipped`. Cancellation
|
|
385
|
+
still raises rather than returning a partial successful call.
|
|
386
|
+
|
|
377
387
|
This is resource containment, **not a filesystem/network security sandbox**.
|
|
378
|
-
The raw crate `render_page`
|
|
388
|
+
The raw crate `info`, `pages` and `render_page` APIs remain in-process;
|
|
389
|
+
`render_page` cannot interrupt Hayro.
|
|
379
390
|
`max_inflated` bounds our preflight, not Hayro's internal decoders.
|
|
380
391
|
|
|
381
392
|
```ruby
|
|
Binary file
|
|
Binary file
|
|
@@ -3,16 +3,18 @@
|
|
|
3
3
|
module Imprimatur
|
|
4
4
|
# Keyword handling only; parsing, limits and rendering live in the native core.
|
|
5
5
|
module PdfReader
|
|
6
|
-
def self.info(document, max_bytes: nil, **limits)
|
|
7
|
-
JSON.parse(Native.pdf_info(Reader.read(document, max_bytes), Reader.limits(max_bytes:, **limits)
|
|
6
|
+
def self.info(document, memory_bytes: 1024 * 1024 * 1024, max_bytes: nil, **limits)
|
|
7
|
+
JSON.parse(Native.pdf_info(Reader.read(document, max_bytes), Reader.limits(max_bytes:, **limits),
|
|
8
|
+
RENDER_WORKER, memory_bytes),
|
|
8
9
|
symbolize_names: true)
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
def self.pages(document, first_page: 1, last_page: 0xFFFFFFFF, max_pages: 500,
|
|
12
13
|
max_page_bytes: 256 * 1024, max_output_bytes: 8 * 1024 * 1024,
|
|
13
|
-
max_bytes: nil, **limits)
|
|
14
|
+
memory_bytes: 1024 * 1024 * 1024, max_bytes: nil, **limits)
|
|
14
15
|
options = [first_page, last_page, max_pages, max_page_bytes, max_output_bytes]
|
|
15
|
-
JSON.parse(Native.pdf_pages(Reader.read(document, max_bytes), Reader.limits(max_bytes:, **limits),
|
|
16
|
+
JSON.parse(Native.pdf_pages(Reader.read(document, max_bytes), Reader.limits(max_bytes:, **limits),
|
|
17
|
+
options, RENDER_WORKER, memory_bytes),
|
|
16
18
|
symbolize_names: true)
|
|
17
19
|
end
|
|
18
20
|
|
data/lib/imprimatur/version.rb
CHANGED