@crvouga/mockingbird-service-slack 3.10.3 → 3.10.4

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-slack
2
2
 
3
+ ## 3.10.4 (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.3 (2026-11-02)
4
10
 
5
11
  ### Fixes and improvements
@@ -14,7 +14,7 @@ import {
14
14
  resolveAdminPrefix,
15
15
  restoreClock,
16
16
  unbindSocketTransport
17
- } from "./chunk-WFT53W4L.js";
17
+ } from "./chunk-USP7TBUK.js";
18
18
 
19
19
  // ../../adapters/node/dist/cli.js
20
20
  import { readFile as readFile5 } from "node:fs/promises";
@@ -3062,7 +3062,7 @@ async function preflightFleet(config, options) {
3062
3062
  break;
3063
3063
  }
3064
3064
  }
3065
- targets.set(name, { ...target, packageVersion: packageVersion ?? "3.10.3" });
3065
+ targets.set(name, { ...target, packageVersion: packageVersion ?? "3.10.4" });
3066
3066
  } catch (error) {
3067
3067
  throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
3068
3068
  }
@@ -5383,4 +5383,4 @@ export {
5383
5383
  createServer2 as createServer,
5384
5384
  serveTarget
5385
5385
  };
5386
- //# sourceMappingURL=chunk-II4GRHGN.js.map
5386
+ //# sourceMappingURL=chunk-CNQLFHX2.js.map
@@ -2389,6 +2389,17 @@ var createNamespaceControls = (options) => {
2389
2389
  };
2390
2390
  };
2391
2391
 
2392
+ // ../core/dist/signing.js
2393
+ var encoder = new TextEncoder();
2394
+ var timingSafeEqual2 = (a, b) => {
2395
+ if (a.length !== b.length)
2396
+ return false;
2397
+ let diff = 0;
2398
+ for (let i = 0; i < a.length; i++)
2399
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2400
+ return diff === 0;
2401
+ };
2402
+
2392
2403
  // ../core/dist/surface.js
2393
2404
  var defineMock = (runtime) => runtime;
2394
2405
  var ADMIN_ROUTE_REFERENCE = {
@@ -2507,6 +2518,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2507
2518
  }
2508
2519
  };
2509
2520
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2521
+ var hasAdminKey = (headers, adminKey) => {
2522
+ const sent = headers.get(ADMIN_KEY_HEADER);
2523
+ return sent !== null && timingSafeEqual2(sent, adminKey);
2524
+ };
2510
2525
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2511
2526
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2512
2527
  var ADMIN_CONTROL_PAGES = [
@@ -2980,7 +2995,7 @@ var createControlPlane = (context) => {
2980
2995
  }
2981
2996
  const path = url.pathname.slice(adminPrefix.length) || "/";
2982
2997
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
2983
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
2998
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
2984
2999
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
2985
3000
  }
2986
3001
  for (const route of routes) {
@@ -3840,7 +3855,7 @@ var stateAdminRoutes = (routes) => {
3840
3855
  };
3841
3856
 
3842
3857
  // ../core/dist/version.js
3843
- var PACKAGE_VERSION = true ? "3.10.3" : UNRELEASED_VERSION;
3858
+ var PACKAGE_VERSION = true ? "3.10.4" : UNRELEASED_VERSION;
3844
3859
 
3845
3860
  // ../core/dist/webhooks.js
3846
3861
  var json5 = (status, body) => new Response(JSON.stringify(body), {
@@ -4821,7 +4836,7 @@ var createRuntime = (options) => {
4821
4836
  throw error;
4822
4837
  }
4823
4838
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
4824
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
4839
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
4825
4840
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
4826
4841
  controls.ensure(namespace);
4827
4842
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -12957,4 +12972,4 @@ export {
12957
12972
  * Copyright (c) 2021 - present, Yusuke Wada and Hono contributors
12958
12973
  * MIT license: see THIRD_PARTY_NOTICES.md in the repository and npm packages.
12959
12974
  */
12960
- //# sourceMappingURL=chunk-WFT53W4L.js.map
12975
+ //# sourceMappingURL=chunk-USP7TBUK.js.map