@crvouga/mockingbird-service-payload-cms 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,18 @@
1
1
  # Changelog — @crvouga/mockingbird-service-payload-cms
2
2
 
3
+ ## 3.10.6 (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.5 (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.4 (2026-11-02)
4
17
 
5
18
  ### Fixes and improvements
@@ -20,6 +20,7 @@ var parsePath = (rawKey) => {
20
20
  return path;
21
21
  };
22
22
  var isIndex = (segment) => /^(0|[1-9][0-9]*)$/.test(segment);
23
+ var MAX_ARRAY_INDEX = 4294967294;
23
24
  var put = (target, key, value) => {
24
25
  if (key === "__proto__") {
25
26
  Object.defineProperty(target, key, {
@@ -82,8 +83,17 @@ var decodeFormPairs = (pairs) => {
82
83
  var densify = (value) => {
83
84
  if (typeof value === "string")
84
85
  return value;
85
- if (Array.isArray(value))
86
- return value.filter((item) => item !== void 0).map(densify);
86
+ if (Array.isArray(value)) {
87
+ const dense = [];
88
+ for (const key of Object.keys(value)) {
89
+ if (!isIndex(key) || Number(key) > MAX_ARRAY_INDEX)
90
+ continue;
91
+ const item = value[Number(key)];
92
+ if (item !== void 0)
93
+ dense.push(densify(item));
94
+ }
95
+ return dense;
96
+ }
87
97
  const out = {};
88
98
  for (const [key, item] of Object.entries(value))
89
99
  put(out, key, densify(item));
@@ -2345,6 +2355,17 @@ var createNamespaceControls = (options) => {
2345
2355
  };
2346
2356
  };
2347
2357
 
2358
+ // ../core/dist/signing.js
2359
+ var encoder = new TextEncoder();
2360
+ var timingSafeEqual = (a, b) => {
2361
+ if (a.length !== b.length)
2362
+ return false;
2363
+ let diff = 0;
2364
+ for (let i = 0; i < a.length; i++)
2365
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2366
+ return diff === 0;
2367
+ };
2368
+
2348
2369
  // ../core/dist/surface.js
2349
2370
  var defineMock = (runtime) => runtime;
2350
2371
  var ADMIN_ROUTE_REFERENCE = {
@@ -2463,6 +2484,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2463
2484
  }
2464
2485
  };
2465
2486
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2487
+ var hasAdminKey = (headers, adminKey) => {
2488
+ const sent = headers.get(ADMIN_KEY_HEADER);
2489
+ return sent !== null && timingSafeEqual(sent, adminKey);
2490
+ };
2466
2491
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2467
2492
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2468
2493
  var ADMIN_CONTROL_PAGES = [
@@ -2936,7 +2961,7 @@ var createControlPlane = (context) => {
2936
2961
  }
2937
2962
  const path = url.pathname.slice(adminPrefix.length) || "/";
2938
2963
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
2939
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
2964
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
2940
2965
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
2941
2966
  }
2942
2967
  for (const route of routes) {
@@ -3767,7 +3792,7 @@ var stateAdminRoutes = (routes) => {
3767
3792
  };
3768
3793
 
3769
3794
  // ../core/dist/version.js
3770
- var PACKAGE_VERSION = true ? "3.10.4" : UNRELEASED_VERSION;
3795
+ var PACKAGE_VERSION = true ? "3.10.6" : UNRELEASED_VERSION;
3771
3796
 
3772
3797
  // ../core/dist/webhooks.js
3773
3798
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -4748,7 +4773,7 @@ var createRuntime = (options) => {
4748
4773
  throw error;
4749
4774
  }
4750
4775
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
4751
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
4776
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
4752
4777
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
4753
4778
  controls.ensure(namespace);
4754
4779
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -5531,4 +5556,4 @@ export {
5531
5556
  compileWhere,
5532
5557
  PayloadCmsAPI
5533
5558
  };
5534
- //# sourceMappingURL=chunk-T5APRFS6.js.map
5559
+ //# sourceMappingURL=chunk-2DDET23K.js.map