@fedify/fedify 2.4.5-dev.2453 → 2.4.5

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.
Files changed (119) hide show
  1. package/README.md +3 -0
  2. package/dist/{builder-CS2LjGi-.mjs → builder-CUAVOHg6.mjs} +2 -2
  3. package/dist/{client-D-XP_Ccb.d.cts → client-3InDZbba.d.cts} +0 -1
  4. package/dist/{client-D-XP_Ccb.d.ts → client-3InDZbba.d.ts} +0 -1
  5. package/dist/{client-CEnNz8O7.mjs → client-5SIFzW3q.mjs} +113 -64
  6. package/dist/compat/mod.d.cts +1 -1
  7. package/dist/compat/mod.d.ts +1 -1
  8. package/dist/compat/transformers.test.mjs +1 -1
  9. package/dist/{compound-proof-C6_4hMjm.mjs → compound-proof-BNjXclzO.mjs} +2 -2
  10. package/dist/{context-7NyiqIcg.d.ts → context-CVOOd9pD.d.ts} +28 -2
  11. package/dist/{context-tsYPJ2Ew.d.cts → context-D0gFIgev.d.cts} +28 -2
  12. package/dist/{deno-CTWhU1oT.mjs → deno-DcJISdwu.mjs} +1 -1
  13. package/dist/docloader-CP1UxMLL.mjs +136 -0
  14. package/dist/federation/builder.test.mjs +1 -1
  15. package/dist/federation/compound-fanout.test.mjs +6 -3
  16. package/dist/federation/handler-compound-proof.test.mjs +3 -3
  17. package/dist/federation/handler.test.mjs +4 -4
  18. package/dist/federation/hashlink-media.test.mjs +2 -2
  19. package/dist/federation/idempotency.test.mjs +2 -2
  20. package/dist/federation/inbox-report.test.mjs +5 -5
  21. package/dist/federation/inbox.test.mjs +1 -1
  22. package/dist/federation/metrics.test.mjs +1 -1
  23. package/dist/federation/middleware.test.mjs +465 -32
  24. package/dist/federation/mod.cjs +1 -1
  25. package/dist/federation/mod.d.cts +3 -3
  26. package/dist/federation/mod.d.ts +3 -3
  27. package/dist/federation/mod.js +1 -1
  28. package/dist/federation/outgoing-proof.test.mjs +9 -6
  29. package/dist/federation/portable-actor.test.mjs +3 -3
  30. package/dist/federation/portable-chain.test.mjs +3 -3
  31. package/dist/federation/portable-collection.test.mjs +4 -4
  32. package/dist/federation/portable-delivery.test.mjs +2 -2
  33. package/dist/federation/portable-gateway-keys.test.mjs +11 -5
  34. package/dist/federation/portable-inbox.test.mjs +4 -4
  35. package/dist/federation/portable-parse-uri.test.mjs +1 -1
  36. package/dist/federation/portable-route-activity.test.mjs +2 -2
  37. package/dist/federation/portable.test.mjs +3 -3
  38. package/dist/federation/send.test.mjs +498 -88
  39. package/dist/federation/tasks/enqueue.test.mjs +1 -1
  40. package/dist/federation/tasks/tasks.test.mjs +2 -2
  41. package/dist/federation/temporal.test.mjs +1 -1
  42. package/dist/federation/webfinger.test.mjs +1 -1
  43. package/dist/{federation-DWVfQYX_.cjs → federation-Bkfq2YpS.cjs} +240 -102
  44. package/dist/{http-Dx5s5-pP.cjs → http-DHVH0DqC.cjs} +179 -110
  45. package/dist/{http-rgt1uxns.mjs → http-DuGmr8J8.mjs} +204 -106
  46. package/dist/{http-y9FnJFIe.js → http-R0ty0Udi.js} +178 -109
  47. package/dist/{inbox-4AZHfaO8.mjs → inbox-Bl1Y0s_A.mjs} +2 -2
  48. package/dist/{key-DYxuyd-s.d.cts → key-CyCcut3h.d.ts} +1 -2
  49. package/dist/{key-C1nv7_jD.d.ts → key-VEL1QqHF.d.cts} +1 -2
  50. package/dist/{kv-cache-DmxFPJaR.cjs → kv-cache-BtBSBZi9.cjs} +72 -27
  51. package/dist/{kv-cache-C3QkJF-x.mjs → kv-cache-DAV2_U44.mjs} +1 -1
  52. package/dist/{kv-cache-w4yWxqS1.js → kv-cache-FnLtmATH.js} +73 -28
  53. package/dist/{ld-CT-bAqSC.mjs → ld-Cy5GqbvS.mjs} +2 -2
  54. package/dist/{metrics-DsFjgE5X.mjs → metrics-CW8LoN7n.mjs} +1 -1
  55. package/dist/{middleware-DC8Omn-e.mjs → middleware-CdP-lz8Q.mjs} +1 -1
  56. package/dist/{middleware-Ch9WIaoZ.mjs → middleware-D2fk45uN.mjs} +82 -42
  57. package/dist/{middleware-BCHbutlW.js → middleware-D4rQARvq.js} +241 -103
  58. package/dist/{mod-DEZXwV6J.d.ts → mod-B1Qt5cQQ.d.ts} +2 -9
  59. package/dist/{mod-Xj5P4s4d.d.ts → mod-B5COx5Wd.d.ts} +1 -1
  60. package/dist/{mod-CavhAgLw.d.cts → mod-BTxJG7ZH.d.cts} +1 -1
  61. package/dist/{mod-CtpF2BU5.d.ts → mod-CpyjFA9s.d.ts} +1 -1
  62. package/dist/{mod-BojP2Bw3.d.cts → mod-makPMVMg.d.cts} +1 -1
  63. package/dist/{mod-Dw-nPxQh.d.cts → mod-ss0wBUH1.d.cts} +2 -9
  64. package/dist/mod.cjs +5 -5
  65. package/dist/mod.d.cts +6 -6
  66. package/dist/mod.d.ts +6 -6
  67. package/dist/mod.js +5 -5
  68. package/dist/nodeinfo/client.test.mjs +337 -19
  69. package/dist/nodeinfo/handler.test.mjs +1 -1
  70. package/dist/nodeinfo/mod.cjs +1 -1
  71. package/dist/nodeinfo/mod.d.cts +1 -1
  72. package/dist/nodeinfo/mod.d.ts +1 -1
  73. package/dist/nodeinfo/mod.js +1 -1
  74. package/dist/otel/exporter.test.mjs +292 -30
  75. package/dist/otel/mod.cjs +36 -30
  76. package/dist/otel/mod.d.cts +13 -0
  77. package/dist/otel/mod.d.ts +13 -0
  78. package/dist/otel/mod.js +36 -30
  79. package/dist/{owner-BGYYk-xi.mjs → owner-CbQZqFim.mjs} +3 -3
  80. package/dist/{portable-collection-DzEc4cB2.js → portable-collection-B5Aryi8I.js} +1 -1
  81. package/dist/{portable-collection-Cwn7DM0G.cjs → portable-collection-C_Kmvl3q.cjs} +1 -1
  82. package/dist/{portable-collection-DJSwe8QM.mjs → portable-collection-D2JYDadi.mjs} +2 -2
  83. package/dist/{portable-key-Dc6N1SEB.mjs → portable-key-Cc-ctNU2.mjs} +1 -1
  84. package/dist/{proof-DP93iZiH.mjs → proof-UN4CW55z.mjs} +3 -3
  85. package/dist/{send-c6buRbhI.mjs → send-BzbX2e6v.mjs} +174 -76
  86. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  87. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  88. package/dist/sig/compound-proof-verification.test.mjs +2 -2
  89. package/dist/sig/compound-proof.test.mjs +2 -2
  90. package/dist/sig/http.test.mjs +553 -2
  91. package/dist/sig/key.test.mjs +1 -1
  92. package/dist/sig/ld.test.mjs +1 -1
  93. package/dist/sig/mitra-receive-interop.test.mjs +4 -4
  94. package/dist/sig/mitra-send-interop.test.mjs +3 -3
  95. package/dist/sig/mod.cjs +2 -2
  96. package/dist/sig/mod.d.cts +2 -2
  97. package/dist/sig/mod.d.ts +2 -2
  98. package/dist/sig/mod.js +2 -2
  99. package/dist/sig/owner.test.mjs +1 -1
  100. package/dist/sig/portable-collection.test.mjs +1 -1
  101. package/dist/sig/portable-interop.test.mjs +3 -3
  102. package/dist/sig/portable-key.test.mjs +5 -5
  103. package/dist/sig/proof.test.mjs +4 -4
  104. package/dist/sig/tootik-request-interop.test.mjs +4 -4
  105. package/dist/sig/tootik-send-interop.test.mjs +3 -3
  106. package/dist/sig/verification.test.mjs +3 -3
  107. package/dist/{temporal-DfC1NkLg.mjs → temporal-B7Wvxrjs.mjs} +1 -1
  108. package/dist/testing/kv.test.mjs +1 -1
  109. package/dist/testing/mod.d.mts +26 -0
  110. package/dist/{types-_S2_MeLF.js → types-DUjZb4i6.js} +112 -63
  111. package/dist/{types-poIao40f.cjs → types-hKCCjii0.cjs} +111 -62
  112. package/dist/utils/docloader.test.mjs +344 -36
  113. package/dist/utils/kv-cache.test.mjs +1 -1
  114. package/dist/utils/mod.cjs +1 -1
  115. package/dist/utils/mod.d.cts +1 -1
  116. package/dist/utils/mod.d.ts +1 -1
  117. package/dist/utils/mod.js +1 -1
  118. package/package.json +7 -7
  119. package/dist/docloader-CXFE-n2O.mjs +0 -91
@@ -3,8 +3,8 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { c as isPortableActorDocument, d as isPortableUri, l as isPortableId, m as parseKeyIdString, s as isCompatibleKeyId } from "./portable-key-id-Ca30-hOa.mjs";
5
5
  import { a as verificationObservation, i as triedKey, n as observeCheck, t as observeAttempt } from "./verification-Dpfcw8ml.mjs";
6
- import { n as version, t as name } from "./deno-CTWhU1oT.mjs";
7
- import { _ as recordKeyLookup, n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch, t as classifyFetchError } from "./metrics-DsFjgE5X.mjs";
6
+ import { n as version, t as name } from "./deno-DcJISdwu.mjs";
7
+ import { _ as recordKeyLookup, n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch, t as classifyFetchError } from "./metrics-CW8LoN7n.mjs";
8
8
  import { n as attachKeyOwnerEvidence, t as MAX_PORTABLE_KEY_TTL } from "./key-owner-evidence-APB6NpSk.mjs";
9
9
  import { getLogger } from "@logtape/logtape";
10
10
  import { Activity, CryptographicKey, Multikey, Object as Object$1, getTypeId, isActor } from "@fedify/vocab";
@@ -1,7 +1,7 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-CTWhU1oT.mjs";
4
+ import { n as version, t as name } from "./deno-DcJISdwu.mjs";
5
5
  import { metrics } from "@opentelemetry/api";
6
6
  import { FetchError } from "@fedify/vocab-runtime";
7
7
  //#region src/federation/metrics.ts
@@ -1,5 +1,5 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as FederationImpl } from "./middleware-Ch9WIaoZ.mjs";
4
+ import { n as FederationImpl } from "./middleware-D2fk45uN.mjs";
5
5
  export { FederationImpl };
@@ -4,28 +4,28 @@ globalThis.addEventListener = () => {};
4
4
  import { d as isPortableUri, f as isSameObjectId, i as getPortableDid, l as isPortableId, n as getCanonicalPortableId, o as hasPortableActor, r as getGatewayKeyBase, s as isCompatibleKeyId, t as getAuthenticationOrigin, u as isPortableKeyId } from "./portable-key-id-Ca30-hOa.mjs";
5
5
  import { n as isPubliclyAddressedNode, t as isInAudience } from "./audience-CHQ-FlLD.mjs";
6
6
  import { a as verificationObservation, r as snapshotKey, t as observeAttempt } from "./verification-Dpfcw8ml.mjs";
7
- import { n as version, t as name } from "./deno-CTWhU1oT.mjs";
8
- import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-DsFjgE5X.mjs";
7
+ import { n as version, t as name } from "./deno-DcJISdwu.mjs";
8
+ import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-CW8LoN7n.mjs";
9
9
  import { t as formatAcceptSignature } from "./accept-CPVqki78.mjs";
10
- import { T as validateCryptoKey, _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike, w as importJwk, y as exportJwk } from "./ld-CT-bAqSC.mjs";
10
+ import { T as validateCryptoKey, _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike, w as importJwk, y as exportJwk } from "./ld-Cy5GqbvS.mjs";
11
11
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
12
- import { a as signObject, c as verifyPortableObjectProof, i as hasProofLike, s as verifyObject, t as InvalidPortableObjectIdError, u as verifyPortableObjectProofWithRoot } from "./proof-DP93iZiH.mjs";
13
- import { a as listRequestSignatures, c as selectRequestSignature, d as validateMaxSignatures, f as verifyRequest, p as verifyRequestDetailed, s as parseRfc9421SignatureInput } from "./http-rgt1uxns.mjs";
14
- import { t as getAuthenticatedDocumentLoader } from "./docloader-CXFE-n2O.mjs";
15
- import { n as kvCache } from "./kv-cache-C3QkJF-x.mjs";
16
- import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-CEnNz8O7.mjs";
12
+ import { a as signObject, c as verifyPortableObjectProof, i as hasProofLike, s as verifyObject, t as InvalidPortableObjectIdError, u as verifyPortableObjectProofWithRoot } from "./proof-UN4CW55z.mjs";
13
+ import { c as parseRfc9421SignatureInput, f as validateMaxSignatures, l as selectRequestSignature, m as verifyRequestDetailed, o as listRequestSignatures, p as verifyRequest } from "./http-DuGmr8J8.mjs";
14
+ import { n as getAuthenticatedDocumentLoader } from "./docloader-CP1UxMLL.mjs";
15
+ import { n as kvCache } from "./kv-cache-DAV2_U44.mjs";
16
+ import { d as MAX_BODY_SIZE, f as readBoundedText, t as getNodeInfo, u as BodyTooLargeError } from "./client-5SIFzW3q.mjs";
17
17
  import { t as nodeInfoToJson } from "./types-DE_LV1JB.mjs";
18
- import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-BGYYk-xi.mjs";
19
- import { t as verifyPortableObject } from "./portable-collection-DJSwe8QM.mjs";
20
- import { a as getOrderingDestination, i as sendActivityThroughGateways, n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-c6buRbhI.mjs";
21
- import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-CS2LjGi-.mjs";
18
+ import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-CbQZqFim.mjs";
19
+ import { t as verifyPortableObject } from "./portable-collection-D2JYDadi.mjs";
20
+ import { a as sendActivityThroughGateways, i as sendActivity, n as extractInboxes, o as getOrderingDestination, t as SendActivityError } from "./send-BzbX2e6v.mjs";
21
+ import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-CUAVOHg6.mjs";
22
22
  import { t as CircuitBreaker } from "./circuit-breaker-XJ53md4S.mjs";
23
23
  import { t as buildCollectionSynchronizationHeader } from "./collection-CnnP1UAv.mjs";
24
- import { a as inspectCompoundPortableObjectApplicability, c as verifyServedPortableObjects, i as findUnsupportedCompoundProofShape, o as verifyCompoundPortableObjectProofs, r as findEmbeddedProofWithoutContext, t as containsCompoundPortableObject } from "./compound-proof-C6_4hMjm.mjs";
25
- import { n as routeActivity, t as actorsHaveSameOrigin } from "./inbox-4AZHfaO8.mjs";
24
+ import { a as inspectCompoundPortableObjectApplicability, c as verifyServedPortableObjects, i as findUnsupportedCompoundProofShape, o as verifyCompoundPortableObjectProofs, r as findEmbeddedProofWithoutContext, t as containsCompoundPortableObject } from "./compound-proof-BNjXclzO.mjs";
25
+ import { n as routeActivity, t as actorsHaveSameOrigin } from "./inbox-Bl1Y0s_A.mjs";
26
26
  import { t as KvKeyCache } from "./keycache-N2opu4-3.mjs";
27
27
  import { t as acceptsJsonLd } from "./negotiation-CCocWT_N.mjs";
28
- import { t as hasMalformedKnownTemporalLiteral } from "./temporal-DfC1NkLg.mjs";
28
+ import { t as hasMalformedKnownTemporalLiteral } from "./temporal-B7Wvxrjs.mjs";
29
29
  import { t as createExponentialBackoffPolicy } from "./retry-zX5xw5e0.mjs";
30
30
  import { t as TaskCodec } from "./codec-C6rTrpIp.mjs";
31
31
  import { getLogger, withContext } from "@logtape/logtape";
@@ -6222,7 +6222,7 @@ var FederationImpl = class extends FederationBuilderImpl {
6222
6222
  onNotAcceptable ??= notAcceptable;
6223
6223
  onUnauthorized ??= unauthorized;
6224
6224
  const url = new URL(request.url);
6225
- const route = this.router.route(url.pathname);
6225
+ const route = this.router.route(url.pathname, { allowUnencodedColon: true });
6226
6226
  if (route == null) {
6227
6227
  const media = this.hashlinkMediaDispatcher == null ? null : parseHashlinkGatewayRequest(url);
6228
6228
  if (media != null) return await this.#fetchHashlinkMedia(request, media, {
@@ -7955,45 +7955,85 @@ var RequestContextImpl = class RequestContextImpl extends ContextImpl {
7955
7955
  if (object instanceof Tombstone && !(object instanceof cls) && options?.tombstone !== "passthrough") return null;
7956
7956
  return object;
7957
7957
  }
7958
- #signedKey = void 0;
7958
+ #signedKey = null;
7959
+ #signedKeyOwner = null;
7960
+ #signatureChecks = /* @__PURE__ */ new WeakMap();
7961
+ #getSignatureCheck(documentLoader, contextLoader) {
7962
+ let checks = this.#signatureChecks.get(documentLoader);
7963
+ if (checks == null) {
7964
+ checks = /* @__PURE__ */ new WeakMap();
7965
+ this.#signatureChecks.set(documentLoader, checks);
7966
+ }
7967
+ let check = checks.get(contextLoader);
7968
+ if (check == null) {
7969
+ check = {};
7970
+ checks.set(contextLoader, check);
7971
+ }
7972
+ return check;
7973
+ }
7959
7974
  async getSignedKey(options = {}) {
7960
7975
  if (this.#signedKey != null) return this.#signedKey;
7961
- return this.#signedKey = await verifyRequest(this.request, {
7976
+ const documentLoader = options.documentLoader ?? this.documentLoader;
7977
+ const contextLoader = options.contextLoader ?? this.contextLoader;
7978
+ const check = this.#getSignatureCheck(documentLoader, contextLoader);
7979
+ if (check.key != null) return check.key;
7980
+ const promise = verifyRequest(this.request, {
7962
7981
  ...this,
7963
- contextLoader: options.contextLoader ?? this.contextLoader,
7964
- documentLoader: options.documentLoader ?? this.documentLoader,
7982
+ contextLoader,
7983
+ documentLoader,
7965
7984
  timeWindow: this.federation.signatureTimeWindow,
7966
7985
  maxSignatures: this.federation.maxHttpSignatures,
7967
7986
  meterProvider: this.meterProvider,
7968
7987
  tracerProvider: options.tracerProvider ?? this.tracerProvider
7988
+ }).then((key) => {
7989
+ if (key != null) this.#signedKey ??= key;
7990
+ return key;
7991
+ }).catch((error) => {
7992
+ if (check.key === promise) check.key = void 0;
7993
+ throw error;
7969
7994
  });
7995
+ check.key = promise;
7996
+ return await promise;
7970
7997
  }
7971
- #signedKeyOwner = void 0;
7972
7998
  async getSignedKeyOwner(options = {}) {
7973
7999
  if (this.#signedKeyOwner != null) return this.#signedKeyOwner;
7974
- const key = await this.getSignedKey(options);
7975
- if (key == null) return this.#signedKeyOwner = null;
7976
- try {
7977
- return this.#signedKeyOwner = await getKeyOwner(key, {
7978
- contextLoader: options.contextLoader ?? this.contextLoader,
7979
- documentLoader: options.documentLoader ?? this.documentLoader,
7980
- tracerProvider: options.tracerProvider ?? this.tracerProvider
7981
- });
7982
- } catch (error) {
7983
- if (error instanceof FetchError) {
7984
- getLogger([
7985
- "fedify",
7986
- "federation",
7987
- "actor"
7988
- ]).warn("Failed to fetch the key owner {keyOwner} of {keyId} while verifying the request signature; treating the request as unauthenticated: {error}", {
7989
- keyId: key.id?.href,
7990
- keyOwner: error.url.href,
7991
- error
7992
- });
7993
- return this.#signedKeyOwner = null;
8000
+ const normalizedOptions = {
8001
+ documentLoader: options.documentLoader ?? this.documentLoader,
8002
+ contextLoader: options.contextLoader ?? this.contextLoader,
8003
+ tracerProvider: options.tracerProvider ?? this.tracerProvider
8004
+ };
8005
+ const check = this.#getSignatureCheck(normalizedOptions.documentLoader, normalizedOptions.contextLoader);
8006
+ if (check.owner != null) return check.owner;
8007
+ const promise = this.getSignedKey(normalizedOptions).then(async (key) => {
8008
+ if (key == null) {
8009
+ if (check.owner === promise) check.owner = void 0;
8010
+ return null;
8011
+ }
8012
+ try {
8013
+ const owner = await getKeyOwner(key, normalizedOptions);
8014
+ if (owner != null) this.#signedKeyOwner ??= owner;
8015
+ return owner;
8016
+ } catch (error) {
8017
+ if (error instanceof FetchError) {
8018
+ getLogger([
8019
+ "fedify",
8020
+ "federation",
8021
+ "actor"
8022
+ ]).warn("Failed to fetch the key owner {keyOwner} of {keyId} while verifying the request signature; treating the request as unauthenticated: {error}", {
8023
+ keyId: key.id?.href,
8024
+ keyOwner: error.url.href,
8025
+ error
8026
+ });
8027
+ return null;
8028
+ }
8029
+ throw error;
7994
8030
  }
8031
+ }).catch((error) => {
8032
+ if (check.owner === promise) check.owner = void 0;
7995
8033
  throw error;
7996
- }
8034
+ });
8035
+ check.owner = promise;
8036
+ return await promise;
7997
8037
  }
7998
8038
  async isSignedByAudience(object, options = {}) {
7999
8039
  return await isInAudience(object, null) || await isInAudience(object, await this.getSignedKeyOwner(options), options);