@crvouga/mockingbird-service-ecs 1.10.5 → 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,11 @@
1
1
  # Changelog — @crvouga/mockingbird-service-ecs
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
+
3
9
  ## 1.10.5 (2026-11-02)
4
10
 
5
11
  ### Fixes and improvements
@@ -9,7 +9,7 @@ import {
9
9
  parseFaultHeader,
10
10
  resolveAdminPrefix,
11
11
  restoreClock
12
- } from "./chunk-53ZK33XM.js";
12
+ } from "./chunk-CXHMF424.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 ?? "1.10.5" });
3060
+ targets.set(name, { ...target, packageVersion: packageVersion ?? "1.10.6" });
3061
3061
  } catch (error) {
3062
3062
  throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
3063
3063
  }
@@ -5011,4 +5011,4 @@ export {
5011
5011
  createServer2 as createServer,
5012
5012
  serveTarget
5013
5013
  };
5014
- //# sourceMappingURL=chunk-7EQQYFJL.js.map
5014
+ //# sourceMappingURL=chunk-3GDPB3FT.js.map
@@ -2516,6 +2516,17 @@ var createNamespaceControls = (options) => {
2516
2516
  };
2517
2517
  };
2518
2518
 
2519
+ // ../core/dist/signing.js
2520
+ var encoder = new TextEncoder();
2521
+ var timingSafeEqual = (a, b) => {
2522
+ if (a.length !== b.length)
2523
+ return false;
2524
+ let diff = 0;
2525
+ for (let i = 0; i < a.length; i++)
2526
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2527
+ return diff === 0;
2528
+ };
2529
+
2519
2530
  // ../core/dist/surface.js
2520
2531
  var defineMock = (runtime) => runtime;
2521
2532
  var ADMIN_ROUTE_REFERENCE = {
@@ -2634,6 +2645,10 @@ var assertAdminPrefixAvailable = (prefix2, paths) => {
2634
2645
  }
2635
2646
  };
2636
2647
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2648
+ var hasAdminKey = (headers, adminKey) => {
2649
+ const sent = headers.get(ADMIN_KEY_HEADER);
2650
+ return sent !== null && timingSafeEqual(sent, adminKey);
2651
+ };
2637
2652
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2638
2653
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2639
2654
  var ADMIN_CONTROL_PAGES = [
@@ -3107,7 +3122,7 @@ var createControlPlane = (context) => {
3107
3122
  }
3108
3123
  const path = url.pathname.slice(adminPrefix.length) || "/";
3109
3124
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
3110
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
3125
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
3111
3126
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
3112
3127
  }
3113
3128
  for (const route of routes) {
@@ -3870,7 +3885,7 @@ var stateAdminRoutes = (routes) => {
3870
3885
  };
3871
3886
 
3872
3887
  // ../core/dist/version.js
3873
- var PACKAGE_VERSION = true ? "1.10.5" : UNRELEASED_VERSION;
3888
+ var PACKAGE_VERSION = true ? "1.10.6" : UNRELEASED_VERSION;
3874
3889
 
3875
3890
  // ../core/dist/webhooks.js
3876
3891
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -4849,7 +4864,7 @@ var createRuntime = (options) => {
4849
4864
  throw error;
4850
4865
  }
4851
4866
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
4852
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
4867
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
4853
4868
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
4854
4869
  controls.ensure(namespace);
4855
4870
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -5376,4 +5391,4 @@ export {
5376
5391
  DEFAULT_TASK_DEFINITION,
5377
5392
  ECSAPI
5378
5393
  };
5379
- //# sourceMappingURL=chunk-53ZK33XM.js.map
5394
+ //# sourceMappingURL=chunk-CXHMF424.js.map