@crvouga/mockingbird-service-google 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-google
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
@@ -9,7 +9,7 @@ import {
9
9
  parseFaultHeader,
10
10
  resolveAdminPrefix,
11
11
  restoreClock
12
- } from "./chunk-CNCZITHC.js";
12
+ } from "./chunk-LLHSVKQY.js";
13
13
 
14
14
  // ../../adapters/node/dist/cli.js
15
15
  import { readFile as readFile5 } from "node:fs/promises";
@@ -3057,7 +3057,7 @@ async function preflightFleet(config, options) {
3057
3057
  break;
3058
3058
  }
3059
3059
  }
3060
- targets.set(name, { ...target, packageVersion: packageVersion ?? "0.9.5" });
3060
+ targets.set(name, { ...target, packageVersion: packageVersion ?? "0.9.7" });
3061
3061
  } catch (error) {
3062
3062
  throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
3063
3063
  }
@@ -5062,4 +5062,4 @@ export {
5062
5062
  createServer2 as createServer,
5063
5063
  serveTarget
5064
5064
  };
5065
- //# sourceMappingURL=chunk-6727KT3S.js.map
5065
+ //# sourceMappingURL=chunk-K2QBOUKS.js.map
@@ -2470,6 +2470,17 @@ var createNamespaceControls = (options) => {
2470
2470
  };
2471
2471
  };
2472
2472
 
2473
+ // ../core/dist/signing.js
2474
+ var encoder = new TextEncoder();
2475
+ var timingSafeEqual2 = (a, b) => {
2476
+ if (a.length !== b.length)
2477
+ return false;
2478
+ let diff = 0;
2479
+ for (let i = 0; i < a.length; i++)
2480
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2481
+ return diff === 0;
2482
+ };
2483
+
2473
2484
  // ../core/dist/surface.js
2474
2485
  var defineMock = (runtime) => runtime;
2475
2486
  var ADMIN_ROUTE_REFERENCE = {
@@ -2588,6 +2599,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2588
2599
  }
2589
2600
  };
2590
2601
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2602
+ var hasAdminKey = (headers, adminKey) => {
2603
+ const sent = headers.get(ADMIN_KEY_HEADER);
2604
+ return sent !== null && timingSafeEqual2(sent, adminKey);
2605
+ };
2591
2606
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2592
2607
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2593
2608
  var ADMIN_CONTROL_PAGES = [
@@ -3061,7 +3076,7 @@ var createControlPlane = (context) => {
3061
3076
  }
3062
3077
  const path = url.pathname.slice(adminPrefix.length) || "/";
3063
3078
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
3064
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
3079
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
3065
3080
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
3066
3081
  }
3067
3082
  for (const route of routes) {
@@ -3816,7 +3831,7 @@ var stateAdminRoutes = (routes) => {
3816
3831
  };
3817
3832
 
3818
3833
  // ../core/dist/version.js
3819
- var PACKAGE_VERSION = true ? "0.9.5" : UNRELEASED_VERSION;
3834
+ var PACKAGE_VERSION = true ? "0.9.7" : UNRELEASED_VERSION;
3820
3835
 
3821
3836
  // ../core/dist/webhooks.js
3822
3837
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -4795,7 +4810,7 @@ var createRuntime = (options) => {
4795
4810
  throw error;
4796
4811
  }
4797
4812
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
4798
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
4813
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
4799
4814
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
4800
4815
  controls.ensure(namespace);
4801
4816
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -10363,4 +10378,4 @@ export {
10363
10378
  * Copyright (c) 2021 - present, Yusuke Wada and Hono contributors
10364
10379
  * MIT license: see THIRD_PARTY_NOTICES.md in the repository and npm packages.
10365
10380
  */
10366
- //# sourceMappingURL=chunk-CNCZITHC.js.map
10381
+ //# sourceMappingURL=chunk-LLHSVKQY.js.map