@crvouga/mockingbird-service-edamam 3.10.4 → 3.10.6

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-edamam
2
2
 
3
+ ## 3.10.6 (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.5 (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.4 (2026-11-02)
4
16
 
5
17
  ### Fixes and improvements
@@ -2644,6 +2644,25 @@ var createNamespaceControls = (options) => {
2644
2644
  };
2645
2645
  };
2646
2646
 
2647
+ // ../core/dist/signing.js
2648
+ var encoder = new TextEncoder();
2649
+ var toBase64 = (bytes) => {
2650
+ let binary = "";
2651
+ for (const byte of bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes)) {
2652
+ binary += String.fromCharCode(byte);
2653
+ }
2654
+ return btoa(binary);
2655
+ };
2656
+ var fromBase64 = (value) => Uint8Array.from(atob(value), (char) => char.charCodeAt(0));
2657
+ var timingSafeEqual = (a, b) => {
2658
+ if (a.length !== b.length)
2659
+ return false;
2660
+ let diff = 0;
2661
+ for (let i = 0; i < a.length; i++)
2662
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2663
+ return diff === 0;
2664
+ };
2665
+
2647
2666
  // ../core/dist/surface.js
2648
2667
  var defineMock = (runtime) => runtime;
2649
2668
  var ADMIN_ROUTE_REFERENCE = {
@@ -2762,6 +2781,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2762
2781
  }
2763
2782
  };
2764
2783
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2784
+ var hasAdminKey = (headers, adminKey) => {
2785
+ const sent = headers.get(ADMIN_KEY_HEADER);
2786
+ return sent !== null && timingSafeEqual(sent, adminKey);
2787
+ };
2765
2788
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2766
2789
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2767
2790
  var ADMIN_CONTROL_PAGES = [
@@ -3235,7 +3258,7 @@ var createControlPlane = (context) => {
3235
3258
  }
3236
3259
  const path = url.pathname.slice(adminPrefix.length) || "/";
3237
3260
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
3238
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
3261
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
3239
3262
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
3240
3263
  }
3241
3264
  for (const route of routes) {
@@ -4036,18 +4059,7 @@ var stateAdminRoutes = (routes) => {
4036
4059
  };
4037
4060
 
4038
4061
  // ../core/dist/version.js
4039
- var PACKAGE_VERSION = true ? "3.10.4" : UNRELEASED_VERSION;
4040
-
4041
- // ../core/dist/signing.js
4042
- var encoder = new TextEncoder();
4043
- var toBase64 = (bytes) => {
4044
- let binary = "";
4045
- for (const byte of bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes)) {
4046
- binary += String.fromCharCode(byte);
4047
- }
4048
- return btoa(binary);
4049
- };
4050
- var fromBase64 = (value) => Uint8Array.from(atob(value), (char) => char.charCodeAt(0));
4062
+ var PACKAGE_VERSION = true ? "3.10.6" : UNRELEASED_VERSION;
4051
4063
 
4052
4064
  // ../core/dist/webhooks.js
4053
4065
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -5028,7 +5040,7 @@ var createRuntime = (options) => {
5028
5040
  throw error;
5029
5041
  }
5030
5042
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
5031
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
5043
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
5032
5044
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
5033
5045
  controls.ensure(namespace);
5034
5046
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -6663,4 +6675,4 @@ export {
6663
6675
  appIdCredential,
6664
6676
  EdamamAPI
6665
6677
  };
6666
- //# sourceMappingURL=chunk-SXKX7KV7.js.map
6678
+ //# sourceMappingURL=chunk-7YAC6QEO.js.map