@fedify/fedify 2.0.0-dev.1641 → 2.0.0-dev.1726
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/dist/{actor-CP03csrm.cjs → actor-Bn2RCpws.cjs} +7263 -2440
- package/dist/{actor-DMgu-ZjT.d.cts → actor-D6K058Tb.d.cts} +1 -1
- package/dist/{actor-C22bXuuC.d.ts → actor-T6RyhRgk.d.ts} +1 -1
- package/dist/{actor-DVpsNXhn.js → actor-dO7jHa6A.js} +1 -1
- package/dist/{actor-DU511yTk.js → actor-menZmmiI.js} +7263 -2440
- package/dist/{assert_rejects-7UF4R_Qs.js → assert_rejects-DiIiJbZn.js} +1 -1
- package/dist/{assert_throws-53_pKeP3.js → assert_throws-BOO88avQ.js} +1 -1
- package/dist/{authdocloader-BnsFSERg.cjs → authdocloader-CEqdZdT7.cjs} +3 -3
- package/dist/{authdocloader-DCgMyo82.js → authdocloader-CZsCIRLV.js} +3 -3
- package/dist/{authdocloader-BkIZCKQv.js → authdocloader-DevmXsTo.js} +3 -3
- package/dist/{builder-E2Icrl_a.js → builder-CGF1vv7G.js} +14 -8
- package/dist/{client-BW4V0OJx.js → client-BfzV3u96.js} +1 -1
- package/dist/compat/mod.d.cts +7 -7
- package/dist/compat/mod.d.ts +7 -7
- package/dist/compat/transformers.test.js +18 -17
- package/dist/{context-CDSZdQHD.d.ts → context-B1X8-X33.d.ts} +185 -98
- package/dist/{context-Dq8aCtMH.d.cts → context-DYCJXr7J.d.cts} +185 -98
- package/dist/{docloader-kae6M-GI.cjs → docloader-Buh0Ah9G.cjs} +2 -2
- package/dist/{docloader-BtqIh1OE.js → docloader-DOmINJ1U.js} +2 -2
- package/dist/{esm-mtx3XJAD.js → esm-BODOj_Oi.js} +1 -1
- package/dist/federation/builder.test.js +10 -10
- package/dist/federation/collection.test.js +8 -8
- package/dist/federation/handler.test.js +26 -145
- package/dist/federation/idempotency.test.d.ts +3 -0
- package/dist/federation/idempotency.test.js +202 -0
- package/dist/federation/inbox.test.js +6 -6
- package/dist/federation/keycache.test.js +4 -4
- package/dist/federation/kv.test.js +8 -8
- package/dist/federation/middleware.test.js +238 -44
- package/dist/federation/mod.cjs +10 -10
- package/dist/federation/mod.d.cts +7 -7
- package/dist/federation/mod.d.ts +7 -7
- package/dist/federation/mod.js +10 -10
- package/dist/federation/mq.test.js +10 -10
- package/dist/federation/negotiation.test.d.ts +3 -0
- package/dist/federation/negotiation.test.js +28 -0
- package/dist/federation/retry.test.js +5 -5
- package/dist/federation/router.test.js +8 -8
- package/dist/federation/send.test.js +15 -15
- package/dist/fixtures/media.example.com/avatars/test-avatar.jpg.json +6 -0
- package/dist/{http-ZhcoaYEa.cjs → http-BmbMWfmh.cjs} +3 -3
- package/dist/{http-BS6766zs.d.cts → http-D-e6AFwR.d.cts} +1 -1
- package/dist/{http-DqSNLFNY.d.ts → http-D6Uj2x2y.d.ts} +1 -1
- package/dist/{http-Cox5GsED.js → http-Danw_xTY.js} +2 -2
- package/dist/{http-C7uYFcBo.js → http-gHyCrTrX.js} +3 -3
- package/dist/{inbox-BDdRbWNI.js → inbox-Blp5F74G.js} +24 -7
- package/dist/{key-CgwCzDC4.js → key-B2cp5-JF.js} +3 -3
- package/dist/{key-HqzOCwDc.cjs → key-BR1W25rw.cjs} +2 -2
- package/dist/{key-Cc0JlcKe.js → key-BnjofJ4e.js} +2 -2
- package/dist/{key-CfiBDu3o.js → key-CIIkeide.js} +2 -2
- package/dist/key-DhflzsBJ.cjs +10 -0
- package/dist/{key-B9Z5ZuX9.js → key-WES6wszI.js} +4 -4
- package/dist/{keycache-CVBjz3xi.js → keycache-Covv8lvK.js} +1 -1
- package/dist/{keys-CBKbYaJA.js → keys-DZ1bqhJz.js} +1 -1
- package/dist/{ld-CxgmnSO3.js → ld-C7KL1MK2.js} +2 -2
- package/dist/{lookup-QHjmy4Og.cjs → lookup-CDOxr8vw.cjs} +1 -1
- package/dist/{lookup-NuT9cCSl.js → lookup-D8tCnUj2.js} +1 -1
- package/dist/{lookup-CiU3QxQz.js → lookup-VSVPBU3J.js} +21 -12
- package/dist/middleware-9KSLASn7.js +17 -0
- package/dist/{middleware-LyCG_YVM.cjs → middleware-C60xXvWx.cjs} +99 -108
- package/dist/middleware-CH0PNtaj.cjs +17 -0
- package/dist/middleware-CrzCnpdt.js +26 -0
- package/dist/{middleware-DXidHY4N.js → middleware-DXOZ6_ST.js} +99 -108
- package/dist/{middleware-ByPnvMMS.js → middleware-HKKY6sAX.js} +69 -165
- package/dist/{mod-Drmz72EK.d.ts → mod-BhUKmBJD.d.ts} +2 -2
- package/dist/{mod-TFoH2Ql8.d.ts → mod-CerN_Sza.d.ts} +1 -1
- package/dist/{mod-Dc_-mf8s.d.cts → mod-Cj1tHXBR.d.cts} +1 -1
- package/dist/{mod-evzlRVZq.d.cts → mod-CxkWO3Mg.d.cts} +19 -1
- package/dist/{mod-RI3-KvUI.d.ts → mod-DcKxhFQ8.d.ts} +2 -2
- package/dist/{mod-BClfg3ej.d.cts → mod-Djzcw2ry.d.cts} +2 -2
- package/dist/{mod-Cxt4Kpf6.d.ts → mod-DlU8ISoa.d.ts} +19 -1
- package/dist/{mod-BhMnAkFX.d.cts → mod-twdvV2hR.d.cts} +2 -2
- package/dist/mod.cjs +10 -10
- package/dist/mod.d.cts +10 -10
- package/dist/mod.d.ts +10 -10
- package/dist/mod.js +10 -10
- package/dist/negotiation-5NPJL6zp.js +71 -0
- package/dist/nodeinfo/client.test.js +10 -10
- package/dist/nodeinfo/handler.test.js +23 -22
- package/dist/nodeinfo/mod.cjs +2 -2
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/types.test.js +8 -8
- package/dist/{owner-B-7Ptt_m.d.cts → owner-BN_tO3cY.d.cts} +2 -2
- package/dist/{owner-Cxob5_PK.js → owner-COcyel6J.js} +2 -2
- package/dist/{owner-CQPnQVtf.d.ts → owner-hd9lvQcP.d.ts} +2 -2
- package/dist/{proof-2Gcor0_N.cjs → proof-CMJcrQoM.cjs} +3 -3
- package/dist/{proof-BiSQNUmQ.js → proof-Cpk853lc.js} +2 -2
- package/dist/{proof-DkxwMaWE.js → proof-D6pbnNx2.js} +3 -3
- package/dist/runtime/authdocloader.test.js +14 -14
- package/dist/runtime/docloader.test.js +9 -9
- package/dist/runtime/key.test.js +10 -10
- package/dist/runtime/langstr.test.js +8 -8
- package/dist/runtime/link.test.js +3 -3
- package/dist/runtime/mod.cjs +6 -6
- package/dist/runtime/mod.d.cts +3 -3
- package/dist/runtime/mod.d.ts +3 -3
- package/dist/runtime/mod.js +6 -6
- package/dist/runtime/multibase/multibase.test.js +8 -8
- package/dist/runtime/url.test.js +5 -5
- package/dist/{send-DSEhWIYD.js → send-C7A7_big.js} +2 -2
- package/dist/sig/http.test.js +13 -13
- package/dist/sig/key.test.js +11 -11
- package/dist/sig/ld.test.js +10 -10
- package/dist/sig/mod.cjs +6 -6
- package/dist/sig/mod.d.cts +5 -5
- package/dist/sig/mod.d.ts +5 -5
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +12 -12
- package/dist/sig/proof.test.js +12 -12
- package/dist/testing/docloader.test.js +8 -8
- package/dist/testing/mod.d.ts +391 -86
- package/dist/testing/mod.js +3 -3
- package/dist/{testing-ByQmUvf-.js → testing-e8Kpb1uV.js} +2 -2
- package/dist/{type-B4NJkfVg.js → type-D_8QzkEn.js} +6944 -2121
- package/dist/{types-l2uh_ZhP.js → types-Db4ukgX8.js} +1 -1
- package/dist/{types-Bqt2EgP0.cjs → types-LjTL4QMx.cjs} +1 -1
- package/dist/vocab/actor.test.js +10 -10
- package/dist/vocab/lookup.test.js +259 -9
- package/dist/vocab/mod.cjs +4 -4
- package/dist/vocab/mod.d.cts +3 -3
- package/dist/vocab/mod.d.ts +3 -3
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +402 -13
- package/dist/{vocab-SOE1ifCr.d.ts → vocab-BI0Ak5lL.d.ts} +290 -0
- package/dist/{vocab-lBFcVxVF.js → vocab-CJHF7Q71.js} +23 -14
- package/dist/{vocab-B0-5a8pw.cjs → vocab-DLHpZwOW.cjs} +23 -14
- package/dist/{vocab-DJTYMqyU.d.cts → vocab-Dw1-yVGg.d.cts} +290 -0
- package/dist/webfinger/handler.test.js +23 -22
- package/dist/webfinger/lookup.test.js +9 -9
- package/dist/webfinger/mod.cjs +2 -2
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/cfworkers.test.js +8 -8
- package/dist/x/hono.d.cts +6 -6
- package/dist/x/hono.d.ts +6 -6
- package/dist/x/sveltekit.d.cts +6 -6
- package/dist/x/sveltekit.d.ts +6 -6
- package/package.json +1 -1
- package/dist/key-D-7DPHNl.cjs +0 -10
- package/dist/middleware-BHboQ4BE.js +0 -25
- package/dist/middleware-Bp3I9z8r.js +0 -17
- package/dist/middleware-oYqSU5ky.cjs +0 -17
- /package/dist/{assert_is_error-B035L3om.js → assert_is_error-BPGph1Jx.js} +0 -0
- /package/dist/{assert_not_equals-C80BG-_5.js → assert_not_equals-f3m3epl3.js} +0 -0
- /package/dist/{denokv-jZ0Z2h0M.js → denokv-Bv33Xxea.js} +0 -0
- /package/dist/{retry-CfF8Gn4d.js → retry-D4GJ670a.js} +0 -0
- /package/dist/{std__assert-DWivtrGR.js → std__assert-X-_kMxKM.js} +0 -0
@@ -3,12 +3,12 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import "../type-
|
6
|
+
import "../type-D_8QzkEn.js";
|
7
7
|
import { AssertionError, assertEquals } from "../assert_equals-DSbWqCm3.js";
|
8
|
-
import "../lookup-
|
9
|
-
import { createExponentialBackoffPolicy } from "../retry-
|
10
|
-
import { test } from "../testing-
|
11
|
-
import { assertNotEquals } from "../assert_not_equals-
|
8
|
+
import "../lookup-VSVPBU3J.js";
|
9
|
+
import { createExponentialBackoffPolicy } from "../retry-D4GJ670a.js";
|
10
|
+
import { test } from "../testing-e8Kpb1uV.js";
|
11
|
+
import { assertNotEquals } from "../assert_not_equals-f3m3epl3.js";
|
12
12
|
|
13
13
|
//#region src/federation/retry.test.ts
|
14
14
|
test("createExponentialBackoffPolicy()", () => {
|
@@ -3,17 +3,17 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import "../type-
|
6
|
+
import "../type-D_8QzkEn.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 { Router, RouterError } from "../lookup-
|
11
|
-
import { test } from "../testing-
|
12
|
-
import "../std__assert-
|
13
|
-
import { assertFalse } from "../assert_rejects-
|
14
|
-
import "../assert_is_error-
|
15
|
-
import "../assert_not_equals-
|
16
|
-
import { assertThrows } from "../assert_throws-
|
10
|
+
import { Router, RouterError } from "../lookup-VSVPBU3J.js";
|
11
|
+
import { test } from "../testing-e8Kpb1uV.js";
|
12
|
+
import "../std__assert-X-_kMxKM.js";
|
13
|
+
import { assertFalse } from "../assert_rejects-DiIiJbZn.js";
|
14
|
+
import "../assert_is_error-BPGph1Jx.js";
|
15
|
+
import "../assert_not_equals-f3m3epl3.js";
|
16
|
+
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
17
17
|
|
18
18
|
//#region src/federation/router.test.ts
|
19
19
|
function setUp(options = {}) {
|
@@ -3,24 +3,24 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Activity, Application, Endpoints, Group, Person, Service } from "../type-
|
6
|
+
import { Activity, Application, Endpoints, Group, Person, Service } from "../type-D_8QzkEn.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 "../key-
|
13
|
-
import { verifyRequest } from "../http-
|
14
|
-
import { doesActorOwnKey } from "../owner-
|
15
|
-
import { extractInboxes, sendActivity } from "../send-
|
16
|
-
import { mockDocumentLoader, test } from "../testing-
|
17
|
-
import "../std__assert-
|
18
|
-
import { assertFalse, assertRejects } from "../assert_rejects-
|
19
|
-
import "../assert_is_error-
|
20
|
-
import { assertNotEquals } from "../assert_not_equals-
|
21
|
-
import "../assert_throws-
|
22
|
-
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-
|
23
|
-
import { esm_default } from "../esm-
|
10
|
+
import "../lookup-VSVPBU3J.js";
|
11
|
+
import "../actor-dO7jHa6A.js";
|
12
|
+
import "../key-CIIkeide.js";
|
13
|
+
import { verifyRequest } from "../http-Danw_xTY.js";
|
14
|
+
import { doesActorOwnKey } from "../owner-COcyel6J.js";
|
15
|
+
import { extractInboxes, sendActivity } from "../send-C7A7_big.js";
|
16
|
+
import { mockDocumentLoader, test } from "../testing-e8Kpb1uV.js";
|
17
|
+
import "../std__assert-X-_kMxKM.js";
|
18
|
+
import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
19
|
+
import "../assert_is_error-BPGph1Jx.js";
|
20
|
+
import { assertNotEquals } from "../assert_not_equals-f3m3epl3.js";
|
21
|
+
import "../assert_throws-BOO88avQ.js";
|
22
|
+
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-DZ1bqhJz.js";
|
23
|
+
import { esm_default } from "../esm-BODOj_Oi.js";
|
24
24
|
|
25
25
|
//#region src/federation/send.test.ts
|
26
26
|
test("extractInboxes()", () => {
|
@@ -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_actor = require('./actor-
|
8
|
-
const require_key = require('./key-
|
6
|
+
const require_docloader = require('./docloader-Buh0Ah9G.cjs');
|
7
|
+
const require_actor = require('./actor-Bn2RCpws.cjs');
|
8
|
+
const require_key = require('./key-BR1W25rw.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 byte_encodings_base64 = require_chunk.__toESM(require("byte-encodings/base64"));
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { DocumentLoader } from "./docloader-D-MrRyHl.cjs";
|
2
|
-
import { CryptographicKey, Multikey } from "./vocab-
|
2
|
+
import { CryptographicKey, Multikey } from "./vocab-Dw1-yVGg.cjs";
|
3
3
|
import { TracerProvider } from "@opentelemetry/api";
|
4
4
|
|
5
5
|
//#region src/sig/key.d.ts
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
3
|
import { DocumentLoader } from "./docloader-CxWcuWqQ.js";
|
4
|
-
import { CryptographicKey, Multikey } from "./vocab-
|
4
|
+
import { CryptographicKey, Multikey } from "./vocab-BI0Ak5lL.js";
|
5
5
|
import { TracerProvider } from "@opentelemetry/api";
|
6
6
|
|
7
7
|
//#region src/sig/key.d.ts
|
@@ -3,8 +3,8 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { CryptographicKey, deno_default } from "./type-
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
6
|
+
import { CryptographicKey, deno_default } from "./type-D_8QzkEn.js";
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-CIIkeide.js";
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
10
10
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
@@ -2,9 +2,9 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { deno_default } from "./docloader-
|
6
|
-
import { CryptographicKey } from "./actor-
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
5
|
+
import { deno_default } from "./docloader-DOmINJ1U.js";
|
6
|
+
import { CryptographicKey } from "./actor-menZmmiI.js";
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-BnjofJ4e.js";
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
10
10
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Activity, deno_default, getTypeId } from "./type-
|
6
|
+
import { Activity, deno_default, getTypeId } from "./type-D_8QzkEn.js";
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
8
8
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
9
9
|
|
@@ -41,17 +41,34 @@ var InboxListenerSet = class InboxListenerSet {
|
|
41
41
|
return this.dispatchWithClass(activity)?.listener ?? null;
|
42
42
|
}
|
43
43
|
};
|
44
|
-
async function routeActivity({ context: ctx, json, activity, recipient, inboxListeners, inboxContextFactory, inboxErrorHandler, kv, kvPrefixes, queue, span, tracerProvider }) {
|
44
|
+
async function routeActivity({ context: ctx, json, activity, recipient, inboxListeners, inboxContextFactory, inboxErrorHandler, kv, kvPrefixes, queue, span, tracerProvider, idempotencyStrategy }) {
|
45
45
|
const logger = getLogger([
|
46
46
|
"fedify",
|
47
47
|
"federation",
|
48
48
|
"inbox"
|
49
49
|
]);
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
50
|
+
let cacheKey = null;
|
51
|
+
if (activity.id != null) {
|
52
|
+
const inboxContext = inboxContextFactory(recipient, json, activity.id?.href, getTypeId(activity).href);
|
53
|
+
const strategy = idempotencyStrategy ?? "per-inbox";
|
54
|
+
let keyString;
|
55
|
+
if (typeof strategy === "function") {
|
56
|
+
const result = await strategy(inboxContext, activity);
|
57
|
+
keyString = result;
|
58
|
+
} else switch (strategy) {
|
59
|
+
case "global":
|
60
|
+
keyString = activity.id.href;
|
61
|
+
break;
|
62
|
+
case "per-origin":
|
63
|
+
keyString = `${ctx.origin}\n${activity.id.href}`;
|
64
|
+
break;
|
65
|
+
case "per-inbox":
|
66
|
+
keyString = `${ctx.origin}\n${activity.id.href}\n${recipient == null ? "sharedInbox" : `inbox\n${recipient}`}`;
|
67
|
+
break;
|
68
|
+
default: keyString = `${ctx.origin}\n${activity.id.href}`;
|
69
|
+
}
|
70
|
+
if (keyString != null) cacheKey = [...kvPrefixes.activityIdempotence, keyString];
|
71
|
+
}
|
55
72
|
if (cacheKey != null) {
|
56
73
|
const cached = await kv.get(cacheKey);
|
57
74
|
if (cached === true) {
|
@@ -3,8 +3,8 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import "./type-
|
7
|
-
import "./actor-
|
8
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "./key-
|
6
|
+
import "./type-D_8QzkEn.js";
|
7
|
+
import "./actor-dO7jHa6A.js";
|
8
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "./key-CIIkeide.js";
|
9
9
|
|
10
10
|
export { validateCryptoKey };
|
@@ -3,8 +3,8 @@
|
|
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_actor = require('./actor-
|
6
|
+
const require_docloader = require('./docloader-Buh0Ah9G.cjs');
|
7
|
+
const require_actor = require('./actor-Bn2RCpws.cjs');
|
8
8
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
9
9
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
10
10
|
|
@@ -2,8 +2,8 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { deno_default, getDocumentLoader } from "./docloader-
|
6
|
-
import { CryptographicKey, Object as Object$1, isActor } from "./actor-
|
5
|
+
import { deno_default, getDocumentLoader } from "./docloader-DOmINJ1U.js";
|
6
|
+
import { CryptographicKey, Object as Object$1, isActor } from "./actor-menZmmiI.js";
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
8
8
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
9
9
|
|
@@ -3,8 +3,8 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { CryptographicKey, Object as Object$1, deno_default, getDocumentLoader } from "./type-
|
7
|
-
import { isActor } from "./actor-
|
6
|
+
import { CryptographicKey, Object as Object$1, deno_default, getDocumentLoader } from "./type-D_8QzkEn.js";
|
7
|
+
import { isActor } from "./actor-dO7jHa6A.js";
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
9
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
10
10
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
4
|
+
|
5
|
+
require('./docloader-Buh0Ah9G.cjs');
|
6
|
+
require('./actor-Bn2RCpws.cjs');
|
7
|
+
require('./lookup-CDOxr8vw.cjs');
|
8
|
+
const require_key = require('./key-BR1W25rw.cjs');
|
9
|
+
|
10
|
+
exports.validateCryptoKey = require_key.validateCryptoKey;
|
@@ -2,9 +2,9 @@
|
|
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, validateCryptoKey } from "./key-
|
5
|
+
import "./docloader-DOmINJ1U.js";
|
6
|
+
import "./actor-menZmmiI.js";
|
7
|
+
import "./lookup-D8tCnUj2.js";
|
8
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "./key-BnjofJ4e.js";
|
9
9
|
|
10
10
|
export { validateCryptoKey };
|
@@ -3,7 +3,7 @@
|
|
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-D_8QzkEn.js";
|
7
7
|
|
8
8
|
//#region src/federation/keycache.ts
|
9
9
|
var KvKeyCache = class {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { CryptographicKey, Multikey, importSpki } from "./type-
|
6
|
+
import { CryptographicKey, Multikey, importSpki } from "./type-D_8QzkEn.js";
|
7
7
|
|
8
8
|
//#region src/testing/keys.ts
|
9
9
|
const rsaPublicKey1 = new CryptographicKey({
|
@@ -3,8 +3,8 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Activity, CryptographicKey, Object as Object$1, deno_default, getDocumentLoader, getTypeId } from "./type-
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
6
|
+
import { Activity, CryptographicKey, Object as Object$1, deno_default, getDocumentLoader, getTypeId } from "./type-D_8QzkEn.js";
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-CIIkeide.js";
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
10
10
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
@@ -3,7 +3,7 @@
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
4
4
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
6
|
-
const require_docloader = require('./docloader-
|
6
|
+
const require_docloader = require('./docloader-Buh0Ah9G.cjs');
|
7
7
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
8
8
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
9
9
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { UrlError, deno_default, getUserAgent, validatePublicUrl } from "./docloader-
|
5
|
+
import { UrlError, deno_default, getUserAgent, validatePublicUrl } from "./docloader-DOmINJ1U.js";
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
7
7
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
8
8
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Object as Object$1, deno_default, getDocumentLoader, getTypeId, lookupWebFinger } from "./type-
|
6
|
+
import { Object as Object$1, deno_default, getDocumentLoader, getTypeId, lookupWebFinger } from "./type-D_8QzkEn.js";
|
7
7
|
import { cloneDeep, delay } from "es-toolkit";
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
@@ -240,14 +240,13 @@ async function lookupObject(identifier, options = {}) {
|
|
240
240
|
async function lookupObjectInternal(identifier, options = {}) {
|
241
241
|
const documentLoader = options.documentLoader ?? getDocumentLoader({ userAgent: options.userAgent });
|
242
242
|
if (typeof identifier === "string") identifier = toAcctUrl(identifier) ?? new URL(identifier);
|
243
|
-
let
|
243
|
+
let remoteDoc = null;
|
244
244
|
if (identifier.protocol === "http:" || identifier.protocol === "https:") try {
|
245
|
-
|
246
|
-
document = remoteDoc.document;
|
245
|
+
remoteDoc = await documentLoader(identifier.href, { signal: options.signal });
|
247
246
|
} catch (error) {
|
248
247
|
logger.debug("Failed to fetch remote document:\n{error}", { error });
|
249
248
|
}
|
250
|
-
if (
|
249
|
+
if (remoteDoc == null) {
|
251
250
|
const jrd = await lookupWebFinger(identifier, {
|
252
251
|
userAgent: options.userAgent,
|
253
252
|
tracerProvider: options.tracerProvider,
|
@@ -258,8 +257,7 @@ async function lookupObjectInternal(identifier, options = {}) {
|
|
258
257
|
for (const l of jrd.links) {
|
259
258
|
if (l.type !== "application/activity+json" && !l.type?.match(/application\/ld\+json;\s*profile="https:\/\/www.w3.org\/ns\/activitystreams"/) || l.rel !== "self" || l.href == null) continue;
|
260
259
|
try {
|
261
|
-
|
262
|
-
document = remoteDoc.document;
|
260
|
+
remoteDoc = await documentLoader(l.href, { signal: options.signal });
|
263
261
|
break;
|
264
262
|
} catch (error) {
|
265
263
|
logger.debug("Failed to fetch remote document:\n{error}", { error });
|
@@ -267,23 +265,34 @@ async function lookupObjectInternal(identifier, options = {}) {
|
|
267
265
|
}
|
268
266
|
}
|
269
267
|
}
|
270
|
-
if (
|
268
|
+
if (remoteDoc == null) return null;
|
269
|
+
let object;
|
271
270
|
try {
|
272
|
-
|
271
|
+
object = await Object$1.fromJsonLd(remoteDoc.document, {
|
273
272
|
documentLoader,
|
274
273
|
contextLoader: options.contextLoader,
|
275
|
-
tracerProvider: options.tracerProvider
|
274
|
+
tracerProvider: options.tracerProvider,
|
275
|
+
baseUrl: new URL(remoteDoc.documentUrl)
|
276
276
|
});
|
277
277
|
} catch (error) {
|
278
278
|
if (error instanceof TypeError) {
|
279
279
|
logger.debug("Failed to parse JSON-LD document: {error}\n{document}", {
|
280
|
-
|
281
|
-
|
280
|
+
...remoteDoc,
|
281
|
+
error
|
282
282
|
});
|
283
283
|
return null;
|
284
284
|
}
|
285
285
|
throw error;
|
286
286
|
}
|
287
|
+
if (options.crossOrigin !== "trust" && object.id != null && object.id.origin !== new URL(remoteDoc.documentUrl).origin) {
|
288
|
+
if (options.crossOrigin === "throw") throw new Error(`The object's @id (${object.id.href}) has a different origin than the document URL (${remoteDoc.documentUrl}); refusing to return the object. If you want to bypass this check and are aware of the security implications, set the crossOrigin option to "trust".`);
|
289
|
+
logger.warn("The object's @id ({objectId}) has a different origin than the document URL ({documentUrl}); refusing to return the object. If you want to bypass this check and are aware of the security implications, set the crossOrigin option to \"trust\".", {
|
290
|
+
...remoteDoc,
|
291
|
+
objectId: object.id.href
|
292
|
+
});
|
293
|
+
return null;
|
294
|
+
}
|
295
|
+
return object;
|
287
296
|
}
|
288
297
|
/**
|
289
298
|
* Traverses a collection, yielding each item in the collection.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
|
5
|
+
import "./transformers-BFT6d7J5.js";
|
6
|
+
import "./docloader-DOmINJ1U.js";
|
7
|
+
import "./actor-menZmmiI.js";
|
8
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-DXOZ6_ST.js";
|
9
|
+
import "./lookup-D8tCnUj2.js";
|
10
|
+
import "./key-BnjofJ4e.js";
|
11
|
+
import "./http-gHyCrTrX.js";
|
12
|
+
import "./proof-D6pbnNx2.js";
|
13
|
+
import "./types-Db4ukgX8.js";
|
14
|
+
import "./authdocloader-CZsCIRLV.js";
|
15
|
+
import "./vocab-CJHF7Q71.js";
|
16
|
+
|
17
|
+
export { FederationImpl };
|