@crvouga/mockingbird-service-eventbridge 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-eventbridge
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
@@ -10,7 +10,7 @@ import {
10
10
  parseFaultHeader,
11
11
  resolveAdminPrefix,
12
12
  restoreClock
13
- } from "./chunk-AYEXMCH7.js";
13
+ } from "./chunk-TRYM7MGC.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 ?? "1.10.5" });
3061
+ targets.set(name, { ...target, packageVersion: packageVersion ?? "1.10.6" });
3062
3062
  } catch (error) {
3063
3063
  throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
3064
3064
  }
@@ -5020,4 +5020,4 @@ export {
5020
5020
  createServer3 as createServer2,
5021
5021
  serveTarget
5022
5022
  };
5023
- //# sourceMappingURL=chunk-DN6UTFNL.js.map
5023
+ //# sourceMappingURL=chunk-AVN5BJ72.js.map
@@ -6806,6 +6806,17 @@ var createNamespaceControls = (options) => {
6806
6806
  };
6807
6807
  };
6808
6808
 
6809
+ // ../core/dist/signing.js
6810
+ var encoder = new TextEncoder();
6811
+ var timingSafeEqual = (a, b) => {
6812
+ if (a.length !== b.length)
6813
+ return false;
6814
+ let diff = 0;
6815
+ for (let i = 0; i < a.length; i++)
6816
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
6817
+ return diff === 0;
6818
+ };
6819
+
6809
6820
  // ../core/dist/surface.js
6810
6821
  var defineMock = (runtime) => runtime;
6811
6822
  var ADMIN_ROUTE_REFERENCE = {
@@ -6924,6 +6935,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
6924
6935
  }
6925
6936
  };
6926
6937
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
6938
+ var hasAdminKey = (headers, adminKey) => {
6939
+ const sent = headers.get(ADMIN_KEY_HEADER);
6940
+ return sent !== null && timingSafeEqual(sent, adminKey);
6941
+ };
6927
6942
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
6928
6943
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
6929
6944
  var ADMIN_CONTROL_PAGES = [
@@ -7397,7 +7412,7 @@ var createControlPlane = (context) => {
7397
7412
  }
7398
7413
  const path = url.pathname.slice(adminPrefix.length) || "/";
7399
7414
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
7400
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
7415
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
7401
7416
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
7402
7417
  }
7403
7418
  for (const route of routes) {
@@ -8160,7 +8175,7 @@ var stateAdminRoutes = (routes) => {
8160
8175
  };
8161
8176
 
8162
8177
  // ../core/dist/version.js
8163
- var PACKAGE_VERSION = true ? "1.10.5" : UNRELEASED_VERSION;
8178
+ var PACKAGE_VERSION = true ? "1.10.6" : UNRELEASED_VERSION;
8164
8179
 
8165
8180
  // ../core/dist/webhooks.js
8166
8181
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -9139,7 +9154,7 @@ var createRuntime = (options) => {
9139
9154
  throw error;
9140
9155
  }
9141
9156
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
9142
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
9157
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
9143
9158
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
9144
9159
  controls.ensure(namespace);
9145
9160
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -9786,4 +9801,4 @@ export {
9786
9801
  EVENTBRIDGE_NAMESPACE,
9787
9802
  EventBridgeAPI
9788
9803
  };
9789
- //# sourceMappingURL=chunk-AYEXMCH7.js.map
9804
+ //# sourceMappingURL=chunk-TRYM7MGC.js.map