@crvouga/mockingbird-service-junction 3.10.6 → 3.10.8

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-junction
2
2
 
3
+ ## 3.10.8 (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.7 (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.6 (2026-11-02)
4
16
 
5
17
  ### Fixes and improvements
@@ -13,7 +13,7 @@ import {
13
13
  pullCorpus,
14
14
  resolveAdminPrefix,
15
15
  restoreClock
16
- } from "./chunk-CNSVFYBN.js";
16
+ } from "./chunk-QCCX6DI7.js";
17
17
  import {
18
18
  defaultCorpus
19
19
  } from "./chunk-2FZJPMTR.js";
@@ -3070,7 +3070,7 @@ async function preflightFleet(config, options) {
3070
3070
  break;
3071
3071
  }
3072
3072
  }
3073
- targets.set(name, { ...target, packageVersion: packageVersion ?? "3.10.6" });
3073
+ targets.set(name, { ...target, packageVersion: packageVersion ?? "3.10.8" });
3074
3074
  } catch (error) {
3075
3075
  throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
3076
3076
  }
@@ -5264,4 +5264,4 @@ export {
5264
5264
  createServer2 as createServer,
5265
5265
  serveTarget
5266
5266
  };
5267
- //# sourceMappingURL=chunk-7VFPFGD2.js.map
5267
+ //# sourceMappingURL=chunk-C7TRCEUC.js.map
@@ -2405,6 +2405,17 @@ var createNamespaceControls = (options) => {
2405
2405
  };
2406
2406
  };
2407
2407
 
2408
+ // ../core/dist/signing.js
2409
+ var encoder = new TextEncoder();
2410
+ var timingSafeEqual = (a, b) => {
2411
+ if (a.length !== b.length)
2412
+ return false;
2413
+ let diff = 0;
2414
+ for (let i = 0; i < a.length; i++)
2415
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2416
+ return diff === 0;
2417
+ };
2418
+
2408
2419
  // ../core/dist/surface.js
2409
2420
  var defineMock = (runtime) => runtime;
2410
2421
  var ADMIN_ROUTE_REFERENCE = {
@@ -2523,6 +2534,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2523
2534
  }
2524
2535
  };
2525
2536
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2537
+ var hasAdminKey = (headers, adminKey) => {
2538
+ const sent = headers.get(ADMIN_KEY_HEADER);
2539
+ return sent !== null && timingSafeEqual(sent, adminKey);
2540
+ };
2526
2541
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2527
2542
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2528
2543
  var ADMIN_CONTROL_PAGES = [
@@ -2996,7 +3011,7 @@ var createControlPlane = (context) => {
2996
3011
  }
2997
3012
  const path = url.pathname.slice(adminPrefix.length) || "/";
2998
3013
  const shell = request2.method === "GET" && (path === "/ui" || path === "/ui/");
2999
- if (!shell && context.adminKey !== void 0 && request2.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
3014
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request2.headers, context.adminKey)) {
3000
3015
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
3001
3016
  }
3002
3017
  for (const route of routes) {
@@ -3779,7 +3794,7 @@ var stateAdminRoutes = (routes) => {
3779
3794
  };
3780
3795
 
3781
3796
  // ../core/dist/version.js
3782
- var PACKAGE_VERSION = true ? "3.10.6" : UNRELEASED_VERSION;
3797
+ var PACKAGE_VERSION = true ? "3.10.8" : UNRELEASED_VERSION;
3783
3798
 
3784
3799
  // ../core/dist/webhooks.js
3785
3800
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -4758,7 +4773,7 @@ var createRuntime = (options) => {
4758
4773
  throw error;
4759
4774
  }
4760
4775
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request2.method);
4761
- if ((requested || rewinds) && options.adminKey !== void 0 && request2.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
4776
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request2.headers, options.adminKey))
4762
4777
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
4763
4778
  controls.ensure(namespace);
4764
4779
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -12679,7 +12694,7 @@ var diffCorpus = (before, after) => {
12679
12694
  };
12680
12695
 
12681
12696
  // src/webhooks.ts
12682
- var encoder = new TextEncoder();
12697
+ var encoder2 = new TextEncoder();
12683
12698
  var base64 = (bytes) => {
12684
12699
  let binary = "";
12685
12700
  for (const byte of new Uint8Array(bytes)) binary += String.fromCharCode(byte);
@@ -12704,7 +12719,7 @@ var signSvix = async (secret, messageId, timestampSeconds, body) => {
12704
12719
  const signed = await crypto.subtle.sign(
12705
12720
  "HMAC",
12706
12721
  key,
12707
- encoder.encode(`${messageId}.${timestampSeconds}.${body}`)
12722
+ encoder2.encode(`${messageId}.${timestampSeconds}.${body}`)
12708
12723
  );
12709
12724
  return `v1,${base64(signed)}`;
12710
12725
  };
@@ -13913,4 +13928,4 @@ export {
13913
13928
  JunctionAPI,
13914
13929
  LabAccountConflict
13915
13930
  };
13916
- //# sourceMappingURL=chunk-CNSVFYBN.js.map
13931
+ //# sourceMappingURL=chunk-QCCX6DI7.js.map