@crvouga/mockingbird-service-easypost 3.10.5 → 3.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-easypost
2
2
 
3
+ ## 3.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
+ ## 3.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
  ## 3.10.5 (2026-11-02)
4
16
 
5
17
  ### Fixes and improvements
@@ -2666,6 +2666,17 @@ var createNamespaceControls = (options) => {
2666
2666
  };
2667
2667
  };
2668
2668
 
2669
+ // ../core/dist/signing.js
2670
+ var encoder = new TextEncoder();
2671
+ var timingSafeEqual = (a, b) => {
2672
+ if (a.length !== b.length)
2673
+ return false;
2674
+ let diff = 0;
2675
+ for (let i = 0; i < a.length; i++)
2676
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2677
+ return diff === 0;
2678
+ };
2679
+
2669
2680
  // ../core/dist/surface.js
2670
2681
  var defineMock = (runtime) => runtime;
2671
2682
  var ADMIN_ROUTE_REFERENCE = {
@@ -2784,6 +2795,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2784
2795
  }
2785
2796
  };
2786
2797
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2798
+ var hasAdminKey = (headers, adminKey) => {
2799
+ const sent = headers.get(ADMIN_KEY_HEADER);
2800
+ return sent !== null && timingSafeEqual(sent, adminKey);
2801
+ };
2787
2802
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2788
2803
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2789
2804
  var ADMIN_CONTROL_PAGES = [
@@ -3257,7 +3272,7 @@ var createControlPlane = (context) => {
3257
3272
  }
3258
3273
  const path = url.pathname.slice(adminPrefix.length) || "/";
3259
3274
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
3260
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
3275
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
3261
3276
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
3262
3277
  }
3263
3278
  for (const route of routes) {
@@ -4099,7 +4114,7 @@ var stateAdminRoutes = (routes) => {
4099
4114
  };
4100
4115
 
4101
4116
  // ../core/dist/version.js
4102
- var PACKAGE_VERSION = true ? "3.10.5" : UNRELEASED_VERSION;
4117
+ var PACKAGE_VERSION = true ? "3.10.7" : UNRELEASED_VERSION;
4103
4118
 
4104
4119
  // ../core/dist/webhooks.js
4105
4120
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -5078,7 +5093,7 @@ var createRuntime = (options) => {
5078
5093
  throw error;
5079
5094
  }
5080
5095
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
5081
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
5096
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
5082
5097
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
5083
5098
  controls.ensure(namespace);
5084
5099
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -5801,4 +5816,4 @@ export {
5801
5816
  isTrackerStatus,
5802
5817
  EasyPostAPI
5803
5818
  };
5804
- //# sourceMappingURL=chunk-ZCONBGMU.js.map
5819
+ //# sourceMappingURL=chunk-A3QB4NR3.js.map