@crvouga/mockingbird-service-cloudwatch 1.10.5 → 1.10.7

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,17 @@
1
1
  # Changelog — @crvouga/mockingbird-service-cloudwatch
2
2
 
3
+ ## 1.10.7 (2026-11-02)
4
+
5
+ ### Fixes and improvements
6
+
7
+ - save and replay a 500 the endpoint produced under an Idempotency-Key ([789bbcc](https://github.com/crvouga/mockingbird/commit/789bbcccb792cddaf27f4f6db6d2fcf2da1d07fe))
8
+
9
+ ## 1.10.6 (2026-11-02)
10
+
11
+ ### Fixes and improvements
12
+
13
+ - compare the admin key in constant time ([2a43141](https://github.com/crvouga/mockingbird/commit/2a43141f50dab41e698c3bbce0c69bf65b40e24e))
14
+
3
15
  ## 1.10.5 (2026-11-02)
4
16
 
5
17
  ### Fixes and improvements
@@ -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.7" : 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))
@@ -9663,4 +9678,4 @@ export {
9663
9678
  createRuntime2 as createRuntime,
9664
9679
  CloudwatchAPI
9665
9680
  };
9666
- //# sourceMappingURL=chunk-XSLNWMKN.js.map
9681
+ //# sourceMappingURL=chunk-JWR3AAUB.js.map