@fedify/fedify 1.9.2-dev.1890 → 1.10.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/{actor-C2kxp5Fl.cjs → actor-8zynMl2a.cjs} +187 -187
- package/dist/{actor-DyfGDQJB.js → actor-Bv7llTFW.js} +1 -1
- package/dist/{actor-LJkP7iVc.js → actor-eIATKOh7.js} +187 -187
- package/dist/{authdocloader-DaFhFZWS.cjs → authdocloader-BEPeTSD8.cjs} +3 -3
- package/dist/{authdocloader-Djn6Z8TB.js → authdocloader-BNIyrORx.js} +3 -3
- package/dist/{authdocloader-8jtTmnjn.js → authdocloader-TNeksncq.js} +3 -3
- package/dist/{builder-DG1srBKu.js → builder-C7fApQY_.js} +4 -4
- package/dist/{client-Dq-zkC8Y.js → client-Bwnrdh_A.js} +1 -1
- package/dist/compat/transformers.test.js +16 -16
- package/dist/{docloader-B_A2nB2W.js → docloader-CLYexeNv.js} +38 -9
- package/dist/{docloader-Uh0ciwr4.cjs → docloader-CdsuyjrU.cjs} +38 -9
- package/dist/{esm-D-py171v.js → esm-aj4vkb76.js} +1 -1
- package/dist/federation/builder.test.js +5 -5
- package/dist/federation/collection.test.js +3 -3
- package/dist/federation/handler.test.js +104 -17
- package/dist/federation/idempotency.test.js +17 -17
- package/dist/federation/inbox.test.js +4 -4
- package/dist/federation/keycache.test.js +4 -4
- package/dist/federation/kv.test.js +3 -3
- package/dist/federation/middleware.test.js +18 -18
- package/dist/federation/mod.cjs +10 -10
- package/dist/federation/mod.js +10 -10
- package/dist/federation/mq.test.js +5 -5
- package/dist/federation/retry.test.js +3 -3
- package/dist/federation/router.test.js +3 -3
- package/dist/federation/send.test.js +53 -10
- package/dist/{http-DNoRdF3N.cjs → http-CK80ff9S.cjs} +3 -3
- package/dist/{http-CJ7SfCok.js → http-DMJrVRf0.js} +3 -3
- package/dist/{http-jrUnvC1R.js → http-DXmKLE1t.js} +2 -2
- package/dist/{inbox-C3N4s1QJ.js → inbox-Dt-Q2rJt.js} +1 -1
- package/dist/{key-D-Vs5Xls.js → key-BL8DRhuI.js} +3 -3
- package/dist/{key-CkxzRYsV.cjs → key-BU1Vsq8S.cjs} +2 -2
- package/dist/{key-CtByaj7Q.js → key-DTzAk78O.js} +4 -4
- package/dist/{key-CAH7GCWj.js → key-DWDJFZzD.js} +2 -2
- package/dist/{key-Ci7FKLpn.js → key-Tt9B2Qkj.js} +2 -2
- package/dist/key-gZEWdYwT.cjs +10 -0
- package/dist/{keycache-CEs327f0.js → keycache-CXF4YAON.js} +1 -1
- package/dist/{keys-BgYAMY7I.js → keys-CAUbEZtV.js} +1 -1
- package/dist/{ld-CF-_Iv3N.js → ld-CqoYKNwB.js} +2 -2
- package/dist/{lookup-DqmSkJVj.js → lookup-8Ik9lSMm.js} +1 -1
- package/dist/{lookup-BqEeMRXW.cjs → lookup-BXlOCJsH.cjs} +1 -1
- package/dist/{lookup-BA3bNgf4.js → lookup-Co4Y1ycg.js} +6 -1
- package/dist/middleware-09gZVY21.cjs +17 -0
- package/dist/middleware-B8Q9c1ys.js +26 -0
- package/dist/middleware-DHUCp8iq.js +17 -0
- package/dist/{middleware-DFDGXfT5.js → middleware-DnXc8LK4.js} +24 -12
- package/dist/{middleware-BhU7xqzl.cjs → middleware-bN29Orv5.cjs} +24 -12
- package/dist/{middleware-8Utrfm2B.js → middleware-nSw7nWf8.js} +20 -13
- package/dist/mod.cjs +10 -10
- package/dist/mod.js +10 -10
- package/dist/nodeinfo/client.test.js +5 -5
- package/dist/nodeinfo/handler.test.js +16 -16
- package/dist/nodeinfo/mod.cjs +2 -2
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/semver.test.js +3 -3
- package/dist/nodeinfo/types.test.js +3 -3
- package/dist/otel-Chy5T2Xh.js +64 -0
- package/dist/{owner-D2N6v5Gm.js → owner-9jSx_21P.js} +44 -8
- package/dist/{proof-GwNAN3ln.js → proof-B5YI7sn5.js} +2 -2
- package/dist/{proof-XCcYDcHk.js → proof-BT3OPhWQ.js} +45 -9
- package/dist/{proof-CbitzfgJ.cjs → proof-BuLnngRI.cjs} +44 -8
- package/dist/runtime/authdocloader.test.js +9 -9
- package/dist/runtime/docloader.test.js +70 -4
- package/dist/runtime/key.test.js +5 -5
- package/dist/runtime/langstr.test.js +3 -3
- package/dist/runtime/link.test.js +3 -3
- package/dist/runtime/mod.cjs +6 -6
- package/dist/runtime/mod.js +6 -6
- package/dist/runtime/multibase/multibase.test.js +3 -3
- package/dist/runtime/url.test.js +3 -3
- package/dist/{send-D_f3mgyD.js → send-DlPE7bKe.js} +9 -4
- package/dist/sig/http.test.js +8 -8
- package/dist/sig/key.test.js +6 -6
- package/dist/sig/ld.test.js +7 -7
- package/dist/sig/mod.cjs +6 -6
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +31 -7
- package/dist/sig/proof.test.js +7 -7
- package/dist/testing/docloader.test.js +3 -3
- package/dist/testing/mod.js +3 -3
- package/dist/{testing-hVeFvsZ9.js → testing-B17zODFD.js} +2 -2
- package/dist/{type-CfrcT6D9.js → type-E_91dusN.js} +222 -194
- package/dist/{types-apcavnI7.js → types-By5LByL1.js} +1 -1
- package/dist/{types-DvsdrWOg.cjs → types-Ci8XKEfO.cjs} +1 -1
- package/dist/vocab/actor.test.js +5 -5
- package/dist/vocab/lookup.test.js +27 -5
- package/dist/vocab/mod.cjs +4 -4
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +4 -4
- package/dist/{vocab-0FCIW9qL.cjs → vocab-BjnZ49Xt.cjs} +8 -3
- package/dist/{vocab-DGzlpjfi.js → vocab-CthegyUc.js} +8 -3
- package/dist/webfinger/handler.test.js +16 -16
- package/dist/webfinger/lookup.test.js +4 -4
- package/dist/webfinger/mod.cjs +2 -2
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/cfworkers.test.js +3 -3
- package/package.json +5 -3
- package/dist/key-CEK-2eTr.cjs +0 -10
- package/dist/middleware-BQ3VcPQj.js +0 -17
- package/dist/middleware-BxBgtIG4.js +0 -26
- package/dist/middleware-UJYNu-kk.cjs +0 -17
- /package/dist/{denokv-Bv33Xxea.js → denokv-D0nfNQ1x.js} +0 -0
|
@@ -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-
|
|
6
|
+
import { FetchError, UrlError, contexts_default, deno_default, getDocumentLoader, getUserAgent, kvCache } from "../type-E_91dusN.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
10
|
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
|
|
11
|
-
import "../lookup-
|
|
12
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
11
|
+
import "../lookup-Co4Y1ycg.js";
|
|
12
|
+
import { mockDocumentLoader, test } from "../testing-B17zODFD.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 {
|
|
18
|
+
import { createTestTracerProvider } from "../otel-Chy5T2Xh.js";
|
|
19
|
+
import { esm_default } from "../esm-aj4vkb76.js";
|
|
19
20
|
import process from "node:process";
|
|
20
21
|
|
|
21
22
|
//#region src/runtime/docloader.test.ts
|
|
@@ -518,5 +519,70 @@ test("getUserAgent()", () => {
|
|
|
518
519
|
}), `MyApp/1.0.0 (Fedify/${deno_default.version}; Node.js/${process.versions.node}; +https://example.com/)`);
|
|
519
520
|
}
|
|
520
521
|
});
|
|
522
|
+
test("getDocumentLoader() records OpenTelemetry span", async (t) => {
|
|
523
|
+
const [tracerProvider, exporter] = createTestTracerProvider();
|
|
524
|
+
esm_default.spyGlobal();
|
|
525
|
+
await t.step("successful fetch", async () => {
|
|
526
|
+
esm_default.get("https://example.com/doc", {
|
|
527
|
+
status: 200,
|
|
528
|
+
headers: { "Content-Type": "application/activity+json" },
|
|
529
|
+
body: JSON.stringify({
|
|
530
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
531
|
+
type: "Note"
|
|
532
|
+
})
|
|
533
|
+
});
|
|
534
|
+
const loader = getDocumentLoader();
|
|
535
|
+
const { trace } = await import("@opentelemetry/api");
|
|
536
|
+
const originalProvider = trace.getTracerProvider();
|
|
537
|
+
trace.setGlobalTracerProvider(tracerProvider);
|
|
538
|
+
try {
|
|
539
|
+
const result = await loader("https://example.com/doc");
|
|
540
|
+
assertEquals(result.documentUrl, "https://example.com/doc");
|
|
541
|
+
const spans = exporter.getSpans("activitypub.fetch_document");
|
|
542
|
+
assertEquals(spans.length, 1);
|
|
543
|
+
const span = spans[0];
|
|
544
|
+
assertEquals(span.attributes["url.full"], "https://example.com/doc");
|
|
545
|
+
assertEquals(span.attributes["http.response.status_code"], 200);
|
|
546
|
+
assertEquals(span.attributes["docloader.document_url"], "https://example.com/doc");
|
|
547
|
+
} finally {
|
|
548
|
+
trace.setGlobalTracerProvider(originalProvider);
|
|
549
|
+
exporter.clear();
|
|
550
|
+
esm_default.hardReset();
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
await t.step("redirect", async () => {
|
|
554
|
+
esm_default.spyGlobal();
|
|
555
|
+
esm_default.get("https://example.com/doc", {
|
|
556
|
+
status: 302,
|
|
557
|
+
headers: { "Location": "https://example.com/new-doc" }
|
|
558
|
+
});
|
|
559
|
+
esm_default.get("https://example.com/new-doc", {
|
|
560
|
+
status: 200,
|
|
561
|
+
headers: { "Content-Type": "application/activity+json" },
|
|
562
|
+
body: JSON.stringify({
|
|
563
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
564
|
+
type: "Note"
|
|
565
|
+
})
|
|
566
|
+
});
|
|
567
|
+
const loader = getDocumentLoader();
|
|
568
|
+
const { trace } = await import("@opentelemetry/api");
|
|
569
|
+
const originalProvider = trace.getTracerProvider();
|
|
570
|
+
trace.setGlobalTracerProvider(tracerProvider);
|
|
571
|
+
try {
|
|
572
|
+
const result = await loader("https://example.com/doc");
|
|
573
|
+
assertEquals(result.documentUrl, "https://example.com/new-doc");
|
|
574
|
+
const spans = exporter.getSpans("activitypub.fetch_document");
|
|
575
|
+
assertEquals(spans.length, 2);
|
|
576
|
+
const redirectSpan = spans[spans.length - 1];
|
|
577
|
+
assertEquals(redirectSpan.attributes["url.full"], "https://example.com/doc");
|
|
578
|
+
assertEquals(redirectSpan.attributes["http.response.status_code"], 302);
|
|
579
|
+
assertEquals(redirectSpan.attributes["http.redirect.url"], "https://example.com/new-doc");
|
|
580
|
+
} finally {
|
|
581
|
+
trace.setGlobalTracerProvider(originalProvider);
|
|
582
|
+
exporter.clear();
|
|
583
|
+
esm_default.hardReset();
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
});
|
|
521
587
|
|
|
522
588
|
//#endregion
|
package/dist/runtime/key.test.js
CHANGED
|
@@ -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-
|
|
6
|
+
import { exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../type-E_91dusN.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-
|
|
11
|
-
import "../actor-
|
|
12
|
-
import { exportJwk, importJwk } from "../key-
|
|
13
|
-
import { test } from "../testing-
|
|
10
|
+
import "../lookup-Co4Y1ycg.js";
|
|
11
|
+
import "../actor-Bv7llTFW.js";
|
|
12
|
+
import { exportJwk, importJwk } from "../key-Tt9B2Qkj.js";
|
|
13
|
+
import { test } from "../testing-B17zODFD.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-
|
|
6
|
+
import { LanguageString } from "../type-E_91dusN.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-
|
|
11
|
-
import { test } from "../testing-
|
|
10
|
+
import "../lookup-Co4Y1ycg.js";
|
|
11
|
+
import { test } from "../testing-B17zODFD.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-
|
|
7
|
-
import "../lookup-
|
|
8
|
-
import { test } from "../testing-
|
|
6
|
+
import { HttpHeaderLink } from "../type-E_91dusN.js";
|
|
7
|
+
import "../lookup-Co4Y1ycg.js";
|
|
8
|
+
import { test } from "../testing-B17zODFD.js";
|
|
9
9
|
import { deepStrictEqual, throws } from "node:assert";
|
|
10
10
|
|
|
11
11
|
//#region src/runtime/link.test.ts
|
package/dist/runtime/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
|
-
const require_docloader = require('../docloader-
|
|
6
|
-
const require_actor = require('../actor-
|
|
7
|
-
require('../lookup-
|
|
8
|
-
require('../key-
|
|
9
|
-
require('../http-
|
|
10
|
-
const require_authdocloader = require('../authdocloader-
|
|
5
|
+
const require_docloader = require('../docloader-CdsuyjrU.cjs');
|
|
6
|
+
const require_actor = require('../actor-8zynMl2a.cjs');
|
|
7
|
+
require('../lookup-BXlOCJsH.cjs');
|
|
8
|
+
require('../key-BU1Vsq8S.cjs');
|
|
9
|
+
require('../http-CK80ff9S.cjs');
|
|
10
|
+
const require_authdocloader = require('../authdocloader-BEPeTSD8.cjs');
|
|
11
11
|
require('../runtime-C58AJWSv.cjs');
|
|
12
12
|
|
|
13
13
|
exports.FetchError = require_docloader.FetchError;
|
package/dist/runtime/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 { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "../docloader-
|
|
6
|
-
import { LanguageString, exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../actor-
|
|
7
|
-
import "../lookup-
|
|
8
|
-
import "../key-
|
|
9
|
-
import "../http-
|
|
10
|
-
import { getAuthenticatedDocumentLoader } from "../authdocloader-
|
|
5
|
+
import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "../docloader-CLYexeNv.js";
|
|
6
|
+
import { LanguageString, exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../actor-eIATKOh7.js";
|
|
7
|
+
import "../lookup-8Ik9lSMm.js";
|
|
8
|
+
import "../key-DWDJFZzD.js";
|
|
9
|
+
import "../http-DMJrVRf0.js";
|
|
10
|
+
import { getAuthenticatedDocumentLoader } from "../authdocloader-BNIyrORx.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-
|
|
6
|
+
import { codes, decode, decodeText, encode, encodeText, names } from "../../type-E_91dusN.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-
|
|
11
|
-
import { test } from "../../testing-
|
|
10
|
+
import "../../lookup-Co4Y1ycg.js";
|
|
11
|
+
import { test } from "../../testing-B17zODFD.js";
|
|
12
12
|
import "../../std__assert-X-_kMxKM.js";
|
|
13
13
|
import "../../assert_rejects-DiIiJbZn.js";
|
|
14
14
|
import "../../assert_is_error-BPGph1Jx.js";
|
package/dist/runtime/url.test.js
CHANGED
|
@@ -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-
|
|
6
|
+
import { UrlError, expandIPv6Address, isValidPublicIPv4Address, isValidPublicIPv6Address, validatePublicUrl } from "../type-E_91dusN.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
|
-
import "../lookup-
|
|
10
|
-
import { test } from "../testing-
|
|
9
|
+
import "../lookup-Co4Y1ycg.js";
|
|
10
|
+
import { test } from "../testing-B17zODFD.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-
|
|
7
|
-
import { doubleKnock } from "./http-
|
|
6
|
+
import { deno_default } from "./type-E_91dusN.js";
|
|
7
|
+
import { doubleKnock } from "./http-DXmKLE1t.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
|
package/dist/sig/http.test.js
CHANGED
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { exportSpki } from "../type-
|
|
6
|
+
import { exportSpki } from "../type-E_91dusN.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-
|
|
11
|
-
import "../actor-
|
|
12
|
-
import { exportJwk } from "../key-
|
|
13
|
-
import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-
|
|
14
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import "../lookup-Co4Y1ycg.js";
|
|
11
|
+
import "../actor-Bv7llTFW.js";
|
|
12
|
+
import { exportJwk } from "../key-Tt9B2Qkj.js";
|
|
13
|
+
import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-DXmKLE1t.js";
|
|
14
|
+
import { mockDocumentLoader, test } from "../testing-B17zODFD.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-
|
|
21
|
-
import { esm_default } from "../esm-
|
|
20
|
+
import { rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey5 } from "../keys-CAUbEZtV.js";
|
|
21
|
+
import { esm_default } from "../esm-aj4vkb76.js";
|
|
22
22
|
import { encodeBase64 } from "byte-encodings/base64";
|
|
23
23
|
|
|
24
24
|
//#region src/sig/http.test.ts
|
package/dist/sig/key.test.js
CHANGED
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { CryptographicKey, Multikey } from "../type-
|
|
6
|
+
import { CryptographicKey, Multikey } from "../type-E_91dusN.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-
|
|
11
|
-
import "../actor-
|
|
12
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-
|
|
13
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import "../lookup-Co4Y1ycg.js";
|
|
11
|
+
import "../actor-Bv7llTFW.js";
|
|
12
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-Tt9B2Qkj.js";
|
|
13
|
+
import { mockDocumentLoader, test } from "../testing-B17zODFD.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-
|
|
19
|
+
import { ed25519Multikey, rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey3 } from "../keys-CAUbEZtV.js";
|
|
20
20
|
|
|
21
21
|
//#region src/sig/key.test.ts
|
|
22
22
|
test("validateCryptoKey()", async () => {
|
package/dist/sig/ld.test.js
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { CryptographicKey } from "../type-
|
|
6
|
+
import { CryptographicKey } from "../type-E_91dusN.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
|
-
import "../lookup-
|
|
10
|
-
import "../actor-
|
|
11
|
-
import { generateCryptoKeyPair } from "../key-
|
|
12
|
-
import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-
|
|
13
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
9
|
+
import "../lookup-Co4Y1ycg.js";
|
|
10
|
+
import "../actor-Bv7llTFW.js";
|
|
11
|
+
import { generateCryptoKeyPair } from "../key-Tt9B2Qkj.js";
|
|
12
|
+
import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-CqoYKNwB.js";
|
|
13
|
+
import { mockDocumentLoader, test } from "../testing-B17zODFD.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-
|
|
17
|
+
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-CAUbEZtV.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-
|
|
6
|
-
require('../actor-
|
|
7
|
-
require('../lookup-
|
|
8
|
-
const require_key = require('../key-
|
|
9
|
-
const require_http = require('../http-
|
|
10
|
-
const require_proof = require('../proof-
|
|
5
|
+
require('../docloader-CdsuyjrU.cjs');
|
|
6
|
+
require('../actor-8zynMl2a.cjs');
|
|
7
|
+
require('../lookup-BXlOCJsH.cjs');
|
|
8
|
+
const require_key = require('../key-BU1Vsq8S.cjs');
|
|
9
|
+
const require_http = require('../http-CK80ff9S.cjs');
|
|
10
|
+
const require_proof = require('../proof-BuLnngRI.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-
|
|
6
|
-
import "../actor-
|
|
7
|
-
import "../lookup-
|
|
8
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "../key-
|
|
9
|
-
import { signRequest, verifyRequest } from "../http-
|
|
10
|
-
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-
|
|
5
|
+
import "../docloader-CLYexeNv.js";
|
|
6
|
+
import "../actor-eIATKOh7.js";
|
|
7
|
+
import "../lookup-8Ik9lSMm.js";
|
|
8
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "../key-DWDJFZzD.js";
|
|
9
|
+
import { signRequest, verifyRequest } from "../http-DMJrVRf0.js";
|
|
10
|
+
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-BT3OPhWQ.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 };
|
package/dist/sig/owner.test.js
CHANGED
|
@@ -3,21 +3,22 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Create } from "../type-
|
|
6
|
+
import { Create, CryptographicKey } from "../type-E_91dusN.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 { lookupObject } from "../lookup-
|
|
11
|
-
import "../actor-
|
|
12
|
-
import "../key-
|
|
13
|
-
import { doesActorOwnKey, getKeyOwner } from "../owner-
|
|
14
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import { lookupObject } from "../lookup-Co4Y1ycg.js";
|
|
11
|
+
import "../actor-Bv7llTFW.js";
|
|
12
|
+
import "../key-Tt9B2Qkj.js";
|
|
13
|
+
import { doesActorOwnKey, getKeyOwner } from "../owner-9jSx_21P.js";
|
|
14
|
+
import { mockDocumentLoader, test } from "../testing-B17zODFD.js";
|
|
15
15
|
import "../std__assert-X-_kMxKM.js";
|
|
16
16
|
import { assertFalse } from "../assert_rejects-DiIiJbZn.js";
|
|
17
17
|
import "../assert_is_error-BPGph1Jx.js";
|
|
18
18
|
import "../assert_not_equals-f3m3epl3.js";
|
|
19
19
|
import "../assert_throws-BOO88avQ.js";
|
|
20
|
-
import { rsaPublicKey1, rsaPublicKey2 } from "../keys-
|
|
20
|
+
import { rsaPublicKey1, rsaPublicKey2 } from "../keys-CAUbEZtV.js";
|
|
21
|
+
import { createTestTracerProvider } from "../otel-Chy5T2Xh.js";
|
|
21
22
|
|
|
22
23
|
//#region src/sig/owner.test.ts
|
|
23
24
|
test("doesActorOwnKey()", async () => {
|
|
@@ -48,5 +49,28 @@ test("getKeyOwner()", async () => {
|
|
|
48
49
|
const noOwner2 = await getKeyOwner(new URL("https://example.com/object"), options);
|
|
49
50
|
assertEquals(noOwner2, null);
|
|
50
51
|
});
|
|
52
|
+
test("doesActorOwnKey() records OpenTelemetry span", async () => {
|
|
53
|
+
const [tracerProvider, exporter] = createTestTracerProvider();
|
|
54
|
+
const activity = new Create({
|
|
55
|
+
id: new URL("https://example.com/activity"),
|
|
56
|
+
actor: new URL("https://example.com/person")
|
|
57
|
+
});
|
|
58
|
+
const key = new CryptographicKey({
|
|
59
|
+
id: new URL("https://example.com/person#key"),
|
|
60
|
+
owner: new URL("https://example.com/person")
|
|
61
|
+
});
|
|
62
|
+
const result = await doesActorOwnKey(activity, key, {
|
|
63
|
+
documentLoader: mockDocumentLoader,
|
|
64
|
+
tracerProvider
|
|
65
|
+
});
|
|
66
|
+
assert(result);
|
|
67
|
+
const spans = exporter.getSpans("activitypub.verify_key_ownership");
|
|
68
|
+
assertEquals(spans.length, 1);
|
|
69
|
+
const span = spans[0];
|
|
70
|
+
assertEquals(span.attributes["activitypub.actor.id"], "https://example.com/person");
|
|
71
|
+
assertEquals(span.attributes["activitypub.key.id"], "https://example.com/person#key");
|
|
72
|
+
assertEquals(span.attributes["activitypub.key_ownership.verified"], true);
|
|
73
|
+
assertEquals(span.attributes["activitypub.key_ownership.method"], "owner_id");
|
|
74
|
+
});
|
|
51
75
|
|
|
52
76
|
//#endregion
|
package/dist/sig/proof.test.js
CHANGED
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Create, DataIntegrityProof, Multikey, Note, Place, decode, importMultibaseKey } from "../type-
|
|
6
|
+
import { Create, DataIntegrityProof, Multikey, Note, Place, decode, importMultibaseKey } from "../type-E_91dusN.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../lookup-
|
|
11
|
-
import "../actor-
|
|
12
|
-
import "../key-
|
|
13
|
-
import { createProof, signObject, verifyObject, verifyProof } from "../proof-
|
|
14
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import "../lookup-Co4Y1ycg.js";
|
|
11
|
+
import "../actor-Bv7llTFW.js";
|
|
12
|
+
import "../key-Tt9B2Qkj.js";
|
|
13
|
+
import { createProof, signObject, verifyObject, verifyProof } from "../proof-B5YI7sn5.js";
|
|
14
|
+
import { mockDocumentLoader, test } from "../testing-B17zODFD.js";
|
|
15
15
|
import "../std__assert-X-_kMxKM.js";
|
|
16
16
|
import { 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 "../assert_throws-BOO88avQ.js";
|
|
20
|
-
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-
|
|
20
|
+
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-CAUbEZtV.js";
|
|
21
21
|
import { decodeHex, encodeHex } from "byte-encodings/hex";
|
|
22
22
|
|
|
23
23
|
//#region src/sig/proof.test.ts
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../type-
|
|
6
|
+
import "../type-E_91dusN.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-
|
|
11
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import "../lookup-Co4Y1ycg.js";
|
|
11
|
+
import { mockDocumentLoader, test } from "../testing-B17zODFD.js";
|
|
12
12
|
import "../std__assert-X-_kMxKM.js";
|
|
13
13
|
import "../assert_rejects-DiIiJbZn.js";
|
|
14
14
|
import "../assert_is_error-BPGph1Jx.js";
|
package/dist/testing/mod.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../type-
|
|
7
|
-
import "../lookup-
|
|
8
|
-
import { createInboxContext, createRequestContext, test, testDefinitions } from "../testing-
|
|
6
|
+
import "../type-E_91dusN.js";
|
|
7
|
+
import "../lookup-Co4Y1ycg.js";
|
|
8
|
+
import { createInboxContext, createRequestContext, test, testDefinitions } from "../testing-B17zODFD.js";
|
|
9
9
|
|
|
10
10
|
export { createInboxContext, createRequestContext, test, testDefinitions };
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { __require, lookupWebFinger } from "./type-
|
|
7
|
-
import { RouterError, lookupObject, traverseCollection } from "./lookup-
|
|
6
|
+
import { __require, lookupWebFinger } from "./type-E_91dusN.js";
|
|
7
|
+
import { RouterError, lookupObject, traverseCollection } from "./lookup-Co4Y1ycg.js";
|
|
8
8
|
import { configure, getConsoleSink, getLogger, reset } from "@logtape/logtape";
|
|
9
9
|
import { trace } from "@opentelemetry/api";
|
|
10
10
|
|