@crvouga/mockingbird-service-docker 1.10.4 → 1.10.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-docker
2
2
 
3
+ ## 1.10.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
+ ## 1.10.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
  ## 1.10.4 (2026-11-02)
4
17
 
5
18
  ### Fixes and improvements
@@ -5,7 +5,7 @@ import {
5
5
  createRuntime,
6
6
  isRunning,
7
7
  jsonRes
8
- } from "./chunk-ADULJCBP.js";
8
+ } from "./chunk-SYSIEUKT.js";
9
9
 
10
10
  // src/attach.ts
11
11
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -627,4 +627,4 @@ export {
627
627
  createServer2 as createServer,
628
628
  serveTarget
629
629
  };
630
- //# sourceMappingURL=chunk-NBB6CDQ6.js.map
630
+ //# sourceMappingURL=chunk-AXUQQ3SX.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));
@@ -2391,6 +2401,17 @@ var createNamespaceControls = (options) => {
2391
2401
  };
2392
2402
  };
2393
2403
 
2404
+ // ../core/dist/signing.js
2405
+ var encoder = new TextEncoder();
2406
+ var timingSafeEqual = (a, b) => {
2407
+ if (a.length !== b.length)
2408
+ return false;
2409
+ let diff = 0;
2410
+ for (let i = 0; i < a.length; i++)
2411
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2412
+ return diff === 0;
2413
+ };
2414
+
2394
2415
  // ../core/dist/surface.js
2395
2416
  var defineMock = (runtime) => runtime;
2396
2417
  var ADMIN_ROUTE_REFERENCE = {
@@ -2509,6 +2530,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2509
2530
  }
2510
2531
  };
2511
2532
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2533
+ var hasAdminKey = (headers, adminKey) => {
2534
+ const sent = headers.get(ADMIN_KEY_HEADER);
2535
+ return sent !== null && timingSafeEqual(sent, adminKey);
2536
+ };
2512
2537
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2513
2538
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2514
2539
  var ADMIN_CONTROL_PAGES = [
@@ -2982,7 +3007,7 @@ var createControlPlane = (context) => {
2982
3007
  }
2983
3008
  const path = url.pathname.slice(adminPrefix.length) || "/";
2984
3009
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
2985
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
3010
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
2986
3011
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
2987
3012
  }
2988
3013
  for (const route of routes) {
@@ -3743,7 +3768,7 @@ var stateAdminRoutes = (routes) => {
3743
3768
  };
3744
3769
 
3745
3770
  // ../core/dist/version.js
3746
- var PACKAGE_VERSION = true ? "1.10.4" : UNRELEASED_VERSION;
3771
+ var PACKAGE_VERSION = true ? "1.10.6" : UNRELEASED_VERSION;
3747
3772
 
3748
3773
  // ../core/dist/webhooks.js
3749
3774
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -4727,7 +4752,7 @@ var createRuntime = (options) => {
4727
4752
  throw error;
4728
4753
  }
4729
4754
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
4730
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
4755
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
4731
4756
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
4732
4757
  controls.ensure(namespace);
4733
4758
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -6182,4 +6207,4 @@ export {
6182
6207
  DOCKER_NAMESPACE,
6183
6208
  DockerAPI
6184
6209
  };
6185
- //# sourceMappingURL=chunk-ADULJCBP.js.map
6210
+ //# sourceMappingURL=chunk-SYSIEUKT.js.map