@crvouga/mockingbird-service-dynamodb 3.10.7 → 3.10.9

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-dynamodb
2
2
 
3
+ ## 3.10.9 (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
+ ## 3.10.8 (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
  ## 3.10.7 (2026-11-02)
4
16
 
5
17
  ### Fixes and improvements
@@ -2507,6 +2507,17 @@ var createNamespaceControls = (options) => {
2507
2507
  };
2508
2508
  };
2509
2509
 
2510
+ // ../core/dist/signing.js
2511
+ var encoder = new TextEncoder();
2512
+ var timingSafeEqual = (a, b) => {
2513
+ if (a.length !== b.length)
2514
+ return false;
2515
+ let diff = 0;
2516
+ for (let i = 0; i < a.length; i++)
2517
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2518
+ return diff === 0;
2519
+ };
2520
+
2510
2521
  // ../core/dist/surface.js
2511
2522
  var defineMock = (runtime) => runtime;
2512
2523
  var ADMIN_ROUTE_REFERENCE = {
@@ -2625,6 +2636,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2625
2636
  }
2626
2637
  };
2627
2638
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2639
+ var hasAdminKey = (headers, adminKey) => {
2640
+ const sent = headers.get(ADMIN_KEY_HEADER);
2641
+ return sent !== null && timingSafeEqual(sent, adminKey);
2642
+ };
2628
2643
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2629
2644
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2630
2645
  var ADMIN_CONTROL_PAGES = [
@@ -3098,7 +3113,7 @@ var createControlPlane = (context) => {
3098
3113
  }
3099
3114
  const path = url.pathname.slice(adminPrefix.length) || "/";
3100
3115
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
3101
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
3116
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
3102
3117
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
3103
3118
  }
3104
3119
  for (const route of routes) {
@@ -3861,7 +3876,7 @@ var stateAdminRoutes = (routes) => {
3861
3876
  };
3862
3877
 
3863
3878
  // ../core/dist/version.js
3864
- var PACKAGE_VERSION = true ? "3.10.7" : UNRELEASED_VERSION;
3879
+ var PACKAGE_VERSION = true ? "3.10.9" : UNRELEASED_VERSION;
3865
3880
 
3866
3881
  // ../core/dist/webhooks.js
3867
3882
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -4840,7 +4855,7 @@ var createRuntime = (options) => {
4840
4855
  throw error;
4841
4856
  }
4842
4857
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
4843
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
4858
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
4844
4859
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
4845
4860
  controls.ensure(namespace);
4846
4861
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -6013,4 +6028,4 @@ export {
6013
6028
  accessKeyCredential,
6014
6029
  DynamoAPI
6015
6030
  };
6016
- //# sourceMappingURL=chunk-C22XGG65.js.map
6031
+ //# sourceMappingURL=chunk-4LTVTO5I.js.map