@crvouga/mockingbird-service-aws-secrets 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-secrets
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
@@ -2507,6 +2507,17 @@ var createNamespaceControls = (options) => {
2507
2507
  };
2508
2508
  };
2509
2509
 
2510
+ // ../core/dist/signing.js
2511
+ var encoder = new TextEncoder();
2512
+ var timingSafeEqual = (a, b) => {
2513
+ if (a.length !== b.length)
2514
+ return false;
2515
+ let diff = 0;
2516
+ for (let i = 0; i < a.length; i++)
2517
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
2518
+ return diff === 0;
2519
+ };
2520
+
2510
2521
  // ../core/dist/surface.js
2511
2522
  var defineMock = (runtime) => runtime;
2512
2523
  var ADMIN_ROUTE_REFERENCE = {
@@ -2625,6 +2636,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
2625
2636
  }
2626
2637
  };
2627
2638
  var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
2639
+ var hasAdminKey = (headers, adminKey) => {
2640
+ const sent = headers.get(ADMIN_KEY_HEADER);
2641
+ return sent !== null && timingSafeEqual(sent, adminKey);
2642
+ };
2628
2643
  var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
2629
2644
  var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
2630
2645
  var ADMIN_CONTROL_PAGES = [
@@ -3098,7 +3113,7 @@ var createControlPlane = (context) => {
3098
3113
  }
3099
3114
  const path = url.pathname.slice(adminPrefix.length) || "/";
3100
3115
  const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
3101
- if (!shell && context.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== context.adminKey) {
3116
+ if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
3102
3117
  return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
3103
3118
  }
3104
3119
  for (const route of routes) {
@@ -3861,7 +3876,7 @@ var stateAdminRoutes = (routes) => {
3861
3876
  };
3862
3877
 
3863
3878
  // ../core/dist/version.js
3864
- var PACKAGE_VERSION = true ? "3.10.4" : UNRELEASED_VERSION;
3879
+ var PACKAGE_VERSION = true ? "3.10.6" : UNRELEASED_VERSION;
3865
3880
 
3866
3881
  // ../core/dist/webhooks.js
3867
3882
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -4840,7 +4855,7 @@ var createRuntime = (options) => {
4840
4855
  throw error2;
4841
4856
  }
4842
4857
  const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
4843
- if ((requested || rewinds) && options.adminKey !== void 0 && request.headers.get(ADMIN_KEY_HEADER) !== options.adminKey)
4858
+ if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
4844
4859
  return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
4845
4860
  controls.ensure(namespace);
4846
4861
  if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
@@ -5242,7 +5257,7 @@ var createRuntime2 = (options = {}) => createRuntime({
5242
5257
  // src/index.ts
5243
5258
  var AWS_SECRETS_NAMESPACE = "aws-secrets";
5244
5259
  var accessKeyCredential = sigV4AccessKeyId;
5245
- var encoder = new TextEncoder();
5260
+ var encoder2 = new TextEncoder();
5246
5261
  var decoder = new TextDecoder();
5247
5262
  var base64 = (bytes) => {
5248
5263
  let binary = "";
@@ -5250,7 +5265,7 @@ var base64 = (bytes) => {
5250
5265
  return btoa(binary);
5251
5266
  };
5252
5267
  var unbase64 = (value) => Uint8Array.from(atob(value), (char) => char.charCodeAt(0));
5253
- var encodeString = (value) => base64(encoder.encode(value));
5268
+ var encodeString = (value) => base64(encoder2.encode(value));
5254
5269
  var decodeString = (value) => decoder.decode(unbase64(value));
5255
5270
  var AwsSecretsAPI = class {
5256
5271
  constructor(options = {}) {
@@ -5277,7 +5292,7 @@ var AwsSecretsAPI = class {
5277
5292
  Name: secret.name,
5278
5293
  ...secret.binary ? {
5279
5294
  SecretBinary: base64(
5280
- typeof secret.value === "string" ? encoder.encode(secret.value) : secret.value
5295
+ typeof secret.value === "string" ? encoder2.encode(secret.value) : secret.value
5281
5296
  )
5282
5297
  } : {
5283
5298
  SecretString: typeof secret.value === "string" ? secret.value : decoder.decode(secret.value)
@@ -5408,7 +5423,7 @@ var AwsSecretsAPI = class {
5408
5423
  if (!secret) return void 0;
5409
5424
  return this.newVersion(
5410
5425
  secret,
5411
- binary ? { SecretBinary: base64(typeof value === "string" ? encoder.encode(value) : value) } : { SecretString: typeof value === "string" ? value : decoder.decode(value) }
5426
+ binary ? { SecretBinary: base64(typeof value === "string" ? encoder2.encode(value) : value) } : { SecretString: typeof value === "string" ? value : decoder.decode(value) }
5412
5427
  );
5413
5428
  }
5414
5429
  async fetch(request) {
@@ -5545,4 +5560,4 @@ export {
5545
5560
  accessKeyCredential,
5546
5561
  AwsSecretsAPI
5547
5562
  };
5548
- //# sourceMappingURL=chunk-V7VHEQPO.js.map
5563
+ //# sourceMappingURL=chunk-AOO7SYOZ.js.map