@fedify/fedify 1.10.0-dev.1871 → 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-DhtSf14w.cjs → actor-8zynMl2a.cjs} +187 -187
- package/dist/{actor-CfGzhUAX.js → actor-Bv7llTFW.js} +1 -1
- package/dist/{actor-D4WHPSCH.js → actor-eIATKOh7.js} +187 -187
- package/dist/{authdocloader-pF-wLmI7.cjs → authdocloader-BEPeTSD8.cjs} +3 -3
- package/dist/{authdocloader-zjoY3BuQ.js → authdocloader-BNIyrORx.js} +3 -3
- package/dist/{authdocloader-BQrpfeKZ.js → authdocloader-TNeksncq.js} +3 -3
- package/dist/{builder-VDUOlO5_.js → builder-C7fApQY_.js} +4 -4
- package/dist/{client-CSgYHRLI.js → client-Bwnrdh_A.js} +1 -1
- package/dist/compat/transformers.test.js +16 -16
- package/dist/{docloader-CncYs8UV.js → docloader-CLYexeNv.js} +38 -9
- package/dist/{docloader-B0LuS-cg.cjs → docloader-CdsuyjrU.cjs} +38 -9
- package/dist/{esm-3ldbheMA.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-CrHQ9vvq.cjs → http-CK80ff9S.cjs} +3 -3
- package/dist/{http-DDUtYyG2.js → http-DMJrVRf0.js} +3 -3
- package/dist/{http-BEgyqh3n.js → http-DXmKLE1t.js} +2 -2
- package/dist/{inbox-CrJDO5ET.js → inbox-Dt-Q2rJt.js} +1 -1
- package/dist/{key-CA9cZx7Z.js → key-BL8DRhuI.js} +3 -3
- package/dist/{key-N3d_lqdx.cjs → key-BU1Vsq8S.cjs} +2 -2
- package/dist/{key-xnit_Im0.js → key-DTzAk78O.js} +4 -4
- package/dist/{key-C-Kzj_i9.js → key-DWDJFZzD.js} +2 -2
- package/dist/{key-CEEnIH7N.js → key-Tt9B2Qkj.js} +2 -2
- package/dist/key-gZEWdYwT.cjs +10 -0
- package/dist/{keycache-E2u97dp7.js → keycache-CXF4YAON.js} +1 -1
- package/dist/{keys-B-M9Ls7Y.js → keys-CAUbEZtV.js} +1 -1
- package/dist/{ld-DwL3K4gH.js → ld-CqoYKNwB.js} +2 -2
- package/dist/{lookup-k3pOXnRa.js → lookup-8Ik9lSMm.js} +1 -1
- package/dist/{lookup-DwfTz04L.cjs → lookup-BXlOCJsH.cjs} +1 -1
- package/dist/{lookup-xSRoxGFY.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-DZWqnOfo.js → middleware-DnXc8LK4.js} +24 -12
- package/dist/{middleware-D1GeKqxh.cjs → middleware-bN29Orv5.cjs} +24 -12
- package/dist/{middleware-DVCHqnbp.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-BOcBaBC_.js → owner-9jSx_21P.js} +44 -8
- package/dist/{proof-DTd3ilzM.js → proof-B5YI7sn5.js} +2 -2
- package/dist/{proof-MQ-8pB0L.js → proof-BT3OPhWQ.js} +45 -9
- package/dist/{proof-DrwSFIzI.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-tJvLIgDs.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-f_tNP1r1.js → testing-B17zODFD.js} +2 -2
- package/dist/{type-Bw-d0BzW.js → type-E_91dusN.js} +222 -194
- package/dist/{types-CKbB6z5P.js → types-By5LByL1.js} +1 -1
- package/dist/{types-CAnLnfUh.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-UCjgY_zC.cjs → vocab-BjnZ49Xt.cjs} +8 -3
- package/dist/{vocab-fCO9uHPr.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-NTXsO1Hj.cjs +0 -10
- package/dist/middleware-BV0aY-JU.js +0 -17
- package/dist/middleware-CkF8G921.js +0 -26
- package/dist/middleware-D3WSJHlb.cjs +0 -17
- /package/dist/{denokv-Bv33Xxea.js → denokv-D0nfNQ1x.js} +0 -0
|
@@ -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-
|
|
7
|
-
const require_key = require('./key-
|
|
8
|
-
const require_http = require('./http-
|
|
6
|
+
const require_docloader = require('./docloader-CdsuyjrU.cjs');
|
|
7
|
+
const require_key = require('./key-BU1Vsq8S.cjs');
|
|
8
|
+
const require_http = require('./http-CK80ff9S.cjs');
|
|
9
9
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
10
10
|
|
|
11
11
|
//#region src/runtime/authdocloader.ts
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./docloader-
|
|
6
|
-
import { validateCryptoKey } from "./key-
|
|
7
|
-
import { doubleKnock } from "./http-
|
|
5
|
+
import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./docloader-CLYexeNv.js";
|
|
6
|
+
import { validateCryptoKey } from "./key-DWDJFZzD.js";
|
|
7
|
+
import { doubleKnock } from "./http-DMJrVRf0.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
|
|
10
10
|
//#region src/runtime/authdocloader.ts
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./type-
|
|
7
|
-
import { validateCryptoKey } from "./key-
|
|
8
|
-
import { doubleKnock } from "./http-
|
|
6
|
+
import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./type-E_91dusN.js";
|
|
7
|
+
import { validateCryptoKey } from "./key-Tt9B2Qkj.js";
|
|
8
|
+
import { doubleKnock } from "./http-DXmKLE1t.js";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
10
10
|
|
|
11
11
|
//#region src/runtime/authdocloader.ts
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default, getTypeId } from "./type-
|
|
7
|
-
import { Router, RouterError } from "./lookup-
|
|
8
|
-
import { InboxListenerSet } from "./inbox-
|
|
6
|
+
import { deno_default, getTypeId } from "./type-E_91dusN.js";
|
|
7
|
+
import { Router, RouterError } from "./lookup-Co4Y1ycg.js";
|
|
8
|
+
import { InboxListenerSet } from "./inbox-Dt-Q2rJt.js";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
10
10
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
11
11
|
|
|
@@ -43,7 +43,7 @@ var FederationBuilderImpl = class {
|
|
|
43
43
|
this.collectionTypeIds = {};
|
|
44
44
|
}
|
|
45
45
|
async build(options) {
|
|
46
|
-
const { FederationImpl } = await import("./middleware-
|
|
46
|
+
const { FederationImpl } = await import("./middleware-B8Q9c1ys.js");
|
|
47
47
|
const f = new FederationImpl(options);
|
|
48
48
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
49
49
|
f.router = this.router.clone();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { getUserAgent } from "./type-
|
|
6
|
+
import { getUserAgent } from "./type-E_91dusN.js";
|
|
7
7
|
import { parseSemVer } from "./semver-dArNLkR9.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
|
|
@@ -3,30 +3,30 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Follow, Person } from "../type-
|
|
6
|
+
import { Follow, Person } 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 { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
10
|
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
|
|
11
|
-
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-
|
|
11
|
+
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-nSw7nWf8.js";
|
|
12
12
|
import "../semver-dArNLkR9.js";
|
|
13
|
-
import "../client-
|
|
14
|
-
import "../lookup-
|
|
13
|
+
import "../client-Bwnrdh_A.js";
|
|
14
|
+
import "../lookup-Co4Y1ycg.js";
|
|
15
15
|
import "../types-BIgY6c-l.js";
|
|
16
|
-
import "../actor-
|
|
17
|
-
import "../key-
|
|
18
|
-
import "../http-
|
|
19
|
-
import "../authdocloader-
|
|
20
|
-
import "../ld-
|
|
21
|
-
import "../owner-
|
|
22
|
-
import "../proof-
|
|
23
|
-
import "../inbox-
|
|
24
|
-
import "../builder-
|
|
16
|
+
import "../actor-Bv7llTFW.js";
|
|
17
|
+
import "../key-Tt9B2Qkj.js";
|
|
18
|
+
import "../http-DXmKLE1t.js";
|
|
19
|
+
import "../authdocloader-TNeksncq.js";
|
|
20
|
+
import "../ld-CqoYKNwB.js";
|
|
21
|
+
import "../owner-9jSx_21P.js";
|
|
22
|
+
import "../proof-B5YI7sn5.js";
|
|
23
|
+
import "../inbox-Dt-Q2rJt.js";
|
|
24
|
+
import "../builder-C7fApQY_.js";
|
|
25
25
|
import "../collection-CSzG2j1P.js";
|
|
26
|
-
import "../keycache-
|
|
26
|
+
import "../keycache-CXF4YAON.js";
|
|
27
27
|
import "../retry-D4GJ670a.js";
|
|
28
|
-
import "../send-
|
|
29
|
-
import { test } from "../testing-
|
|
28
|
+
import "../send-DlPE7bKe.js";
|
|
29
|
+
import { test } from "../testing-B17zODFD.js";
|
|
30
30
|
|
|
31
31
|
//#region src/compat/transformers.test.ts
|
|
32
32
|
const federation = new FederationImpl({ kv: new MemoryKvStore() });
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
5
|
import { getLogger } from "@logtape/logtape";
|
|
6
|
+
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
6
7
|
import process from "node:process";
|
|
7
8
|
import { lookup } from "node:dns/promises";
|
|
8
9
|
import { isIP } from "node:net";
|
|
9
10
|
|
|
10
11
|
//#region deno.json
|
|
11
12
|
var name = "@fedify/fedify";
|
|
12
|
-
var version = "1.10.0-dev.
|
|
13
|
+
var version = "1.10.0-dev.2+13db1686";
|
|
13
14
|
var license = "MIT";
|
|
14
15
|
var exports = {
|
|
15
16
|
".": "./src/mod.ts",
|
|
@@ -31,6 +32,8 @@ var imports = {
|
|
|
31
32
|
"@cfworker/json-schema": "npm:@cfworker/json-schema@^4.1.1",
|
|
32
33
|
"@multiformats/base-x": "npm:@multiformats/base-x@^4.0.1",
|
|
33
34
|
"@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
|
|
35
|
+
"@opentelemetry/core": "npm:@opentelemetry/core@^1.30.1",
|
|
36
|
+
"@opentelemetry/sdk-trace-base": "npm:@opentelemetry/sdk-trace-base@^1.30.1",
|
|
34
37
|
"@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.27.0",
|
|
35
38
|
"@phensley/language-tag": "npm:@phensley/language-tag@^1.9.0",
|
|
36
39
|
"@std/assert": "jsr:@std/assert@^0.226.0",
|
|
@@ -42,7 +45,7 @@ var imports = {
|
|
|
42
45
|
"fast-check": "npm:fast-check@^3.22.0",
|
|
43
46
|
"fetch-mock": "npm:fetch-mock@^12.5.2",
|
|
44
47
|
"json-canon": "npm:json-canon@^1.0.1",
|
|
45
|
-
"jsonld": "npm:jsonld@^
|
|
48
|
+
"jsonld": "npm:jsonld@^9.0.0",
|
|
46
49
|
"multicodec": "npm:multicodec@^3.2.1",
|
|
47
50
|
"pkijs": "npm:pkijs@^3.2.4",
|
|
48
51
|
"structured-field-values": "npm:structured-field-values@^2.0.4",
|
|
@@ -4679,6 +4682,8 @@ async function getRemoteDocument(url, response, fetch$1) {
|
|
|
4679
4682
|
* @since 1.3.0
|
|
4680
4683
|
*/
|
|
4681
4684
|
function getDocumentLoader({ allowPrivateAddress, skipPreloadedContexts, userAgent } = {}) {
|
|
4685
|
+
const tracerProvider = trace.getTracerProvider();
|
|
4686
|
+
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
|
4682
4687
|
async function load(url, options) {
|
|
4683
4688
|
options?.signal?.throwIfAborted();
|
|
4684
4689
|
if (!skipPreloadedContexts && url in contexts_default) {
|
|
@@ -4698,14 +4703,38 @@ function getDocumentLoader({ allowPrivateAddress, skipPreloadedContexts, userAge
|
|
|
4698
4703
|
});
|
|
4699
4704
|
throw error;
|
|
4700
4705
|
}
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
+
return await tracer.startActiveSpan("activitypub.fetch_document", {
|
|
4707
|
+
kind: SpanKind.CLIENT,
|
|
4708
|
+
attributes: { "url.full": url }
|
|
4709
|
+
}, async (span) => {
|
|
4710
|
+
try {
|
|
4711
|
+
const request = createRequest(url, { userAgent });
|
|
4712
|
+
logRequest(request);
|
|
4713
|
+
const response = await fetch(request, {
|
|
4714
|
+
redirect: "manual",
|
|
4715
|
+
signal: options?.signal
|
|
4716
|
+
});
|
|
4717
|
+
span.setAttribute("http.response.status_code", response.status);
|
|
4718
|
+
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
4719
|
+
const redirectUrl = response.headers.get("Location");
|
|
4720
|
+
span.setAttribute("http.redirect.url", redirectUrl);
|
|
4721
|
+
return await load(redirectUrl, options);
|
|
4722
|
+
}
|
|
4723
|
+
const result = await getRemoteDocument(url, response, load);
|
|
4724
|
+
span.setAttribute("docloader.document_url", result.documentUrl);
|
|
4725
|
+
if (result.contextUrl != null) span.setAttribute("docloader.context_url", result.contextUrl);
|
|
4726
|
+
return result;
|
|
4727
|
+
} catch (error) {
|
|
4728
|
+
span.recordException(error);
|
|
4729
|
+
span.setStatus({
|
|
4730
|
+
code: SpanStatusCode.ERROR,
|
|
4731
|
+
message: String(error)
|
|
4732
|
+
});
|
|
4733
|
+
throw error;
|
|
4734
|
+
} finally {
|
|
4735
|
+
span.end();
|
|
4736
|
+
}
|
|
4706
4737
|
});
|
|
4707
|
-
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) return load(response.headers.get("Location"), options);
|
|
4708
|
-
return getRemoteDocument(url, response, load);
|
|
4709
4738
|
}
|
|
4710
4739
|
return load;
|
|
4711
4740
|
}
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
|
6
6
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
7
|
+
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
|
7
8
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
8
9
|
const node_dns_promises = require_chunk.__toESM(require("node:dns/promises"));
|
|
9
10
|
const node_net = require_chunk.__toESM(require("node:net"));
|
|
10
11
|
|
|
11
12
|
//#region deno.json
|
|
12
13
|
var name = "@fedify/fedify";
|
|
13
|
-
var version = "1.10.0-dev.
|
|
14
|
+
var version = "1.10.0-dev.2+13db1686";
|
|
14
15
|
var license = "MIT";
|
|
15
16
|
var exports$1 = {
|
|
16
17
|
".": "./src/mod.ts",
|
|
@@ -32,6 +33,8 @@ var imports = {
|
|
|
32
33
|
"@cfworker/json-schema": "npm:@cfworker/json-schema@^4.1.1",
|
|
33
34
|
"@multiformats/base-x": "npm:@multiformats/base-x@^4.0.1",
|
|
34
35
|
"@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
|
|
36
|
+
"@opentelemetry/core": "npm:@opentelemetry/core@^1.30.1",
|
|
37
|
+
"@opentelemetry/sdk-trace-base": "npm:@opentelemetry/sdk-trace-base@^1.30.1",
|
|
35
38
|
"@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.27.0",
|
|
36
39
|
"@phensley/language-tag": "npm:@phensley/language-tag@^1.9.0",
|
|
37
40
|
"@std/assert": "jsr:@std/assert@^0.226.0",
|
|
@@ -43,7 +46,7 @@ var imports = {
|
|
|
43
46
|
"fast-check": "npm:fast-check@^3.22.0",
|
|
44
47
|
"fetch-mock": "npm:fetch-mock@^12.5.2",
|
|
45
48
|
"json-canon": "npm:json-canon@^1.0.1",
|
|
46
|
-
"jsonld": "npm:jsonld@^
|
|
49
|
+
"jsonld": "npm:jsonld@^9.0.0",
|
|
47
50
|
"multicodec": "npm:multicodec@^3.2.1",
|
|
48
51
|
"pkijs": "npm:pkijs@^3.2.4",
|
|
49
52
|
"structured-field-values": "npm:structured-field-values@^2.0.4",
|
|
@@ -4680,6 +4683,8 @@ async function getRemoteDocument(url, response, fetch$1) {
|
|
|
4680
4683
|
* @since 1.3.0
|
|
4681
4684
|
*/
|
|
4682
4685
|
function getDocumentLoader({ allowPrivateAddress, skipPreloadedContexts, userAgent } = {}) {
|
|
4686
|
+
const tracerProvider = __opentelemetry_api.trace.getTracerProvider();
|
|
4687
|
+
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
|
4683
4688
|
async function load(url, options) {
|
|
4684
4689
|
options?.signal?.throwIfAborted();
|
|
4685
4690
|
if (!skipPreloadedContexts && url in contexts_default) {
|
|
@@ -4699,14 +4704,38 @@ function getDocumentLoader({ allowPrivateAddress, skipPreloadedContexts, userAge
|
|
|
4699
4704
|
});
|
|
4700
4705
|
throw error;
|
|
4701
4706
|
}
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
+
return await tracer.startActiveSpan("activitypub.fetch_document", {
|
|
4708
|
+
kind: __opentelemetry_api.SpanKind.CLIENT,
|
|
4709
|
+
attributes: { "url.full": url }
|
|
4710
|
+
}, async (span) => {
|
|
4711
|
+
try {
|
|
4712
|
+
const request = createRequest(url, { userAgent });
|
|
4713
|
+
logRequest(request);
|
|
4714
|
+
const response = await fetch(request, {
|
|
4715
|
+
redirect: "manual",
|
|
4716
|
+
signal: options?.signal
|
|
4717
|
+
});
|
|
4718
|
+
span.setAttribute("http.response.status_code", response.status);
|
|
4719
|
+
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
4720
|
+
const redirectUrl = response.headers.get("Location");
|
|
4721
|
+
span.setAttribute("http.redirect.url", redirectUrl);
|
|
4722
|
+
return await load(redirectUrl, options);
|
|
4723
|
+
}
|
|
4724
|
+
const result = await getRemoteDocument(url, response, load);
|
|
4725
|
+
span.setAttribute("docloader.document_url", result.documentUrl);
|
|
4726
|
+
if (result.contextUrl != null) span.setAttribute("docloader.context_url", result.contextUrl);
|
|
4727
|
+
return result;
|
|
4728
|
+
} catch (error) {
|
|
4729
|
+
span.recordException(error);
|
|
4730
|
+
span.setStatus({
|
|
4731
|
+
code: __opentelemetry_api.SpanStatusCode.ERROR,
|
|
4732
|
+
message: String(error)
|
|
4733
|
+
});
|
|
4734
|
+
throw error;
|
|
4735
|
+
} finally {
|
|
4736
|
+
span.end();
|
|
4737
|
+
}
|
|
4707
4738
|
});
|
|
4708
|
-
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) return load(response.headers.get("Location"), options);
|
|
4709
|
-
return getRemoteDocument(url, response, load);
|
|
4710
4739
|
}
|
|
4711
4740
|
return load;
|
|
4712
4741
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { __commonJS, __toESM } from "./type-
|
|
6
|
+
import { __commonJS, __toESM } from "./type-E_91dusN.js";
|
|
7
7
|
|
|
8
8
|
//#region ../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js
|
|
9
9
|
var require_glob_to_regexp = __commonJS({ "../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js"(exports, module) {
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Activity, Note, Person } from "../type-
|
|
6
|
+
import { Activity, Note, Person } 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
11
|
import { parseSemVer } from "../semver-dArNLkR9.js";
|
|
12
|
-
import "../lookup-
|
|
13
|
-
import "../inbox-
|
|
14
|
-
import { createFederationBuilder } from "../builder-
|
|
15
|
-
import { test } from "../testing-
|
|
12
|
+
import "../lookup-Co4Y1ycg.js";
|
|
13
|
+
import "../inbox-Dt-Q2rJt.js";
|
|
14
|
+
import { createFederationBuilder } from "../builder-C7fApQY_.js";
|
|
15
|
+
import { test } from "../testing-B17zODFD.js";
|
|
16
16
|
import { assertExists } from "../std__assert-X-_kMxKM.js";
|
|
17
17
|
import "../assert_rejects-DiIiJbZn.js";
|
|
18
18
|
import "../assert_is_error-BPGph1Jx.js";
|
|
@@ -3,13 +3,13 @@
|
|
|
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-
|
|
10
|
+
import "../lookup-Co4Y1ycg.js";
|
|
11
11
|
import { buildCollectionSynchronizationHeader, digest } from "../collection-CSzG2j1P.js";
|
|
12
|
-
import { test } from "../testing-
|
|
12
|
+
import { test } from "../testing-B17zODFD.js";
|
|
13
13
|
import "../std__assert-X-_kMxKM.js";
|
|
14
14
|
import "../assert_rejects-DiIiJbZn.js";
|
|
15
15
|
import "../assert_is_error-BPGph1Jx.js";
|
|
@@ -3,36 +3,37 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Create, Note, Person } from "../type-
|
|
6
|
+
import { Create, Note, Person } 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
10
|
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
|
|
11
|
-
import { acceptsJsonLd, createFederation, handleActor, handleCollection, handleCustomCollection, handleInbox, handleObject, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-
|
|
11
|
+
import { acceptsJsonLd, createFederation, handleActor, handleCollection, handleCustomCollection, handleInbox, handleObject, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-nSw7nWf8.js";
|
|
12
12
|
import "../semver-dArNLkR9.js";
|
|
13
|
-
import "../client-
|
|
14
|
-
import "../lookup-
|
|
13
|
+
import "../client-Bwnrdh_A.js";
|
|
14
|
+
import "../lookup-Co4Y1ycg.js";
|
|
15
15
|
import "../types-BIgY6c-l.js";
|
|
16
|
-
import "../actor-
|
|
17
|
-
import "../key-
|
|
18
|
-
import { signRequest } from "../http-
|
|
19
|
-
import "../authdocloader-
|
|
20
|
-
import "../ld-
|
|
21
|
-
import "../owner-
|
|
22
|
-
import "../proof-
|
|
23
|
-
import { InboxListenerSet } from "../inbox-
|
|
24
|
-
import "../builder-
|
|
16
|
+
import "../actor-Bv7llTFW.js";
|
|
17
|
+
import "../key-Tt9B2Qkj.js";
|
|
18
|
+
import { signRequest } from "../http-DXmKLE1t.js";
|
|
19
|
+
import "../authdocloader-TNeksncq.js";
|
|
20
|
+
import "../ld-CqoYKNwB.js";
|
|
21
|
+
import "../owner-9jSx_21P.js";
|
|
22
|
+
import "../proof-B5YI7sn5.js";
|
|
23
|
+
import { InboxListenerSet } from "../inbox-Dt-Q2rJt.js";
|
|
24
|
+
import "../builder-C7fApQY_.js";
|
|
25
25
|
import "../collection-CSzG2j1P.js";
|
|
26
|
-
import "../keycache-
|
|
26
|
+
import "../keycache-CXF4YAON.js";
|
|
27
27
|
import "../retry-D4GJ670a.js";
|
|
28
|
-
import "../send-
|
|
29
|
-
import { createInboxContext, createRequestContext, mockDocumentLoader, test } from "../testing-
|
|
28
|
+
import "../send-DlPE7bKe.js";
|
|
29
|
+
import { createInboxContext, createRequestContext, mockDocumentLoader, test } from "../testing-B17zODFD.js";
|
|
30
30
|
import "../std__assert-X-_kMxKM.js";
|
|
31
31
|
import { assertFalse } from "../assert_rejects-DiIiJbZn.js";
|
|
32
32
|
import "../assert_is_error-BPGph1Jx.js";
|
|
33
33
|
import "../assert_not_equals-f3m3epl3.js";
|
|
34
34
|
import "../assert_throws-BOO88avQ.js";
|
|
35
|
-
import { rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-
|
|
35
|
+
import { rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-CAUbEZtV.js";
|
|
36
|
+
import { createTestTracerProvider } from "../otel-Chy5T2Xh.js";
|
|
36
37
|
|
|
37
38
|
//#region src/federation/handler.test.ts
|
|
38
39
|
test("acceptsJsonLd()", () => {
|
|
@@ -1602,5 +1603,91 @@ test("handleCustomCollection()", async () => {
|
|
|
1602
1603
|
assertEquals(onNotAcceptableCalled, null);
|
|
1603
1604
|
assertEquals(onUnauthorizedCalled, null);
|
|
1604
1605
|
});
|
|
1606
|
+
test("handleInbox() records OpenTelemetry span events", async () => {
|
|
1607
|
+
const [tracerProvider, exporter] = createTestTracerProvider();
|
|
1608
|
+
const kv = new MemoryKvStore();
|
|
1609
|
+
const federation = createFederation({
|
|
1610
|
+
kv,
|
|
1611
|
+
tracerProvider
|
|
1612
|
+
});
|
|
1613
|
+
const activity = new Create({
|
|
1614
|
+
id: new URL("https://example.com/activity"),
|
|
1615
|
+
actor: new URL("https://example.com/users/someone"),
|
|
1616
|
+
object: new Note({
|
|
1617
|
+
id: new URL("https://example.com/note"),
|
|
1618
|
+
content: "Hello, world!"
|
|
1619
|
+
})
|
|
1620
|
+
});
|
|
1621
|
+
const request = new Request("https://example.com/users/someone/inbox", {
|
|
1622
|
+
method: "POST",
|
|
1623
|
+
headers: { "Content-Type": "application/activity+json" },
|
|
1624
|
+
body: JSON.stringify(await activity.toJsonLd())
|
|
1625
|
+
});
|
|
1626
|
+
const signed = await signRequest(request, rsaPrivateKey3, new URL("https://example.com/users/someone#main-key"));
|
|
1627
|
+
const context = createRequestContext({
|
|
1628
|
+
federation,
|
|
1629
|
+
request: signed,
|
|
1630
|
+
url: new URL(signed.url),
|
|
1631
|
+
data: void 0,
|
|
1632
|
+
documentLoader: mockDocumentLoader,
|
|
1633
|
+
contextLoader: mockDocumentLoader,
|
|
1634
|
+
getActorUri(identifier) {
|
|
1635
|
+
return new URL(`https://example.com/users/${identifier}`);
|
|
1636
|
+
}
|
|
1637
|
+
});
|
|
1638
|
+
const actorDispatcher = (ctx, handle) => {
|
|
1639
|
+
if (handle !== "someone") return null;
|
|
1640
|
+
return new Person({
|
|
1641
|
+
id: ctx.getActorUri(handle),
|
|
1642
|
+
name: "Someone",
|
|
1643
|
+
inbox: new URL("https://example.com/users/someone/inbox"),
|
|
1644
|
+
publicKey: rsaPublicKey2
|
|
1645
|
+
});
|
|
1646
|
+
};
|
|
1647
|
+
const listeners = new InboxListenerSet();
|
|
1648
|
+
let receivedActivity = null;
|
|
1649
|
+
listeners.add(Create, (_ctx, activity$1) => {
|
|
1650
|
+
receivedActivity = activity$1;
|
|
1651
|
+
});
|
|
1652
|
+
const response = await handleInbox(signed, {
|
|
1653
|
+
recipient: "someone",
|
|
1654
|
+
context,
|
|
1655
|
+
inboxContextFactory(_activity) {
|
|
1656
|
+
return createInboxContext({
|
|
1657
|
+
...context,
|
|
1658
|
+
clone: void 0
|
|
1659
|
+
});
|
|
1660
|
+
},
|
|
1661
|
+
kv,
|
|
1662
|
+
kvPrefixes: {
|
|
1663
|
+
activityIdempotence: ["activityIdempotence"],
|
|
1664
|
+
publicKey: ["publicKey"]
|
|
1665
|
+
},
|
|
1666
|
+
actorDispatcher,
|
|
1667
|
+
inboxListeners: listeners,
|
|
1668
|
+
inboxErrorHandler: void 0,
|
|
1669
|
+
onNotFound: (_request) => new Response("Not found", { status: 404 }),
|
|
1670
|
+
signatureTimeWindow: false,
|
|
1671
|
+
skipSignatureVerification: true,
|
|
1672
|
+
tracerProvider
|
|
1673
|
+
});
|
|
1674
|
+
assertEquals(response.status, 202);
|
|
1675
|
+
assert(receivedActivity != null);
|
|
1676
|
+
const spans = exporter.getSpans("activitypub.inbox");
|
|
1677
|
+
assertEquals(spans.length, 1);
|
|
1678
|
+
const span = spans[0];
|
|
1679
|
+
assertEquals(span.attributes["fedify.inbox.recipient"], "someone");
|
|
1680
|
+
assertEquals(span.attributes["activitypub.activity.id"], "https://example.com/activity");
|
|
1681
|
+
const events = exporter.getEvents("activitypub.inbox", "activitypub.activity.received");
|
|
1682
|
+
assertEquals(events.length, 1);
|
|
1683
|
+
const event = events[0];
|
|
1684
|
+
assert(event.attributes != null);
|
|
1685
|
+
assertEquals(event.attributes["activitypub.activity.verified"], true);
|
|
1686
|
+
assertEquals(event.attributes["http_signatures.verified"], false);
|
|
1687
|
+
assert(typeof event.attributes["activitypub.activity.json"] === "string");
|
|
1688
|
+
const recordedActivity = JSON.parse(event.attributes["activitypub.activity.json"]);
|
|
1689
|
+
assertEquals(recordedActivity.id, "https://example.com/activity");
|
|
1690
|
+
assertEquals(recordedActivity.type, "Create");
|
|
1691
|
+
});
|
|
1605
1692
|
|
|
1606
1693
|
//#endregion
|
|
@@ -3,36 +3,36 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Create, Follow, Person } from "../type-
|
|
6
|
+
import { Create, Follow, Person } 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 { createFederation } from "../middleware-
|
|
11
|
+
import { createFederation } from "../middleware-nSw7nWf8.js";
|
|
12
12
|
import "../semver-dArNLkR9.js";
|
|
13
|
-
import "../client-
|
|
14
|
-
import "../lookup-
|
|
13
|
+
import "../client-Bwnrdh_A.js";
|
|
14
|
+
import "../lookup-Co4Y1ycg.js";
|
|
15
15
|
import "../types-BIgY6c-l.js";
|
|
16
|
-
import "../actor-
|
|
17
|
-
import "../key-
|
|
18
|
-
import "../http-
|
|
19
|
-
import "../authdocloader-
|
|
20
|
-
import "../ld-
|
|
21
|
-
import "../owner-
|
|
22
|
-
import { signObject } from "../proof-
|
|
23
|
-
import "../inbox-
|
|
24
|
-
import "../builder-
|
|
16
|
+
import "../actor-Bv7llTFW.js";
|
|
17
|
+
import "../key-Tt9B2Qkj.js";
|
|
18
|
+
import "../http-DXmKLE1t.js";
|
|
19
|
+
import "../authdocloader-TNeksncq.js";
|
|
20
|
+
import "../ld-CqoYKNwB.js";
|
|
21
|
+
import "../owner-9jSx_21P.js";
|
|
22
|
+
import { signObject } from "../proof-B5YI7sn5.js";
|
|
23
|
+
import "../inbox-Dt-Q2rJt.js";
|
|
24
|
+
import "../builder-C7fApQY_.js";
|
|
25
25
|
import "../collection-CSzG2j1P.js";
|
|
26
|
-
import "../keycache-
|
|
26
|
+
import "../keycache-CXF4YAON.js";
|
|
27
27
|
import "../retry-D4GJ670a.js";
|
|
28
|
-
import "../send-
|
|
29
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
28
|
+
import "../send-DlPE7bKe.js";
|
|
29
|
+
import { mockDocumentLoader, test } from "../testing-B17zODFD.js";
|
|
30
30
|
import "../std__assert-X-_kMxKM.js";
|
|
31
31
|
import "../assert_rejects-DiIiJbZn.js";
|
|
32
32
|
import "../assert_is_error-BPGph1Jx.js";
|
|
33
33
|
import "../assert_not_equals-f3m3epl3.js";
|
|
34
34
|
import "../assert_throws-BOO88avQ.js";
|
|
35
|
-
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey } from "../keys-
|
|
35
|
+
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey } from "../keys-CAUbEZtV.js";
|
|
36
36
|
|
|
37
37
|
//#region src/federation/idempotency.test.ts
|
|
38
38
|
const kv = new MemoryKvStore();
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Activity, Create, Invite, Offer, Update } from "../type-
|
|
6
|
+
import { Activity, Create, Invite, Offer, Update } from "../type-E_91dusN.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
|
-
import "../lookup-
|
|
9
|
-
import { InboxListenerSet } from "../inbox-
|
|
10
|
-
import { test } from "../testing-
|
|
8
|
+
import "../lookup-Co4Y1ycg.js";
|
|
9
|
+
import { InboxListenerSet } from "../inbox-Dt-Q2rJt.js";
|
|
10
|
+
import { test } from "../testing-B17zODFD.js";
|
|
11
11
|
import "../assert_is_error-BPGph1Jx.js";
|
|
12
12
|
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
|
13
13
|
|
|
@@ -3,14 +3,14 @@
|
|
|
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 } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
10
|
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
|
|
11
|
-
import "../lookup-
|
|
12
|
-
import { KvKeyCache } from "../keycache-
|
|
13
|
-
import { test } from "../testing-
|
|
11
|
+
import "../lookup-Co4Y1ycg.js";
|
|
12
|
+
import { KvKeyCache } from "../keycache-CXF4YAON.js";
|
|
13
|
+
import { test } from "../testing-B17zODFD.js";
|
|
14
14
|
|
|
15
15
|
//#region src/federation/keycache.test.ts
|
|
16
16
|
test("KvKeyCache.set()", async () => {
|
|
@@ -3,13 +3,13 @@
|
|
|
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
10
|
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
|
|
11
|
-
import "../lookup-
|
|
12
|
-
import { test } from "../testing-
|
|
11
|
+
import "../lookup-Co4Y1ycg.js";
|
|
12
|
+
import { test } from "../testing-B17zODFD.js";
|
|
13
13
|
import "../std__assert-X-_kMxKM.js";
|
|
14
14
|
import "../assert_rejects-DiIiJbZn.js";
|
|
15
15
|
import "../assert_is_error-BPGph1Jx.js";
|