@fedify/fedify 2.2.5 → 2.2.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.
Files changed (45) hide show
  1. package/dist/{builder-zDJOhWad.mjs → builder-C-al99Vs.mjs} +2 -2
  2. package/dist/compat/transformers.test.mjs +1 -1
  3. package/dist/{deno-4Q9ruIMJ.mjs → deno-B0LcALOm.mjs} +1 -1
  4. package/dist/{docloader-BHrm7BpO.mjs → docloader-DLAjdiZt.mjs} +2 -2
  5. package/dist/federation/builder.test.mjs +1 -1
  6. package/dist/federation/handler.test.mjs +3 -3
  7. package/dist/federation/idempotency.test.mjs +2 -2
  8. package/dist/federation/middleware.test.mjs +6 -6
  9. package/dist/federation/mod.cjs +1 -1
  10. package/dist/federation/mod.js +1 -1
  11. package/dist/federation/send.test.mjs +3 -3
  12. package/dist/federation/temporal.test.mjs +1 -1
  13. package/dist/federation/webfinger.test.mjs +1 -1
  14. package/dist/{http-CUIxu16z.mjs → http-BkivuOe4.mjs} +2 -2
  15. package/dist/{http-BTcDrLzD.js → http-C-9duWvR.js} +17 -7
  16. package/dist/{http-CK9ElgLS.cjs → http-NEN2KDMb.cjs} +17 -7
  17. package/dist/{key-CVHsRpwc.mjs → key-BcpJR7wT.mjs} +17 -7
  18. package/dist/{kv-cache-C_aWsl_r.js → kv-cache-8o7zAqEi.js} +1 -1
  19. package/dist/{kv-cache-DI-7Y6VS.cjs → kv-cache-9K6uVGgd.cjs} +1 -1
  20. package/dist/{ld-8MkMznIw.mjs → ld-DAZQsoKN.mjs} +2 -2
  21. package/dist/{middleware-D7us7Y1k.cjs → middleware-BUiHyCQ9.cjs} +25 -8
  22. package/dist/{middleware-0TW9PJkh.js → middleware-Bk-ge16h.js} +24 -7
  23. package/dist/{middleware-ZavT88mD.mjs → middleware-BysI6Pqz.mjs} +1 -1
  24. package/dist/{middleware-DHyZlPpi.mjs → middleware-C3JAusAj.mjs} +31 -14
  25. package/dist/{middleware-B373Um8U.cjs → middleware-CeqmkLh1.cjs} +1 -1
  26. package/dist/mod.cjs +4 -4
  27. package/dist/mod.js +4 -4
  28. package/dist/nodeinfo/handler.test.mjs +1 -1
  29. package/dist/{owner-BqFf5aUc.mjs → owner-CwVIBwY0.mjs} +2 -2
  30. package/dist/{proof-BpBLMdLk.cjs → proof-C2en2Cmb.cjs} +1 -1
  31. package/dist/{proof-v_hACCAr.js → proof-IyDe0jjt.js} +1 -1
  32. package/dist/{proof-DkLHCewr.mjs → proof-wrxzZi_u.mjs} +2 -2
  33. package/dist/{send-Cv34R1iA.mjs → send-DOlXF7S8.mjs} +2 -2
  34. package/dist/sig/http.test.mjs +2 -2
  35. package/dist/sig/key.test.mjs +51 -1
  36. package/dist/sig/ld.test.mjs +2 -2
  37. package/dist/sig/mod.cjs +2 -2
  38. package/dist/sig/mod.js +2 -2
  39. package/dist/sig/owner.test.mjs +1 -1
  40. package/dist/sig/proof.test.mjs +1 -1
  41. package/dist/{temporal-DqCyup3d.mjs → temporal-B13wkvUP.mjs} +1 -1
  42. package/dist/utils/docloader.test.mjs +2 -2
  43. package/dist/utils/mod.cjs +1 -1
  44. package/dist/utils/mod.js +1 -1
  45. package/package.json +6 -6
@@ -2,7 +2,7 @@ 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-4Q9ruIMJ.mjs";
5
+ import { n as version, t as name } from "./deno-B0LcALOm.mjs";
6
6
  import { t as ActivityListenerSet } from "./activity-listener-ell7W1s9.mjs";
7
7
  import { Tombstone, getTypeId } from "@fedify/vocab";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -58,7 +58,7 @@ var FederationBuilderImpl = class {
58
58
  this.collectionTypeIds = {};
59
59
  }
60
60
  async build(options) {
61
- const { FederationImpl } = await import("./middleware-ZavT88mD.mjs");
61
+ const { FederationImpl } = await import("./middleware-BysI6Pqz.mjs");
62
62
  const f = new FederationImpl(options);
63
63
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
64
64
  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-DikXweDx.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
8
- import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-DHyZlPpi.mjs";
8
+ import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-C3JAusAj.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.2.5";
6
+ var version = "2.2.6";
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-CVHsRpwc.mjs";
5
- import { n as doubleKnock } from "./http-CUIxu16z.mjs";
4
+ import { o as validateCryptoKey } from "./key-BcpJR7wT.mjs";
5
+ import { n as doubleKnock } from "./http-BkivuOe4.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";
@@ -6,7 +6,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import { i as assertExists } from "../std__assert-CRDpx_HF.mjs";
7
7
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
8
8
  import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
9
- import { n as createFederationBuilder } from "../builder-zDJOhWad.mjs";
9
+ import { n as createFederationBuilder } from "../builder-C-al99Vs.mjs";
10
10
  import { test } from "@fedify/fixture";
11
11
  import { Activity, Note, Person } from "@fedify/vocab";
12
12
  //#region src/federation/builder.test.ts
@@ -8,11 +8,11 @@ import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
8
8
  import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
9
9
  import { t as assert } from "../assert-DikXweDx.mjs";
10
10
  import { r as parseAcceptSignature } from "../accept-CPkZzmGN.mjs";
11
- import { s as signRequest } from "../http-CUIxu16z.mjs";
11
+ import { s as signRequest } from "../http-BkivuOe4.mjs";
12
12
  import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-DGu1NFwu.mjs";
13
- import { a as compactJsonLd, p as signJsonLd } from "../ld-8MkMznIw.mjs";
13
+ import { a as compactJsonLd, p as signJsonLd } from "../ld-DAZQsoKN.mjs";
14
14
  import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
15
- import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-DHyZlPpi.mjs";
15
+ import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-C3JAusAj.mjs";
16
16
  import { t as ActivityListenerSet } from "../activity-listener-ell7W1s9.mjs";
17
17
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
18
18
  import { Activity, Create, Note, Person, Tombstone } from "@fedify/vocab";
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import "../std__assert-CRDpx_HF.mjs";
6
6
  import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
7
- import { r as signObject } from "../proof-DkLHCewr.mjs";
7
+ import { r as signObject } from "../proof-wrxzZi_u.mjs";
8
8
  import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
9
- import { o as createFederation } from "../middleware-DHyZlPpi.mjs";
9
+ import { o as createFederation } from "../middleware-C3JAusAj.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
@@ -11,14 +11,14 @@ 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 assertStrictEquals } from "../assert_strict_equals-Dmjbg-bA.mjs";
13
13
  import { t as assert } from "../assert-DikXweDx.mjs";
14
- import { l as verifyRequest, s as signRequest } from "../http-CUIxu16z.mjs";
14
+ import { l as verifyRequest, s as signRequest } from "../http-BkivuOe4.mjs";
15
15
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
16
- import { t as getAuthenticatedDocumentLoader } from "../docloader-BHrm7BpO.mjs";
17
- import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-8MkMznIw.mjs";
18
- import { t as doesActorOwnKey } from "../owner-BqFf5aUc.mjs";
19
- import { i as verifyObject, r as signObject } from "../proof-DkLHCewr.mjs";
16
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-DLAjdiZt.mjs";
17
+ import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-DAZQsoKN.mjs";
18
+ import { t as doesActorOwnKey } from "../owner-CwVIBwY0.mjs";
19
+ import { i as verifyObject, r as signObject } from "../proof-wrxzZi_u.mjs";
20
20
  import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
21
- import { i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-DHyZlPpi.mjs";
21
+ import { i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-C3JAusAj.mjs";
22
22
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
23
23
  import * as vocab from "@fedify/vocab";
24
24
  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-D7us7Y1k.cjs");
5
+ const require_middleware = require("../middleware-BUiHyCQ9.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-0TW9PJkh.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-Bk-ge16h.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-DikXweDx.mjs";
11
- import { l as verifyRequest } from "../http-CUIxu16z.mjs";
11
+ import { l as verifyRequest } from "../http-BkivuOe4.mjs";
12
12
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
13
- import { t as doesActorOwnKey } from "../owner-BqFf5aUc.mjs";
14
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-Cv34R1iA.mjs";
13
+ import { t as doesActorOwnKey } from "../owner-CwVIBwY0.mjs";
14
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-DOlXF7S8.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-CRDpx_HF.mjs";
5
5
  import { n as assertFalse } from "../assert_rejects-B-qJtC9Z.mjs";
6
6
  import { t as assert } from "../assert-DikXweDx.mjs";
7
- import { t as hasMalformedKnownTemporalLiteral } from "../temporal-DqCyup3d.mjs";
7
+ import { t as hasMalformedKnownTemporalLiteral } from "../temporal-B13wkvUP.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 { r as createRequestContext } from "../context-Dk_tacqz.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import "../std__assert-CRDpx_HF.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
8
- import { o as createFederation, s as handleWebFinger } from "../middleware-DHyZlPpi.mjs";
8
+ import { o as createFederation, s as handleWebFinger } from "../middleware-C3JAusAj.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  import { Image, Link, Person, Tombstone } from "@fedify/vocab";
11
11
  //#region src/federation/webfinger.test.ts
@@ -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-4Q9ruIMJ.mjs";
4
+ import { n as version, t as name } from "./deno-B0LcALOm.mjs";
5
5
  import { i as validateAcceptSignature, n as fulfillAcceptSignature, r as parseAcceptSignature } from "./accept-CPkZzmGN.mjs";
6
- import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-CVHsRpwc.mjs";
6
+ import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-BcpJR7wT.mjs";
7
7
  import { CryptographicKey } from "@fedify/vocab";
8
8
  import { SpanStatusCode, trace } from "@opentelemetry/api";
9
9
  import { FetchError } from "@fedify/vocab-runtime";
@@ -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.2.5";
13
+ var version = "2.2.6";
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;
@@ -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.2.5";
14
+ var version = "2.2.6";
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;
@@ -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-4Q9ruIMJ.mjs";
4
+ import { n as version, t as name } from "./deno-B0LcALOm.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-BTcDrLzD.js";
3
+ import { d as validateCryptoKey, t as doubleKnock } from "./http-C-9duWvR.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-CK9ElgLS.cjs");
4
+ const require_http = require("./http-NEN2KDMb.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-4Q9ruIMJ.mjs";
5
- import { n as fetchKey, o as validateCryptoKey } from "./key-CVHsRpwc.mjs";
4
+ import { n as version, t as name } from "./deno-B0LcALOm.mjs";
5
+ import { n as fetchKey, o as validateCryptoKey } from "./key-BcpJR7wT.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";
@@ -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-CK9ElgLS.cjs");
6
- const require_proof = require("./proof-BpBLMdLk.cjs");
5
+ const require_http = require("./http-NEN2KDMb.cjs");
6
+ const require_proof = require("./proof-C2en2Cmb.cjs");
7
7
  const require_types = require("./types-KC4QAoxe.cjs");
8
- const require_kv_cache = require("./kv-cache-DI-7Y6VS.cjs");
8
+ const require_kv_cache = require("./kv-cache-9K6uVGgd.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");
@@ -212,7 +212,7 @@ var FederationBuilderImpl = class {
212
212
  this.collectionTypeIds = {};
213
213
  }
214
214
  async build(options) {
215
- const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-B373Um8U.cjs"));
215
+ const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-CeqmkLh1.cjs"));
216
216
  const f = new FederationImpl(options);
217
217
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
218
218
  f.router = this.router.clone();
@@ -2951,6 +2951,15 @@ function isPermanentRemoteContextError(error) {
2951
2951
  function isPermanentInboxParseError(error) {
2952
2952
  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));
2953
2953
  }
2954
+ function hasLinkedDataSignatureJsonLdProcessingError(error) {
2955
+ if (error.message.startsWith("Maximum deep iterations exceeded")) return true;
2956
+ const cause = error.cause instanceof Error ? error.cause : error.details?.cause;
2957
+ 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.");
2958
+ return error.name !== "jsonld.InvalidUrl" && error.name.startsWith("jsonld.");
2959
+ }
2960
+ function isLinkedDataSignatureJsonLdProcessingError(error) {
2961
+ return error instanceof Error && hasLinkedDataSignatureJsonLdProcessingError(error);
2962
+ }
2954
2963
  /**
2955
2964
  * Create a new {@link Federation} instance.
2956
2965
  * @param parameters Parameters for initializing the instance.
@@ -3608,10 +3617,18 @@ var FederationImpl = class extends FederationBuilderImpl {
3608
3617
  privateKey: pair.privateKey
3609
3618
  }))
3610
3619
  });
3611
- else jsonLd = await require_proof.signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
3612
- contextLoader,
3613
- tracerProvider: this.tracerProvider
3614
- });
3620
+ else try {
3621
+ jsonLd = await require_proof.signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
3622
+ contextLoader,
3623
+ tracerProvider: this.tracerProvider
3624
+ });
3625
+ } catch (error) {
3626
+ if (!isLinkedDataSignatureJsonLdProcessingError(error)) throw error;
3627
+ logger.warn("Failed to create a Linked Data signature for the activity {activityId}. The activity will be sent without a Linked Data signature.", {
3628
+ activityId,
3629
+ error
3630
+ });
3631
+ }
3615
3632
  if (!hasProof) 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.", {
3616
3633
  activityId,
3617
3634
  keys: keys.map((pair) => ({
@@ -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-BTcDrLzD.js";
6
- import { _ as hasSignatureLike, b as signJsonLd, c as getKeyOwner, f as compactJsonLd, g as hasSignature, h as getNormalizationContextLoader, i as verifyObject, l as InvalidContextReferenceError, m as detachSignature, n as hasProofLike, o as normalizeOutgoingActivityJsonLd, r as signObject, s as doesActorOwnKey, u as assertSafeJsonLd, v as isClearlyMalformedContextReference, w as wrapContextLoaderForJsonLd, x as verifyCompactJsonLd, y as isInvalidUrlTypeError } from "./proof-v_hACCAr.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-C-9duWvR.js";
6
+ import { _ as hasSignatureLike, b as signJsonLd, c as getKeyOwner, f as compactJsonLd, g as hasSignature, h as getNormalizationContextLoader, i as verifyObject, l as InvalidContextReferenceError, m as detachSignature, n as hasProofLike, o as normalizeOutgoingActivityJsonLd, r as signObject, s as doesActorOwnKey, u as assertSafeJsonLd, v as isClearlyMalformedContextReference, w as wrapContextLoaderForJsonLd, x as verifyCompactJsonLd, y as isInvalidUrlTypeError } from "./proof-IyDe0jjt.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-C_aWsl_r.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-8o7zAqEi.js";
9
9
  import { getLogger, withContext } from "@logtape/logtape";
10
10
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
11
11
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
@@ -2958,6 +2958,15 @@ function isPermanentRemoteContextError(error) {
2958
2958
  function isPermanentInboxParseError(error) {
2959
2959
  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));
2960
2960
  }
2961
+ function hasLinkedDataSignatureJsonLdProcessingError(error) {
2962
+ if (error.message.startsWith("Maximum deep iterations exceeded")) return true;
2963
+ const cause = error.cause instanceof Error ? error.cause : error.details?.cause;
2964
+ 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.");
2965
+ return error.name !== "jsonld.InvalidUrl" && error.name.startsWith("jsonld.");
2966
+ }
2967
+ function isLinkedDataSignatureJsonLdProcessingError(error) {
2968
+ return error instanceof Error && hasLinkedDataSignatureJsonLdProcessingError(error);
2969
+ }
2961
2970
  /**
2962
2971
  * Create a new {@link Federation} instance.
2963
2972
  * @param parameters Parameters for initializing the instance.
@@ -3615,10 +3624,18 @@ var FederationImpl = class extends FederationBuilderImpl {
3615
3624
  privateKey: pair.privateKey
3616
3625
  }))
3617
3626
  });
3618
- else jsonLd = await signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
3619
- contextLoader,
3620
- tracerProvider: this.tracerProvider
3621
- });
3627
+ else try {
3628
+ jsonLd = await signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
3629
+ contextLoader,
3630
+ tracerProvider: this.tracerProvider
3631
+ });
3632
+ } catch (error) {
3633
+ if (!isLinkedDataSignatureJsonLdProcessingError(error)) throw error;
3634
+ logger.warn("Failed to create a Linked Data signature for the activity {activityId}. The activity will be sent without a Linked Data signature.", {
3635
+ activityId,
3636
+ error
3637
+ });
3638
+ }
3622
3639
  if (!hasProof) 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.", {
3623
3640
  activityId,
3624
3641
  keys: keys.map((pair) => ({
@@ -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-DHyZlPpi.mjs";
4
+ import { n as FederationImpl } from "./middleware-C3JAusAj.mjs";
5
5
  export { 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-4Q9ruIMJ.mjs";
5
+ import { n as version, t as name } from "./deno-B0LcALOm.mjs";
6
6
  import { t as formatAcceptSignature } from "./accept-CPkZzmGN.mjs";
7
- import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-CVHsRpwc.mjs";
8
- import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-CUIxu16z.mjs";
9
- import { t as getAuthenticatedDocumentLoader } from "./docloader-BHrm7BpO.mjs";
7
+ import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-BcpJR7wT.mjs";
8
+ import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-BkivuOe4.mjs";
9
+ import { t as getAuthenticatedDocumentLoader } from "./docloader-DLAjdiZt.mjs";
10
10
  import { n as kvCache } from "./kv-cache-DYsF2MhP.mjs";
11
- import { _ 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 } from "./ld-8MkMznIw.mjs";
12
- import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-BqFf5aUc.mjs";
11
+ import { _ 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 } from "./ld-DAZQsoKN.mjs";
12
+ import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-CwVIBwY0.mjs";
13
13
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-CNmZLixq.mjs";
14
- import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-DkLHCewr.mjs";
14
+ import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-wrxzZi_u.mjs";
15
15
  import { t as getNodeInfo } from "./client-D_1QpnWt.mjs";
16
16
  import { t as nodeInfoToJson } from "./types-J53Kw7so.mjs";
17
- import { t as FederationBuilderImpl } from "./builder-zDJOhWad.mjs";
17
+ import { t as FederationBuilderImpl } from "./builder-C-al99Vs.mjs";
18
18
  import { t as buildCollectionSynchronizationHeader } from "./collection-D-HqUuA2.mjs";
19
19
  import { t as KvKeyCache } from "./keycache-EGATflN-.mjs";
20
20
  import { t as acceptsJsonLd } from "./negotiation-SQvQgUqe.mjs";
21
- import { t as hasMalformedKnownTemporalLiteral } from "./temporal-DqCyup3d.mjs";
21
+ import { t as hasMalformedKnownTemporalLiteral } from "./temporal-B13wkvUP.mjs";
22
22
  import { t as createExponentialBackoffPolicy } from "./retry-v_sGLH1d.mjs";
23
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-Cv34R1iA.mjs";
23
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-DOlXF7S8.mjs";
24
24
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
25
25
  import { lookupWebFinger } from "@fedify/webfinger";
26
26
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
@@ -1840,6 +1840,15 @@ function isPermanentRemoteContextError(error) {
1840
1840
  function isPermanentInboxParseError(error) {
1841
1841
  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));
1842
1842
  }
1843
+ function hasLinkedDataSignatureJsonLdProcessingError(error) {
1844
+ if (error.message.startsWith("Maximum deep iterations exceeded")) return true;
1845
+ const cause = error.cause instanceof Error ? error.cause : error.details?.cause;
1846
+ 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.");
1847
+ return error.name !== "jsonld.InvalidUrl" && error.name.startsWith("jsonld.");
1848
+ }
1849
+ function isLinkedDataSignatureJsonLdProcessingError(error) {
1850
+ return error instanceof Error && hasLinkedDataSignatureJsonLdProcessingError(error);
1851
+ }
1843
1852
  /**
1844
1853
  * Create a new {@link Federation} instance.
1845
1854
  * @param parameters Parameters for initializing the instance.
@@ -2497,10 +2506,18 @@ var FederationImpl = class extends FederationBuilderImpl {
2497
2506
  privateKey: pair.privateKey
2498
2507
  }))
2499
2508
  });
2500
- else jsonLd = await signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
2501
- contextLoader,
2502
- tracerProvider: this.tracerProvider
2503
- });
2509
+ else try {
2510
+ jsonLd = await signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
2511
+ contextLoader,
2512
+ tracerProvider: this.tracerProvider
2513
+ });
2514
+ } catch (error) {
2515
+ if (!isLinkedDataSignatureJsonLdProcessingError(error)) throw error;
2516
+ logger.warn("Failed to create a Linked Data signature for the activity {activityId}. The activity will be sent without a Linked Data signature.", {
2517
+ activityId,
2518
+ error
2519
+ });
2520
+ }
2504
2521
  if (!hasProof) 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.", {
2505
2522
  activityId,
2506
2523
  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-D7us7Y1k.cjs");
3
+ const require_middleware = require("./middleware-BUiHyCQ9.cjs");
4
4
  exports.FederationImpl = require_middleware.FederationImpl;
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-CK9ElgLS.cjs");
8
- const require_middleware = require("./middleware-D7us7Y1k.cjs");
9
- const require_proof = require("./proof-BpBLMdLk.cjs");
7
+ const require_http = require("./http-NEN2KDMb.cjs");
8
+ const require_middleware = require("./middleware-BUiHyCQ9.cjs");
9
+ const require_proof = require("./proof-C2en2Cmb.cjs");
10
10
  const require_types = require("./types-KC4QAoxe.cjs");
11
- const require_kv_cache = require("./kv-cache-DI-7Y6VS.cjs");
11
+ const require_kv_cache = require("./kv-cache-9K6uVGgd.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-BTcDrLzD.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-0TW9PJkh.js";
8
- import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-v_hACCAr.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-C-9duWvR.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-Bk-ge16h.js";
8
+ import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-IyDe0jjt.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-C_aWsl_r.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-8o7zAqEi.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 { r as createRequestContext } from "../context-Dk_tacqz.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import "../std__assert-CRDpx_HF.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
8
- import { _ as handleNodeInfoJrd, g as handleNodeInfo, o as createFederation } from "../middleware-DHyZlPpi.mjs";
8
+ import { _ as handleNodeInfoJrd, g as handleNodeInfo, o as createFederation } from "../middleware-C3JAusAj.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-4Q9ruIMJ.mjs";
5
- import "./key-CVHsRpwc.mjs";
4
+ import { n as version, t as name } from "./deno-B0LcALOm.mjs";
5
+ import "./key-BcpJR7wT.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,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-CK9ElgLS.cjs");
4
+ const require_http = require("./http-NEN2KDMb.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,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-BTcDrLzD.js";
3
+ import { _ as version, d as validateCryptoKey, g as name, s as fetchKey } from "./http-C-9duWvR.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, PUBLIC_COLLECTION, getTypeId, isActor } from "@fedify/vocab";
6
6
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -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-4Q9ruIMJ.mjs";
5
- import { n as fetchKey, o as validateCryptoKey } from "./key-CVHsRpwc.mjs";
4
+ import { n as version, t as name } from "./deno-B0LcALOm.mjs";
5
+ import { n as fetchKey, o as validateCryptoKey } from "./key-BcpJR7wT.mjs";
6
6
  import { n as preloadedOnlyDocumentLoader } from "./public-audience-DYFHzm_c.mjs";
7
7
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-CNmZLixq.mjs";
8
8
  import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
@@ -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-4Q9ruIMJ.mjs";
5
- import { n as doubleKnock } from "./http-CUIxu16z.mjs";
4
+ import { n as version, t as name } from "./deno-B0LcALOm.mjs";
5
+ import { n as doubleKnock } from "./http-BkivuOe4.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 { i as assertExists, t as assertStringIncludes } from "../std__assert-CRD
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-DikXweDx.mjs";
10
- import { t as exportJwk } from "../key-CVHsRpwc.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-CUIxu16z.mjs";
10
+ import { t as exportJwk } from "../key-BcpJR7wT.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-BkivuOe4.mjs";
12
12
  import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DGu1NFwu.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-CRDpx_HF.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-CVHsRpwc.mjs";
8
+ import { a as importJwk, i as generateCryptoKeyPair, n as fetchKey, o as validateCryptoKey, r as fetchKeyDetailed, t as exportJwk } from "../key-BcpJR7wT.mjs";
9
9
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.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-DikXweDx.mjs";
8
- import { i as generateCryptoKeyPair } from "../key-CVHsRpwc.mjs";
8
+ import { i as generateCryptoKeyPair } from "../key-BcpJR7wT.mjs";
9
9
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
10
- import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-8MkMznIw.mjs";
10
+ import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-DAZQsoKN.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-CK9ElgLS.cjs");
5
- const require_proof = require("../proof-BpBLMdLk.cjs");
4
+ const require_http = require("../http-NEN2KDMb.cjs");
5
+ const require_proof = require("../proof-C2en2Cmb.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-BTcDrLzD.js";
4
- import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "../proof-v_hACCAr.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-C-9duWvR.js";
4
+ import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "../proof-IyDe0jjt.js";
5
5
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
@@ -6,7 +6,7 @@ import "../std__assert-CRDpx_HF.mjs";
6
6
  import { n as assertFalse } from "../assert_rejects-B-qJtC9Z.mjs";
7
7
  import { t as assert } from "../assert-DikXweDx.mjs";
8
8
  import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DGu1NFwu.mjs";
9
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-BqFf5aUc.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-CwVIBwY0.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
@@ -8,7 +8,7 @@ import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
8
8
  import { t as assert } from "../assert-DikXweDx.mjs";
9
9
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
10
10
  import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-CNmZLixq.mjs";
11
- import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-DkLHCewr.mjs";
11
+ import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-wrxzZi_u.mjs";
12
12
  import { mockDocumentLoader, test } from "@fedify/fixture";
13
13
  import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place } from "@fedify/vocab";
14
14
  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-8MkMznIw.mjs";
4
+ import { c as getNormalizationContextLoader } from "./ld-DAZQsoKN.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-CRDpx_HF.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
8
- import { l as verifyRequest } from "../http-CUIxu16z.mjs";
8
+ import { l as verifyRequest } from "../http-BkivuOe4.mjs";
9
9
  import { i as rsaPrivateKey2 } from "../keys-DGu1NFwu.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../docloader-BHrm7BpO.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-DLAjdiZt.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-DI-7Y6VS.cjs");
4
+ const require_kv_cache = require("../kv-cache-9K6uVGgd.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-C_aWsl_r.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-8o7zAqEi.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -153,9 +153,9 @@
153
153
  "uri-template-router": "^1.0.0",
154
154
  "url-template": "^3.1.1",
155
155
  "urlpattern-polyfill": "^10.1.0",
156
- "@fedify/webfinger": "2.2.5",
157
- "@fedify/vocab-runtime": "2.2.5",
158
- "@fedify/vocab": "2.2.5"
156
+ "@fedify/vocab-runtime": "2.2.6",
157
+ "@fedify/vocab": "2.2.6",
158
+ "@fedify/webfinger": "2.2.6"
159
159
  },
160
160
  "devDependencies": {
161
161
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -167,8 +167,8 @@
167
167
  "tsx": "^4.19.4",
168
168
  "typescript": "^6.0.0",
169
169
  "wrangler": "^4.17.0",
170
- "@fedify/fixture": "2.0.0",
171
- "@fedify/vocab-tools": "^2.2.5"
170
+ "@fedify/vocab-tools": "^2.2.6",
171
+ "@fedify/fixture": "2.0.0"
172
172
  },
173
173
  "scripts": {
174
174
  "build:self": "tsdown",