@fedify/fedify 1.9.2-dev.1890 → 1.10.0-dev.11

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 (104) hide show
  1. package/README.md +3 -0
  2. package/dist/{actor-LJkP7iVc.js → actor-BrjBSlv8.js} +187 -187
  3. package/dist/{actor-C2kxp5Fl.cjs → actor-CdCyXIiy.cjs} +187 -187
  4. package/dist/{actor-DyfGDQJB.js → actor-CzhWrNYT.js} +1 -1
  5. package/dist/{authdocloader-DaFhFZWS.cjs → authdocloader-BJPbXGjs.cjs} +3 -3
  6. package/dist/{authdocloader-8jtTmnjn.js → authdocloader-DWc5tH1y.js} +3 -3
  7. package/dist/{authdocloader-Djn6Z8TB.js → authdocloader-Y9lwp2q3.js} +3 -3
  8. package/dist/{builder-DG1srBKu.js → builder-D9HmXe-c.js} +4 -4
  9. package/dist/{client-Dq-zkC8Y.js → client-DPYh54yM.js} +1 -1
  10. package/dist/compat/transformers.test.js +16 -16
  11. package/dist/{docloader-Uh0ciwr4.cjs → docloader-Cgy1RCqb.cjs} +67 -29
  12. package/dist/{docloader-B_A2nB2W.js → docloader-Crf5jJS0.js} +67 -29
  13. package/dist/{esm-D-py171v.js → esm-D6gwWBFZ.js} +1 -1
  14. package/dist/federation/builder.test.js +5 -5
  15. package/dist/federation/collection.test.js +3 -3
  16. package/dist/federation/handler.test.js +104 -17
  17. package/dist/federation/idempotency.test.js +17 -17
  18. package/dist/federation/inbox.test.js +4 -4
  19. package/dist/federation/keycache.test.js +4 -4
  20. package/dist/federation/kv.test.js +3 -3
  21. package/dist/federation/middleware.test.js +18 -18
  22. package/dist/federation/mod.cjs +10 -10
  23. package/dist/federation/mod.js +10 -10
  24. package/dist/federation/mq.test.js +5 -5
  25. package/dist/federation/retry.test.js +3 -3
  26. package/dist/federation/router.test.js +3 -3
  27. package/dist/federation/send.test.js +53 -10
  28. package/dist/{http-jrUnvC1R.js → http-BqvHtYhP.js} +2 -2
  29. package/dist/{http-CJ7SfCok.js → http-CSJ1EReB.js} +3 -3
  30. package/dist/{http-DNoRdF3N.cjs → http-DBJHuWVd.cjs} +3 -3
  31. package/dist/{inbox-C3N4s1QJ.js → inbox-BuzNfn3x.js} +1 -1
  32. package/dist/{key-CAH7GCWj.js → key-1YPBM8c7.js} +2 -2
  33. package/dist/{key-CtByaj7Q.js → key-B5Hkq3o6.js} +4 -4
  34. package/dist/key-BgW3veKX.cjs +10 -0
  35. package/dist/{key-CkxzRYsV.cjs → key-CHl3R_Y6.cjs} +2 -2
  36. package/dist/{key-D-Vs5Xls.js → key-CJW3qlT7.js} +3 -3
  37. package/dist/{key-Ci7FKLpn.js → key-DZXdhUze.js} +2 -2
  38. package/dist/{keycache-CEs327f0.js → keycache-CGSAu6vs.js} +1 -1
  39. package/dist/{keys-BgYAMY7I.js → keys-CfLhGOby.js} +1 -1
  40. package/dist/{ld-CF-_Iv3N.js → ld-CmJQd-xc.js} +2 -2
  41. package/dist/{lookup-DqmSkJVj.js → lookup--mgANXmv.js} +1 -1
  42. package/dist/{lookup-BqEeMRXW.cjs → lookup-BQeZoGI4.cjs} +1 -1
  43. package/dist/{lookup-BA3bNgf4.js → lookup-pw97bxAu.js} +6 -1
  44. package/dist/{middleware-BhU7xqzl.cjs → middleware-Bh5EE6vq.cjs} +24 -12
  45. package/dist/middleware-DATy40bZ.cjs +17 -0
  46. package/dist/{middleware-DFDGXfT5.js → middleware-DfeWQSw-.js} +24 -12
  47. package/dist/middleware-V-6KSCRG.js +17 -0
  48. package/dist/{middleware-8Utrfm2B.js → middleware-_hA7WuDf.js} +20 -13
  49. package/dist/middleware-qKLKzVpT.js +26 -0
  50. package/dist/mod.cjs +10 -10
  51. package/dist/mod.js +10 -10
  52. package/dist/nodeinfo/client.test.js +5 -5
  53. package/dist/nodeinfo/handler.test.js +16 -16
  54. package/dist/nodeinfo/mod.cjs +2 -2
  55. package/dist/nodeinfo/mod.js +2 -2
  56. package/dist/nodeinfo/semver.test.js +3 -3
  57. package/dist/nodeinfo/types.test.js +3 -3
  58. package/dist/otel-Chy5T2Xh.js +64 -0
  59. package/dist/{owner-D2N6v5Gm.js → owner-B7WLWS8V.js} +44 -8
  60. package/dist/{proof-XCcYDcHk.js → proof-BSHkn7FC.js} +45 -9
  61. package/dist/{proof-GwNAN3ln.js → proof-BSpRVVLc.js} +2 -2
  62. package/dist/{proof-CbitzfgJ.cjs → proof-Dkb2_kGH.cjs} +44 -8
  63. package/dist/runtime/authdocloader.test.js +9 -9
  64. package/dist/runtime/docloader.test.js +82 -5
  65. package/dist/runtime/key.test.js +5 -5
  66. package/dist/runtime/langstr.test.js +3 -3
  67. package/dist/runtime/link.test.js +3 -3
  68. package/dist/runtime/mod.cjs +6 -6
  69. package/dist/runtime/mod.js +6 -6
  70. package/dist/runtime/multibase/multibase.test.js +3 -3
  71. package/dist/runtime/url.test.js +3 -3
  72. package/dist/{send-D_f3mgyD.js → send-CKzTk_tF.js} +9 -4
  73. package/dist/sig/http.test.js +8 -8
  74. package/dist/sig/key.test.js +6 -6
  75. package/dist/sig/ld.test.js +7 -7
  76. package/dist/sig/mod.cjs +6 -6
  77. package/dist/sig/mod.js +6 -6
  78. package/dist/sig/owner.test.js +31 -7
  79. package/dist/sig/proof.test.js +7 -7
  80. package/dist/testing/docloader.test.js +3 -3
  81. package/dist/testing/mod.js +3 -3
  82. package/dist/{testing-hVeFvsZ9.js → testing-DiHxoGZd.js} +2 -2
  83. package/dist/{type-CfrcT6D9.js → type-Bjc-_Rom.js} +253 -216
  84. package/dist/{types-apcavnI7.js → types-B5V7vlb3.js} +1 -1
  85. package/dist/{types-DvsdrWOg.cjs → types-DWiBkfCv.cjs} +1 -1
  86. package/dist/vocab/actor.test.js +5 -5
  87. package/dist/vocab/lookup.test.js +27 -5
  88. package/dist/vocab/mod.cjs +4 -4
  89. package/dist/vocab/mod.js +4 -4
  90. package/dist/vocab/type.test.js +3 -3
  91. package/dist/vocab/vocab.test.js +4 -4
  92. package/dist/{vocab-0FCIW9qL.cjs → vocab-BdU947qD.cjs} +8 -3
  93. package/dist/{vocab-DGzlpjfi.js → vocab-ChCCqvR3.js} +8 -3
  94. package/dist/webfinger/handler.test.js +16 -16
  95. package/dist/webfinger/lookup.test.js +4 -4
  96. package/dist/webfinger/mod.cjs +2 -2
  97. package/dist/webfinger/mod.js +2 -2
  98. package/dist/x/cfworkers.test.js +3 -3
  99. package/package.json +5 -3
  100. package/dist/key-CEK-2eTr.cjs +0 -10
  101. package/dist/middleware-BQ3VcPQj.js +0 -17
  102. package/dist/middleware-BxBgtIG4.js +0 -26
  103. package/dist/middleware-UJYNu-kk.cjs +0 -17
  104. /package/dist/{denokv-Bv33Xxea.js → denokv-D0nfNQ1x.js} +0 -0
@@ -2,11 +2,11 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import { deno_default, getDocumentLoader } from "./docloader-B_A2nB2W.js";
6
- import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "./actor-LJkP7iVc.js";
7
- import { fetchKey, validateCryptoKey } from "./key-CAH7GCWj.js";
5
+ import { deno_default, getDocumentLoader } from "./docloader-Crf5jJS0.js";
6
+ import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "./actor-BrjBSlv8.js";
7
+ import { fetchKey, validateCryptoKey } from "./key-1YPBM8c7.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
- import { SpanStatusCode, trace } from "@opentelemetry/api";
9
+ import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
10
10
  import jsonld from "jsonld";
11
11
  import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
12
12
  import { encodeHex } from "byte-encodings/hex";
@@ -275,11 +275,47 @@ async function hashJsonLd(jsonLd, contextLoader) {
275
275
  * @returns Whether the actor is the owner of the key.
276
276
  */
277
277
  async function doesActorOwnKey(activity, key, options) {
278
- if (key.ownerId != null) return key.ownerId.href === activity.actorId?.href;
279
- const actor = await activity.getActor(options);
280
- if (actor == null || !isActor(actor)) return false;
281
- for (const publicKeyId of actor.publicKeyIds) if (key.id != null && publicKeyId.href === key.id.href) return true;
282
- return false;
278
+ const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
279
+ const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
280
+ return await tracer.startActiveSpan("activitypub.verify_key_ownership", {
281
+ kind: SpanKind.INTERNAL,
282
+ attributes: {
283
+ "activitypub.actor.id": activity.actorId?.href ?? "",
284
+ "activitypub.key.id": key.id?.href ?? ""
285
+ }
286
+ }, async (span) => {
287
+ try {
288
+ if (key.ownerId != null) {
289
+ const owns = key.ownerId.href === activity.actorId?.href;
290
+ span.setAttribute("activitypub.key_ownership.verified", owns);
291
+ span.setAttribute("activitypub.key_ownership.method", "owner_id");
292
+ return owns;
293
+ }
294
+ const actor = await activity.getActor(options);
295
+ if (actor == null || !isActor(actor)) {
296
+ span.setAttribute("activitypub.key_ownership.verified", false);
297
+ span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
298
+ return false;
299
+ }
300
+ for (const publicKeyId of actor.publicKeyIds) if (key.id != null && publicKeyId.href === key.id.href) {
301
+ span.setAttribute("activitypub.key_ownership.verified", true);
302
+ span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
303
+ return true;
304
+ }
305
+ span.setAttribute("activitypub.key_ownership.verified", false);
306
+ span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
307
+ return false;
308
+ } catch (error) {
309
+ span.recordException(error);
310
+ span.setStatus({
311
+ code: SpanStatusCode.ERROR,
312
+ message: String(error)
313
+ });
314
+ throw error;
315
+ } finally {
316
+ span.end();
317
+ }
318
+ });
283
319
  }
284
320
  /**
285
321
  * Gets the actor that owns the specified key. Returns `null` if the key has no
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Activity, DataIntegrityProof, Multikey, deno_default, getTypeId } from "./type-CfrcT6D9.js";
7
- import { fetchKey, validateCryptoKey } from "./key-Ci7FKLpn.js";
6
+ import { Activity, DataIntegrityProof, Multikey, deno_default, getTypeId } from "./type-Bjc-_Rom.js";
7
+ import { fetchKey, validateCryptoKey } from "./key-DZXdhUze.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  import { SpanStatusCode, trace } from "@opentelemetry/api";
10
10
  import { encodeHex } from "byte-encodings/hex";
@@ -3,9 +3,9 @@
3
3
  const { URLPattern } = require("urlpattern-polyfill");
4
4
 
5
5
  const require_chunk = require('./chunk-DqRYRqnO.cjs');
6
- const require_docloader = require('./docloader-Uh0ciwr4.cjs');
7
- const require_actor = require('./actor-C2kxp5Fl.cjs');
8
- const require_key = require('./key-CkxzRYsV.cjs');
6
+ const require_docloader = require('./docloader-Cgy1RCqb.cjs');
7
+ const require_actor = require('./actor-CdCyXIiy.cjs');
8
+ const require_key = require('./key-CHl3R_Y6.cjs');
9
9
  const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
10
10
  const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
11
11
  const jsonld = require_chunk.__toESM(require("jsonld"));
@@ -276,11 +276,47 @@ async function hashJsonLd(jsonLd, contextLoader) {
276
276
  * @returns Whether the actor is the owner of the key.
277
277
  */
278
278
  async function doesActorOwnKey(activity, key, options) {
279
- if (key.ownerId != null) return key.ownerId.href === activity.actorId?.href;
280
- const actor = await activity.getActor(options);
281
- if (actor == null || !require_actor.isActor(actor)) return false;
282
- for (const publicKeyId of actor.publicKeyIds) if (key.id != null && publicKeyId.href === key.id.href) return true;
283
- return false;
279
+ const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
280
+ const tracer = tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
281
+ return await tracer.startActiveSpan("activitypub.verify_key_ownership", {
282
+ kind: __opentelemetry_api.SpanKind.INTERNAL,
283
+ attributes: {
284
+ "activitypub.actor.id": activity.actorId?.href ?? "",
285
+ "activitypub.key.id": key.id?.href ?? ""
286
+ }
287
+ }, async (span) => {
288
+ try {
289
+ if (key.ownerId != null) {
290
+ const owns = key.ownerId.href === activity.actorId?.href;
291
+ span.setAttribute("activitypub.key_ownership.verified", owns);
292
+ span.setAttribute("activitypub.key_ownership.method", "owner_id");
293
+ return owns;
294
+ }
295
+ const actor = await activity.getActor(options);
296
+ if (actor == null || !require_actor.isActor(actor)) {
297
+ span.setAttribute("activitypub.key_ownership.verified", false);
298
+ span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
299
+ return false;
300
+ }
301
+ for (const publicKeyId of actor.publicKeyIds) if (key.id != null && publicKeyId.href === key.id.href) {
302
+ span.setAttribute("activitypub.key_ownership.verified", true);
303
+ span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
304
+ return true;
305
+ }
306
+ span.setAttribute("activitypub.key_ownership.verified", false);
307
+ span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
308
+ return false;
309
+ } catch (error) {
310
+ span.recordException(error);
311
+ span.setStatus({
312
+ code: __opentelemetry_api.SpanStatusCode.ERROR,
313
+ message: String(error)
314
+ });
315
+ throw error;
316
+ } finally {
317
+ span.end();
318
+ }
319
+ });
284
320
  }
285
321
  /**
286
322
  * Gets the actor that owns the specified key. Returns `null` if the key has no
@@ -3,23 +3,23 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { UrlError } from "../type-CfrcT6D9.js";
6
+ import { UrlError } from "../type-Bjc-_Rom.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-BA3bNgf4.js";
11
- import "../actor-DyfGDQJB.js";
12
- import "../key-Ci7FKLpn.js";
13
- import { verifyRequest } from "../http-jrUnvC1R.js";
14
- import { getAuthenticatedDocumentLoader } from "../authdocloader-8jtTmnjn.js";
15
- import { mockDocumentLoader, test } from "../testing-hVeFvsZ9.js";
10
+ import "../lookup-pw97bxAu.js";
11
+ import "../actor-CzhWrNYT.js";
12
+ import "../key-DZXdhUze.js";
13
+ import { verifyRequest } from "../http-BqvHtYhP.js";
14
+ import { getAuthenticatedDocumentLoader } from "../authdocloader-DWc5tH1y.js";
15
+ import { mockDocumentLoader, test } from "../testing-DiHxoGZd.js";
16
16
  import "../std__assert-X-_kMxKM.js";
17
17
  import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
18
18
  import "../assert_is_error-BPGph1Jx.js";
19
19
  import "../assert_not_equals-f3m3epl3.js";
20
20
  import "../assert_throws-BOO88avQ.js";
21
- import { rsaPrivateKey2 } from "../keys-BgYAMY7I.js";
22
- import { esm_default } from "../esm-D-py171v.js";
21
+ import { rsaPrivateKey2 } from "../keys-CfLhGOby.js";
22
+ import { esm_default } from "../esm-D6gwWBFZ.js";
23
23
 
24
24
  //#region src/runtime/authdocloader.test.ts
25
25
  test("getAuthenticatedDocumentLoader()", async (t) => {
@@ -3,19 +3,20 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { FetchError, UrlError, contexts_default, deno_default, getDocumentLoader, getUserAgent, kvCache } from "../type-CfrcT6D9.js";
6
+ import { FetchError, UrlError, contexts_default, deno_default, getDocumentLoader, getUserAgent, kvCache } from "../type-Bjc-_Rom.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
- import "../assert-MZs1qjMx.js";
8
+ import { assert } from "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
10
  import { MemoryKvStore } from "../kv-CRZrzyXm.js";
11
- import "../lookup-BA3bNgf4.js";
12
- import { mockDocumentLoader, test } from "../testing-hVeFvsZ9.js";
11
+ import "../lookup-pw97bxAu.js";
12
+ import { mockDocumentLoader, test } from "../testing-DiHxoGZd.js";
13
13
  import "../std__assert-X-_kMxKM.js";
14
14
  import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
15
15
  import "../assert_is_error-BPGph1Jx.js";
16
16
  import "../assert_not_equals-f3m3epl3.js";
17
17
  import { assertThrows } from "../assert_throws-BOO88avQ.js";
18
- import { esm_default } from "../esm-D-py171v.js";
18
+ import { createTestTracerProvider } from "../otel-Chy5T2Xh.js";
19
+ import { esm_default } from "../esm-D6gwWBFZ.js";
19
20
  import process from "node:process";
20
21
 
21
22
  //#region src/runtime/docloader.test.ts
@@ -286,6 +287,17 @@ test("getDocumentLoader()", async (t) => {
286
287
  assertEquals(await fetchDocumentLoader2("https://example.com/localhost-redirect"), expected);
287
288
  assertEquals(await fetchDocumentLoader2("https://example.com/localhost-link"), expected);
288
289
  });
290
+ const maliciousPayload = "<a" + " a=\"b\"".repeat(30) + " ";
291
+ esm_default.get("https://example.com/redos", {
292
+ body: maliciousPayload,
293
+ headers: { "Content-Type": "text/html; charset=utf-8" }
294
+ });
295
+ await t.step("ReDoS resistance (CVE-2025-68475)", async () => {
296
+ const start = performance.now();
297
+ await assertRejects(() => fetchDocumentLoader("https://example.com/redos"), SyntaxError);
298
+ const elapsed = performance.now() - start;
299
+ assert(elapsed < 1e3, `Potential ReDoS vulnerability detected: ${elapsed}ms (expected < 1000ms)`);
300
+ });
289
301
  esm_default.hardReset();
290
302
  });
291
303
  test("kvCache()", async (t) => {
@@ -518,5 +530,70 @@ test("getUserAgent()", () => {
518
530
  }), `MyApp/1.0.0 (Fedify/${deno_default.version}; Node.js/${process.versions.node}; +https://example.com/)`);
519
531
  }
520
532
  });
533
+ test("getDocumentLoader() records OpenTelemetry span", async (t) => {
534
+ const [tracerProvider, exporter] = createTestTracerProvider();
535
+ esm_default.spyGlobal();
536
+ await t.step("successful fetch", async () => {
537
+ esm_default.get("https://example.com/doc", {
538
+ status: 200,
539
+ headers: { "Content-Type": "application/activity+json" },
540
+ body: JSON.stringify({
541
+ "@context": "https://www.w3.org/ns/activitystreams",
542
+ type: "Note"
543
+ })
544
+ });
545
+ const loader = getDocumentLoader();
546
+ const { trace } = await import("@opentelemetry/api");
547
+ const originalProvider = trace.getTracerProvider();
548
+ trace.setGlobalTracerProvider(tracerProvider);
549
+ try {
550
+ const result = await loader("https://example.com/doc");
551
+ assertEquals(result.documentUrl, "https://example.com/doc");
552
+ const spans = exporter.getSpans("activitypub.fetch_document");
553
+ assertEquals(spans.length, 1);
554
+ const span = spans[0];
555
+ assertEquals(span.attributes["url.full"], "https://example.com/doc");
556
+ assertEquals(span.attributes["http.response.status_code"], 200);
557
+ assertEquals(span.attributes["docloader.document_url"], "https://example.com/doc");
558
+ } finally {
559
+ trace.setGlobalTracerProvider(originalProvider);
560
+ exporter.clear();
561
+ esm_default.hardReset();
562
+ }
563
+ });
564
+ await t.step("redirect", async () => {
565
+ esm_default.spyGlobal();
566
+ esm_default.get("https://example.com/doc", {
567
+ status: 302,
568
+ headers: { "Location": "https://example.com/new-doc" }
569
+ });
570
+ esm_default.get("https://example.com/new-doc", {
571
+ status: 200,
572
+ headers: { "Content-Type": "application/activity+json" },
573
+ body: JSON.stringify({
574
+ "@context": "https://www.w3.org/ns/activitystreams",
575
+ type: "Note"
576
+ })
577
+ });
578
+ const loader = getDocumentLoader();
579
+ const { trace } = await import("@opentelemetry/api");
580
+ const originalProvider = trace.getTracerProvider();
581
+ trace.setGlobalTracerProvider(tracerProvider);
582
+ try {
583
+ const result = await loader("https://example.com/doc");
584
+ assertEquals(result.documentUrl, "https://example.com/new-doc");
585
+ const spans = exporter.getSpans("activitypub.fetch_document");
586
+ assertEquals(spans.length, 2);
587
+ const redirectSpan = spans[spans.length - 1];
588
+ assertEquals(redirectSpan.attributes["url.full"], "https://example.com/doc");
589
+ assertEquals(redirectSpan.attributes["http.response.status_code"], 302);
590
+ assertEquals(redirectSpan.attributes["http.redirect.url"], "https://example.com/new-doc");
591
+ } finally {
592
+ trace.setGlobalTracerProvider(originalProvider);
593
+ exporter.clear();
594
+ esm_default.hardReset();
595
+ }
596
+ });
597
+ });
521
598
 
522
599
  //#endregion
@@ -3,14 +3,14 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../type-CfrcT6D9.js";
6
+ import { exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../type-Bjc-_Rom.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-BA3bNgf4.js";
11
- import "../actor-DyfGDQJB.js";
12
- import { exportJwk, importJwk } from "../key-Ci7FKLpn.js";
13
- import { test } from "../testing-hVeFvsZ9.js";
10
+ import "../lookup-pw97bxAu.js";
11
+ import "../actor-CzhWrNYT.js";
12
+ import { exportJwk, importJwk } from "../key-DZXdhUze.js";
13
+ import { test } from "../testing-DiHxoGZd.js";
14
14
  import "../std__assert-X-_kMxKM.js";
15
15
  import "../assert_rejects-DiIiJbZn.js";
16
16
  import "../assert_is_error-BPGph1Jx.js";
@@ -3,12 +3,12 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { LanguageString } from "../type-CfrcT6D9.js";
6
+ import { LanguageString } from "../type-Bjc-_Rom.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-BA3bNgf4.js";
11
- import { test } from "../testing-hVeFvsZ9.js";
10
+ import "../lookup-pw97bxAu.js";
11
+ import { test } from "../testing-DiHxoGZd.js";
12
12
  import "../std__assert-X-_kMxKM.js";
13
13
  import "../assert_rejects-DiIiJbZn.js";
14
14
  import "../assert_is_error-BPGph1Jx.js";
@@ -3,9 +3,9 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { HttpHeaderLink } from "../type-CfrcT6D9.js";
7
- import "../lookup-BA3bNgf4.js";
8
- import { test } from "../testing-hVeFvsZ9.js";
6
+ import { HttpHeaderLink } from "../type-Bjc-_Rom.js";
7
+ import "../lookup-pw97bxAu.js";
8
+ import { test } from "../testing-DiHxoGZd.js";
9
9
  import { deepStrictEqual, throws } from "node:assert";
10
10
 
11
11
  //#region src/runtime/link.test.ts
@@ -2,12 +2,12 @@
2
2
  const { Temporal } = require("@js-temporal/polyfill");
3
3
  const { URLPattern } = require("urlpattern-polyfill");
4
4
 
5
- const require_docloader = require('../docloader-Uh0ciwr4.cjs');
6
- const require_actor = require('../actor-C2kxp5Fl.cjs');
7
- require('../lookup-BqEeMRXW.cjs');
8
- require('../key-CkxzRYsV.cjs');
9
- require('../http-DNoRdF3N.cjs');
10
- const require_authdocloader = require('../authdocloader-DaFhFZWS.cjs');
5
+ const require_docloader = require('../docloader-Cgy1RCqb.cjs');
6
+ const require_actor = require('../actor-CdCyXIiy.cjs');
7
+ require('../lookup-BQeZoGI4.cjs');
8
+ require('../key-CHl3R_Y6.cjs');
9
+ require('../http-DBJHuWVd.cjs');
10
+ const require_authdocloader = require('../authdocloader-BJPbXGjs.cjs');
11
11
  require('../runtime-C58AJWSv.cjs');
12
12
 
13
13
  exports.FetchError = require_docloader.FetchError;
@@ -2,12 +2,12 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "../docloader-B_A2nB2W.js";
6
- import { LanguageString, exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../actor-LJkP7iVc.js";
7
- import "../lookup-DqmSkJVj.js";
8
- import "../key-CAH7GCWj.js";
9
- import "../http-CJ7SfCok.js";
10
- import { getAuthenticatedDocumentLoader } from "../authdocloader-Djn6Z8TB.js";
5
+ import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "../docloader-Crf5jJS0.js";
6
+ import { LanguageString, exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../actor-BrjBSlv8.js";
7
+ import "../lookup--mgANXmv.js";
8
+ import "../key-1YPBM8c7.js";
9
+ import "../http-CSJ1EReB.js";
10
+ import { getAuthenticatedDocumentLoader } from "../authdocloader-Y9lwp2q3.js";
11
11
  import "../runtime-DPYEDf-o.js";
12
12
 
13
13
  export { FetchError, LanguageString, exportMultibaseKey, exportSpki, fetchDocumentLoader, getAuthenticatedDocumentLoader, getDocumentLoader, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, kvCache };
@@ -3,12 +3,12 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { codes, decode, decodeText, encode, encodeText, names } from "../../type-CfrcT6D9.js";
6
+ import { codes, decode, decodeText, encode, encodeText, names } from "../../type-Bjc-_Rom.js";
7
7
  import { assertEquals } from "../../assert_equals-DSbWqCm3.js";
8
8
  import "../../assert-MZs1qjMx.js";
9
9
  import "../../assert_instance_of-DHz7EHNU.js";
10
- import "../../lookup-BA3bNgf4.js";
11
- import { test } from "../../testing-hVeFvsZ9.js";
10
+ import "../../lookup-pw97bxAu.js";
11
+ import { test } from "../../testing-DiHxoGZd.js";
12
12
  import "../../std__assert-X-_kMxKM.js";
13
13
  import "../../assert_rejects-DiIiJbZn.js";
14
14
  import "../../assert_is_error-BPGph1Jx.js";
@@ -3,11 +3,11 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { UrlError, expandIPv6Address, isValidPublicIPv4Address, isValidPublicIPv6Address, validatePublicUrl } from "../type-CfrcT6D9.js";
6
+ import { UrlError, expandIPv6Address, isValidPublicIPv4Address, isValidPublicIPv6Address, validatePublicUrl } from "../type-Bjc-_Rom.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
- import "../lookup-BA3bNgf4.js";
10
- import { test } from "../testing-hVeFvsZ9.js";
9
+ import "../lookup-pw97bxAu.js";
10
+ import { test } from "../testing-DiHxoGZd.js";
11
11
  import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
12
12
  import "../assert_is_error-BPGph1Jx.js";
13
13
 
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default } from "./type-CfrcT6D9.js";
7
- import { doubleKnock } from "./http-jrUnvC1R.js";
6
+ import { deno_default } from "./type-Bjc-_Rom.js";
7
+ import { doubleKnock } from "./http-BqvHtYhP.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
10
10
 
@@ -55,7 +55,7 @@ function sendActivity(options) {
55
55
  await sendActivityInternal({
56
56
  ...options,
57
57
  tracerProvider
58
- });
58
+ }, span);
59
59
  } catch (e) {
60
60
  span.setStatus({
61
61
  code: SpanStatusCode.ERROR,
@@ -67,7 +67,7 @@ function sendActivity(options) {
67
67
  }
68
68
  });
69
69
  }
70
- async function sendActivityInternal({ activity, activityId, keys, inbox, headers, specDeterminer, tracerProvider }) {
70
+ async function sendActivityInternal({ activity, activityId, keys, inbox, headers, specDeterminer, tracerProvider }, span) {
71
71
  const logger = getLogger([
72
72
  "fedify",
73
73
  "federation",
@@ -122,6 +122,11 @@ async function sendActivityInternal({ activity, activityId, keys, inbox, headers
122
122
  });
123
123
  throw new Error(`Failed to send activity ${activityId} to ${inbox.href} (${response.status} ${response.statusText}):\n${error}`);
124
124
  }
125
+ span.addEvent("activitypub.activity.sent", {
126
+ "activitypub.activity.json": JSON.stringify(activity),
127
+ "activitypub.inbox.url": inbox.href,
128
+ "activitypub.activity.id": activityId ?? ""
129
+ });
125
130
  }
126
131
 
127
132
  //#endregion
@@ -3,22 +3,22 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { exportSpki } from "../type-CfrcT6D9.js";
6
+ import { exportSpki } from "../type-Bjc-_Rom.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-BA3bNgf4.js";
11
- import "../actor-DyfGDQJB.js";
12
- import { exportJwk } from "../key-Ci7FKLpn.js";
13
- import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-jrUnvC1R.js";
14
- import { mockDocumentLoader, test } from "../testing-hVeFvsZ9.js";
10
+ import "../lookup-pw97bxAu.js";
11
+ import "../actor-CzhWrNYT.js";
12
+ import { exportJwk } from "../key-DZXdhUze.js";
13
+ import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-BqvHtYhP.js";
14
+ import { mockDocumentLoader, test } from "../testing-DiHxoGZd.js";
15
15
  import { assertExists, assertStringIncludes } from "../std__assert-X-_kMxKM.js";
16
16
  import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
17
17
  import "../assert_is_error-BPGph1Jx.js";
18
18
  import "../assert_not_equals-f3m3epl3.js";
19
19
  import { assertThrows } from "../assert_throws-BOO88avQ.js";
20
- import { rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey5 } from "../keys-BgYAMY7I.js";
21
- import { esm_default } from "../esm-D-py171v.js";
20
+ import { rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey5 } from "../keys-CfLhGOby.js";
21
+ import { esm_default } from "../esm-D6gwWBFZ.js";
22
22
  import { encodeBase64 } from "byte-encodings/base64";
23
23
 
24
24
  //#region src/sig/http.test.ts
@@ -3,20 +3,20 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { CryptographicKey, Multikey } from "../type-CfrcT6D9.js";
6
+ import { CryptographicKey, Multikey } from "../type-Bjc-_Rom.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-BA3bNgf4.js";
11
- import "../actor-DyfGDQJB.js";
12
- import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-Ci7FKLpn.js";
13
- import { mockDocumentLoader, test } from "../testing-hVeFvsZ9.js";
10
+ import "../lookup-pw97bxAu.js";
11
+ import "../actor-CzhWrNYT.js";
12
+ import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-DZXdhUze.js";
13
+ import { mockDocumentLoader, test } from "../testing-DiHxoGZd.js";
14
14
  import "../std__assert-X-_kMxKM.js";
15
15
  import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
16
16
  import "../assert_is_error-BPGph1Jx.js";
17
17
  import "../assert_not_equals-f3m3epl3.js";
18
18
  import { assertThrows } from "../assert_throws-BOO88avQ.js";
19
- import { ed25519Multikey, rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey3 } from "../keys-BgYAMY7I.js";
19
+ import { ed25519Multikey, rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey3 } from "../keys-CfLhGOby.js";
20
20
 
21
21
  //#region src/sig/key.test.ts
22
22
  test("validateCryptoKey()", async () => {
@@ -3,18 +3,18 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { CryptographicKey } from "../type-CfrcT6D9.js";
6
+ import { CryptographicKey } from "../type-Bjc-_Rom.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
- import "../lookup-BA3bNgf4.js";
10
- import "../actor-DyfGDQJB.js";
11
- import { generateCryptoKeyPair } from "../key-Ci7FKLpn.js";
12
- import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-CF-_Iv3N.js";
13
- import { mockDocumentLoader, test } from "../testing-hVeFvsZ9.js";
9
+ import "../lookup-pw97bxAu.js";
10
+ import "../actor-CzhWrNYT.js";
11
+ import { generateCryptoKeyPair } from "../key-DZXdhUze.js";
12
+ import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-CmJQd-xc.js";
13
+ import { mockDocumentLoader, test } from "../testing-DiHxoGZd.js";
14
14
  import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
15
15
  import "../assert_is_error-BPGph1Jx.js";
16
16
  import { assertThrows } from "../assert_throws-BOO88avQ.js";
17
- import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-BgYAMY7I.js";
17
+ import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-CfLhGOby.js";
18
18
  import { encodeBase64 } from "byte-encodings/base64";
19
19
 
20
20
  //#region src/sig/ld.test.ts
package/dist/sig/mod.cjs CHANGED
@@ -2,12 +2,12 @@
2
2
  const { Temporal } = require("@js-temporal/polyfill");
3
3
  const { URLPattern } = require("urlpattern-polyfill");
4
4
 
5
- require('../docloader-Uh0ciwr4.cjs');
6
- require('../actor-C2kxp5Fl.cjs');
7
- require('../lookup-BqEeMRXW.cjs');
8
- const require_key = require('../key-CkxzRYsV.cjs');
9
- const require_http = require('../http-DNoRdF3N.cjs');
10
- const require_proof = require('../proof-CbitzfgJ.cjs');
5
+ require('../docloader-Cgy1RCqb.cjs');
6
+ require('../actor-CdCyXIiy.cjs');
7
+ require('../lookup-BQeZoGI4.cjs');
8
+ const require_key = require('../key-CHl3R_Y6.cjs');
9
+ const require_http = require('../http-DBJHuWVd.cjs');
10
+ const require_proof = require('../proof-Dkb2_kGH.cjs');
11
11
  require('../sig-ByHXzqUi.cjs');
12
12
 
13
13
  exports.attachSignature = require_proof.attachSignature;
package/dist/sig/mod.js CHANGED
@@ -2,12 +2,12 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import "../docloader-B_A2nB2W.js";
6
- import "../actor-LJkP7iVc.js";
7
- import "../lookup-DqmSkJVj.js";
8
- import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "../key-CAH7GCWj.js";
9
- import { signRequest, verifyRequest } from "../http-CJ7SfCok.js";
10
- import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-XCcYDcHk.js";
5
+ import "../docloader-Crf5jJS0.js";
6
+ import "../actor-BrjBSlv8.js";
7
+ import "../lookup--mgANXmv.js";
8
+ import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "../key-1YPBM8c7.js";
9
+ import { signRequest, verifyRequest } from "../http-CSJ1EReB.js";
10
+ import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-BSHkn7FC.js";
11
11
  import "../sig-Cj3tk-ig.js";
12
12
 
13
13
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };