@c9up/vellum 0.1.2 → 0.1.4

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.
package/README.md CHANGED
@@ -318,6 +318,19 @@ signers: {
318
318
  }
319
319
  ```
320
320
 
321
+ **Where this signer's limits are.** It signs with `rsa`, whose modular
322
+ exponentiation is not constant-time — RUSTSEC-2023-0071, which recognises no
323
+ fixed release. Vellum blinds the operation, which is the mitigation the
324
+ advisory itself points to, and that is enough for a key you hold and use on
325
+ work your own application starts.
326
+
327
+ It is not enough when the signer is reachable from remote input: an HTTP
328
+ endpoint that signs on request, or a queue a client can feed, hands an
329
+ attacker both the timing and the repetition the attack needs. That deployment
330
+ wants an HSM, a remote signing service, or an audited constant-time backend —
331
+ `Signer` is an interface, so one can be dropped in without touching the rest.
332
+
333
+
321
334
  It builds a CAdES `SignedData` whose signed attributes carry the content type,
322
335
  the document's digest, the signing time and — as PAdES requires —
323
336
  `signing-certificate-v2`. That last one is not decoration: without it a
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c9up/vellum",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "PDF toolkit — convert PDF pages to images, author and inspect documents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -31,13 +31,16 @@
31
31
  "import": "./dist/services/main.js"
32
32
  }
33
33
  },
34
+ "engines": {
35
+ "node": ">=22.0.0"
36
+ },
34
37
  "devDependencies": {
35
- "@biomejs/biome": "^2.4.10",
38
+ "@biomejs/biome": "^2.5.12",
36
39
  "@c9up/ream": "^0.2.0",
37
- "@types/node": "^22.19.15",
38
- "@vitest/coverage-v8": "^4.1.2",
39
- "typescript": "^6.0.2",
40
- "vitest": "^4.1.2"
40
+ "@types/node": "^22.20.1",
41
+ "@vitest/coverage-v8": "4.1.11",
42
+ "typescript": "^6.0.3",
43
+ "vitest": "4.1.11"
41
44
  },
42
45
  "publishConfig": {
43
46
  "access": "public"
@@ -1,5 +1,5 @@
1
1
  import { copyFileSync, existsSync } from 'node:fs'
2
- import { dirname, join } from 'node:path'
2
+ import { dirname, join, resolve } from 'node:path'
3
3
  import { arch, env, platform } from 'node:process'
4
4
  import { fileURLToPath } from 'node:url'
5
5
 
@@ -20,16 +20,24 @@ const hostSuffixMap = {
20
20
  'darwin-x64': 'darwin-x64', 'darwin-arm64': 'darwin-arm64', 'win32-x64': 'win32-x64-msvc',
21
21
  }
22
22
 
23
+ // Cargo writes its artifacts under CARGO_TARGET_DIR when that is set — a
24
+ // shared cache, a CI mount — so they are not under this package's `target/` at
25
+ // all. A relative value is resolved against the directory cargo ran in, which
26
+ // is this package root.
27
+ const targetDir = env.CARGO_TARGET_DIR
28
+ ? resolve(root, env.CARGO_TARGET_DIR)
29
+ : join(root, 'target')
30
+
23
31
  const triple = env.CARGO_BUILD_TARGET ?? ''
24
32
  let suffix, os, releaseDir
25
33
  if (triple) {
26
34
  const entry = tripleMap[triple]
27
35
  if (!entry) throw new Error(`${TAG} unsupported CARGO_BUILD_TARGET: ${triple}`)
28
36
  suffix = entry.suffix; os = entry.os
29
- releaseDir = join(root, 'target', triple, 'release')
37
+ releaseDir = join(targetDir, triple, 'release')
30
38
  } else {
31
39
  suffix = hostSuffixMap[`${platform}-${arch}`]; os = platform
32
- releaseDir = join(root, 'target', 'release')
40
+ releaseDir = join(targetDir, 'release')
33
41
  if (!suffix) throw new Error(`${TAG} unsupported platform/arch: ${platform}-${arch}`)
34
42
  }
35
43