@crvouga/mockingbird-service-postgres 3.12.4 → 3.12.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,9 +1,17 @@
1
1
  # Changelog — @crvouga/mockingbird-service-postgres
2
2
 
3
+ ## 3.12.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
+
3
9
  ## 3.12.4 (2026-11-02)
4
10
 
5
11
  ### Fixes and improvements
6
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))
7
15
  - do not save idempotent results for requests that fail validation ([f2161aa](https://github.com/crvouga/mockingbird/commit/f2161aadeae30bcc586e26131da12a7030bdeb11))
8
16
 
9
17
  ## 3.12.3 (2026-11-02)
package/dist/admin.js CHANGED
@@ -1562,6 +1562,17 @@ var createNamespaceControls = (options) => {
1562
1562
  };
1563
1563
  };
1564
1564
 
1565
+ // ../core/dist/signing.js
1566
+ var encoder = new TextEncoder();
1567
+ var timingSafeEqual = (a, b) => {
1568
+ if (a.length !== b.length)
1569
+ return false;
1570
+ let diff = 0;
1571
+ for (let i = 0; i < a.length; i++)
1572
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
1573
+ return diff === 0;
1574
+ };
1575
+
1565
1576
  // ../core/dist/surface.js
1566
1577
  var ADMIN_ROUTE_REFERENCE = {
1567
1578
  "GET /": "This index: every route and control header, with a one-line summary each.",
@@ -1625,6 +1636,10 @@ var resolveAdminPrefix = (prefix = ADMIN_PREFIX) => {
1625
1636
  };
1626
1637
  var isAdminPath = (path, prefix) => path === prefix || path.startsWith(`${prefix}/`);
1627
1638
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
1639
+ var hasAdminKey = (headers, adminKey) => {
1640
+ const sent = headers.get(ADMIN_KEY_HEADER);
1641
+ return sent !== null && timingSafeEqual(sent, adminKey);
1642
+ };
1628
1643
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
1629
1644
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
1630
1645
  var ADMIN_CONTROL_PAGES = [
@@ -2098,7 +2113,7 @@ var createControlPlane = (context) => {
2098
2113
  }
2099
2114
  const path = url.pathname.slice(adminPrefix.length) || "/";
2100
2115
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
2101
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
2116
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
2102
2117
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
2103
2118
  }
2104
2119
  for (const route of routes) {
@@ -9289,9 +9304,9 @@ function cmpString(a, b) {
9289
9304
  }
9290
9305
  return ea.length - eb.length;
9291
9306
  }
9292
- var encoder = new TextEncoder();
9307
+ var encoder2 = new TextEncoder();
9293
9308
  function utf8(s) {
9294
- return encoder.encode(s);
9309
+ return encoder2.encode(s);
9295
9310
  }
9296
9311
  function arrayCompare(t, a, b, ctx) {
9297
9312
  const elem = arrayElemType(t);