@crvouga/mockingbird-service-aws-speech 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-aws-speech
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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createRuntime
3
- } from "./chunk-KUTPU742.js";
3
+ } from "./chunk-GTWVESZG.js";
4
4
 
5
5
  // src/h2c.ts
6
6
  import {
@@ -305,4 +305,4 @@ export {
305
305
  createServer,
306
306
  serveTarget
307
307
  };
308
- //# sourceMappingURL=chunk-XSJYBA2H.js.map
308
+ //# sourceMappingURL=chunk-7IWY6SCH.js.map
@@ -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));
@@ -2369,6 +2379,18 @@ var createNamespaceControls = (options) => {
2369
2379
  };
2370
2380
  };
2371
2381
 
2382
+ // ../core/dist/signing.js
2383
+ var encoder = new TextEncoder();
2384
+ var toHex = (bytes) => [...bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
2385
+ var timingSafeEqual = (a, b) => {
2386
+ if (a.length !== b.length)
2387
+ return false;
2388
+ let diff = 0;
2389
+ for (let i = 0; i < a.length; i++)
2390
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2391
+ return diff === 0;
2392
+ };
2393
+
2372
2394
  // ../core/dist/surface.js
2373
2395
  var defineMock = (runtime) => runtime;
2374
2396
  var ADMIN_ROUTE_REFERENCE = {
@@ -2487,6 +2509,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2487
2509
  }
2488
2510
  };
2489
2511
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2512
+ var hasAdminKey = (headers, adminKey) => {
2513
+ const sent = headers.get(ADMIN_KEY_HEADER);
2514
+ return sent !== null && timingSafeEqual(sent, adminKey);
2515
+ };
2490
2516
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2491
2517
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2492
2518
  var ADMIN_CONTROL_PAGES = [
@@ -2960,7 +2986,7 @@ var createControlPlane = (context) => {
2960
2986
  }
2961
2987
  const path = url.pathname.slice(adminPrefix.length) || "/";
2962
2988
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
2963
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
2989
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
2964
2990
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
2965
2991
  }
2966
2992
  for (const route of routes) {
@@ -3751,11 +3777,7 @@ var stateAdminRoutes = (routes) => {
3751
3777
  };
3752
3778
 
3753
3779
  // ../core/dist/version.js
3754
- var PACKAGE_VERSION = true ? "3.10.4" : UNRELEASED_VERSION;
3755
-
3756
- // ../core/dist/signing.js
3757
- var encoder = new TextEncoder();
3758
- var toHex = (bytes) => [...bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
3780
+ var PACKAGE_VERSION = true ? "3.10.6" : UNRELEASED_VERSION;
3759
3781
 
3760
3782
  // ../core/dist/webhooks.js
3761
3783
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -4736,7 +4758,7 @@ var createRuntime = (options) => {
4736
4758
  throw error;
4737
4759
  }
4738
4760
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
4739
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
4761
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
4740
4762
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
4741
4763
  controls.ensure(namespace);
4742
4764
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -6510,4 +6532,4 @@ export {
6510
6532
  accessKeyCredential,
6511
6533
  SpeechAPI
6512
6534
  };
6513
- //# sourceMappingURL=chunk-KUTPU742.js.map
6535
+ //# sourceMappingURL=chunk-GTWVESZG.js.map