@crvouga/mockingbird-service-google-maps 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-google-maps
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
@@ -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,25 @@ var createNamespaceControls = (options) => {
2369
2379
  };
2370
2380
  };
2371
2381
 
2382
+ // ../core/dist/signing.js
2383
+ var encoder = new TextEncoder();
2384
+ var toBase64 = (bytes) => {
2385
+ let binary = "";
2386
+ for (const byte of bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes)) {
2387
+ binary += String.fromCharCode(byte);
2388
+ }
2389
+ return btoa(binary);
2390
+ };
2391
+ var fromBase64 = (value) => Uint8Array.from(atob(value), (char) => char.charCodeAt(0));
2392
+ var timingSafeEqual = (a, b) => {
2393
+ if (a.length !== b.length)
2394
+ return false;
2395
+ let diff = 0;
2396
+ for (let i = 0; i < a.length; i++)
2397
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2398
+ return diff === 0;
2399
+ };
2400
+
2372
2401
  // ../core/dist/surface.js
2373
2402
  var defineMock = (runtime) => runtime;
2374
2403
  var ADMIN_ROUTE_REFERENCE = {
@@ -2487,6 +2516,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2487
2516
  }
2488
2517
  };
2489
2518
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2519
+ var hasAdminKey = (headers, adminKey) => {
2520
+ const sent = headers.get(ADMIN_KEY_HEADER);
2521
+ return sent !== null && timingSafeEqual(sent, adminKey);
2522
+ };
2490
2523
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2491
2524
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2492
2525
  var ADMIN_CONTROL_PAGES = [
@@ -2960,7 +2993,7 @@ var createControlPlane = (context) => {
2960
2993
  }
2961
2994
  const path = url.pathname.slice(adminPrefix.length) || "/";
2962
2995
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
2963
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
2996
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
2964
2997
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
2965
2998
  }
2966
2999
  for (const route of routes) {
@@ -3743,18 +3776,7 @@ var stateAdminRoutes = (routes) => {
3743
3776
  };
3744
3777
 
3745
3778
  // ../core/dist/version.js
3746
- var PACKAGE_VERSION = true ? "3.10.4" : UNRELEASED_VERSION;
3747
-
3748
- // ../core/dist/signing.js
3749
- var encoder = new TextEncoder();
3750
- var toBase64 = (bytes) => {
3751
- let binary = "";
3752
- for (const byte of bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes)) {
3753
- binary += String.fromCharCode(byte);
3754
- }
3755
- return btoa(binary);
3756
- };
3757
- var fromBase64 = (value) => Uint8Array.from(atob(value), (char) => char.charCodeAt(0));
3779
+ var PACKAGE_VERSION = true ? "3.10.6" : UNRELEASED_VERSION;
3758
3780
 
3759
3781
  // ../core/dist/webhooks.js
3760
3782
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -4735,7 +4757,7 @@ var createRuntime = (options) => {
4735
4757
  throw error;
4736
4758
  }
4737
4759
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
4738
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
4760
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
4739
4761
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
4740
4762
  controls.ensure(namespace);
4741
4763
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -7201,4 +7223,4 @@ export {
7201
7223
  keyCredential,
7202
7224
  GoogleMapsAPI
7203
7225
  };
7204
- //# sourceMappingURL=chunk-45UMH66Y.js.map
7226
+ //# sourceMappingURL=chunk-PF6TYQMS.js.map