@crvouga/mockingbird-service-aws-speech 3.10.5 → 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,11 @@
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
+
3
9
  ## 3.10.5 (2026-11-02)
4
10
 
5
11
  ### Fixes and improvements
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createRuntime
3
- } from "./chunk-OT36VMFU.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-UPLAPOSU.js.map
308
+ //# sourceMappingURL=chunk-7IWY6SCH.js.map
@@ -2379,6 +2379,18 @@ var createNamespaceControls = (options) => {
2379
2379
  };
2380
2380
  };
2381
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
+
2382
2394
  // ../core/dist/surface.js
2383
2395
  var defineMock = (runtime) => runtime;
2384
2396
  var ADMIN_ROUTE_REFERENCE = {
@@ -2497,6 +2509,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2497
2509
  }
2498
2510
  };
2499
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
+ };
2500
2516
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2501
2517
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2502
2518
  var ADMIN_CONTROL_PAGES = [
@@ -2970,7 +2986,7 @@ var createControlPlane = (context) => {
2970
2986
  }
2971
2987
  const path = url.pathname.slice(adminPrefix.length) || "/";
2972
2988
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
2973
- 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)) {
2974
2990
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
2975
2991
  }
2976
2992
  for (const route of routes) {
@@ -3761,11 +3777,7 @@ var stateAdminRoutes = (routes) => {
3761
3777
  };
3762
3778
 
3763
3779
  // ../core/dist/version.js
3764
- var PACKAGE_VERSION = true ? "3.10.5" : UNRELEASED_VERSION;
3765
-
3766
- // ../core/dist/signing.js
3767
- var encoder = new TextEncoder();
3768
- 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;
3769
3781
 
3770
3782
  // ../core/dist/webhooks.js
3771
3783
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -4746,7 +4758,7 @@ var createRuntime = (options) => {
4746
4758
  throw error;
4747
4759
  }
4748
4760
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
4749
- 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))
4750
4762
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
4751
4763
  controls.ensure(namespace);
4752
4764
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -6520,4 +6532,4 @@ export {
6520
6532
  accessKeyCredential,
6521
6533
  SpeechAPI
6522
6534
  };
6523
- //# sourceMappingURL=chunk-OT36VMFU.js.map
6535
+ //# sourceMappingURL=chunk-GTWVESZG.js.map