@blamejs/blamejs-shop 0.4.53 → 0.4.55

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/lib/admin.js +255 -1
  3. package/lib/asset-manifest.json +3 -3
  4. package/lib/storefront.js +135 -0
  5. package/lib/vendor/MANIFEST.json +41 -35
  6. package/lib/vendor/blamejs/CHANGELOG.md +2 -0
  7. package/lib/vendor/blamejs/SECURITY.md +1 -0
  8. package/lib/vendor/blamejs/api-snapshot.json +10 -2
  9. package/lib/vendor/blamejs/examples/wiki/lib/html-entities.js +24 -0
  10. package/lib/vendor/blamejs/examples/wiki/lib/symbol-index.js +7 -5
  11. package/lib/vendor/blamejs/examples/wiki/test/e2e.js +9 -1
  12. package/lib/vendor/blamejs/examples/wiki/test/validate-nav-coverage.js +2 -8
  13. package/lib/vendor/blamejs/lib/acme.js +7 -11
  14. package/lib/vendor/blamejs/lib/client-hints.js +3 -1
  15. package/lib/vendor/blamejs/lib/cluster.js +4 -2
  16. package/lib/vendor/blamejs/lib/guard-filename.js +6 -2
  17. package/lib/vendor/blamejs/lib/http-client-cache.js +3 -1
  18. package/lib/vendor/blamejs/lib/http-message-signature.js +25 -8
  19. package/lib/vendor/blamejs/lib/log-stream-otlp-grpc.js +12 -1
  20. package/lib/vendor/blamejs/lib/log-stream-syslog.js +6 -0
  21. package/lib/vendor/blamejs/lib/log.js +24 -2
  22. package/lib/vendor/blamejs/lib/mail.js +5 -0
  23. package/lib/vendor/blamejs/lib/middleware/body-parser.js +48 -6
  24. package/lib/vendor/blamejs/lib/network-dns.js +22 -26
  25. package/lib/vendor/blamejs/lib/network-heartbeat.js +3 -3
  26. package/lib/vendor/blamejs/lib/network-proxy.js +3 -7
  27. package/lib/vendor/blamejs/lib/network-tls.js +34 -13
  28. package/lib/vendor/blamejs/lib/network.js +2 -6
  29. package/lib/vendor/blamejs/lib/notify.js +7 -12
  30. package/lib/vendor/blamejs/lib/seeders.js +5 -10
  31. package/lib/vendor/blamejs/lib/structured-fields.js +38 -1
  32. package/lib/vendor/blamejs/package.json +1 -1
  33. package/lib/vendor/blamejs/release-notes/v0.15.12.json +47 -0
  34. package/lib/vendor/blamejs/test/00-primitives.js +24 -0
  35. package/lib/vendor/blamejs/test/layer-0-primitives/body-parser-error-redaction.test.js +74 -0
  36. package/lib/vendor/blamejs/test/layer-0-primitives/codebase-patterns.test.js +18 -8
  37. package/lib/vendor/blamejs/test/layer-0-primitives/guard-filename.test.js +11 -0
  38. package/lib/vendor/blamejs/test/layer-0-primitives/http-message-signature.test.js +33 -0
  39. package/lib/vendor/blamejs/test/layer-0-primitives/log-stream-otlp-grpc.test.js +27 -0
  40. package/lib/vendor/blamejs/test/layer-0-primitives/network-tls.test.js +31 -0
  41. package/lib/vendor/blamejs/test/layer-0-primitives/structured-fields.test.js +14 -0
  42. package/package.json +1 -1
@@ -185,6 +185,32 @@ async function testValidationRejectsBadUrl() {
185
185
  check("missing url throws", threw && threw.code === "BAD_OPT");
186
186
  }
187
187
 
188
+ // The insecure-TLS audit must only fire on an actual TLS session. An h2c
189
+ // endpoint (http://, cleartext HTTP/2) creates no TLS session, so allowInsecure
190
+ // there skips no certificate and must NOT emit tls.insecure_skip_verify — a
191
+ // false security/compliance event. https:// + allowInsecure still emits it.
192
+ async function testInsecureTlsAuditGatedToHttps() {
193
+ var observability = require("../../lib/observability");
194
+ function capture(cfg) {
195
+ var events = [];
196
+ observability.setTap(function (name) { if (name === "tls.insecure_skip_verify") events.push(name); });
197
+ var session;
198
+ try { session = grpc._makeClient(cfg); }
199
+ finally { observability.setTap(null); }
200
+ if (session) {
201
+ session.on("error", function () { /* dead address — expected */ });
202
+ try { session.destroy(); } catch (_e) { /* best-effort */ }
203
+ }
204
+ return events.length;
205
+ }
206
+
207
+ var h2c = capture({ url: "http://127.0.0.1:1", allowInsecure: true, allowedProtocols: ["http:", "https:"] });
208
+ check("h2c (cleartext) endpoint with allowInsecure emits NO insecure-TLS audit", h2c === 0);
209
+
210
+ var tls = capture({ url: "https://127.0.0.1:1", allowInsecure: true, allowedProtocols: ["http:", "https:"] });
211
+ check("https endpoint with allowInsecure DOES emit the insecure-TLS audit", tls === 1);
212
+ }
213
+
188
214
  async function run() {
189
215
  await testFramingShape();
190
216
  await testEncodeLogRecord();
@@ -192,6 +218,7 @@ async function run() {
192
218
  await testGrpcRoundTrip();
193
219
  await testGrpcServerErrorTrailer();
194
220
  await testValidationRejectsBadUrl();
221
+ await testInsecureTlsAuditGatedToHttps();
195
222
  }
196
223
 
197
224
  module.exports = { run: run };
@@ -422,7 +422,38 @@ function testPkixHostShape() {
422
422
  err2 && err2.code === "tls/pkix-hostname-mismatch");
423
423
  }
424
424
 
425
+ // v0.15.12 (#143) — an outbound TLS connection that honors rejectUnauthorized:
426
+ // false (operator opt-in to disable peer-cert validation) must emit an audit +
427
+ // observability event so the degraded posture is observable. Capture the event
428
+ // through the real operator tap (observability.setTap) — observability has no
429
+ // `emit`, so the emit must land on the safeEvent → tap path that an operator
430
+ // actually wires (the live connect path is covered in the integration suite
431
+ // alongside tls.classical_downgrade).
432
+ function testInsecureTlsAudit() {
433
+ var nt = b.network.tls;
434
+ check("auditInsecureTls is exported", typeof nt.auditInsecureTls === "function");
435
+
436
+ var observability = require("../../lib/observability");
437
+ var captured = [];
438
+ observability.setTap(function (name, value, labels) { captured.push({ name: name, labels: labels }); });
439
+ try {
440
+ nt.auditInsecureTls({ host: "peer.example", port: 8443, source: "network.tls.connectWithEch" });
441
+ } finally {
442
+ observability.setTap(null);
443
+ }
444
+ var ev = captured.filter(function (c) { return c.name === "tls.insecure_skip_verify"; });
445
+ check("auditInsecureTls emits tls.insecure_skip_verify", ev.length >= 1);
446
+ check("audit event carries host/port/source",
447
+ ev.length >= 1 && ev[0].labels.host === "peer.example" &&
448
+ ev[0].labels.port === 8443 && ev[0].labels.source === "network.tls.connectWithEch");
449
+
450
+ var threw = false;
451
+ try { nt.auditInsecureTls(null); } catch (_e) { threw = true; }
452
+ check("auditInsecureTls is drop-silent on bad input (never throws into a connect)", threw === false);
453
+ }
454
+
425
455
  async function run() {
456
+ testInsecureTlsAudit();
426
457
  testEchSurface();
427
458
  testEchParseDraft22();
428
459
  testEchParseAcceptsBase64();
@@ -156,6 +156,20 @@ function testUnquoteSfString() {
156
156
  b.structuredFields.unquoteSfString("bare-token") === "bare-token");
157
157
  check("unquoteSfString: unterminated quote returns null",
158
158
  b.structuredFields.unquoteSfString('"oops') === null);
159
+ // v0.15.12 (#77) — adjacent / repeated escapes the old two-pass .replace()
160
+ // decode mangled. unquoteSfString routes through the single-pass
161
+ // unescapeSfStringBody; the two-pass form returned a DOUBLED backslash for a
162
+ // lone escaped backslash.
163
+ check("unquoteSfString: lone escaped backslash decodes to a single backslash",
164
+ b.structuredFields.unquoteSfString('"\\\\"') === "\\");
165
+ check("unquoteSfString: escaped backslash adjacent to escaped quote",
166
+ b.structuredFields.unquoteSfString('"\\\\\\""') === "\\\"");
167
+ check("unescapeSfStringBody: lone escaped backslash -> single",
168
+ b.structuredFields.unescapeSfStringBody("\\\\") === "\\");
169
+ check("unescapeSfStringBody: two escaped backslashes -> two",
170
+ b.structuredFields.unescapeSfStringBody("\\\\\\\\") === "\\\\");
171
+ check("unescapeSfStringBody: non-string passthrough",
172
+ b.structuredFields.unescapeSfStringBody(42) === 42);
159
173
  check("unquoteSfString: empty returns empty",
160
174
  b.structuredFields.unquoteSfString("") === "");
161
175
  check("unquoteSfString: whitespace-only returns empty",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blamejs/blamejs-shop",
3
- "version": "0.4.53",
3
+ "version": "0.4.55",
4
4
  "description": "Open-source framework built on blamejs. Vendored stack, zero npm runtime deps, PQC-first crypto, security-on by default.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {