@crvouga/mockingbird-service-plane 3.10.3 → 3.10.5

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,19 @@
1
1
  # Changelog — @crvouga/mockingbird-service-plane
2
2
 
3
+ ## 3.10.5 (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.10.4 (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
+ - do not save idempotent results for requests that fail validation ([f2161aa](https://github.com/crvouga/mockingbird/commit/f2161aadeae30bcc586e26131da12a7030bdeb11))
16
+
3
17
  ## 3.10.3 (2026-11-02)
4
18
 
5
19
  ### Fixes and improvements
@@ -9,7 +9,7 @@ import {
9
9
  parseFaultHeader,
10
10
  resolveAdminPrefix,
11
11
  restoreClock
12
- } from "./chunk-XKTDBQID.js";
12
+ } from "./chunk-WTZXB66U.js";
13
13
 
14
14
  // ../../adapters/node/dist/cli.js
15
15
  import { readFile as readFile5 } from "node:fs/promises";
@@ -3057,7 +3057,7 @@ async function preflightFleet(config, options) {
3057
3057
  break;
3058
3058
  }
3059
3059
  }
3060
- targets.set(name, { ...target, packageVersion: packageVersion ?? "3.10.3" });
3060
+ targets.set(name, { ...target, packageVersion: packageVersion ?? "3.10.5" });
3061
3061
  } catch (error) {
3062
3062
  throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
3063
3063
  }
@@ -5037,4 +5037,4 @@ export {
5037
5037
  createServer2 as createServer,
5038
5038
  serveTarget
5039
5039
  };
5040
- //# sourceMappingURL=chunk-3A3PUSBZ.js.map
5040
+ //# sourceMappingURL=chunk-GWNCN6NJ.js.map
@@ -495,6 +495,7 @@ var parsePath = (rawKey) => {
495
495
  return path;
496
496
  };
497
497
  var isIndex = (segment) => /^(0|[1-9][0-9]*)$/.test(segment);
498
+ var MAX_ARRAY_INDEX = 4294967294;
498
499
  var put = (target, key, value) => {
499
500
  if (key === "__proto__") {
500
501
  Object.defineProperty(target, key, {
@@ -557,8 +558,17 @@ var decodeFormPairs = (pairs) => {
557
558
  var densify = (value) => {
558
559
  if (typeof value === "string")
559
560
  return value;
560
- if (Array.isArray(value))
561
- return value.filter((item) => item !== void 0).map(densify);
561
+ if (Array.isArray(value)) {
562
+ const dense = [];
563
+ for (const key of Object.keys(value)) {
564
+ if (!isIndex(key) || Number(key) > MAX_ARRAY_INDEX)
565
+ continue;
566
+ const item = value[Number(key)];
567
+ if (item !== void 0)
568
+ dense.push(densify(item));
569
+ }
570
+ return dense;
571
+ }
562
572
  const out = {};
563
573
  for (const [key, item] of Object.entries(value))
564
574
  put(out, key, densify(item));
@@ -2656,6 +2666,17 @@ var createNamespaceControls = (options) => {
2656
2666
  };
2657
2667
  };
2658
2668
 
2669
+ // ../core/dist/signing.js
2670
+ var encoder = new TextEncoder();
2671
+ var timingSafeEqual = (a, b) => {
2672
+ if (a.length !== b.length)
2673
+ return false;
2674
+ let diff = 0;
2675
+ for (let i = 0; i < a.length; i++)
2676
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2677
+ return diff === 0;
2678
+ };
2679
+
2659
2680
  // ../core/dist/surface.js
2660
2681
  var defineMock = (runtime) => runtime;
2661
2682
  var ADMIN_ROUTE_REFERENCE = {
@@ -2774,6 +2795,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2774
2795
  }
2775
2796
  };
2776
2797
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2798
+ var hasAdminKey = (headers, adminKey) => {
2799
+ const sent = headers.get(ADMIN_KEY_HEADER);
2800
+ return sent !== null && timingSafeEqual(sent, adminKey);
2801
+ };
2777
2802
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2778
2803
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2779
2804
  var ADMIN_CONTROL_PAGES = [
@@ -3247,7 +3272,7 @@ var createControlPlane = (context) => {
3247
3272
  }
3248
3273
  const path = url.pathname.slice(adminPrefix.length) || "/";
3249
3274
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
3250
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
3275
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
3251
3276
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
3252
3277
  }
3253
3278
  for (const route of routes) {
@@ -4071,7 +4096,7 @@ var stateAdminRoutes = (routes) => {
4071
4096
  };
4072
4097
 
4073
4098
  // ../core/dist/version.js
4074
- var PACKAGE_VERSION = true ? "3.10.3" : UNRELEASED_VERSION;
4099
+ var PACKAGE_VERSION = true ? "3.10.5" : UNRELEASED_VERSION;
4075
4100
 
4076
4101
  // ../core/dist/webhooks.js
4077
4102
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -5052,7 +5077,7 @@ var createRuntime = (options) => {
5052
5077
  throw error;
5053
5078
  }
5054
5079
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
5055
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
5080
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
5056
5081
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
5057
5082
  controls.ensure(namespace);
5058
5083
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -6242,4 +6267,4 @@ export {
6242
6267
  apiKeyCredential,
6243
6268
  PlaneAPI
6244
6269
  };
6245
- //# sourceMappingURL=chunk-XKTDBQID.js.map
6270
+ //# sourceMappingURL=chunk-WTZXB66U.js.map