@crvouga/mockingbird-service-aws 0.9.5 → 0.9.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-aws
2
2
 
3
+ ## 0.9.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
+ ## 0.9.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
  ## 0.9.5 (2026-11-02)
4
16
 
5
17
  ### Fixes and improvements
@@ -2469,6 +2469,17 @@ var createNamespaceControls = (options) => {
2469
2469
  };
2470
2470
  };
2471
2471
 
2472
+ // ../core/dist/signing.js
2473
+ var encoder = new TextEncoder();
2474
+ var timingSafeEqual = (a, b) => {
2475
+ if (a.length !== b.length)
2476
+ return false;
2477
+ let diff = 0;
2478
+ for (let i = 0; i < a.length; i++)
2479
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2480
+ return diff === 0;
2481
+ };
2482
+
2472
2483
  // ../core/dist/surface.js
2473
2484
  var defineMock = (runtime) => runtime;
2474
2485
  var ADMIN_ROUTE_REFERENCE = {
@@ -2587,6 +2598,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2587
2598
  }
2588
2599
  };
2589
2600
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2601
+ var hasAdminKey = (headers, adminKey) => {
2602
+ const sent = headers.get(ADMIN_KEY_HEADER);
2603
+ return sent !== null && timingSafeEqual(sent, adminKey);
2604
+ };
2590
2605
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2591
2606
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2592
2607
  var ADMIN_CONTROL_PAGES = [
@@ -3060,7 +3075,7 @@ var createControlPlane = (context) => {
3060
3075
  }
3061
3076
  const path = url.pathname.slice(adminPrefix.length) || "/";
3062
3077
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
3063
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
3078
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
3064
3079
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
3065
3080
  }
3066
3081
  for (const route of routes) {
@@ -3815,7 +3830,7 @@ var stateAdminRoutes = (routes) => {
3815
3830
  };
3816
3831
 
3817
3832
  // ../core/dist/version.js
3818
- var PACKAGE_VERSION = true ? "0.9.5" : UNRELEASED_VERSION;
3833
+ var PACKAGE_VERSION = true ? "0.9.7" : UNRELEASED_VERSION;
3819
3834
 
3820
3835
  // ../core/dist/webhooks.js
3821
3836
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -4794,7 +4809,7 @@ var createRuntime = (options) => {
4794
4809
  throw error;
4795
4810
  }
4796
4811
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
4797
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
4812
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
4798
4813
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
4799
4814
  controls.ensure(namespace);
4800
4815
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -7759,4 +7774,4 @@ export {
7759
7774
  * Copyright (c) 2021 - present, Yusuke Wada and Hono contributors
7760
7775
  * MIT license: see THIRD_PARTY_NOTICES.md in the repository and npm packages.
7761
7776
  */
7762
- //# sourceMappingURL=chunk-XMCKHTB2.js.map
7777
+ //# sourceMappingURL=chunk-3YW6PCSY.js.map