@blamejs/core 0.9.16 → 0.9.18
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/CHANGELOG.md +2 -0
- package/MIGRATING.md +23 -1
- package/lib/acme.js +2 -2
- package/lib/api-snapshot.js +1 -1
- package/lib/app-shutdown.js +2 -2
- package/lib/app.js +2 -2
- package/lib/argon2-builtin.js +1 -1
- package/lib/atomic-file.js +8 -8
- package/lib/audit-sign.js +3 -3
- package/lib/audit-tools.js +2 -2
- package/lib/auth/dpop.js +1 -1
- package/lib/auth/elevation-grant.js +1 -1
- package/lib/auth/jwt-external.js +1 -1
- package/lib/auth/jwt.js +1 -1
- package/lib/auth/oauth.js +1 -1
- package/lib/auth/status-list.js +1 -1
- package/lib/backup/bundle.js +2 -2
- package/lib/backup/index.js +7 -7
- package/lib/bundler.js +4 -4
- package/lib/cli.js +1 -1
- package/lib/cloud-events.js +1 -1
- package/lib/compliance-sanctions.js +1 -1
- package/lib/crypto-hpke.js +1 -1
- package/lib/crypto.js +3 -3
- package/lib/daemon.js +2 -2
- package/lib/db-file-lifecycle.js +5 -5
- package/lib/db-schema.js +1 -1
- package/lib/db.js +2 -2
- package/lib/dev.js +5 -5
- package/lib/dr-runbook.js +2 -2
- package/lib/external-db-migrate.js +1 -1
- package/lib/flag-evaluation-context.js +1 -1
- package/lib/flag-providers.js +1 -1
- package/lib/http-client.js +11 -11
- package/lib/http-message-signature.js +1 -1
- package/lib/keychain.js +2 -2
- package/lib/local-db-thin.js +2 -2
- package/lib/log-stream-local.js +3 -3
- package/lib/log-stream-syslog.js +4 -4
- package/lib/mail-arc-sign.js +1 -1
- package/lib/mail-dkim.js +1 -1
- package/lib/mail.js +5 -5
- package/lib/middleware/asyncapi-serve.js +1 -1
- package/lib/middleware/body-parser.js +4 -4
- package/lib/middleware/openapi-serve.js +1 -1
- package/lib/middleware/tus-upload.js +1 -1
- package/lib/migrations.js +1 -1
- package/lib/mtls-ca.js +4 -4
- package/lib/network-smtp-policy.js +1 -1
- package/lib/ntp-check.js +1 -1
- package/lib/object-store/azure-blob.js +3 -3
- package/lib/object-store/gcs.js +3 -3
- package/lib/object-store/http-put.js +1 -1
- package/lib/object-store/local.js +3 -3
- package/lib/object-store/sigv4-bucket-ops.js +1 -1
- package/lib/object-store/sigv4.js +3 -3
- package/lib/observability.js +1 -1
- package/lib/process-spawn.js +2 -2
- package/lib/restore-bundle.js +2 -2
- package/lib/restore-rollback.js +4 -4
- package/lib/restore.js +3 -3
- package/lib/retry.js +1 -1
- package/lib/router.js +4 -4
- package/lib/safe-url.js +2 -2
- package/lib/sandbox.js +1 -1
- package/lib/security-assert.js +1 -1
- package/lib/seeders.js +2 -2
- package/lib/self-update-standalone-verifier.js +2 -2
- package/lib/self-update.js +5 -5
- package/lib/session-device-binding.js +1 -1
- package/lib/storage.js +1 -1
- package/lib/template.js +2 -2
- package/lib/totp.js +1 -1
- package/lib/vault/index.js +2 -2
- package/lib/vault/passphrase-ops.js +2 -2
- package/lib/vault/passphrase-source.js +2 -2
- package/lib/vault/rotate.js +7 -7
- package/lib/vault/seal-pem-file.js +8 -8
- package/lib/vendor-data.js +1 -1
- package/lib/watcher.js +4 -4
- package/lib/webhook.js +1 -1
- package/lib/websocket.js +3 -3
- package/lib/ws-client.js +6 -6
- package/package.json +1 -1
- package/sbom.cdx.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,8 @@ upgrading across more than a few patches at a time.
|
|
|
8
8
|
|
|
9
9
|
## v0.9.x
|
|
10
10
|
|
|
11
|
+
- v0.9.18 (2026-05-14) — **18 CodeQL alerts closed across 4 rule classes + SECURITY.md hardening checklist additions for v0.9.13+ primitives + MIGRATING.md out-of-band breaking-changes section.** Post-v0.9.17 audit identified 18 pre-existing CodeQL security findings on `main` — accumulated over many releases, surfaced explicitly when v0.9.15's rename sweep changed line content. v0.9.18 closes them all. (1) **`js/file-system-race` (6 sites)** — TOCTOU between `fs.existsSync()` / `fs.statSync()` and a subsequent file op. Fixed via the framework's canonical TOCTOU-safe-read scaffold (open fd first → `fstatSync` → `readSync` loop → `closeSync` in `finally`) at `lib/atomic-file.js` (`_readSyncCore`), `lib/restore-rollback.js` (marker write switched to exclusive-create `wx` + EEXIST-tolerant), `lib/network-tls.js` (`_readPathFile` extraction with per-file ENOENT tolerance), `lib/backup/bundle.js` (open-fd-first plus required-vs-skip branch routing), `lib/static.js` (request-serve hot path narrowed to single fd). `lib/vault/seal-pem-file.js` retained as-is with a CodeQL suppression — the site has an in-line `lstat.ino === fstat.ino` inode-equality defense (line 290) that refuses with `seal-pem-file/toctou-detected` if an attacker swaps the file between `lstat` and `open`. (2) **`js/insecure-temporary-file` (6 sites)** — predictable temp paths. `lib/vault/rotate.js` now uses `mkdtempSync` for a per-rotation random scratch dir + plain filenames inside (replaces the predictable `_blamejs_rotate.tmp.db` / `_blamejs_verify.tmp.db` paths in `stagingDir`). `lib/mtls-ca.js` switched to exclusive-create `openSync(..., "wx", 0o600)` + `writeSync` + `fsyncSync` so an attacker pre-creating the path is refused at `EEXIST`. `lib/atomic-file.js` (`fsyncDir`), `lib/vault/rotate.js` (`_fsyncFileByPath`), `lib/http-client.js` (atomic tmp path) retained as-is with suppressions — `dirPath` / `p` are operator-supplied framework data paths (not `os.tmpdir`-reachable), and `tmpPath` carries 16 hex chars of crypto-random suffix (line 1802 `dest + ".tmp-" + bCrypto.generateToken(8)`). (3) **`js/path-injection` (2 sites in `lib/static.js`)** — `nodeFs.createReadStream(absPath)` in `_readMeta` (line 161) and the request-serve hot path (line 1115). Suppression comments added referencing the upstream `_resolveSafe` lexical-resolve + `startsWith(rootResolved + nodePath.sep)` + realpath escape check at lines 181-207 — `absPath` is sandbox-validated against `root` before reaching these lines. (4) **`js/remote-property-injection` (4 sites)** — `lib/websocket.js` (`ext.params: {}` → `Object.create(null)`), `lib/middleware/csrf-protect.js` (`var out = {}` → `Object.create(null)` for cookie-parse output). `lib/middleware/body-parser.js` (multipart `fields[currentField] = ...`) retained as-is with suppression — `currentField` is gated upstream at line 867 by `POISONED_KEYS = new Set(["__proto__", "constructor", "prototype"])` refusing the field BEFORE assignment with a 400 BodyParserError. **Plus: SECURITY.md hardening checklist** gains 5 lines covering `b.middleware.idempotencyKey.dbStore` (hash + seal defaults), `b.metrics.snapshot` (out-of-process metrics export), `b.selfUpdate.standaloneVerifier` (zero-dep install-pipeline verifier), `b.pqcAgent.reload` (TLS-posture refresh without restart), `b.crypto.hashFilesParallel` (parallel SBOM/integrity-sweep hashing). **Plus: MIGRATING.md** now carries an "Out-of-band breaking changes" section (the v0.9.15 dbStore schema break is the first entry); `scripts/gen-migrating.js` extended with an `OUT_OF_BAND_BREAKS` table so future schema/on-disk format breaks land in MIGRATING.md without operators needing to grep CHANGELOG.
|
|
12
|
+
- v0.9.17 (2026-05-14) — **Two new `codebase-patterns` detectors + 192-site cleanup sweep — `node:` prefix consistency + internal-binding leak prevention.** Post-v0.9.16 audit surfaced two enforceable invariants the existing detectors didn't cover. (1) **`node-builtin-prefix` detector** — every `require("<X>")` of a Node built-in (`fs`, `path`, `crypto`, `stream`, `tls`, `url`, `os`, `net`, `http`, `http2`, `https`, `zlib`, `dgram`, `events`, `child_process`, `readline`, …) must use the modern `require("node:<X>")` form. Three reasons: (a) userland packages on npm CAN be named after built-ins, so without the `node:` prefix a typo or `npm install` accident could shadow the built-in; (b) the prefix is a clearer at-a-glance signal that the dependency is on Node, not on a userland module; (c) bundler / SEA static-trace passes treat `node:` prefix as an unambiguous Node-builtin marker. Sweep: 153 `require()` rewrites across 79 framework files (2 parallel agents). The detector skips JSDoc `@example` block continuation lines (`*`-prefixed), so operator-facing examples that show `var fs = require("fs")` aren't rewritten — operators write their own bindings however they prefer. (2) **`internal-binding-in-prose` detector** — internal binding names (`nodeFs` / `nodePath` / `nodeCrypto` / `nodeStream` / `nodeTls` / `nodeUrl` / `bCrypto` / `retryHelper`) must NOT appear in operator-facing surface: JSDoc/comment continuation lines or string literals (error messages, audit metadata). Operators see the public API name (`path` / `fs` / `crypto` / `retry` / …), never the framework's internal alias. Sweep: 39 prose-leak fixes across 16 files — comments rewritten to use the operator-facing word (`nodePath` → `path`, `nodeFs.watch failed` → `fs.watch failed`, debug-log `"op": "nodeFs.unlinkSync"` → `"op": "fs.unlinkSync"`). (3) **2 follow-on require-binding canonicalizations** surfaced by the node-prefix sweep — `lib/ws-client.js` now destructures `var { EventEmitter } = require("node:events")` (was binding the entire `events` module to a class-shaped name) and `lib/process-spawn.js` renames inline `nodeChild` → `childProcess` (matches the module-level `childProcess` lazyRequire in `lib/dev.js`).
|
|
11
13
|
- v0.9.16 (2026-05-14) — **Operator-facing prose cleanup + `require-binding-name` detector now covers `lazyRequire` wrappers + dbStore seal round-trip test added.** Post-v0.9.15 audit surfaced three classes of follow-up. (1) **Operator-facing prose leaks (7 sites)** — the v0.9.15 mechanical rename pattern `<OLD>.` → `<NEW>.` also caught occurrences inside JSDoc `@opts` comments and error-message string literals, so operators reading `b.keychain.create(opts)` saw `// absolute nodePath; required if file fallback may engage` instead of `// absolute path`. Fixed: `lib/db.js` (stream-limit error), `lib/keychain.js` (fallback-file error + 3 JSDoc lines), `lib/restore-bundle.js` (staging-dir error), `lib/watcher.js` (fs.watch failure error). Operators see plain English; internal binding names stay internal. (2) **`require-binding-name` detector extended to cover `lazyRequire`** — the v0.9.15 detector only matched plain `var X = require("M")` and missed the framework's `var X = lazyRequire(function () { return require("M"); })` pattern (used to break load cycles). 34 additional inconsistencies surfaced (`auditFwk` / `auditMod` / `auditModule` / `lazyAudit` → `audit`, `crypto` / `fwCrypto` → `bCrypto`, `dbMod` / `dbModule` → `db`, etc.) — every minority site renamed per the same canonical-name map. (3) **dbStore seal round-trip test** — the v0.9.15 test suite covered seal-falls-back-when-vault-not-ready and cross-process-sealed-row-preserved, but did NOT exercise the actual default-ON seal/unseal path because the test environment didn't `b.vault.init(...)`. New `testDbStoreSealRoundTripWithVault` bootstraps a plaintext vault, builds a dbStore with `seal: true`, writes a record + reads it back, and asserts (a) `headers` + `body` columns carry the `vault:` envelope on disk, (b) the round-trip restores the original values, and (c) `status_code` stays plaintext so forensic SELECTs still work without unsealing.
|
|
12
14
|
- v0.9.15 (2026-05-13) — **`b.middleware.idempotencyKey.dbStore` hardening + framework-wide `require()` binding-name consistency.** Two operator-surfaced gaps closed: (1) **dbStore now hashes keys + seals body/headers by default.** Operator-supplied idempotency keys sometimes carry PII (order numbers, emails, vendor prefixes); the `k` column previously stored them raw, leaving every DB dump as a PII surface. v0.9.15 sha3-512 namespace-hashes the key via `b.crypto.namespaceHash("idempotency-key", key)` before insert/lookup — round-trips are transparent (operators still pass raw keys), but the DB never sees the original. The schema also splits the previous single-`v` JSON-envelope column into discrete `fingerprint` / `status_code` / `headers` / `body` / `expires_at` columns; `headers` + `body` are sealed via `b.cryptoField.sealRow` (vault-managed AEAD envelope) when vault is initialized, so a DB dump leaks neither cached response bodies nor headers. Non-sealed columns (`status_code`, `fingerprint`, `expires_at`) stay forensic-queryable. Both defaults are operator-opt-out via `opts.hashKeys: false` and `opts.seal: false`; the seal path silently falls back to plaintext + emits an `idempotency.seal_skipped_no_vault` audit warning on first use when vault isn't ready, so test fixtures and boot scripts still work. **Schema migration**: v0.9.15's split columns are incompatible with v0.9.14's single-`v` column — operators with a v0.9.14 idempotency table `DROP TABLE <tableName>;` (or pick a fresh `tableName`) before upgrading. Pre-v1 framework breaks across patch versions for security correctness. (2) **New `require-binding-name` codebase-patterns detector enforces consistent `var X = require("M")` names framework-wide.** Inconsistent names (`fs` vs `nodeFs`, `crypto` vs `nodeCrypto`, `path` vs `nodePath`, `nb` vs `numericBounds`) made `grep` across the lib unreliable and let reviewers miss shadowing bugs (`var crypto = require("crypto")` collides with the framework's own `b.crypto`). The detector carries a `CANONICAL_REQUIRE_BINDINGS` map with safety-first defaults: Node built-ins get a `node<X>` prefix (`nodeFs` / `nodePath` / `nodeCrypto` / `nodeStream` / `nodeTls` / `nodeUrl`) so a local var named `fs` / `path` / `crypto` can never shadow them; the framework's own `lib/crypto.js` binds as `bCrypto` (matches the `b.crypto` public-namespace shape and doesn't shadow node:crypto). Modules without a declared canonical fall back to majority-wins (most-sites name wins, alphabetical tiebreak). Fix is rename, not allowlist — every minority site was updated. **Sweep**: 184 require-binding renames across 108 framework files in this release; primitives + tests unchanged in surface. (3) **`b.graphqlFederation` internal `_timingSafeEqual` now routes through `b.crypto.timingSafeEqual`** (was re-implementing the length-tolerant wrapper inline; the new require-binding-name detector surfaced this; same-patch fix per the audit-existing-code rule).
|
|
13
15
|
- v0.9.14 (2026-05-13) — **Audit-existing-code sweep: `safeSql.quoteIdentifier` adopted across every framework primitive that interpolates SQL identifiers; new `raw-sql-identifier-interpolation` detector seals the bug class.** Codex P1 on PR #44 flagged that `dbStore.get`'s expired-row cleanup was an unconditional `DELETE WHERE k = ?` between SELECT and DELETE — in a multi-process deployment another process could upsert the same key in the race window, and the unconditional delete would erase the fresh row. Fix: scope the delete by the observed `expires_at`. While reviewing, a wider gap surfaced — every `db.prepare("CREATE TABLE " + tableName + ...)` site in the framework had been concatenating identifiers raw, sometimes with inline shape-regex validation that varied per module. The framework already shipped `b.safeSql.quoteIdentifier(name, dialect?)` for exactly this; per the audit-existing-code rule the same patch (a) routes every site through the helper (`lib/audit.js` segregation-of-duties trigger DDL, `lib/dsr.js` ticket store, `lib/inbox.js` message-receive table, `lib/middleware/idempotency-key.js` dbStore, `lib/vault/rotate.js` column-rotation DDL) and (b) adds a `raw-sql-identifier-interpolation` codebase-patterns detector so the bug class can't return. The detector skips variables whose names signal already-quoted identifiers (`q<X>` / `Q_<X>` / `quoted<X>` prefix), so future primitives that use the helper read naturally. **Plus: bounded JSON parse for two file-/DB-backed primitives.** `b.metrics.snapshot.read` and `b.middleware.idempotencyKey.dbStore.get` previously used bare `JSON.parse` with `allow:bare-json-parse` markers; both are read by processes separate from where they were written (CLI/sidecar reads daemon-written snapshot; multi-process fleet shares DB) where a hostile or misbehaving writer could plant a multi-GB value and OOM the reader. Both now route through `b.safeJson.parse(raw, { maxBytes: 4 MiB })`. **Three new primitives — `b.crypto.hashFilesParallel`, `b.pqcAgent.reload`, `b.middleware.idempotencyKey.dbStore` — plus republish of v0.9.13's surface**. v0.9.13's npm-publish workflow failed at the wiki-e2e gate (the Codex P1 fix removed the `opts` parameter from `b.selfUpdate.standaloneVerifier.verify` but the `@signature` JSDoc still declared four arguments — three vs. four arity drift). The v0.9.13 git tag + GH release reached operators but the npm tarball did not; the registry stayed at v0.9.12. v0.9.14 carries v0.9.13's entire shipped surface (circuitBreaker.create({...}) opts-object fix + `b.selfUpdate.standaloneVerifier` + `b.metrics.snapshot` + `b.retry.withBreaker`) plus three additional Tier 2 primitives surfaced by the same downstream consumer that flagged the v0.9.13 batch. (1) **`b.crypto.hashFilesParallel(filePaths, opts?)`** — parallel multi-digest hashing for many files in a single read pass per file. Worker-pool concurrency cap (default `min(8, paths.length)`, 1..256), operator-tunable `algorithms` list (default `["sha256", "sha3-512"]`), optional `onProgress(completed, total)` callback (throws swallowed). Returns rows in the same order as input. The common consumer-side reason to reach for this is SBOM regeneration / vendor-data integrity sweeps / release-asset bundling — situations where N files each need both SHA-256 (legacy compat) and SHA-3-512 (PQC-first) digests and rolling a worker pool by hand has cost a downstream consumer the same two-loop, capture-N-promises, settle-Q boilerplate every release. (2) **`b.pqcAgent.reload()`** — tear down the lazily-built default agent and reset to null so the next `b.pqcAgent.agent` access rebuilds against current TLS posture + `b.network.tls.applyToContext` output. Long-running daemons that rotate the framework's TLS posture (TLS-pinset reload, certificate-pinset refresh, `C.TLS_GROUP_PREFERENCE` update behind a feature flag) need a way to re-source the outbound `https.Agent` without forking a new process. `reload()` calls `.destroy()` on the existing default agent (Node closes idle keep-alive sockets, lets in-flight sockets complete) then nulls the cache. Agents handed out via explicit `b.pqcAgent.create()` are unaffected. Returns `{ destroyed: boolean }`. (3) **`b.middleware.idempotencyKey.dbStore({ db, tableName?, init? })`** — persistent-backed store for the `idempotencyKey` middleware. Same three-method interface as `memoryStore` (`get` / `set` / `delete`) but stores records in any sqlite-shaped database (`{ prepare(sql) → { run, get, all } }`) — the framework's internal `b.db`, an operator-supplied better-sqlite3 instance, or a custom adapter. Use this instead of `memoryStore` when (a) multiple processes share the request-handling fleet so retries can land on a different process than the original, (b) the daemon may restart between the original request and the retry (graceful rolling deploy, OOM kill), or (c) audit / compliance review needs to walk historic idempotency-cache decisions queryable via `SELECT * FROM <tableName>`. TTL is lazily enforced at read time; `set()` upserts on conflict so concurrent retries on different processes don't error. The `tableName` is validated via `b.safeSql.validateIdentifier` (ASCII identifier shape, 63-char cap, no reserved words). (4) **Internal fix**: `b.apiSnapshot.read` now passes `maxBytes: 64 MiB` to `safeJson.parse` — the framework-generated snapshot file outgrew safeJson's 1 MiB default after v0.9.13. Operators consuming `@blamejs/core` via npm jump from v0.9.12 directly to v0.9.14; v0.9.13's content is included.
|
package/MIGRATING.md
CHANGED
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
# Migrating
|
|
2
2
|
|
|
3
|
-
Operator-facing migration recipes per breaking change.
|
|
3
|
+
Operator-facing migration recipes per breaking change. The bulk of this file is auto-generated from `deprecate()`-marked surface in the framework — the running app warns about each (with `BLAMEJS_DEPRECATIONS=warn` set, or by default outside production) before the noted removal version. Re-run `node scripts/gen-migrating.js` before each release; the file is committed so operators can diff it against the prior tag.
|
|
4
|
+
|
|
5
|
+
**Out-of-band breaking changes** (schema breaks, config-shape changes, on-disk format breaks) cannot be expressed as `deprecate()` calls because there's no in-process runtime to warn from. They're hardcoded in the OUT_OF_BAND_BREAKS table inside `scripts/gen-migrating.js` so the operator sees the full upgrade path here without needing to grep CHANGELOG.
|
|
4
6
|
|
|
5
7
|
## No active deprecations
|
|
6
8
|
|
|
7
9
|
The framework has no `deprecate()`-marked surface awaiting removal.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Out-of-band breaking changes
|
|
14
|
+
|
|
15
|
+
Listed newest-first.
|
|
16
|
+
|
|
17
|
+
### v0.9.15 — `b.middleware.idempotencyKey.dbStore — table schema`
|
|
18
|
+
|
|
19
|
+
Single `v` JSON-envelope column split into discrete `fingerprint` / `status_code` / `headers` / `body` / `expires_at` columns; `headers` + `body` are sealed via `b.cryptoField.sealRow` when vault is initialized; `k` column carries the sha3-512 namespace-hash of the operator-supplied key.
|
|
20
|
+
|
|
21
|
+
Operators with a v0.9.14 (or earlier) idempotency table on disk:
|
|
22
|
+
|
|
23
|
+
```sql
|
|
24
|
+
DROP TABLE <tableName>; -- default: blamejs_idempotency_keys
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or pick a fresh `tableName` in v0.9.15+ `dbStore({ tableName: "..." })`. The init step (`init: true`, default) creates the new split-column schema. `CREATE TABLE IF NOT EXISTS` does NOT migrate column layout on an existing table, so the drop-and-recreate is required.
|
|
28
|
+
|
|
29
|
+
Cached records in the existing table are not recoverable across the schema break — operators who care about replay continuity warm the new table by retrying the in-flight requests under the new dbStore.
|
package/lib/acme.js
CHANGED
|
@@ -302,8 +302,8 @@ function _findAkiKeyIdentifier(rawDer) {
|
|
|
302
302
|
* maxBytes: number, // default 2 MiB — response body cap
|
|
303
303
|
*
|
|
304
304
|
* @example
|
|
305
|
-
* var
|
|
306
|
-
* var pair =
|
|
305
|
+
* var crypto = require("crypto");
|
|
306
|
+
* var pair = crypto.generateKeyPairSync("ec", { namedCurve: "P-256" });
|
|
307
307
|
* var acme = b.acme.create({
|
|
308
308
|
* directory: "https://acme-staging-v02.api.letsencrypt.org/directory",
|
|
309
309
|
* accountKey: {
|
package/lib/api-snapshot.js
CHANGED
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
* Public-API surface walker plus breaking-change detector — the framework's LTS-contract enforcement at the type level.
|
|
51
51
|
*/
|
|
52
52
|
|
|
53
|
-
var nodeFs = require("fs");
|
|
53
|
+
var nodeFs = require("node:fs");
|
|
54
54
|
var numericBounds = require("./numeric-bounds");
|
|
55
55
|
var safeJson = require("./safe-json");
|
|
56
56
|
var { FrameworkError } = require("./framework-error");
|
package/lib/app-shutdown.js
CHANGED
|
@@ -449,8 +449,8 @@ function standardPhases(components) {
|
|
|
449
449
|
// fs.openSync) which gives the same single-instance guarantee but
|
|
450
450
|
// without the cross-process advisory lock — the lock file presence
|
|
451
451
|
// IS the lock.
|
|
452
|
-
var nodeFs = require("fs");
|
|
453
|
-
var nodePath = require("path");
|
|
452
|
+
var nodeFs = require("node:fs");
|
|
453
|
+
var nodePath = require("node:path");
|
|
454
454
|
|
|
455
455
|
/**
|
|
456
456
|
* @primitive b.appShutdown.pidLock
|
package/lib/app.js
CHANGED
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
* level tables still get the framework tables (sessions, queue jobs,
|
|
90
90
|
* audit_log, consent_log).
|
|
91
91
|
*/
|
|
92
|
-
var nodeFs = require("fs");
|
|
93
|
-
var nodePath = require("path");
|
|
92
|
+
var nodeFs = require("node:fs");
|
|
93
|
+
var nodePath = require("node:path");
|
|
94
94
|
var appShutdown = require("./app-shutdown");
|
|
95
95
|
var C = require("./constants");
|
|
96
96
|
var cluster = require("./cluster");
|
package/lib/argon2-builtin.js
CHANGED
package/lib/atomic-file.js
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* Every write goes through the same crash-safe sequence:
|
|
12
12
|
* 1. write payload to a sibling temp file (`<filepath>.tmp-<token>`)
|
|
13
13
|
* 2. fsync the file descriptor before close
|
|
14
|
-
* 3.
|
|
15
|
-
* is atomic on the same filesystem; on Windows,
|
|
14
|
+
* 3. fs.rename() the temp file over the destination — POSIX rename
|
|
15
|
+
* is atomic on the same filesystem; on Windows, fs.rename uses
|
|
16
16
|
* MoveFileEx with REPLACE_EXISTING for the same guarantee
|
|
17
17
|
* 4. fsync the parent directory so the rename itself is durable
|
|
18
18
|
*
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
* @card
|
|
39
39
|
* Atomic file I/O with integrity verification, retry on transient errors, and cross-process locking.
|
|
40
40
|
*/
|
|
41
|
-
var nodeFs = require("fs");
|
|
42
|
-
var nodePath = require("path");
|
|
41
|
+
var nodeFs = require("node:fs");
|
|
42
|
+
var nodePath = require("node:path");
|
|
43
43
|
var { generateToken, sha3Hash } = require("./crypto");
|
|
44
44
|
var safeJson = require("./safe-json");
|
|
45
45
|
var C = require("./constants");
|
|
@@ -114,7 +114,7 @@ async function _withRetry(fn, opts) {
|
|
|
114
114
|
* @status stable
|
|
115
115
|
* @related b.atomicFile.fsyncDir, b.atomicFile.write
|
|
116
116
|
*
|
|
117
|
-
* Best-effort
|
|
117
|
+
* Best-effort fs.fsyncSync wrapper. Silently swallows errors because
|
|
118
118
|
* not every platform / fd type supports fsync (some FUSE mounts, some
|
|
119
119
|
* device fds). Use this when you want the durability hint but don't
|
|
120
120
|
* want a non-fsyncable target to crash the caller.
|
|
@@ -124,7 +124,7 @@ async function _withRetry(fn, opts) {
|
|
|
124
124
|
* var fd = fs.openSync("/tmp/note.txt", "w");
|
|
125
125
|
* fs.writeSync(fd, "hello\n");
|
|
126
126
|
* b.atomicFile.fsync(fd);
|
|
127
|
-
*
|
|
127
|
+
* fs.closeSync(fd);
|
|
128
128
|
*/
|
|
129
129
|
function fsync(fd) {
|
|
130
130
|
try { nodeFs.fsyncSync(fd); } catch (_e) { /* not all platforms support fsync on every fd type */ }
|
|
@@ -354,7 +354,7 @@ function writeSync(filepath, data, opts) {
|
|
|
354
354
|
* predict — only glob-by-prefix and prune by age. Operators should
|
|
355
355
|
* call this at boot for every "important" filepath (vault.key.sealed,
|
|
356
356
|
* audit-sign.key.sealed, db.enc, ...) BEFORE the first atomic write
|
|
357
|
-
* to that
|
|
357
|
+
* to that path. Returns the number of orphans removed.
|
|
358
358
|
*
|
|
359
359
|
* @opts
|
|
360
360
|
* olderThanMs: 300000, // only prune temp files older than this many ms (default 5 minutes)
|
|
@@ -706,7 +706,7 @@ async function copy(src, dst, opts) {
|
|
|
706
706
|
* @status stable
|
|
707
707
|
* @related b.atomicFile.read, b.atomicFile.readSync
|
|
708
708
|
*
|
|
709
|
-
* Synchronous existence check. Thin wrapper over `
|
|
709
|
+
* Synchronous existence check. Thin wrapper over `fs.existsSync` that
|
|
710
710
|
* normalises the answer for callers that already require this module
|
|
711
711
|
* — saves an additional `require("fs")` in modules that otherwise
|
|
712
712
|
* only need atomicFile.
|
package/lib/audit-sign.js
CHANGED
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
* @card
|
|
59
59
|
* SLH-DSA-SHAKE-256f post-quantum signature for audit-chain checkpoints.
|
|
60
60
|
*/
|
|
61
|
-
var nodeFs = require("fs");
|
|
62
|
-
var nodePath = require("path");
|
|
63
|
-
var nodeCrypto = require("crypto");
|
|
61
|
+
var nodeFs = require("node:fs");
|
|
62
|
+
var nodePath = require("node:path");
|
|
63
|
+
var nodeCrypto = require("node:crypto");
|
|
64
64
|
var atomicFile = require("./atomic-file");
|
|
65
65
|
var { sha3Hash } = require("./crypto");
|
|
66
66
|
var { defineClass } = require("./framework-error");
|
package/lib/audit-tools.js
CHANGED
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
* Operator-side audit-chain inspection / export — verify chain integrity end-to-end, export RFC 8785 canonical-JSON slices, format rows for downstream SIEM (CADF / ISO 19395), and generate tamper-evident compliance-evidence bundles auditors can verify off-line.
|
|
55
55
|
*/
|
|
56
56
|
|
|
57
|
-
var nodeFs = require("fs");
|
|
58
|
-
var nodePath = require("path");
|
|
57
|
+
var nodeFs = require("node:fs");
|
|
58
|
+
var nodePath = require("node:path");
|
|
59
59
|
var pkg = require("../package.json");
|
|
60
60
|
var atomicFile = require("./atomic-file");
|
|
61
61
|
var auditChain = require("./audit-chain");
|
package/lib/auth/dpop.js
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* Middleware: see `lib/middleware/dpop.js` (`b.middleware.dpop`).
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
-
var nodeCrypto = require("crypto");
|
|
29
|
+
var nodeCrypto = require("node:crypto");
|
|
30
30
|
var bCrypto = require("../crypto");
|
|
31
31
|
var safeJson = require("../safe-json");
|
|
32
32
|
var safeUrl = require("../safe-url");
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* time entry-point); verify() returns structured errors (hot path).
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
var nodeCrypto = require("crypto");
|
|
31
|
+
var nodeCrypto = require("node:crypto");
|
|
32
32
|
var validateOpts = require("../validate-opts");
|
|
33
33
|
var lazyRequire = require("../lazy-require");
|
|
34
34
|
var safeJson = require("../safe-json");
|
package/lib/auth/jwt-external.js
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
* can route alerts on a single class.
|
|
50
50
|
*/
|
|
51
51
|
|
|
52
|
-
var nodeCrypto = require("crypto");
|
|
52
|
+
var nodeCrypto = require("node:crypto");
|
|
53
53
|
var safeJson = require("../safe-json");
|
|
54
54
|
var safeUrl = require("../safe-url");
|
|
55
55
|
var lazyRequire = require("../lazy-require");
|
package/lib/auth/jwt.js
CHANGED
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
* codes per failure class so callers can branch (display "expired"
|
|
71
71
|
* vs "not yet valid" UX, audit "bad-signature" attempts separately).
|
|
72
72
|
*/
|
|
73
|
-
var nodeCrypto = require("crypto");
|
|
73
|
+
var nodeCrypto = require("node:crypto");
|
|
74
74
|
var C = require("../constants");
|
|
75
75
|
var safeJson = require("../safe-json");
|
|
76
76
|
var validateOpts = require("../validate-opts");
|
package/lib/auth/oauth.js
CHANGED
|
@@ -112,7 +112,7 @@ var { generateBytes, timingSafeEqual: cryptoTimingSafeEqual } = require("../cryp
|
|
|
112
112
|
var httpClient = require("../http-client");
|
|
113
113
|
var safeJson = require("../safe-json");
|
|
114
114
|
var safeUrl = require("../safe-url");
|
|
115
|
-
var { URL } = require("url");
|
|
115
|
+
var { URL } = require("node:url");
|
|
116
116
|
var { defineClass } = require("../framework-error");
|
|
117
117
|
|
|
118
118
|
// Cap on responses parsed from upstream OAuth providers. Token /
|
package/lib/auth/status-list.js
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
* to a few KB on the wire when most bits are zero.
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
|
-
var nodeCrypto = require("crypto");
|
|
47
|
+
var nodeCrypto = require("node:crypto");
|
|
48
48
|
var zlib = require("node:zlib");
|
|
49
49
|
var safeJson = require("../safe-json");
|
|
50
50
|
var validateOpts = require("../validate-opts");
|
package/lib/backup/bundle.js
CHANGED
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
* compressor (gzip, zstd) downstream of the framework primitive.
|
|
47
47
|
*/
|
|
48
48
|
|
|
49
|
-
var nodeFs = require("fs");
|
|
50
|
-
var nodePath = require("path");
|
|
49
|
+
var nodeFs = require("node:fs");
|
|
50
|
+
var nodePath = require("node:path");
|
|
51
51
|
var atomicFile = require("../atomic-file");
|
|
52
52
|
var bCrypto = require("./crypto");
|
|
53
53
|
var backupManifest = require("./manifest");
|
package/lib/backup/index.js
CHANGED
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
* PQC-encrypted backup bundles — sealed columns + audit chain + keyring.
|
|
49
49
|
*/
|
|
50
50
|
|
|
51
|
-
var nodeFs = require("fs");
|
|
52
|
-
var os = require("os");
|
|
53
|
-
var nodePath = require("path");
|
|
51
|
+
var nodeFs = require("node:fs");
|
|
52
|
+
var os = require("node:os");
|
|
53
|
+
var nodePath = require("node:path");
|
|
54
54
|
var bCrypto = require("../crypto");
|
|
55
55
|
var atomicFile = require("../atomic-file");
|
|
56
56
|
var backupBundle = require("./bundle");
|
|
@@ -285,10 +285,10 @@ async function _resolveVaultKeyJson(vaultKeyJsonOpt) {
|
|
|
285
285
|
* var path = require("node:path");
|
|
286
286
|
* var os = require("node:os");
|
|
287
287
|
*
|
|
288
|
-
* var dataDir =
|
|
289
|
-
* var root =
|
|
290
|
-
*
|
|
291
|
-
*
|
|
288
|
+
* var dataDir = fs.mkdtempSync(path.join(os.tmpdir(), "backup-data-"));
|
|
289
|
+
* var root = fs.mkdtempSync(path.join(os.tmpdir(), "backup-root-"));
|
|
290
|
+
* fs.writeFileSync(path.join(dataDir, "db.enc"), Buffer.from([1, 2, 3]));
|
|
291
|
+
* fs.writeFileSync(path.join(dataDir, "db.key.enc"), Buffer.from([4, 5, 6]));
|
|
292
292
|
*
|
|
293
293
|
* var engine = b.backup.create({
|
|
294
294
|
* dataDir: dataDir,
|
package/lib/bundler.js
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* override via `opts.hashLen` between 4 and 64). Source maps written
|
|
27
27
|
* by an engine land as `<hashed>.<ext>.map` siblings.
|
|
28
28
|
*
|
|
29
|
-
* Watch mode: `bundler.watch(callback)` arms `
|
|
29
|
+
* Watch mode: `bundler.watch(callback)` arms `fs.watch` on each
|
|
30
30
|
* entry's directory, debounces bursts via `opts.graceMs` (default
|
|
31
31
|
* 100 ms), and rebuilds the entire entry set on change.
|
|
32
32
|
*
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
* Client-side asset bundler — produces content-hashed `dist/<name>.<hash>.<ext>` files plus a `manifest.json` mapping logical name to hashed filename.
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
|
-
var nodePath = require("path");
|
|
47
|
-
var nodeFs = require("fs");
|
|
46
|
+
var nodePath = require("node:path");
|
|
47
|
+
var nodeFs = require("node:fs");
|
|
48
48
|
var bCrypto = require("./crypto");
|
|
49
49
|
var atomicFile = require("./atomic-file");
|
|
50
50
|
var logModule = require("./log");
|
|
@@ -200,7 +200,7 @@ function _validateEngine(eng) {
|
|
|
200
200
|
* Build a content-hashed asset pipeline for a fixed set of named
|
|
201
201
|
* entries. The returned object exposes `build()` (one-shot rebuild,
|
|
202
202
|
* resolves to `{ outputs, manifestPath, manifest, durationMs }`),
|
|
203
|
-
* `watch(callback)` (arm `
|
|
203
|
+
* `watch(callback)` (arm `fs.watch` and debounce-rebuild on change),
|
|
204
204
|
* and `close()` (drop watchers and pending timers).
|
|
205
205
|
*
|
|
206
206
|
* Throws `BundlerError` at config time on missing / malformed entries,
|
package/lib/cli.js
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
var nodeFs = require("node:fs");
|
|
38
38
|
var os = require("node:os");
|
|
39
|
-
var nodePath = require("path");
|
|
39
|
+
var nodePath = require("node:path");
|
|
40
40
|
var apiSnapshot = require("./api-snapshot");
|
|
41
41
|
var argParser = require("./arg-parser");
|
|
42
42
|
var auditChain = require("./audit-chain");
|
package/lib/cloud-events.js
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* Produce and consume webhook / pubsub / queue payloads in the framework-neutral CNCF CloudEvents v1.0 schema (cloudevents.io/spec/v1.0).
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
var nodeCrypto = require("crypto");
|
|
37
|
+
var nodeCrypto = require("node:crypto");
|
|
38
38
|
var validateOpts = require("./validate-opts");
|
|
39
39
|
var { defineClass } = require("./framework-error");
|
|
40
40
|
|
|
@@ -483,7 +483,7 @@ function create(opts) {
|
|
|
483
483
|
// ignorable for the audit-trail use case (operators store the
|
|
484
484
|
// ruleVersion + entry count alongside).
|
|
485
485
|
function snapshot() {
|
|
486
|
-
var nodeCrypto = require("crypto");
|
|
486
|
+
var nodeCrypto = require("node:crypto");
|
|
487
487
|
var ids = index.map(function (e) { return e.id; }).sort();
|
|
488
488
|
var hash = nodeCrypto.createHash("sha3-512");
|
|
489
489
|
for (var i = 0; i < ids.length; i++) hash.update(ids[i]);
|
package/lib/crypto-hpke.js
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
* (recipientPubKey shape, plaintext type, missing private key on open).
|
|
52
52
|
*/
|
|
53
53
|
|
|
54
|
-
var nodeCrypto = require("crypto");
|
|
54
|
+
var nodeCrypto = require("node:crypto");
|
|
55
55
|
var C = require("./constants");
|
|
56
56
|
var lazyRequire = require("./lazy-require");
|
|
57
57
|
var validateOpts = require("./validate-opts");
|
package/lib/crypto.js
CHANGED
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
* @card
|
|
45
45
|
* The framework's PQC-first cryptography surface.
|
|
46
46
|
*/
|
|
47
|
-
var nodeCrypto = require("crypto");
|
|
48
|
-
var nodeFs = require("fs");
|
|
49
|
-
var { pipeline } = require("stream/promises");
|
|
47
|
+
var nodeCrypto = require("node:crypto");
|
|
48
|
+
var nodeFs = require("node:fs");
|
|
49
|
+
var { pipeline } = require("node:stream/promises");
|
|
50
50
|
var { xchacha20poly1305 } = require("./vendor/noble-ciphers.cjs");
|
|
51
51
|
var C = require("./constants");
|
|
52
52
|
|
package/lib/daemon.js
CHANGED
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
* Long-running process orchestration — supervisor wiring around `b.appShutdown`, foreground signal handling, detached-fork spawn via `b.processSpawn`, PID-file health probes, and a SIGTERM-then-SIGKILL restart policy on stop.
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
|
-
var nodeFs = require("fs");
|
|
41
|
-
var nodePath = require("path");
|
|
40
|
+
var nodeFs = require("node:fs");
|
|
41
|
+
var nodePath = require("node:path");
|
|
42
42
|
var numericBounds = require("./numeric-bounds");
|
|
43
43
|
var appShutdown = require("./app-shutdown");
|
|
44
44
|
var processSpawn = require("./process-spawn");
|
package/lib/db-file-lifecycle.js
CHANGED
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
* bun:sqlite).
|
|
58
58
|
*/
|
|
59
59
|
|
|
60
|
-
var nodeFs = require("fs");
|
|
61
|
-
var os = require("os");
|
|
62
|
-
var nodePath = require("path");
|
|
60
|
+
var nodeFs = require("node:fs");
|
|
61
|
+
var os = require("node:os");
|
|
62
|
+
var nodePath = require("node:path");
|
|
63
63
|
var atomicFile = require("./atomic-file");
|
|
64
64
|
var C = require("./constants");
|
|
65
65
|
var { generateBytes, generateToken, encryptPacked, decryptPacked } = require("./crypto");
|
|
@@ -115,8 +115,8 @@ function _resolveTmpDir(operatorTmpDir, allowDiskFallback) {
|
|
|
115
115
|
* Returns an encrypted-DB-file lifecycle handle. Methods:
|
|
116
116
|
*
|
|
117
117
|
* - `decryptToTmp()` — decrypt the encrypted DB file to a fresh
|
|
118
|
-
* tmpfs path and return the
|
|
119
|
-
* return the existing
|
|
118
|
+
* tmpfs path and return the path. Idempotent: subsequent calls
|
|
119
|
+
* return the existing path.
|
|
120
120
|
* - `dbPath` — the resolved plaintext-tmpfs path (set after
|
|
121
121
|
* `decryptToTmp()` runs).
|
|
122
122
|
* - `startFlushTimer(db, opts?)` — start a periodic flush timer
|
package/lib/db-schema.js
CHANGED
package/lib/db.js
CHANGED
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
* @card
|
|
42
42
|
* Database core — SQLite (node:sqlite) wrapped in encrypted-at-rest storage, sealed-column field-level crypto, append-only audit-chain integration, declarative schema reconcile, and run-once migrations.
|
|
43
43
|
*/
|
|
44
|
-
var nodeFs = require("fs");
|
|
45
|
-
var nodePath = require("path");
|
|
44
|
+
var nodeFs = require("node:fs");
|
|
45
|
+
var nodePath = require("node:path");
|
|
46
46
|
var { DatabaseSync } = require("node:sqlite");
|
|
47
47
|
var { Readable } = require("node:stream");
|
|
48
48
|
var atomicFile = require("./atomic-file");
|
package/lib/dev.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* spawned app's logs unchanged.
|
|
12
12
|
*
|
|
13
13
|
* The hot-reload loop spawns the app as a child process, watches the
|
|
14
|
-
* source directories with `
|
|
14
|
+
* source directories with `fs.watch({ recursive: true })`, and
|
|
15
15
|
* restarts the child when an unignored file changes. On-disk state
|
|
16
16
|
* (vault keys, encrypted DB, sealed cookies) survives the restart
|
|
17
17
|
* because the child re-opens the files; only in-process state is
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
*
|
|
42
42
|
* Test seams: `opts._spawn(cmd, args, sopts)` and
|
|
43
43
|
* `opts._watch(dir, wopts, listener)` default to `child_process.spawn`
|
|
44
|
-
* and `
|
|
44
|
+
* and `fs.watch`; unit tests pass fakes to drive the engine without
|
|
45
45
|
* real subprocesses.
|
|
46
46
|
*
|
|
47
47
|
* @card
|
|
48
48
|
* Dev-mode helpers — hot-reload signal (file watch + child-process restart), route-list dump exposed via `dev.stats()`, and a request inspector courtesy of `stdio: 'inherit'` so the operator sees the spawned app's logs unchanged.
|
|
49
49
|
*/
|
|
50
50
|
|
|
51
|
-
var nodePath = require("path");
|
|
52
|
-
var nodeFs = require("fs");
|
|
51
|
+
var nodePath = require("node:path");
|
|
52
|
+
var nodeFs = require("node:fs");
|
|
53
53
|
var lazyRequire = require("./lazy-require");
|
|
54
54
|
var logModule = require("./log");
|
|
55
55
|
var numericBounds = require("./numeric-bounds");
|
|
@@ -65,7 +65,7 @@ var { FrameworkError } = require("./framework-error");
|
|
|
65
65
|
// inspecting a deployed bundle don't see it as a top-level dep of an
|
|
66
66
|
// otherwise hermetic framework. Production deployments additionally
|
|
67
67
|
// refuse to construct dev.create() — see _refuseInProduction below.
|
|
68
|
-
var childProcess = lazyRequire(function () { return require("child_process"); });
|
|
68
|
+
var childProcess = lazyRequire(function () { return require("node:child_process"); });
|
|
69
69
|
|
|
70
70
|
class DevError extends FrameworkError {
|
|
71
71
|
constructor(code, message) {
|
package/lib/dr-runbook.js
CHANGED
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
* Disaster-recovery runbook executor — composes pre-recorded regulatory steps, operator confirmation gates, and the framework's audit chain into a posture-appropriate Markdown runbook a regulator can read alongside `b.audit`.
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
|
-
var nodeFs = require("fs");
|
|
46
|
-
var nodePath = require("path");
|
|
45
|
+
var nodeFs = require("node:fs");
|
|
46
|
+
var nodePath = require("node:path");
|
|
47
47
|
var C = require("./constants");
|
|
48
48
|
var atomicFile = require("./atomic-file");
|
|
49
49
|
var lazyRequire = require("./lazy-require");
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
* - externaldb.migrate.lock.acquired { holder }
|
|
49
49
|
* - externaldb.migrate.lock.released { holder }
|
|
50
50
|
*/
|
|
51
|
-
var nodePath = require("path");
|
|
51
|
+
var nodePath = require("node:path");
|
|
52
52
|
var atomicFile = require("./atomic-file");
|
|
53
53
|
var canonicalJson = require("./canonical-json");
|
|
54
54
|
var { sha3Hash } = require("./crypto");
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* then evaluate.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
var nodeCrypto = require("crypto");
|
|
19
|
+
var nodeCrypto = require("node:crypto");
|
|
20
20
|
var validateOpts = require("./validate-opts");
|
|
21
21
|
var lazyRequire = require("./lazy-require");
|
|
22
22
|
var { defineClass } = require("./framework-error");
|
package/lib/flag-providers.js
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* provider.kind -> "local-file" | "memory" | "environment" | <operator-defined>
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
|
-
var nodeFs = require("fs");
|
|
39
|
+
var nodeFs = require("node:fs");
|
|
40
40
|
var validateOpts = require("./validate-opts");
|
|
41
41
|
var lazyRequire = require("./lazy-require");
|
|
42
42
|
var safeJson = require("./safe-json");
|
package/lib/http-client.js
CHANGED
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
* Outbound HTTP client with SSRF gate, retry, circuit breaker, wall-clock + idle timeouts, AbortSignal propagation, connection pooling, streaming, and ALPN-negotiated HTTP/2.
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
|
-
var nodeFs = require("fs");
|
|
39
|
-
var http = require("http");
|
|
40
|
-
var https = require("https");
|
|
41
|
-
var http2 = require("http2");
|
|
42
|
-
var nodeCrypto = require("crypto");
|
|
43
|
-
var nodePath = require("path");
|
|
38
|
+
var nodeFs = require("node:fs");
|
|
39
|
+
var http = require("node:http");
|
|
40
|
+
var https = require("node:https");
|
|
41
|
+
var http2 = require("node:http2");
|
|
42
|
+
var nodeCrypto = require("node:crypto");
|
|
43
|
+
var nodePath = require("node:path");
|
|
44
44
|
var nodeStream = require("node:stream");
|
|
45
45
|
var streamPromises = require("node:stream/promises");
|
|
46
|
-
var { URL } = require("url");
|
|
46
|
+
var { URL } = require("node:url");
|
|
47
47
|
var atomicFile = require("./atomic-file");
|
|
48
48
|
var C = require("./constants");
|
|
49
49
|
var bCrypto = require("./crypto");
|
|
@@ -476,9 +476,9 @@ function _attachJarCookie(headers, jar, url) {
|
|
|
476
476
|
function _buildMultipartBody(spec) {
|
|
477
477
|
var boundary = "----blamejs-mp-" + bCrypto.generateToken(C.BYTES.bytes(16));
|
|
478
478
|
var CRLF = "\r\n";
|
|
479
|
-
var nodeFs = require("fs"); // allow:inline-require — only on multipart paths that touch the filesystem
|
|
480
|
-
var path = require("path"); // allow:inline-require — same
|
|
481
|
-
var nodeStream = require("stream"); // allow:inline-require — Readable subclass only when streaming
|
|
479
|
+
var nodeFs = require("node:fs"); // allow:inline-require — only on multipart paths that touch the filesystem
|
|
480
|
+
var path = require("node:path"); // allow:inline-require — same
|
|
481
|
+
var nodeStream = require("node:stream"); // allow:inline-require — Readable subclass only when streaming
|
|
482
482
|
|
|
483
483
|
// Each entry is { headerBytes, source } where source is one of:
|
|
484
484
|
// { kind: "buffer", buf: Buffer }
|
|
@@ -1959,7 +1959,7 @@ function _validateUploadOpts(opts) {
|
|
|
1959
1959
|
*
|
|
1960
1960
|
* POSTs a file body via `multipart/form-data` without buffering the
|
|
1961
1961
|
* file in memory. Streams from disk through the request body using
|
|
1962
|
-
* `
|
|
1962
|
+
* `fs.createReadStream` + `node:stream/promises` pipeline. Throws
|
|
1963
1963
|
* `httpclient/missing-file` when `opts.file.path` doesn't exist or
|
|
1964
1964
|
* isn't a regular file. Composes through `request()` so SSRF gating,
|
|
1965
1965
|
* proxy routing, and the per-origin transport cache apply unchanged.
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
* // → { valid, label, keyid, alg, covered, reason? }
|
|
60
60
|
*/
|
|
61
61
|
|
|
62
|
-
var nodeCrypto = require("crypto");
|
|
62
|
+
var nodeCrypto = require("node:crypto");
|
|
63
63
|
var safeUrl = require("./safe-url");
|
|
64
64
|
var safeBuffer = require("./safe-buffer");
|
|
65
65
|
var C = require("./constants");
|
package/lib/keychain.js
CHANGED
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
* OS keychain abstraction with encrypted-file fallback — stores / retrieves / removes a `(service, account) -> password` binding via the host operating system's native credential store.
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
|
-
var nodeFs = require("fs");
|
|
47
|
-
var nodePath = require("path");
|
|
46
|
+
var nodeFs = require("node:fs");
|
|
47
|
+
var nodePath = require("node:path");
|
|
48
48
|
|
|
49
49
|
var atomicFile = require("./atomic-file");
|
|
50
50
|
var C = require("./constants");
|
package/lib/local-db-thin.js
CHANGED
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
* localdb.thin.closed { file }
|
|
54
54
|
*/
|
|
55
55
|
|
|
56
|
-
var nodeFs = require("fs");
|
|
57
|
-
var nodePath = require("path");
|
|
56
|
+
var nodeFs = require("node:fs");
|
|
57
|
+
var nodePath = require("node:path");
|
|
58
58
|
var lazyRequire = require("./lazy-require");
|
|
59
59
|
var validateOpts = require("./validate-opts");
|
|
60
60
|
var safeSql = require("./safe-sql");
|