@crvouga/mockingbird-service-edamam 3.10.3 → 3.10.5

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,18 @@
1
1
  # Changelog — @crvouga/mockingbird-service-edamam
2
2
 
3
+ ## 3.10.5 (2026-11-02)
4
+
5
+ ### Fixes and improvements
6
+
7
+ - compare the admin key in constant time ([2a43141](https://github.com/crvouga/mockingbird/commit/2a43141f50dab41e698c3bbce0c69bf65b40e24e))
8
+
9
+ ## 3.10.4 (2026-11-02)
10
+
11
+ ### Fixes and improvements
12
+
13
+ - stop walkSchema recursing forever on a self-referential $ref ([69464a9](https://github.com/crvouga/mockingbird/commit/69464a9d9e7f468c5e1095125108d4d3d5515431))
14
+ - densify sparse bracket arrays by their written indices ([84a28cb](https://github.com/crvouga/mockingbird/commit/84a28cb182e3d7df91102897f0fc11fca714ba5f))
15
+
3
16
  ## 3.10.3 (2026-11-02)
4
17
 
5
18
  ### Fixes and improvements
@@ -473,6 +473,7 @@ var parsePath = (rawKey) => {
473
473
  return path;
474
474
  };
475
475
  var isIndex = (segment) => /^(0|[1-9][0-9]*)$/.test(segment);
476
+ var MAX_ARRAY_INDEX = 4294967294;
476
477
  var put = (target, key, value) => {
477
478
  if (key === "__proto__") {
478
479
  Object.defineProperty(target, key, {
@@ -535,8 +536,17 @@ var decodeFormPairs = (pairs) => {
535
536
  var densify = (value) => {
536
537
  if (typeof value === "string")
537
538
  return value;
538
- if (Array.isArray(value))
539
- return value.filter((item) => item !== void 0).map(densify);
539
+ if (Array.isArray(value)) {
540
+ const dense = [];
541
+ for (const key of Object.keys(value)) {
542
+ if (!isIndex(key) || Number(key) > MAX_ARRAY_INDEX)
543
+ continue;
544
+ const item = value[Number(key)];
545
+ if (item !== void 0)
546
+ dense.push(densify(item));
547
+ }
548
+ return dense;
549
+ }
540
550
  const out = {};
541
551
  for (const [key, item] of Object.entries(value))
542
552
  put(out, key, densify(item));
@@ -2634,6 +2644,25 @@ var createNamespaceControls = (options) => {
2634
2644
  };
2635
2645
  };
2636
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
+
2637
2666
  // ../core/dist/surface.js
2638
2667
  var defineMock = (runtime) => runtime;
2639
2668
  var ADMIN_ROUTE_REFERENCE = {
@@ -2752,6 +2781,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2752
2781
  }
2753
2782
  };
2754
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
+ };
2755
2788
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2756
2789
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2757
2790
  var ADMIN_CONTROL_PAGES = [
@@ -3225,7 +3258,7 @@ var createControlPlane = (context) => {
3225
3258
  }
3226
3259
  const path = url.pathname.slice(adminPrefix.length) || "/";
3227
3260
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
3228
- 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)) {
3229
3262
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
3230
3263
  }
3231
3264
  for (const route of routes) {
@@ -4026,18 +4059,7 @@ var stateAdminRoutes = (routes) => {
4026
4059
  };
4027
4060
 
4028
4061
  // ../core/dist/version.js
4029
- var PACKAGE_VERSION = true ? "3.10.3" : UNRELEASED_VERSION;
4030
-
4031
- // ../core/dist/signing.js
4032
- var encoder = new TextEncoder();
4033
- var toBase64 = (bytes) => {
4034
- let binary = "";
4035
- for (const byte of bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes)) {
4036
- binary += String.fromCharCode(byte);
4037
- }
4038
- return btoa(binary);
4039
- };
4040
- var fromBase64 = (value) => Uint8Array.from(atob(value), (char) => char.charCodeAt(0));
4062
+ var PACKAGE_VERSION = true ? "3.10.5" : UNRELEASED_VERSION;
4041
4063
 
4042
4064
  // ../core/dist/webhooks.js
4043
4065
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -5018,7 +5040,7 @@ var createRuntime = (options) => {
5018
5040
  throw error;
5019
5041
  }
5020
5042
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
5021
- 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))
5022
5044
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
5023
5045
  controls.ensure(namespace);
5024
5046
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -6653,4 +6675,4 @@ export {
6653
6675
  appIdCredential,
6654
6676
  EdamamAPI
6655
6677
  };
6656
- //# sourceMappingURL=chunk-V6NIMN6T.js.map
6678
+ //# sourceMappingURL=chunk-7YAC6QEO.js.map