@fedify/fedify 2.1.16 → 2.1.17

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 (47) hide show
  1. package/dist/{builder-1X5ZSllm.mjs → builder-DUQXHENg.mjs} +3 -3
  2. package/dist/compat/transformers.test.mjs +1 -1
  3. package/dist/{deno-uvgGxlJO.mjs → deno-SeF9Kbof.mjs} +1 -1
  4. package/dist/{docloader-MfbyL6Uw.mjs → docloader-20Uxx-BW.mjs} +2 -2
  5. package/dist/federation/builder.test.mjs +1 -1
  6. package/dist/federation/handler.test.mjs +4 -4
  7. package/dist/federation/idempotency.test.mjs +2 -2
  8. package/dist/federation/inbox.test.mjs +1 -1
  9. package/dist/federation/middleware.test.mjs +6 -6
  10. package/dist/federation/mod.cjs +1 -1
  11. package/dist/federation/mod.js +1 -1
  12. package/dist/federation/send.test.mjs +3 -3
  13. package/dist/federation/temporal.test.mjs +1 -1
  14. package/dist/federation/webfinger.test.mjs +1 -1
  15. package/dist/{http-iWRlK4-w.cjs → http-BVFDfPaf.cjs} +17 -7
  16. package/dist/{http-M_N_jpxD.js → http-D11iWbgC.js} +17 -7
  17. package/dist/{http-BZ90r-xK.mjs → http-vr3aQ7jg.mjs} +2 -2
  18. package/dist/{inbox-CQS-VkkA.mjs → inbox-Bgd66bvQ.mjs} +1 -1
  19. package/dist/{key-C_l2y_v5.mjs → key-DELVYrDs.mjs} +17 -7
  20. package/dist/{kv-cache-C6wLBOs_.js → kv-cache-BPr4KawB.js} +1 -1
  21. package/dist/{kv-cache-DOrRQU4b.cjs → kv-cache-BsvJXj0K.cjs} +1 -1
  22. package/dist/{ld-Do02d7_z.mjs → ld-C30fjlVq.mjs} +2 -2
  23. package/dist/{middleware-nGqgkcI7.mjs → middleware-BsZCAdN-.mjs} +1 -1
  24. package/dist/{middleware-nNP8Zt-F.js → middleware-CLHlFIpA.js} +24 -7
  25. package/dist/{middleware-CkorR4Ti.cjs → middleware-CfvlmuBy.cjs} +25 -8
  26. package/dist/{middleware-CVJJ0_2I.cjs → middleware-DTBJWxr0.cjs} +1 -1
  27. package/dist/{middleware-B6nfYbkX.mjs → middleware-X3Wj8cQj.mjs} +32 -15
  28. package/dist/mod.cjs +4 -4
  29. package/dist/mod.js +4 -4
  30. package/dist/nodeinfo/handler.test.mjs +1 -1
  31. package/dist/{owner-DJkjYxnU.mjs → owner-Vcjlj9bu.mjs} +2 -2
  32. package/dist/{proof-BUDPOoIJ.mjs → proof-BGKiZBbr.mjs} +2 -2
  33. package/dist/{proof-Bc_B5Xv6.js → proof-BjCuYLSJ.js} +1 -1
  34. package/dist/{proof-v44EzN0Z.cjs → proof-ZrhGR6j9.cjs} +1 -1
  35. package/dist/{send-CIjn2gBu.mjs → send-D8h5fYFB.mjs} +2 -2
  36. package/dist/sig/http.test.mjs +2 -2
  37. package/dist/sig/key.test.mjs +51 -1
  38. package/dist/sig/ld.test.mjs +2 -2
  39. package/dist/sig/mod.cjs +2 -2
  40. package/dist/sig/mod.js +2 -2
  41. package/dist/sig/owner.test.mjs +1 -1
  42. package/dist/sig/proof.test.mjs +1 -1
  43. package/dist/{temporal-B_FzqtGP.mjs → temporal-CGP_GCdL.mjs} +1 -1
  44. package/dist/utils/docloader.test.mjs +2 -2
  45. package/dist/utils/mod.cjs +1 -1
  46. package/dist/utils/mod.js +1 -1
  47. package/package.json +6 -6
@@ -2,8 +2,8 @@ import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { n as RouterError, t as Router } from "./router-CrMLXoOr.mjs";
5
- import { n as version, t as name } from "./deno-uvgGxlJO.mjs";
6
- import { t as InboxListenerSet } from "./inbox-CQS-VkkA.mjs";
5
+ import { n as version, t as name } from "./deno-SeF9Kbof.mjs";
6
+ import { t as InboxListenerSet } from "./inbox-Bgd66bvQ.mjs";
7
7
  import { getTypeId } from "@fedify/vocab";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
9
9
  import { getLogger } from "@logtape/logtape";
@@ -43,7 +43,7 @@ var FederationBuilderImpl = class {
43
43
  this.collectionTypeIds = {};
44
44
  }
45
45
  async build(options) {
46
- const { FederationImpl } = await import("./middleware-nGqgkcI7.mjs");
46
+ const { FederationImpl } = await import("./middleware-BsZCAdN-.mjs");
47
47
  const f = new FederationImpl(options);
48
48
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
49
49
  f.router = this.router.clone();
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
6
6
  import { t as assert } from "../assert-ddO5KLpe.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
8
- import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware-B6nfYbkX.mjs";
8
+ import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware-X3Wj8cQj.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  import { Follow, Person } from "@fedify/vocab";
11
11
  //#region src/compat/transformers.test.ts
@@ -3,6 +3,6 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  //#region deno.json
5
5
  var name = "@fedify/fedify";
6
- var version = "2.1.16";
6
+ var version = "2.1.17";
7
7
  //#endregion
8
8
  export { version as n, name as t };
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { o as validateCryptoKey } from "./key-C_l2y_v5.mjs";
5
- import { n as doubleKnock } from "./http-BZ90r-xK.mjs";
4
+ import { o as validateCryptoKey } from "./key-DELVYrDs.mjs";
5
+ import { n as doubleKnock } from "./http-vr3aQ7jg.mjs";
6
6
  import { curry } from "es-toolkit";
7
7
  import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
8
8
  import { getLogger } from "@logtape/logtape";
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { a as assertExists } from "../std__assert-Duiq_YC9.mjs";
6
6
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
8
- import { n as createFederationBuilder } from "../builder-1X5ZSllm.mjs";
8
+ import { n as createFederationBuilder } from "../builder-DUQXHENg.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  import { Activity, Note, Person } from "@fedify/vocab";
11
11
  //#region src/federation/builder.test.ts
@@ -7,12 +7,12 @@ import "../std__assert-Duiq_YC9.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
8
8
  import { t as assert } from "../assert-ddO5KLpe.mjs";
9
9
  import { r as parseAcceptSignature } from "../accept-Dd__NiUL.mjs";
10
- import { s as signRequest } from "../http-BZ90r-xK.mjs";
10
+ import { s as signRequest } from "../http-vr3aQ7jg.mjs";
11
11
  import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-BAK-tUlf.mjs";
12
- import { a as compactJsonLd, f as signJsonLd } from "../ld-Do02d7_z.mjs";
12
+ import { a as compactJsonLd, f as signJsonLd } from "../ld-C30fjlVq.mjs";
13
13
  import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
14
- import { a as createFederation, c as handleCollection, d as handleObject, f as respondWithObject, l as handleCustomCollection, p as respondWithObjectIfAcceptable, s as handleActor, u as handleInbox } from "../middleware-B6nfYbkX.mjs";
15
- import { t as InboxListenerSet } from "../inbox-CQS-VkkA.mjs";
14
+ import { a as createFederation, c as handleCollection, d as handleObject, f as respondWithObject, l as handleCustomCollection, p as respondWithObjectIfAcceptable, s as handleActor, u as handleInbox } from "../middleware-X3Wj8cQj.mjs";
15
+ import { t as InboxListenerSet } from "../inbox-Bgd66bvQ.mjs";
16
16
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
17
17
  import { Create, Note, Person } from "@fedify/vocab";
18
18
  import { FetchError } from "@fedify/vocab-runtime";
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import "../std__assert-Duiq_YC9.mjs";
6
6
  import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
7
- import { n as signObject } from "../proof-BUDPOoIJ.mjs";
7
+ import { n as signObject } from "../proof-BGKiZBbr.mjs";
8
8
  import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
9
- import { a as createFederation } from "../middleware-B6nfYbkX.mjs";
9
+ import { a as createFederation } from "../middleware-X3Wj8cQj.mjs";
10
10
  import { mockDocumentLoader, test } from "@fedify/fixture";
11
11
  import { Create, Follow, Person } from "@fedify/vocab";
12
12
  //#region src/federation/idempotency.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
6
- import { t as InboxListenerSet } from "../inbox-CQS-VkkA.mjs";
6
+ import { t as InboxListenerSet } from "../inbox-Bgd66bvQ.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
9
9
  //#region src/federation/inbox.test.ts
@@ -10,14 +10,14 @@ import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
10
10
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
11
11
  import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
12
12
  import { t as assert } from "../assert-ddO5KLpe.mjs";
13
- import { l as verifyRequest, s as signRequest } from "../http-BZ90r-xK.mjs";
13
+ import { l as verifyRequest, s as signRequest } from "../http-vr3aQ7jg.mjs";
14
14
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
15
- import { t as getAuthenticatedDocumentLoader } from "../docloader-MfbyL6Uw.mjs";
16
- import { a as compactJsonLd, f as signJsonLd, m as verifyJsonLd, s as detachSignature } from "../ld-Do02d7_z.mjs";
17
- import { t as doesActorOwnKey } from "../owner-DJkjYxnU.mjs";
18
- import { n as signObject, r as verifyObject } from "../proof-BUDPOoIJ.mjs";
15
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-20Uxx-BW.mjs";
16
+ import { a as compactJsonLd, f as signJsonLd, m as verifyJsonLd, s as detachSignature } from "../ld-C30fjlVq.mjs";
17
+ import { t as doesActorOwnKey } from "../owner-Vcjlj9bu.mjs";
18
+ import { n as signObject, r as verifyObject } from "../proof-BGKiZBbr.mjs";
19
19
  import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
20
- import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "../middleware-B6nfYbkX.mjs";
20
+ import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "../middleware-X3Wj8cQj.mjs";
21
21
  import { mockDocumentLoader, test } from "@fedify/fixture";
22
22
  import * as vocab from "@fedify/vocab";
23
23
  import { Create, Offer, Person, getTypeId, lookupObject } from "@fedify/vocab";
@@ -2,7 +2,7 @@ const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  require("../chunk-DDcVe30Y.cjs");
5
- const require_middleware = require("../middleware-CkorR4Ti.cjs");
5
+ const require_middleware = require("../middleware-CfvlmuBy.cjs");
6
6
  let es_toolkit = require("es-toolkit");
7
7
  //#region src/federation/kv.ts
8
8
  /**
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "../middleware-nNP8Zt-F.js";
3
+ import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "../middleware-CLHlFIpA.js";
4
4
  import { isEqual } from "es-toolkit";
5
5
  //#region src/federation/kv.ts
6
6
  /**
@@ -8,10 +8,10 @@ import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z
8
8
  import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
9
9
  import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
10
10
  import { t as assert } from "../assert-ddO5KLpe.mjs";
11
- import { l as verifyRequest } from "../http-BZ90r-xK.mjs";
11
+ import { l as verifyRequest } from "../http-vr3aQ7jg.mjs";
12
12
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
13
- import { t as doesActorOwnKey } from "../owner-DJkjYxnU.mjs";
14
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-CIjn2gBu.mjs";
13
+ import { t as doesActorOwnKey } from "../owner-Vcjlj9bu.mjs";
14
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-D8h5fYFB.mjs";
15
15
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
16
16
  import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
17
17
  //#region src/federation/send.test.ts
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
4
4
  import "../std__assert-Duiq_YC9.mjs";
5
5
  import { n as assertFalse } from "../assert_rejects-B-qJtC9Z.mjs";
6
6
  import { t as assert } from "../assert-ddO5KLpe.mjs";
7
- import { t as hasMalformedKnownTemporalLiteral } from "../temporal-B_FzqtGP.mjs";
7
+ import { t as hasMalformedKnownTemporalLiteral } from "../temporal-CGP_GCdL.mjs";
8
8
  import { test } from "@fedify/fixture";
9
9
  //#region src/federation/temporal.test.ts
10
10
  test("hasMalformedKnownTemporalLiteral() detects expanded proof timestamps", async () => {
@@ -5,7 +5,7 @@ import { n as createRequestContext } from "../context-Juj6bdHC.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import "../std__assert-Duiq_YC9.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
8
- import { a as createFederation, o as handleWebFinger } from "../middleware-B6nfYbkX.mjs";
8
+ import { a as createFederation, o as handleWebFinger } from "../middleware-X3Wj8cQj.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  import { Image, Link, Person } from "@fedify/vocab";
11
11
  //#region src/federation/webfinger.test.ts
@@ -11,7 +11,7 @@ let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conve
11
11
  let byte_encodings_base64 = require("byte-encodings/base64");
12
12
  //#region deno.json
13
13
  var name = "@fedify/fedify";
14
- var version = "2.1.16";
14
+ var version = "2.1.17";
15
15
  //#endregion
16
16
  //#region src/sig/accept.ts
17
17
  /**
@@ -393,21 +393,31 @@ async function resolveFetchedKey(document, cacheKey, keyId, cls, { documentLoade
393
393
  const keys = cls === _fedify_vocab.CryptographicKey ? object.getPublicKeys({
394
394
  documentLoader,
395
395
  contextLoader,
396
+ suppressError: true,
396
397
  tracerProvider
397
398
  }) : object.getAssertionMethods({
398
399
  documentLoader,
399
400
  contextLoader,
401
+ suppressError: true,
400
402
  tracerProvider
401
403
  });
402
404
  let length = 0;
403
405
  let lastKey = null;
404
- for await (const k of keys) {
405
- length++;
406
- lastKey = k;
407
- if (k.id?.href === keyId) {
408
- key = k;
409
- break;
406
+ try {
407
+ for await (const k of keys) {
408
+ length++;
409
+ lastKey = k;
410
+ if (k.id?.href === keyId) {
411
+ key = k;
412
+ break;
413
+ }
410
414
  }
415
+ } catch (e) {
416
+ if (!(e instanceof TypeError)) throw e;
417
+ logger.debug("Failed to verify; a malformed key was encountered while iterating the keys of {keyId}; treating it as a missing key: {error}", {
418
+ keyId,
419
+ error: e
420
+ });
411
421
  }
412
422
  const keyIdUrl = new URL(keyId);
413
423
  if (key == null && keyIdUrl.hash === "" && length === 1) key = lastKey;
@@ -10,7 +10,7 @@ import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } fro
10
10
  import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
11
11
  //#region deno.json
12
12
  var name = "@fedify/fedify";
13
- var version = "2.1.16";
13
+ var version = "2.1.17";
14
14
  //#endregion
15
15
  //#region src/sig/accept.ts
16
16
  /**
@@ -392,21 +392,31 @@ async function resolveFetchedKey(document, cacheKey, keyId, cls, { documentLoade
392
392
  const keys = cls === CryptographicKey ? object.getPublicKeys({
393
393
  documentLoader,
394
394
  contextLoader,
395
+ suppressError: true,
395
396
  tracerProvider
396
397
  }) : object.getAssertionMethods({
397
398
  documentLoader,
398
399
  contextLoader,
400
+ suppressError: true,
399
401
  tracerProvider
400
402
  });
401
403
  let length = 0;
402
404
  let lastKey = null;
403
- for await (const k of keys) {
404
- length++;
405
- lastKey = k;
406
- if (k.id?.href === keyId) {
407
- key = k;
408
- break;
405
+ try {
406
+ for await (const k of keys) {
407
+ length++;
408
+ lastKey = k;
409
+ if (k.id?.href === keyId) {
410
+ key = k;
411
+ break;
412
+ }
409
413
  }
414
+ } catch (e) {
415
+ if (!(e instanceof TypeError)) throw e;
416
+ logger.debug("Failed to verify; a malformed key was encountered while iterating the keys of {keyId}; treating it as a missing key: {error}", {
417
+ keyId,
418
+ error: e
419
+ });
410
420
  }
411
421
  const keyIdUrl = new URL(keyId);
412
422
  if (key == null && keyIdUrl.hash === "" && length === 1) key = lastKey;
@@ -1,9 +1,9 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-uvgGxlJO.mjs";
4
+ import { n as version, t as name } from "./deno-SeF9Kbof.mjs";
5
5
  import { i as validateAcceptSignature, n as fulfillAcceptSignature, r as parseAcceptSignature } from "./accept-Dd__NiUL.mjs";
6
- import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-C_l2y_v5.mjs";
6
+ import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-DELVYrDs.mjs";
7
7
  import { CryptographicKey } from "@fedify/vocab";
8
8
  import { SpanStatusCode, trace } from "@opentelemetry/api";
9
9
  import { FetchError } from "@fedify/vocab-runtime";
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-uvgGxlJO.mjs";
4
+ import { n as version, t as name } from "./deno-SeF9Kbof.mjs";
5
5
  import { Activity, getTypeId } from "@fedify/vocab";
6
6
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
7
7
  import { getLogger } from "@logtape/logtape";
@@ -1,7 +1,7 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-uvgGxlJO.mjs";
4
+ import { n as version, t as name } from "./deno-SeF9Kbof.mjs";
5
5
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
6
6
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
7
7
  import { FetchError, getDocumentLoader } from "@fedify/vocab-runtime";
@@ -247,21 +247,31 @@ async function resolveFetchedKey(document, cacheKey, keyId, cls, { documentLoade
247
247
  const keys = cls === CryptographicKey ? object.getPublicKeys({
248
248
  documentLoader,
249
249
  contextLoader,
250
+ suppressError: true,
250
251
  tracerProvider
251
252
  }) : object.getAssertionMethods({
252
253
  documentLoader,
253
254
  contextLoader,
255
+ suppressError: true,
254
256
  tracerProvider
255
257
  });
256
258
  let length = 0;
257
259
  let lastKey = null;
258
- for await (const k of keys) {
259
- length++;
260
- lastKey = k;
261
- if (k.id?.href === keyId) {
262
- key = k;
263
- break;
260
+ try {
261
+ for await (const k of keys) {
262
+ length++;
263
+ lastKey = k;
264
+ if (k.id?.href === keyId) {
265
+ key = k;
266
+ break;
267
+ }
264
268
  }
269
+ } catch (e) {
270
+ if (!(e instanceof TypeError)) throw e;
271
+ logger.debug("Failed to verify; a malformed key was encountered while iterating the keys of {keyId}; treating it as a missing key: {error}", {
272
+ keyId,
273
+ error: e
274
+ });
265
275
  }
266
276
  const keyIdUrl = new URL(keyId);
267
277
  if (key == null && keyIdUrl.hash === "" && length === 1) key = lastKey;
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { d as validateCryptoKey, t as doubleKnock } from "./http-M_N_jpxD.js";
3
+ import { d as validateCryptoKey, t as doubleKnock } from "./http-D11iWbgC.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { curry } from "es-toolkit";
6
6
  import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
@@ -1,7 +1,7 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  require("./chunk-DDcVe30Y.cjs");
4
- const require_http = require("./http-iWRlK4-w.cjs");
4
+ const require_http = require("./http-BVFDfPaf.cjs");
5
5
  let _logtape_logtape = require("@logtape/logtape");
6
6
  let es_toolkit = require("es-toolkit");
7
7
  let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-uvgGxlJO.mjs";
5
- import { n as fetchKey, o as validateCryptoKey } from "./key-C_l2y_v5.mjs";
4
+ import { n as version, t as name } from "./deno-SeF9Kbof.mjs";
5
+ import { n as fetchKey, o as validateCryptoKey } from "./key-DELVYrDs.mjs";
6
6
  import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
7
7
  import { SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  import { getDocumentLoader } from "@fedify/vocab-runtime";
@@ -1,5 +1,5 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as FederationImpl } from "./middleware-B6nfYbkX.mjs";
4
+ import { n as FederationImpl } from "./middleware-X3Wj8cQj.mjs";
5
5
  export { FederationImpl };
@@ -2,10 +2,10 @@ import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { t as __exportAll } from "./chunk-CRNNMoPX.js";
4
4
  import { r as getDefaultActivityTransformers } from "./transformers-BGMIq1cs.js";
5
- import { _ as version, a as verifyRequestDetailed, d as validateCryptoKey, f as formatAcceptSignature, g as name, i as verifyRequest, n as parseRfc9421SignatureInput, o as exportJwk, t as doubleKnock, u as importJwk } from "./http-M_N_jpxD.js";
6
- import { _ as signJsonLd, a as doesActorOwnKey, c as assertSafeJsonLd, f as detachSignature, g as isInvalidUrlTypeError, h as isClearlyMalformedContextReference, m as hasSignature, n as signObject, o as getKeyOwner, p as getNormalizationContextLoader, r as verifyObject, s as InvalidContextReferenceError, u as compactJsonLd, v as verifyCompactJsonLd, x as wrapContextLoaderForJsonLd } from "./proof-Bc_B5Xv6.js";
5
+ import { _ as version, a as verifyRequestDetailed, d as validateCryptoKey, f as formatAcceptSignature, g as name, i as verifyRequest, n as parseRfc9421SignatureInput, o as exportJwk, t as doubleKnock, u as importJwk } from "./http-D11iWbgC.js";
6
+ import { _ as signJsonLd, a as doesActorOwnKey, c as assertSafeJsonLd, f as detachSignature, g as isInvalidUrlTypeError, h as isClearlyMalformedContextReference, m as hasSignature, n as signObject, o as getKeyOwner, p as getNormalizationContextLoader, r as verifyObject, s as InvalidContextReferenceError, u as compactJsonLd, v as verifyCompactJsonLd, x as wrapContextLoaderForJsonLd } from "./proof-BjCuYLSJ.js";
7
7
  import { n as getNodeInfo, t as nodeInfoToJson } from "./types-CAY3OdLq.js";
8
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-C6wLBOs_.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BPr4KawB.js";
9
9
  import { getLogger, withContext } from "@logtape/logtape";
10
10
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
11
11
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
@@ -2692,6 +2692,15 @@ function isPermanentRemoteContextError(error) {
2692
2692
  function isPermanentInboxParseError(error) {
2693
2693
  return error instanceof Error && (error.name === "UnsafeJsonLdError" || error instanceof InvalidContextReferenceError || isPermanentRemoteContextError(error) || error.name === "jsonld.SyntaxError" && !isRemoteContextLoadingFailure(error)) || error instanceof TypeError && (/^(Invalid JSON-LD:|Invalid type:|Unexpected type:)/.test(error.message) || isInvalidUrlTypeError(error));
2694
2694
  }
2695
+ function hasLinkedDataSignatureJsonLdProcessingError(error) {
2696
+ if (error.message.startsWith("Maximum deep iterations exceeded")) return true;
2697
+ const cause = error.cause instanceof Error ? error.cause : error.details?.cause;
2698
+ if (error.name === "jsonld.InvalidUrl" && error.details?.code === "loading remote context failed" && cause instanceof Error) return cause.message.startsWith("Maximum deep iterations exceeded") || cause.name.startsWith("jsonld.");
2699
+ return error.name !== "jsonld.InvalidUrl" && error.name.startsWith("jsonld.");
2700
+ }
2701
+ function isLinkedDataSignatureJsonLdProcessingError(error) {
2702
+ return error instanceof Error && hasLinkedDataSignatureJsonLdProcessingError(error);
2703
+ }
2695
2704
  /**
2696
2705
  * Create a new {@link Federation} instance.
2697
2706
  * @param parameters Parameters for initializing the instance.
@@ -3345,10 +3354,18 @@ var FederationImpl = class extends FederationBuilderImpl {
3345
3354
  privateKey: pair.privateKey
3346
3355
  }))
3347
3356
  });
3348
- else jsonLd = await signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
3349
- contextLoader,
3350
- tracerProvider: this.tracerProvider
3351
- });
3357
+ else try {
3358
+ jsonLd = await signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
3359
+ contextLoader,
3360
+ tracerProvider: this.tracerProvider
3361
+ });
3362
+ } catch (error) {
3363
+ if (!isLinkedDataSignatureJsonLdProcessingError(error)) throw error;
3364
+ logger.warn("Failed to create a Linked Data signature for the activity {activityId}. The activity will be sent without a Linked Data signature.", {
3365
+ activityId,
3366
+ error
3367
+ });
3368
+ }
3352
3369
  if (!proofCreated) logger.warn("No supported key found to create a proof for the activity {activityId}. The activity will be sent without a proof. In order to create a proof, at least one Ed25519 key must be provided.", {
3353
3370
  activityId,
3354
3371
  keys: keys.map((pair) => ({
@@ -2,10 +2,10 @@ const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  const require_chunk = require("./chunk-DDcVe30Y.cjs");
4
4
  const require_transformers = require("./transformers-NeAONrAq.cjs");
5
- const require_http = require("./http-iWRlK4-w.cjs");
6
- const require_proof = require("./proof-v44EzN0Z.cjs");
5
+ const require_http = require("./http-BVFDfPaf.cjs");
6
+ const require_proof = require("./proof-ZrhGR6j9.cjs");
7
7
  const require_types = require("./types-KC4QAoxe.cjs");
8
- const require_kv_cache = require("./kv-cache-DOrRQU4b.cjs");
8
+ const require_kv_cache = require("./kv-cache-BsvJXj0K.cjs");
9
9
  let _logtape_logtape = require("@logtape/logtape");
10
10
  let _fedify_vocab = require("@fedify/vocab");
11
11
  let _opentelemetry_api = require("@opentelemetry/api");
@@ -336,7 +336,7 @@ var FederationBuilderImpl = class {
336
336
  this.collectionTypeIds = {};
337
337
  }
338
338
  async build(options) {
339
- const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-CVJJ0_2I.cjs"));
339
+ const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-DTBJWxr0.cjs"));
340
340
  const f = new FederationImpl(options);
341
341
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
342
342
  f.router = this.router.clone();
@@ -2686,6 +2686,15 @@ function isPermanentRemoteContextError(error) {
2686
2686
  function isPermanentInboxParseError(error) {
2687
2687
  return error instanceof Error && (error.name === "UnsafeJsonLdError" || error instanceof require_proof.InvalidContextReferenceError || isPermanentRemoteContextError(error) || error.name === "jsonld.SyntaxError" && !isRemoteContextLoadingFailure(error)) || error instanceof TypeError && (/^(Invalid JSON-LD:|Invalid type:|Unexpected type:)/.test(error.message) || require_proof.isInvalidUrlTypeError(error));
2688
2688
  }
2689
+ function hasLinkedDataSignatureJsonLdProcessingError(error) {
2690
+ if (error.message.startsWith("Maximum deep iterations exceeded")) return true;
2691
+ const cause = error.cause instanceof Error ? error.cause : error.details?.cause;
2692
+ if (error.name === "jsonld.InvalidUrl" && error.details?.code === "loading remote context failed" && cause instanceof Error) return cause.message.startsWith("Maximum deep iterations exceeded") || cause.name.startsWith("jsonld.");
2693
+ return error.name !== "jsonld.InvalidUrl" && error.name.startsWith("jsonld.");
2694
+ }
2695
+ function isLinkedDataSignatureJsonLdProcessingError(error) {
2696
+ return error instanceof Error && hasLinkedDataSignatureJsonLdProcessingError(error);
2697
+ }
2689
2698
  /**
2690
2699
  * Create a new {@link Federation} instance.
2691
2700
  * @param parameters Parameters for initializing the instance.
@@ -3339,10 +3348,18 @@ var FederationImpl = class extends FederationBuilderImpl {
3339
3348
  privateKey: pair.privateKey
3340
3349
  }))
3341
3350
  });
3342
- else jsonLd = await require_proof.signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
3343
- contextLoader,
3344
- tracerProvider: this.tracerProvider
3345
- });
3351
+ else try {
3352
+ jsonLd = await require_proof.signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
3353
+ contextLoader,
3354
+ tracerProvider: this.tracerProvider
3355
+ });
3356
+ } catch (error) {
3357
+ if (!isLinkedDataSignatureJsonLdProcessingError(error)) throw error;
3358
+ logger.warn("Failed to create a Linked Data signature for the activity {activityId}. The activity will be sent without a Linked Data signature.", {
3359
+ activityId,
3360
+ error
3361
+ });
3362
+ }
3346
3363
  if (!proofCreated) logger.warn("No supported key found to create a proof for the activity {activityId}. The activity will be sent without a proof. In order to create a proof, at least one Ed25519 key must be provided.", {
3347
3364
  activityId,
3348
3365
  keys: keys.map((pair) => ({
@@ -1,4 +1,4 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
- const require_middleware = require("./middleware-CkorR4Ti.cjs");
3
+ const require_middleware = require("./middleware-CfvlmuBy.cjs");
4
4
  exports.FederationImpl = require_middleware.FederationImpl;
@@ -2,25 +2,25 @@ import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { n as RouterError } from "./router-CrMLXoOr.mjs";
5
- import { n as version, t as name } from "./deno-uvgGxlJO.mjs";
5
+ import { n as version, t as name } from "./deno-SeF9Kbof.mjs";
6
6
  import { t as formatAcceptSignature } from "./accept-Dd__NiUL.mjs";
7
- import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-C_l2y_v5.mjs";
8
- import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-BZ90r-xK.mjs";
9
- import { t as getAuthenticatedDocumentLoader } from "./docloader-MfbyL6Uw.mjs";
7
+ import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-DELVYrDs.mjs";
8
+ import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-vr3aQ7jg.mjs";
9
+ import { t as getAuthenticatedDocumentLoader } from "./docloader-20Uxx-BW.mjs";
10
10
  import { n as kvCache } from "./kv-cache-FsT1ljhs.mjs";
11
- import { a as compactJsonLd, c as getNormalizationContextLoader, d as isInvalidUrlTypeError, f as signJsonLd, g as wrapContextLoaderForJsonLd, l as hasSignature, p as verifyCompactJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as isClearlyMalformedContextReference } from "./ld-Do02d7_z.mjs";
12
- import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-DJkjYxnU.mjs";
13
- import { n as signObject, r as verifyObject } from "./proof-BUDPOoIJ.mjs";
11
+ import { a as compactJsonLd, c as getNormalizationContextLoader, d as isInvalidUrlTypeError, f as signJsonLd, g as wrapContextLoaderForJsonLd, l as hasSignature, p as verifyCompactJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as isClearlyMalformedContextReference } from "./ld-C30fjlVq.mjs";
12
+ import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-Vcjlj9bu.mjs";
13
+ import { n as signObject, r as verifyObject } from "./proof-BGKiZBbr.mjs";
14
14
  import { t as getNodeInfo } from "./client-DEpOVgY1.mjs";
15
15
  import { t as nodeInfoToJson } from "./types-DCP0WLdt.mjs";
16
- import { n as routeActivity } from "./inbox-CQS-VkkA.mjs";
17
- import { t as FederationBuilderImpl } from "./builder-1X5ZSllm.mjs";
16
+ import { n as routeActivity } from "./inbox-Bgd66bvQ.mjs";
17
+ import { t as FederationBuilderImpl } from "./builder-DUQXHENg.mjs";
18
18
  import { t as buildCollectionSynchronizationHeader } from "./collection-BD6-SZ6O.mjs";
19
19
  import { t as KvKeyCache } from "./keycache-CCSwkQcY.mjs";
20
20
  import { t as acceptsJsonLd } from "./negotiation-DnsfFF8I.mjs";
21
- import { t as hasMalformedKnownTemporalLiteral } from "./temporal-B_FzqtGP.mjs";
21
+ import { t as hasMalformedKnownTemporalLiteral } from "./temporal-CGP_GCdL.mjs";
22
22
  import { t as createExponentialBackoffPolicy } from "./retry-CJL0poaU.mjs";
23
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-CIjn2gBu.mjs";
23
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-D8h5fYFB.mjs";
24
24
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
25
25
  import { lookupWebFinger } from "@fedify/webfinger";
26
26
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
@@ -1487,6 +1487,15 @@ function isPermanentRemoteContextError(error) {
1487
1487
  function isPermanentInboxParseError(error) {
1488
1488
  return error instanceof Error && (error.name === "UnsafeJsonLdError" || error instanceof InvalidContextReferenceError || isPermanentRemoteContextError(error) || error.name === "jsonld.SyntaxError" && !isRemoteContextLoadingFailure(error)) || error instanceof TypeError && (/^(Invalid JSON-LD:|Invalid type:|Unexpected type:)/.test(error.message) || isInvalidUrlTypeError(error));
1489
1489
  }
1490
+ function hasLinkedDataSignatureJsonLdProcessingError(error) {
1491
+ if (error.message.startsWith("Maximum deep iterations exceeded")) return true;
1492
+ const cause = error.cause instanceof Error ? error.cause : error.details?.cause;
1493
+ if (error.name === "jsonld.InvalidUrl" && error.details?.code === "loading remote context failed" && cause instanceof Error) return cause.message.startsWith("Maximum deep iterations exceeded") || cause.name.startsWith("jsonld.");
1494
+ return error.name !== "jsonld.InvalidUrl" && error.name.startsWith("jsonld.");
1495
+ }
1496
+ function isLinkedDataSignatureJsonLdProcessingError(error) {
1497
+ return error instanceof Error && hasLinkedDataSignatureJsonLdProcessingError(error);
1498
+ }
1490
1499
  /**
1491
1500
  * Create a new {@link Federation} instance.
1492
1501
  * @param parameters Parameters for initializing the instance.
@@ -2140,10 +2149,18 @@ var FederationImpl = class extends FederationBuilderImpl {
2140
2149
  privateKey: pair.privateKey
2141
2150
  }))
2142
2151
  });
2143
- else jsonLd = await signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
2144
- contextLoader,
2145
- tracerProvider: this.tracerProvider
2146
- });
2152
+ else try {
2153
+ jsonLd = await signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
2154
+ contextLoader,
2155
+ tracerProvider: this.tracerProvider
2156
+ });
2157
+ } catch (error) {
2158
+ if (!isLinkedDataSignatureJsonLdProcessingError(error)) throw error;
2159
+ logger.warn("Failed to create a Linked Data signature for the activity {activityId}. The activity will be sent without a Linked Data signature.", {
2160
+ activityId,
2161
+ error
2162
+ });
2163
+ }
2147
2164
  if (!proofCreated) logger.warn("No supported key found to create a proof for the activity {activityId}. The activity will be sent without a proof. In order to create a proof, at least one Ed25519 key must be provided.", {
2148
2165
  activityId,
2149
2166
  keys: keys.map((pair) => ({
package/dist/mod.cjs CHANGED
@@ -4,11 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  require("./chunk-DDcVe30Y.cjs");
5
5
  const require_transformers = require("./transformers-NeAONrAq.cjs");
6
6
  require("./compat/mod.cjs");
7
- const require_http = require("./http-iWRlK4-w.cjs");
8
- const require_middleware = require("./middleware-CkorR4Ti.cjs");
9
- const require_proof = require("./proof-v44EzN0Z.cjs");
7
+ const require_http = require("./http-BVFDfPaf.cjs");
8
+ const require_middleware = require("./middleware-CfvlmuBy.cjs");
9
+ const require_proof = require("./proof-ZrhGR6j9.cjs");
10
10
  const require_types = require("./types-KC4QAoxe.cjs");
11
- const require_kv_cache = require("./kv-cache-DOrRQU4b.cjs");
11
+ const require_kv_cache = require("./kv-cache-BsvJXj0K.cjs");
12
12
  const require_federation_mod = require("./federation/mod.cjs");
13
13
  require("./nodeinfo/mod.cjs");
14
14
  require("./runtime/mod.cjs");
package/dist/mod.js CHANGED
@@ -3,11 +3,11 @@ import { URLPattern } from "urlpattern-polyfill";
3
3
  import "./chunk-CRNNMoPX.js";
4
4
  import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-BGMIq1cs.js";
5
5
  import "./compat/mod.js";
6
- import { a as verifyRequestDetailed, c as fetchKeyDetailed, f as formatAcceptSignature, h as validateAcceptSignature, i as verifyRequest, l as generateCryptoKeyPair, m as parseAcceptSignature, o as exportJwk, p as fulfillAcceptSignature, r as signRequest, s as fetchKey, u as importJwk } from "./http-M_N_jpxD.js";
7
- import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "./middleware-nNP8Zt-F.js";
8
- import { _ as signJsonLd, a as doesActorOwnKey, b as verifySignature, d as createSignature, f as detachSignature, i as verifyProof, l as attachSignature, n as signObject, o as getKeyOwner, r as verifyObject, t as createProof, y as verifyJsonLd } from "./proof-Bc_B5Xv6.js";
6
+ import { a as verifyRequestDetailed, c as fetchKeyDetailed, f as formatAcceptSignature, h as validateAcceptSignature, i as verifyRequest, l as generateCryptoKeyPair, m as parseAcceptSignature, o as exportJwk, p as fulfillAcceptSignature, r as signRequest, s as fetchKey, u as importJwk } from "./http-D11iWbgC.js";
7
+ import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "./middleware-CLHlFIpA.js";
8
+ import { _ as signJsonLd, a as doesActorOwnKey, b as verifySignature, d as createSignature, f as detachSignature, i as verifyProof, l as attachSignature, n as signObject, o as getKeyOwner, r as verifyObject, t as createProof, y as verifyJsonLd } from "./proof-BjCuYLSJ.js";
9
9
  import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-CAY3OdLq.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-C6wLBOs_.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BPr4KawB.js";
11
11
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation/mod.js";
12
12
  import "./nodeinfo/mod.js";
13
13
  import "./runtime/mod.js";
@@ -5,7 +5,7 @@ import { n as createRequestContext } from "../context-Juj6bdHC.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import "../std__assert-Duiq_YC9.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
8
- import { a as createFederation, h as handleNodeInfoJrd, m as handleNodeInfo } from "../middleware-B6nfYbkX.mjs";
8
+ import { a as createFederation, h as handleNodeInfoJrd, m as handleNodeInfo } from "../middleware-X3Wj8cQj.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  //#region src/nodeinfo/handler.test.ts
11
11
  test("handleNodeInfo()", async () => {
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-uvgGxlJO.mjs";
5
- import "./key-C_l2y_v5.mjs";
4
+ import { n as version, t as name } from "./deno-SeF9Kbof.mjs";
5
+ import "./key-DELVYrDs.mjs";
6
6
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
7
7
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  import { getDocumentLoader } from "@fedify/vocab-runtime";
@@ -1,8 +1,8 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-uvgGxlJO.mjs";
5
- import { n as fetchKey, o as validateCryptoKey } from "./key-C_l2y_v5.mjs";
4
+ import { n as version, t as name } from "./deno-SeF9Kbof.mjs";
5
+ import { n as fetchKey, o as validateCryptoKey } from "./key-DELVYrDs.mjs";
6
6
  import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
7
7
  import { SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  import { getLogger } from "@logtape/logtape";
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { _ as version, d as validateCryptoKey, g as name, s as fetchKey } from "./http-M_N_jpxD.js";
3
+ import { _ as version, d as validateCryptoKey, g as name, s as fetchKey } from "./http-D11iWbgC.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "@fedify/vocab";
6
6
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -1,7 +1,7 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  const require_chunk = require("./chunk-DDcVe30Y.cjs");
4
- const require_http = require("./http-iWRlK4-w.cjs");
4
+ const require_http = require("./http-BVFDfPaf.cjs");
5
5
  let _logtape_logtape = require("@logtape/logtape");
6
6
  let _fedify_vocab = require("@fedify/vocab");
7
7
  let _opentelemetry_api = require("@opentelemetry/api");
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-uvgGxlJO.mjs";
5
- import { n as doubleKnock } from "./http-BZ90r-xK.mjs";
4
+ import { n as version, t as name } from "./deno-SeF9Kbof.mjs";
5
+ import { n as doubleKnock } from "./http-vr3aQ7jg.mjs";
6
6
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  //#region src/federation/send.ts
@@ -7,8 +7,8 @@ import { a as assertExists, t as assertStringIncludes } from "../std__assert-Dui
7
7
  import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
8
8
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
9
9
  import { t as assert } from "../assert-ddO5KLpe.mjs";
10
- import { t as exportJwk } from "../key-C_l2y_v5.mjs";
11
- import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-BZ90r-xK.mjs";
10
+ import { t as exportJwk } from "../key-DELVYrDs.mjs";
11
+ import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-vr3aQ7jg.mjs";
12
12
  import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-BAK-tUlf.mjs";
13
13
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
14
14
  import { FetchError, exportSpki } from "@fedify/vocab-runtime";
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import "../std__assert-Duiq_YC9.mjs";
6
6
  import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
7
7
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
8
- import { a as importJwk, i as generateCryptoKeyPair, n as fetchKey, o as validateCryptoKey, r as fetchKeyDetailed, t as exportJwk } from "../key-C_l2y_v5.mjs";
8
+ import { a as importJwk, i as generateCryptoKeyPair, n as fetchKey, o as validateCryptoKey, r as fetchKeyDetailed, t as exportJwk } from "../key-DELVYrDs.mjs";
9
9
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
10
10
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
11
11
  import { CryptographicKey, Multikey } from "@fedify/vocab";
@@ -303,5 +303,55 @@ test("fetchKeyDetailed() returns detailed fetch errors", async () => {
303
303
  if (detailedError == null || !("error" in detailedError)) throw new Error("Expected non-HTTP fetch error details.");
304
304
  assertEquals(detailedError.error, failure);
305
305
  });
306
+ test("fetchKey() returns null for a malformed actor publicKey", async () => {
307
+ const actorId = "https://example.com/malformed-public-key";
308
+ const keyId = "https://example.com/malformed-public-key#main-key";
309
+ const cache = {};
310
+ const options = {
311
+ async documentLoader(resource) {
312
+ if (resource === actorId) return {
313
+ contextUrl: null,
314
+ documentUrl: resource,
315
+ document: {
316
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"],
317
+ id: actorId,
318
+ type: "Person",
319
+ publicKey: keyId
320
+ }
321
+ };
322
+ if (resource === keyId) return {
323
+ contextUrl: null,
324
+ documentUrl: resource,
325
+ document: {
326
+ "@context": "https://w3id.org/security/v1",
327
+ id: keyId,
328
+ type: "Key",
329
+ owner: actorId,
330
+ publicKeyPem: "not a public key"
331
+ }
332
+ };
333
+ return await mockDocumentLoader(resource);
334
+ },
335
+ contextLoader: mockDocumentLoader,
336
+ keyCache: {
337
+ get(keyId) {
338
+ return Promise.resolve(cache[keyId.href]);
339
+ },
340
+ set(keyId, key) {
341
+ cache[keyId.href] = key;
342
+ return Promise.resolve();
343
+ }
344
+ }
345
+ };
346
+ assertEquals(await fetchKey(actorId, CryptographicKey, options), {
347
+ key: null,
348
+ cached: false
349
+ });
350
+ assertEquals(cache, { [actorId]: null });
351
+ assertEquals(await fetchKey(actorId, CryptographicKey, options), {
352
+ key: null,
353
+ cached: true
354
+ });
355
+ });
306
356
  //#endregion
307
357
  export {};
@@ -5,9 +5,9 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
6
6
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
7
7
  import { t as assert } from "../assert-ddO5KLpe.mjs";
8
- import { i as generateCryptoKeyPair } from "../key-C_l2y_v5.mjs";
8
+ import { i as generateCryptoKeyPair } from "../key-DELVYrDs.mjs";
9
9
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
10
- import { a as compactJsonLd, d as isInvalidUrlTypeError, f as signJsonLd, h as verifySignature, i as attachSignature, m as verifyJsonLd, n as UnsafeJsonLdError, o as createSignature, s as detachSignature } from "../ld-Do02d7_z.mjs";
10
+ import { a as compactJsonLd, d as isInvalidUrlTypeError, f as signJsonLd, h as verifySignature, i as attachSignature, m as verifyJsonLd, n as UnsafeJsonLdError, o as createSignature, s as detachSignature } from "../ld-C30fjlVq.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { CryptographicKey } from "@fedify/vocab";
13
13
  import { encodeBase64 } from "byte-encodings/base64";
package/dist/sig/mod.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const require_http = require("../http-iWRlK4-w.cjs");
5
- const require_proof = require("../proof-v44EzN0Z.cjs");
4
+ const require_http = require("../http-BVFDfPaf.cjs");
5
+ const require_proof = require("../proof-ZrhGR6j9.cjs");
6
6
  exports.attachSignature = require_proof.attachSignature;
7
7
  exports.createProof = require_proof.createProof;
8
8
  exports.createSignature = require_proof.createSignature;
package/dist/sig/mod.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { a as verifyRequestDetailed, c as fetchKeyDetailed, f as formatAcceptSignature, h as validateAcceptSignature, i as verifyRequest, l as generateCryptoKeyPair, m as parseAcceptSignature, o as exportJwk, p as fulfillAcceptSignature, r as signRequest, s as fetchKey, u as importJwk } from "../http-M_N_jpxD.js";
4
- import { _ as signJsonLd, a as doesActorOwnKey, b as verifySignature, d as createSignature, f as detachSignature, i as verifyProof, l as attachSignature, n as signObject, o as getKeyOwner, r as verifyObject, t as createProof, y as verifyJsonLd } from "../proof-Bc_B5Xv6.js";
3
+ import { a as verifyRequestDetailed, c as fetchKeyDetailed, f as formatAcceptSignature, h as validateAcceptSignature, i as verifyRequest, l as generateCryptoKeyPair, m as parseAcceptSignature, o as exportJwk, p as fulfillAcceptSignature, r as signRequest, s as fetchKey, u as importJwk } from "../http-D11iWbgC.js";
4
+ import { _ as signJsonLd, a as doesActorOwnKey, b as verifySignature, d as createSignature, f as detachSignature, i as verifyProof, l as attachSignature, n as signObject, o as getKeyOwner, r as verifyObject, t as createProof, y as verifyJsonLd } from "../proof-BjCuYLSJ.js";
5
5
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
@@ -6,7 +6,7 @@ import "../std__assert-Duiq_YC9.mjs";
6
6
  import { n as assertFalse } from "../assert_rejects-B-qJtC9Z.mjs";
7
7
  import { t as assert } from "../assert-ddO5KLpe.mjs";
8
8
  import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-BAK-tUlf.mjs";
9
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DJkjYxnU.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-Vcjlj9bu.mjs";
10
10
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
11
11
  import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
12
12
  //#region src/sig/owner.test.ts
@@ -6,7 +6,7 @@ import "../std__assert-Duiq_YC9.mjs";
6
6
  import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
7
7
  import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
8
8
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
9
- import { i as verifyProof, n as signObject, r as verifyObject, t as createProof } from "../proof-BUDPOoIJ.mjs";
9
+ import { i as verifyProof, n as signObject, r as verifyObject, t as createProof } from "../proof-BGKiZBbr.mjs";
10
10
  import { mockDocumentLoader, test } from "@fedify/fixture";
11
11
  import { Create, DataIntegrityProof, Multikey, Note, Place } from "@fedify/vocab";
12
12
  import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { c as getNormalizationContextLoader } from "./ld-Do02d7_z.mjs";
4
+ import { c as getNormalizationContextLoader } from "./ld-C30fjlVq.mjs";
5
5
  import jsonld from "@fedify/vocab-runtime/jsonld";
6
6
  //#region src/federation/temporal.ts
7
7
  function isPlainObject(value) {
@@ -5,9 +5,9 @@ import { t as esm_default } from "../esm-DVILvP5e.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import "../std__assert-Duiq_YC9.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
8
- import { l as verifyRequest } from "../http-BZ90r-xK.mjs";
8
+ import { l as verifyRequest } from "../http-vr3aQ7jg.mjs";
9
9
  import { i as rsaPrivateKey2 } from "../keys-BAK-tUlf.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../docloader-MfbyL6Uw.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-20Uxx-BW.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { UrlError } from "@fedify/vocab-runtime";
13
13
  //#region src/utils/docloader.test.ts
@@ -1,6 +1,6 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const require_kv_cache = require("../kv-cache-DOrRQU4b.cjs");
4
+ const require_kv_cache = require("../kv-cache-BsvJXj0K.cjs");
5
5
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
6
6
  exports.kvCache = require_kv_cache.kvCache;
package/dist/utils/mod.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-C6wLBOs_.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-BPr4KawB.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.1.16",
3
+ "version": "2.1.17",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -144,9 +144,9 @@
144
144
  "uri-template-router": "^1.0.0",
145
145
  "url-template": "^3.1.1",
146
146
  "urlpattern-polyfill": "^10.1.0",
147
- "@fedify/vocab-runtime": "2.1.16",
148
- "@fedify/webfinger": "2.1.16",
149
- "@fedify/vocab": "2.1.16"
147
+ "@fedify/vocab": "2.1.17",
148
+ "@fedify/vocab-runtime": "2.1.17",
149
+ "@fedify/webfinger": "2.1.17"
150
150
  },
151
151
  "devDependencies": {
152
152
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -158,8 +158,8 @@
158
158
  "tsx": "^4.19.4",
159
159
  "typescript": "^6.0.0",
160
160
  "wrangler": "^4.17.0",
161
- "@fedify/fixture": "2.0.0",
162
- "@fedify/vocab-tools": "^2.1.16"
161
+ "@fedify/vocab-tools": "^2.1.17",
162
+ "@fedify/fixture": "2.0.0"
163
163
  },
164
164
  "scripts": {
165
165
  "build:self": "tsdown",