@crvouga/mockingbird-service-otel 3.11.4 → 3.11.6

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog — @crvouga/mockingbird-service-otel
2
2
 
3
+ ## 3.11.6 (2026-11-02)
4
+
5
+ ### Fixes and improvements
6
+
7
+ - compare the admin key in constant time ([2a43141](https://github.com/crvouga/mockingbird/commit/2a43141f50dab41e698c3bbce0c69bf65b40e24e))
8
+
9
+ ## 3.11.5 (2026-11-02)
10
+
11
+ ### Fixes and improvements
12
+
13
+ - stop walkSchema recursing forever on a self-referential $ref ([69464a9](https://github.com/crvouga/mockingbird/commit/69464a9d9e7f468c5e1095125108d4d3d5515431))
14
+ - densify sparse bracket arrays by their written indices ([84a28cb](https://github.com/crvouga/mockingbird/commit/84a28cb182e3d7df91102897f0fc11fca714ba5f))
15
+
3
16
  ## 3.11.4 (2026-11-02)
4
17
 
5
18
  ### Fixes and improvements
@@ -10,7 +10,7 @@ import {
10
10
  parseFaultHeader,
11
11
  resolveAdminPrefix,
12
12
  restoreClock
13
- } from "./chunk-4FFHIM53.js";
13
+ } from "./chunk-UC7UKIWT.js";
14
14
 
15
15
  // ../../adapters/node/dist/cli.js
16
16
  import { readFile as readFile5 } from "node:fs/promises";
@@ -3058,7 +3058,7 @@ async function preflightFleet(config, options) {
3058
3058
  break;
3059
3059
  }
3060
3060
  }
3061
- targets.set(name, { ...target, packageVersion: packageVersion ?? "3.11.4" });
3061
+ targets.set(name, { ...target, packageVersion: packageVersion ?? "3.11.6" });
3062
3062
  } catch (error) {
3063
3063
  throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
3064
3064
  }
@@ -5084,4 +5084,4 @@ export {
5084
5084
  createServer2 as createServer,
5085
5085
  serveTarget
5086
5086
  };
5087
- //# sourceMappingURL=chunk-GWVPFNK2.js.map
5087
+ //# sourceMappingURL=chunk-33RN7YJ7.js.map
@@ -449,6 +449,7 @@ var parsePath = (rawKey) => {
449
449
  return path;
450
450
  };
451
451
  var isIndex = (segment) => /^(0|[1-9][0-9]*)$/.test(segment);
452
+ var MAX_ARRAY_INDEX = 4294967294;
452
453
  var put = (target, key, value) => {
453
454
  if (key === "__proto__") {
454
455
  Object.defineProperty(target, key, {
@@ -511,8 +512,17 @@ var decodeFormPairs = (pairs) => {
511
512
  var densify = (value) => {
512
513
  if (typeof value === "string")
513
514
  return value;
514
- if (Array.isArray(value))
515
- return value.filter((item) => item !== void 0).map(densify);
515
+ if (Array.isArray(value)) {
516
+ const dense = [];
517
+ for (const key of Object.keys(value)) {
518
+ if (!isIndex(key) || Number(key) > MAX_ARRAY_INDEX)
519
+ continue;
520
+ const item = value[Number(key)];
521
+ if (item !== void 0)
522
+ dense.push(densify(item));
523
+ }
524
+ return dense;
525
+ }
516
526
  const out = {};
517
527
  for (const [key, item] of Object.entries(value))
518
528
  put(out, key, densify(item));
@@ -2345,6 +2355,17 @@ var createNamespaceControls = (options) => {
2345
2355
  };
2346
2356
  };
2347
2357
 
2358
+ // ../core/dist/signing.js
2359
+ var encoder = new TextEncoder();
2360
+ var timingSafeEqual = (a, b) => {
2361
+ if (a.length !== b.length)
2362
+ return false;
2363
+ let diff = 0;
2364
+ for (let i = 0; i < a.length; i++)
2365
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2366
+ return diff === 0;
2367
+ };
2368
+
2348
2369
  // ../core/dist/surface.js
2349
2370
  var defineMock = (runtime) => runtime;
2350
2371
  var ADMIN_ROUTE_REFERENCE = {
@@ -2463,6 +2484,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2463
2484
  }
2464
2485
  };
2465
2486
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2487
+ var hasAdminKey = (headers, adminKey) => {
2488
+ const sent = headers.get(ADMIN_KEY_HEADER);
2489
+ return sent !== null && timingSafeEqual(sent, adminKey);
2490
+ };
2466
2491
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2467
2492
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2468
2493
  var ADMIN_CONTROL_PAGES = [
@@ -2936,7 +2961,7 @@ var createControlPlane = (context) => {
2936
2961
  }
2937
2962
  const path = url.pathname.slice(adminPrefix.length) || "/";
2938
2963
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
2939
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
2964
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
2940
2965
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
2941
2966
  }
2942
2967
  for (const route of routes) {
@@ -3744,7 +3769,7 @@ var stateAdminRoutes = (routes) => {
3744
3769
  };
3745
3770
 
3746
3771
  // ../core/dist/version.js
3747
- var PACKAGE_VERSION = true ? "3.11.4" : UNRELEASED_VERSION;
3772
+ var PACKAGE_VERSION = true ? "3.11.6" : UNRELEASED_VERSION;
3748
3773
 
3749
3774
  // ../core/dist/webhooks.js
3750
3775
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -4725,7 +4750,7 @@ var createRuntime = (options) => {
4725
4750
  throw error;
4726
4751
  }
4727
4752
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
4728
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
4753
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
4729
4754
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
4730
4755
  controls.ensure(namespace);
4731
4756
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -6828,4 +6853,4 @@ export {
6828
6853
  OtelAPI,
6829
6854
  adminRow
6830
6855
  };
6831
- //# sourceMappingURL=chunk-4FFHIM53.js.map
6856
+ //# sourceMappingURL=chunk-UC7UKIWT.js.map