@fedify/fedify 2.0.0-dev.1961 → 2.0.0-dev.206
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/LICENSE +1 -1
- package/README.md +66 -36
- package/dist/{builder-BrqBKkVi.js → builder-BU9qEchZ.js} +5 -3
- package/dist/{client-BsGzbnV-.d.ts → client-CUTUGgvJ.d.ts} +18 -18
- package/dist/{client-pY7-3icS.js → client-Dg7OfUDA.js} +28 -23
- package/dist/{client-94iWEfQa.d.cts → client-by-PEGAJ.d.cts} +18 -18
- package/dist/compat/mod.cjs +1 -1
- package/dist/compat/mod.d.cts +6 -10
- package/dist/compat/mod.d.ts +6 -10
- package/dist/compat/mod.js +1 -1
- package/dist/compat/transformers.test.js +22 -21
- package/dist/context-Bns6uTJq.js +109 -0
- package/dist/{context-V-XS2_6O.d.ts → context-C7vzWilY.d.ts} +63 -65
- package/dist/{context-PxGADCsD.d.cts → context-CrB9RFy5.d.cts} +63 -65
- package/dist/deno-BUTHG7dM.js +117 -0
- package/dist/{testing-DpRy1YTU.js → dist-B5f6a8Tt.js} +90 -110
- package/dist/{docloader-HB61Uc88.js → docloader-BaYIAi2d.js} +3 -3
- package/dist/{esm-DaZiDvFW.js → esm-DGl7uK1r.js} +1 -1
- package/dist/federation/builder.test.js +7 -5
- package/dist/federation/collection.test.js +2 -3
- package/dist/federation/handler.test.js +110 -22
- package/dist/federation/idempotency.test.js +23 -22
- package/dist/federation/inbox.test.js +4 -3
- package/dist/federation/keycache.test.js +4 -4
- package/dist/federation/kv.test.js +56 -3
- package/dist/federation/middleware.test.js +95 -93
- package/dist/federation/mod.cjs +8 -10
- package/dist/federation/mod.d.cts +7 -11
- package/dist/federation/mod.d.ts +7 -11
- package/dist/federation/mod.js +8 -11
- package/dist/federation/mq.test.js +5 -6
- package/dist/federation/negotiation.test.js +2 -3
- package/dist/federation/retry.test.js +2 -3
- package/dist/federation/router.test.js +2 -2
- package/dist/federation/send.test.js +51 -9
- package/dist/{webfinger/handler.test.js → federation/webfinger.test.js} +24 -22
- package/dist/{federation-CRpdnOMS.cjs → federation-B431K2gm.cjs} +22 -0
- package/dist/{federation-jcR8-ZxP.js → federation-BbZwNNWj.js} +28 -6
- package/dist/{http-B2bao4EB.js → http-BxDH6plL.js} +3 -2
- package/dist/{http-M8k5mKc0.d.cts → http-ClB3pLcL.d.cts} +1 -1
- package/dist/{http-BbO0ejuk.d.ts → http-DLBDPal9.d.ts} +1 -1
- package/dist/{http-CUsGQiwU.js → http-DbN7EWyT.js} +119 -9
- package/dist/{http-BxgYWxTY.cjs → http-xz1rOLDK.cjs} +132 -16
- package/dist/{inbox-CAojlSWc.js → inbox-Cv5jVEEr.js} +2 -1
- package/dist/{key-Dz-KWCap.js → key-s_Hu2h8g.js} +3 -3
- package/dist/{keycache-Czcf33al.js → keycache-DRxpZ5r9.js} +1 -1
- package/dist/{keys-BN4nelft.js → keys-ZbcByPg9.js} +1 -1
- package/dist/{kv-Bxr0Q87_.d.cts → kv-B4vFhIYL.d.cts} +30 -1
- package/dist/{kv-BKNZ-Tb-.d.ts → kv-CYySNrsn.d.ts} +30 -1
- package/dist/{kv-CRZrzyXm.js → kv-QzKcOQgP.js} +22 -0
- package/dist/{kv-cache-5j5Pb-V6.cjs → kv-cache-BCBmDkwr.cjs} +2 -2
- package/dist/{kv-cache-DN9pfMBe.js → kv-cache-BEeqyGER.js} +14 -1
- package/dist/{kv-cache-Bq6kUUoG.js → kv-cache-CCkFOmOl.js} +2 -2
- package/dist/{ld-CEJHYq8u.js → ld-DXqgYcc9.js} +4 -3
- package/dist/middleware-CTmdJqh8.cjs +12 -0
- package/dist/middleware-CjwpmFSb.js +26 -0
- package/dist/{middleware-DgrceAHB.js → middleware-DzYMj3P9.js} +162 -165
- package/dist/middleware-FbKIfGNn.js +12 -0
- package/dist/{middleware-DW3rJHWy.cjs → middleware-IW3LA3Vi.cjs} +210 -194
- package/dist/{middleware-Df9OWALM.js → middleware-mAVYJs2q.js} +164 -154
- package/dist/{mod-DMpuiKXi.d.cts → mod-0p9zUdzg.d.cts} +6 -6
- package/dist/mod-0qnPv4EC.d.cts +62 -0
- package/dist/{mod-DgxG-byT.d.cts → mod-BrS8tiad.d.cts} +2 -2
- package/dist/mod-C3SOvTD1.d.ts +64 -0
- package/dist/{mod-BoRKfJPE.d.cts → mod-D6pS5_xJ.d.cts} +4 -4
- package/dist/{mod-D5Z2tISD.d.ts → mod-jOa7W503.d.ts} +2 -2
- package/dist/{mod-Cdo6SYlJ.d.ts → mod-waqu-BL_.d.ts} +4 -4
- package/dist/{mod-aAE2wOWV.d.ts → mod-xc20HhMD.d.ts} +6 -6
- package/dist/mod.cjs +11 -93
- package/dist/mod.d.cts +11 -15
- package/dist/mod.d.ts +11 -15
- package/dist/mod.js +11 -15
- package/dist/nodeinfo/client.test.js +3 -4
- package/dist/nodeinfo/handler.test.js +22 -21
- package/dist/nodeinfo/mod.cjs +2 -2
- package/dist/nodeinfo/mod.d.cts +2 -2
- package/dist/nodeinfo/mod.d.ts +2 -2
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/types.test.js +2 -3
- package/dist/otel/exporter.test.js +893 -0
- package/dist/otel/mod.cjs +256 -0
- package/dist/otel/mod.d.cts +230 -0
- package/dist/otel/mod.d.ts +232 -0
- package/dist/otel/mod.js +255 -0
- package/dist/{owner-kQRGVXG1.d.ts → owner-BgI8C-VY.d.ts} +1 -2
- package/dist/{owner-B4HbyP8s.d.cts → owner-C-zfmVAD.d.cts} +1 -2
- package/dist/{owner-JwI-WzF-.js → owner-VcVFcfvO.js} +44 -8
- package/dist/{proof-CObJuclI.cjs → proof-LJKB8sTg.cjs} +63 -28
- package/dist/{proof-xH0V1mdD.js → proof-Q-IWSQjT.js} +46 -11
- package/dist/{proof-Dhqndmfg.js → proof-VthB8GiV.js} +3 -2
- package/dist/router-D9eI0s4b.js +118 -0
- package/dist/{send-1o7D-GGL.js → send-Bb7N5G5a.js} +9 -4
- package/dist/sig/http.test.js +6 -7
- package/dist/sig/key.test.js +5 -5
- package/dist/sig/ld.test.js +6 -6
- package/dist/sig/mod.cjs +3 -5
- package/dist/sig/mod.d.cts +3 -5
- package/dist/sig/mod.d.ts +3 -5
- package/dist/sig/mod.js +3 -5
- package/dist/sig/owner.test.js +29 -6
- package/dist/sig/proof.test.js +6 -6
- package/dist/testing/mod.d.ts +70 -6999
- package/dist/testing/mod.js +4 -3
- package/dist/{transformers-CoBS-oFG.cjs → transformers-BjBg6Lag.cjs} +2 -2
- package/dist/{transformers-BFT6d7J5.js → transformers-N_ip_y4P.js} +2 -2
- package/dist/{types-BtUjyi5y.js → types-8l28uC8o.js} +30 -25
- package/dist/{types-CWgzGaqk.cjs → types-B6z6CqIz.cjs} +30 -25
- package/dist/{types-C2XVl6gj.js → types-CPz01LGH.js} +3 -3
- package/dist/utils/docloader.test.js +7 -8
- package/dist/utils/kv-cache.test.js +5 -3
- package/dist/utils/mod.cjs +3 -5
- package/dist/utils/mod.d.cts +3 -4
- package/dist/utils/mod.d.ts +3 -4
- package/dist/utils/mod.js +3 -5
- package/package.json +24 -35
- package/dist/actor-DhgrrgXz.cjs +0 -42079
- package/dist/actor-DiKHxw_H.js +0 -41647
- package/dist/actor-DqFajh9s.d.ts +0 -130
- package/dist/actor-Kqyoic-M.js +0 -146
- package/dist/actor-f2NtjyCg.d.cts +0 -128
- package/dist/fixtures/activitypub.academy/users/brauca_darradiul.json +0 -83
- package/dist/fixtures/example.com/announce.json +0 -6
- package/dist/fixtures/example.com/collection.json +0 -19
- package/dist/fixtures/example.com/create.json +0 -6
- package/dist/fixtures/example.com/cross-origin-actor.json +0 -6
- package/dist/fixtures/example.com/hong-gildong.json +0 -11
- package/dist/fixtures/example.com/invite.json +0 -7
- package/dist/fixtures/example.com/key.json +0 -7
- package/dist/fixtures/example.com/key2.json +0 -6
- package/dist/fixtures/example.com/object.json +0 -6
- package/dist/fixtures/example.com/orderedcollectionpage.json +0 -24
- package/dist/fixtures/example.com/paged/a.json +0 -13
- package/dist/fixtures/example.com/paged/b.json +0 -16
- package/dist/fixtures/example.com/paged-collection.json +0 -6
- package/dist/fixtures/example.com/person.json +0 -22
- package/dist/fixtures/example.com/person2.json +0 -40
- package/dist/fixtures/example.com/test.json +0 -5
- package/dist/fixtures/example.com/users/handle.json +0 -16
- package/dist/fixtures/example.com/wrong-type.json +0 -3
- package/dist/fixtures/media.example.com/avatars/test-avatar.jpg.json +0 -6
- package/dist/fixtures/oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd.json +0 -24
- package/dist/fixtures/remote.domain/users/bob.json +0 -20
- package/dist/fixtures/server.example/users/alice.json +0 -20
- package/dist/fixtures/w3id.org/identity/v1.json +0 -152
- package/dist/fixtures/w3id.org/security/data-integrity/v1.json +0 -74
- package/dist/fixtures/w3id.org/security/multikey/v1.json +0 -35
- package/dist/fixtures/w3id.org/security/v1.json +0 -50
- package/dist/fixtures/wizard.casa/users/hongminhee.json +0 -69
- package/dist/fixtures/www.w3.org/ns/activitystreams.json +0 -379
- package/dist/fixtures/www.w3.org/ns/did/v1.json +0 -58
- package/dist/lookup-D8hvtZHY.js +0 -42178
- package/dist/lookup-_Hap2IXS.cjs +0 -265
- package/dist/lookup-gMu_9ZKY.js +0 -253
- package/dist/middleware-19QFZj7b.js +0 -26
- package/dist/middleware-BbbcXY4w.cjs +0 -15
- package/dist/middleware-CSTK543z.js +0 -15
- package/dist/mod-BlVovdcy.d.ts +0 -309
- package/dist/mod-BxRCHTz-.d.cts +0 -307
- package/dist/mod-C58MZ7Wx.d.cts +0 -113
- package/dist/mod-CcDPcLJW.d.cts +0 -1
- package/dist/mod-Ds0mpFZU.d.ts +0 -115
- package/dist/mod-bjzj5QIb.d.ts +0 -2
- package/dist/src/vocab/accept.yaml +0 -15
- package/dist/src/vocab/activity.yaml +0 -98
- package/dist/src/vocab/add.yaml +0 -16
- package/dist/src/vocab/announce.yaml +0 -30
- package/dist/src/vocab/application.yaml +0 -324
- package/dist/src/vocab/arrive.yaml +0 -15
- package/dist/src/vocab/article.yaml +0 -46
- package/dist/src/vocab/audio.yaml +0 -11
- package/dist/src/vocab/block.yaml +0 -16
- package/dist/src/vocab/chatmessage.yaml +0 -50
- package/dist/src/vocab/collection.yaml +0 -154
- package/dist/src/vocab/collectionpage.yaml +0 -55
- package/dist/src/vocab/create.yaml +0 -28
- package/dist/src/vocab/dataintegrityproof.yaml +0 -56
- package/dist/src/vocab/delete.yaml +0 -27
- package/dist/src/vocab/didservice.yaml +0 -22
- package/dist/src/vocab/dislike.yaml +0 -14
- package/dist/src/vocab/document.yaml +0 -31
- package/dist/src/vocab/emoji.yaml +0 -12
- package/dist/src/vocab/emojireact.yaml +0 -17
- package/dist/src/vocab/endpoints.yaml +0 -85
- package/dist/src/vocab/event.yaml +0 -11
- package/dist/src/vocab/export.yaml +0 -9
- package/dist/src/vocab/flag.yaml +0 -15
- package/dist/src/vocab/follow.yaml +0 -19
- package/dist/src/vocab/group.yaml +0 -324
- package/dist/src/vocab/hashtag.yaml +0 -14
- package/dist/src/vocab/ignore.yaml +0 -14
- package/dist/src/vocab/image.yaml +0 -9
- package/dist/src/vocab/intransitiveactivity.yaml +0 -15
- package/dist/src/vocab/invite.yaml +0 -14
- package/dist/src/vocab/join.yaml +0 -14
- package/dist/src/vocab/key.yaml +0 -28
- package/dist/src/vocab/leave.yaml +0 -14
- package/dist/src/vocab/like.yaml +0 -16
- package/dist/src/vocab/link.yaml +0 -101
- package/dist/src/vocab/listen.yaml +0 -12
- package/dist/src/vocab/mention.yaml +0 -9
- package/dist/src/vocab/move.yaml +0 -15
- package/dist/src/vocab/multikey.yaml +0 -36
- package/dist/src/vocab/note.yaml +0 -48
- package/dist/src/vocab/object.yaml +0 -404
- package/dist/src/vocab/offer.yaml +0 -15
- package/dist/src/vocab/orderedcollection.yaml +0 -39
- package/dist/src/vocab/orderedcollectionpage.yaml +0 -50
- package/dist/src/vocab/organization.yaml +0 -324
- package/dist/src/vocab/page.yaml +0 -11
- package/dist/src/vocab/person.yaml +0 -324
- package/dist/src/vocab/place.yaml +0 -75
- package/dist/src/vocab/profile.yaml +0 -26
- package/dist/src/vocab/propertyvalue.yaml +0 -32
- package/dist/src/vocab/question.yaml +0 -103
- package/dist/src/vocab/read.yaml +0 -13
- package/dist/src/vocab/reject.yaml +0 -14
- package/dist/src/vocab/relationship.yaml +0 -52
- package/dist/src/vocab/remove.yaml +0 -14
- package/dist/src/vocab/service.yaml +0 -324
- package/dist/src/vocab/source.yaml +0 -26
- package/dist/src/vocab/tentativeaccept.yaml +0 -14
- package/dist/src/vocab/tentativereject.yaml +0 -14
- package/dist/src/vocab/tombstone.yaml +0 -24
- package/dist/src/vocab/travel.yaml +0 -16
- package/dist/src/vocab/undo.yaml +0 -26
- package/dist/src/vocab/update.yaml +0 -58
- package/dist/src/vocab/video.yaml +0 -11
- package/dist/src/vocab/view.yaml +0 -13
- package/dist/testing/docloader.test.js +0 -22
- package/dist/vocab/actor.test.js +0 -5963
- package/dist/vocab/lookup.test.d.ts +0 -3
- package/dist/vocab/lookup.test.js +0 -454
- package/dist/vocab/mod.cjs +0 -86
- package/dist/vocab/mod.d.cts +0 -4
- package/dist/vocab/mod.d.ts +0 -6
- package/dist/vocab/mod.js +0 -9
- package/dist/vocab/type.test.d.ts +0 -3
- package/dist/vocab/type.test.js +0 -24
- package/dist/vocab/vocab.test.d.ts +0 -3
- package/dist/vocab/vocab.test.js +0 -9397
- package/dist/vocab-BCWe1Ih5.d.ts +0 -14905
- package/dist/vocab-CAwj263k.js +0 -255
- package/dist/vocab-CeDBzu-f.d.cts +0 -14903
- package/dist/vocab-DgHGCFcw.cjs +0 -291
- package/dist/webfinger/handler.test.d.ts +0 -3
- package/dist/webfinger/lookup.test.d.ts +0 -3
- package/dist/webfinger/lookup.test.js +0 -193
- package/dist/webfinger/mod.cjs +0 -8
- package/dist/webfinger/mod.d.cts +0 -2
- package/dist/webfinger/mod.d.ts +0 -4
- package/dist/webfinger/mod.js +0 -8
- package/dist/webfinger-C72Y8lrh.js +0 -4
- package/dist/webfinger-vAtLmxOF.cjs +0 -4
- /package/dist/{collection-BzWsN9pB.js → collection-CcnIw1qY.js} +0 -0
- /package/dist/{testing/docloader.test.d.ts → federation/webfinger.test.d.ts} +0 -0
- /package/dist/{mod-CVgZgliM.d.ts → mod-1E3W847c.d.ts} +0 -0
- /package/dist/{mod-B-hUPT2N.d.cts → mod-C81L6_lQ.d.cts} +0 -0
- /package/dist/{negotiation-C4nFufNk.js → negotiation-5NPJL6zp.js} +0 -0
- /package/dist/{nodeinfo-BnthBobC.js → nodeinfo-BlLsRSiT.js} +0 -0
- /package/dist/{nodeinfo-CdN0rEnZ.cjs → nodeinfo-DuMYTpbZ.cjs} +0 -0
- /package/dist/{vocab/actor.test.d.ts → otel/exporter.test.d.ts} +0 -0
- /package/dist/{retry-CfF8Gn4d.js → retry-D4GJ670a.js} +0 -0
- /package/dist/{sig-C34-oHBl.js → sig-CwuONEzF.js} +0 -0
- /package/dist/{sig-YYj5tCnr.cjs → sig-DeXX2xnj.cjs} +0 -0
- /package/dist/{utils-DyRU1gdZ.cjs → utils-Db0ZmjcD.cjs} +0 -0
- /package/dist/{utils-D-Va7aXC.js → utils-Wranxuoe.js} +0 -0
|
@@ -3,22 +3,21 @@
|
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
|
6
|
-
const require_transformers = require('./transformers-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const require_types = require('./types-CWgzGaqk.cjs');
|
|
12
|
-
const require_kv_cache = require('./kv-cache-5j5Pb-V6.cjs');
|
|
13
|
-
const require_vocab = require('./vocab-DgHGCFcw.cjs');
|
|
6
|
+
const require_transformers = require('./transformers-BjBg6Lag.cjs');
|
|
7
|
+
const require_http = require('./http-xz1rOLDK.cjs');
|
|
8
|
+
const require_proof = require('./proof-LJKB8sTg.cjs');
|
|
9
|
+
const require_types = require('./types-B6z6CqIz.cjs');
|
|
10
|
+
const require_kv_cache = require('./kv-cache-BCBmDkwr.cjs');
|
|
14
11
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
12
|
+
const __fedify_vocab = require_chunk.__toESM(require("@fedify/vocab"));
|
|
15
13
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
|
16
|
-
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
|
17
14
|
const es_toolkit = require_chunk.__toESM(require("es-toolkit"));
|
|
18
15
|
const uri_template_router = require_chunk.__toESM(require("uri-template-router"));
|
|
19
16
|
const url_template = require_chunk.__toESM(require("url-template"));
|
|
20
17
|
const byte_encodings_hex = require_chunk.__toESM(require("byte-encodings/hex"));
|
|
21
18
|
const __opentelemetry_semantic_conventions = require_chunk.__toESM(require("@opentelemetry/semantic-conventions"));
|
|
19
|
+
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
|
20
|
+
const __fedify_webfinger = require_chunk.__toESM(require("@fedify/webfinger"));
|
|
22
21
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
23
22
|
|
|
24
23
|
//#region src/federation/inbox.ts
|
|
@@ -42,7 +41,7 @@ var InboxListenerSet = class InboxListenerSet {
|
|
|
42
41
|
if (inboxListeners == null) return null;
|
|
43
42
|
while (true) {
|
|
44
43
|
if (inboxListeners.has(cls)) break;
|
|
45
|
-
if (cls ===
|
|
44
|
+
if (cls === __fedify_vocab.Activity) return null;
|
|
46
45
|
cls = globalThis.Object.getPrototypeOf(cls);
|
|
47
46
|
}
|
|
48
47
|
const listener = inboxListeners.get(cls);
|
|
@@ -63,7 +62,7 @@ async function routeActivity({ context: ctx, json, activity, recipient, inboxLis
|
|
|
63
62
|
]);
|
|
64
63
|
let cacheKey = null;
|
|
65
64
|
if (activity.id != null) {
|
|
66
|
-
const inboxContext = inboxContextFactory(recipient, json, activity.id?.href,
|
|
65
|
+
const inboxContext = inboxContextFactory(recipient, json, activity.id?.href, (0, __fedify_vocab.getTypeId)(activity).href);
|
|
67
66
|
const strategy = idempotencyStrategy ?? "per-inbox";
|
|
68
67
|
let keyString;
|
|
69
68
|
if (typeof strategy === "function") {
|
|
@@ -142,7 +141,7 @@ async function routeActivity({ context: ctx, json, activity, recipient, inboxLis
|
|
|
142
141
|
return "enqueued";
|
|
143
142
|
}
|
|
144
143
|
tracerProvider = tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
|
145
|
-
const tracer = tracerProvider.getTracer(
|
|
144
|
+
const tracer = tracerProvider.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
146
145
|
return await tracer.startActiveSpan("activitypub.dispatch_inbox_listener", { kind: __opentelemetry_api.SpanKind.INTERNAL }, async (span$1) => {
|
|
147
146
|
const dispatched = inboxListeners?.dispatchWithClass(activity);
|
|
148
147
|
if (dispatched == null) {
|
|
@@ -152,7 +151,7 @@ async function routeActivity({ context: ctx, json, activity, recipient, inboxLis
|
|
|
152
151
|
});
|
|
153
152
|
span$1.setStatus({
|
|
154
153
|
code: __opentelemetry_api.SpanStatusCode.UNSET,
|
|
155
|
-
message: `Unsupported activity type: ${
|
|
154
|
+
message: `Unsupported activity type: ${(0, __fedify_vocab.getTypeId)(activity).href}`
|
|
156
155
|
});
|
|
157
156
|
span$1.end();
|
|
158
157
|
return "unsupportedActivity";
|
|
@@ -160,7 +159,7 @@ async function routeActivity({ context: ctx, json, activity, recipient, inboxLis
|
|
|
160
159
|
const { class: cls, listener } = dispatched;
|
|
161
160
|
span$1.updateName(`activitypub.dispatch_inbox_listener ${cls.name}`);
|
|
162
161
|
try {
|
|
163
|
-
await listener(inboxContextFactory(recipient, json, activity?.id?.href,
|
|
162
|
+
await listener(inboxContextFactory(recipient, json, activity?.id?.href, (0, __fedify_vocab.getTypeId)(activity).href), activity);
|
|
164
163
|
} catch (error) {
|
|
165
164
|
try {
|
|
166
165
|
await inboxErrorHandler?.(ctx, error);
|
|
@@ -339,7 +338,7 @@ var FederationBuilderImpl = class {
|
|
|
339
338
|
this.collectionTypeIds = {};
|
|
340
339
|
}
|
|
341
340
|
async build(options) {
|
|
342
|
-
const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-
|
|
341
|
+
const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-CTmdJqh8.cjs"));
|
|
343
342
|
const f = new FederationImpl$1(options);
|
|
344
343
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
345
344
|
f.router = this.router.clone();
|
|
@@ -365,7 +364,7 @@ var FederationBuilderImpl = class {
|
|
|
365
364
|
return f;
|
|
366
365
|
}
|
|
367
366
|
_getTracer() {
|
|
368
|
-
return __opentelemetry_api.trace.getTracer(
|
|
367
|
+
return __opentelemetry_api.trace.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
369
368
|
}
|
|
370
369
|
setActorDispatcher(path, dispatcher) {
|
|
371
370
|
if (this.router.has("actor")) throw new RouterError("Actor dispatcher already set.");
|
|
@@ -385,7 +384,7 @@ var FederationBuilderImpl = class {
|
|
|
385
384
|
const actor$1 = await dispatcher(context$2, identifier);
|
|
386
385
|
span.setAttribute("activitypub.actor.id", (actor$1?.id ?? context$2.getActorUri(identifier)).href);
|
|
387
386
|
if (actor$1 == null) span.setStatus({ code: __opentelemetry_api.SpanStatusCode.ERROR });
|
|
388
|
-
else span.setAttribute("activitypub.actor.type",
|
|
387
|
+
else span.setAttribute("activitypub.actor.type", (0, __fedify_vocab.getTypeId)(actor$1).href);
|
|
389
388
|
return actor$1;
|
|
390
389
|
} catch (error) {
|
|
391
390
|
span.setStatus({
|
|
@@ -508,7 +507,7 @@ var FederationBuilderImpl = class {
|
|
|
508
507
|
const object = await dispatcher(ctx, values);
|
|
509
508
|
span.setAttribute("activitypub.object.id", (object?.id ?? ctx.getObjectUri(cls, values)).href);
|
|
510
509
|
if (object == null) span.setStatus({ code: __opentelemetry_api.SpanStatusCode.ERROR });
|
|
511
|
-
else span.setAttribute("activitypub.object.type",
|
|
510
|
+
else span.setAttribute("activitypub.object.type", (0, __fedify_vocab.getTypeId)(object).href);
|
|
512
511
|
return object;
|
|
513
512
|
} catch (e) {
|
|
514
513
|
span.setStatus({
|
|
@@ -923,10 +922,10 @@ var KvKeyCache = class {
|
|
|
923
922
|
const serialized = await this.kv.get([...this.prefix, keyId.href]);
|
|
924
923
|
if (serialized == null) return void 0;
|
|
925
924
|
try {
|
|
926
|
-
return await
|
|
925
|
+
return await __fedify_vocab.CryptographicKey.fromJsonLd(serialized, this.options);
|
|
927
926
|
} catch {
|
|
928
927
|
try {
|
|
929
|
-
return await
|
|
928
|
+
return await __fedify_vocab.Multikey.fromJsonLd(serialized, this.options);
|
|
930
929
|
} catch {
|
|
931
930
|
await this.kv.delete([...this.prefix, keyId.href]);
|
|
932
931
|
return void 0;
|
|
@@ -1112,7 +1111,7 @@ async function handleObject(request, { values, context: context$2, objectDispatc
|
|
|
1112
1111
|
async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$2, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound }) {
|
|
1113
1112
|
const spanName = name.trim().replace(/\s+/g, "_");
|
|
1114
1113
|
tracerProvider = tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
|
1115
|
-
const tracer = tracerProvider.getTracer(
|
|
1114
|
+
const tracer = tracerProvider.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
1116
1115
|
const url = new URL(request.url);
|
|
1117
1116
|
const cursor = url.searchParams.get("cursor");
|
|
1118
1117
|
if (collectionCallbacks == null) return await onNotFound(request);
|
|
@@ -1126,7 +1125,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
1126
1125
|
kind: __opentelemetry_api.SpanKind.SERVER,
|
|
1127
1126
|
attributes: {
|
|
1128
1127
|
"activitypub.collection.id": baseUri.href,
|
|
1129
|
-
"activitypub.collection.type":
|
|
1128
|
+
"activitypub.collection.type": __fedify_vocab.OrderedCollection.typeId.href
|
|
1130
1129
|
}
|
|
1131
1130
|
}, async (span) => {
|
|
1132
1131
|
if (totalItems != null) span.setAttribute("activitypub.collection.total_items", Number(totalItems));
|
|
@@ -1150,7 +1149,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
1150
1149
|
}
|
|
1151
1150
|
});
|
|
1152
1151
|
if (itemsOrResponse instanceof Response) return itemsOrResponse;
|
|
1153
|
-
collection = new
|
|
1152
|
+
collection = new __fedify_vocab.OrderedCollection({
|
|
1154
1153
|
id: baseUri,
|
|
1155
1154
|
totalItems: totalItems == null ? null : Number(totalItems),
|
|
1156
1155
|
items: filterCollectionItems(itemsOrResponse, name, filterPredicate)
|
|
@@ -1164,7 +1163,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
1164
1163
|
last = new URL(context$2.url);
|
|
1165
1164
|
last.searchParams.set("cursor", lastCursor);
|
|
1166
1165
|
}
|
|
1167
|
-
collection = new
|
|
1166
|
+
collection = new __fedify_vocab.OrderedCollection({
|
|
1168
1167
|
id: baseUri,
|
|
1169
1168
|
totalItems: totalItems == null ? null : Number(totalItems),
|
|
1170
1169
|
first,
|
|
@@ -1178,7 +1177,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
1178
1177
|
kind: __opentelemetry_api.SpanKind.SERVER,
|
|
1179
1178
|
attributes: {
|
|
1180
1179
|
"activitypub.collection.id": uri.href,
|
|
1181
|
-
"activitypub.collection.type":
|
|
1180
|
+
"activitypub.collection.type": __fedify_vocab.OrderedCollectionPage.typeId.href,
|
|
1182
1181
|
"fedify.collection.cursor": cursor
|
|
1183
1182
|
}
|
|
1184
1183
|
}, async (span) => {
|
|
@@ -1214,7 +1213,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
1214
1213
|
}
|
|
1215
1214
|
const partOf = new URL(context$2.url);
|
|
1216
1215
|
partOf.searchParams.delete("cursor");
|
|
1217
|
-
collection = new
|
|
1216
|
+
collection = new __fedify_vocab.OrderedCollectionPage({
|
|
1218
1217
|
id: uri,
|
|
1219
1218
|
prev,
|
|
1220
1219
|
next,
|
|
@@ -1262,7 +1261,7 @@ function filterCollectionItems(items, collectionName, filterPredicate) {
|
|
|
1262
1261
|
let logged = false;
|
|
1263
1262
|
for (const item of items) {
|
|
1264
1263
|
let mappedItem;
|
|
1265
|
-
if (item instanceof
|
|
1264
|
+
if (item instanceof __fedify_vocab.Object || item instanceof __fedify_vocab.Link || item instanceof URL) mappedItem = item;
|
|
1266
1265
|
else if (item.id == null) continue;
|
|
1267
1266
|
else mappedItem = item.id;
|
|
1268
1267
|
if (filterPredicate != null && !filterPredicate(item)) {
|
|
@@ -1289,7 +1288,7 @@ function filterCollectionItems(items, collectionName, filterPredicate) {
|
|
|
1289
1288
|
*/
|
|
1290
1289
|
async function handleInbox(request, options) {
|
|
1291
1290
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
|
1292
|
-
const tracer = tracerProvider.getTracer(
|
|
1291
|
+
const tracer = tracerProvider.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
1293
1292
|
return await tracer.startActiveSpan("activitypub.inbox", {
|
|
1294
1293
|
kind: options.queue == null ? __opentelemetry_api.SpanKind.SERVER : __opentelemetry_api.SpanKind.PRODUCER,
|
|
1295
1294
|
attributes: { "activitypub.shared_inbox": options.recipient == null }
|
|
@@ -1417,14 +1416,14 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
1417
1416
|
recipient,
|
|
1418
1417
|
json
|
|
1419
1418
|
});
|
|
1420
|
-
activity = await
|
|
1419
|
+
activity = await __fedify_vocab.Activity.fromJsonLd(jsonWithoutSig, ctx);
|
|
1421
1420
|
} else {
|
|
1422
1421
|
logger$1.debug("Linked Data Signatures are not verified.", {
|
|
1423
1422
|
recipient,
|
|
1424
1423
|
json
|
|
1425
1424
|
});
|
|
1426
1425
|
try {
|
|
1427
|
-
activity = await require_proof.verifyObject(
|
|
1426
|
+
activity = await require_proof.verifyObject(__fedify_vocab.Activity, jsonWithoutSig, {
|
|
1428
1427
|
contextLoader: ctx.contextLoader,
|
|
1429
1428
|
documentLoader: ctx.documentLoader,
|
|
1430
1429
|
keyCache,
|
|
@@ -1487,10 +1486,17 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
1487
1486
|
} else logger$1.debug("HTTP Signatures are verified.", { recipient });
|
|
1488
1487
|
httpSigKey = key;
|
|
1489
1488
|
}
|
|
1490
|
-
activity = await
|
|
1489
|
+
activity = await __fedify_vocab.Activity.fromJsonLd(jsonWithoutSig, ctx);
|
|
1491
1490
|
}
|
|
1492
1491
|
if (activity.id != null) span.setAttribute("activitypub.activity.id", activity.id.href);
|
|
1493
|
-
span.setAttribute("activitypub.activity.type",
|
|
1492
|
+
span.setAttribute("activitypub.activity.type", (0, __fedify_vocab.getTypeId)(activity).href);
|
|
1493
|
+
span.addEvent("activitypub.activity.received", {
|
|
1494
|
+
"activitypub.activity.json": JSON.stringify(json),
|
|
1495
|
+
"activitypub.activity.verified": activity != null,
|
|
1496
|
+
"ld_signatures.verified": ldSigVerified,
|
|
1497
|
+
"http_signatures.verified": httpSigKey != null,
|
|
1498
|
+
"http_signatures.key_id": httpSigKey?.id?.href ?? ""
|
|
1499
|
+
});
|
|
1494
1500
|
if (httpSigKey != null && !await require_proof.doesActorOwnKey(activity, httpSigKey, ctx)) {
|
|
1495
1501
|
logger$1.error("The signer ({keyId}) and the actor ({actorId}) do not match.", {
|
|
1496
1502
|
activity: json,
|
|
@@ -1563,7 +1569,7 @@ async function _handleCustomCollection(request, { name, values, context: context
|
|
|
1563
1569
|
verifyDefined(callbacks);
|
|
1564
1570
|
await authIfNeeded(context$2, values, callbacks);
|
|
1565
1571
|
const cursor = new URL(request.url).searchParams.get("cursor");
|
|
1566
|
-
return await new CustomCollectionHandler(name, values, context$2, callbacks, tracerProvider,
|
|
1572
|
+
return await new CustomCollectionHandler(name, values, context$2, callbacks, tracerProvider, __fedify_vocab.Collection, __fedify_vocab.CollectionPage, filterPredicate).fetchCollection(cursor).toJsonLd().then(respondAsActivity);
|
|
1567
1573
|
}
|
|
1568
1574
|
/**
|
|
1569
1575
|
* Handles an ordered collection request.
|
|
@@ -1581,7 +1587,7 @@ async function _handleOrderedCollection(request, { name, values, context: contex
|
|
|
1581
1587
|
verifyDefined(callbacks);
|
|
1582
1588
|
await authIfNeeded(context$2, values, callbacks);
|
|
1583
1589
|
const cursor = new URL(request.url).searchParams.get("cursor");
|
|
1584
|
-
return await new CustomCollectionHandler(name, values, context$2, callbacks, tracerProvider,
|
|
1590
|
+
return await new CustomCollectionHandler(name, values, context$2, callbacks, tracerProvider, __fedify_vocab.OrderedCollection, __fedify_vocab.OrderedCollectionPage, filterPredicate).fetchCollection(cursor).toJsonLd().then(respondAsActivity);
|
|
1585
1591
|
}
|
|
1586
1592
|
/**
|
|
1587
1593
|
* Handling custom collections with support for pagination and filtering.
|
|
@@ -1641,7 +1647,7 @@ var CustomCollectionHandler = class {
|
|
|
1641
1647
|
this.CollectionPage = CollectionPage$1;
|
|
1642
1648
|
this.filterPredicate = filterPredicate;
|
|
1643
1649
|
this.name = this.name.trim().replace(/\s+/g, "_");
|
|
1644
|
-
this.#tracer = this.tracerProvider.getTracer(
|
|
1650
|
+
this.#tracer = this.tracerProvider.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
1645
1651
|
this.#id = new URL(this.context.url);
|
|
1646
1652
|
this.#dispatcher = callbacks.dispatcher.bind(callbacks);
|
|
1647
1653
|
}
|
|
@@ -2031,139 +2037,6 @@ function handleNodeInfoJrd(_request, context$2) {
|
|
|
2031
2037
|
return Promise.resolve(response);
|
|
2032
2038
|
}
|
|
2033
2039
|
|
|
2034
|
-
//#endregion
|
|
2035
|
-
//#region src/webfinger/handler.ts
|
|
2036
|
-
const logger = (0, __logtape_logtape.getLogger)([
|
|
2037
|
-
"fedify",
|
|
2038
|
-
"webfinger",
|
|
2039
|
-
"server"
|
|
2040
|
-
]);
|
|
2041
|
-
/**
|
|
2042
|
-
* Handles a WebFinger request. You would not typically call this function
|
|
2043
|
-
* directly, but instead use {@link Federation.fetch} method.
|
|
2044
|
-
* @param request The WebFinger request to handle.
|
|
2045
|
-
* @param parameters The parameters for handling the request.
|
|
2046
|
-
* @returns The response to the request.
|
|
2047
|
-
*/
|
|
2048
|
-
async function handleWebFinger(request, options) {
|
|
2049
|
-
if (options.tracer == null) return await handleWebFingerInternal(request, options);
|
|
2050
|
-
return await options.tracer.startActiveSpan("webfinger.handle", { kind: __opentelemetry_api.SpanKind.SERVER }, async (span) => {
|
|
2051
|
-
try {
|
|
2052
|
-
const response = await handleWebFingerInternal(request, options);
|
|
2053
|
-
span.setStatus({ code: response.ok ? __opentelemetry_api.SpanStatusCode.UNSET : __opentelemetry_api.SpanStatusCode.ERROR });
|
|
2054
|
-
return response;
|
|
2055
|
-
} catch (error) {
|
|
2056
|
-
span.setStatus({
|
|
2057
|
-
code: __opentelemetry_api.SpanStatusCode.ERROR,
|
|
2058
|
-
message: String(error)
|
|
2059
|
-
});
|
|
2060
|
-
throw error;
|
|
2061
|
-
} finally {
|
|
2062
|
-
span.end();
|
|
2063
|
-
}
|
|
2064
|
-
});
|
|
2065
|
-
}
|
|
2066
|
-
async function handleWebFingerInternal(request, { context: context$2, host, actorDispatcher, actorHandleMapper, actorAliasMapper, onNotFound, span, webFingerLinksDispatcher }) {
|
|
2067
|
-
if (actorDispatcher == null) {
|
|
2068
|
-
logger.error("Actor dispatcher is not set.");
|
|
2069
|
-
return await onNotFound(request);
|
|
2070
|
-
}
|
|
2071
|
-
const resource = context$2.url.searchParams.get("resource");
|
|
2072
|
-
if (resource == null) return new Response("Missing resource parameter.", { status: 400 });
|
|
2073
|
-
span?.setAttribute("webfinger.resource", resource);
|
|
2074
|
-
let resourceUrl;
|
|
2075
|
-
try {
|
|
2076
|
-
resourceUrl = new URL(resource);
|
|
2077
|
-
} catch (e) {
|
|
2078
|
-
if (e instanceof TypeError) return new Response("Invalid resource URL.", { status: 400 });
|
|
2079
|
-
throw e;
|
|
2080
|
-
}
|
|
2081
|
-
span?.setAttribute("webfinger.resource.scheme", resourceUrl.protocol.replace(/:$/, ""));
|
|
2082
|
-
async function mapUsernameToIdentifier(username) {
|
|
2083
|
-
if (actorHandleMapper == null) {
|
|
2084
|
-
logger.error("No actor handle mapper is set; use the WebFinger username {username} as the actor's internal identifier.", { username });
|
|
2085
|
-
return username;
|
|
2086
|
-
}
|
|
2087
|
-
const identifier$1 = await actorHandleMapper(context$2, username);
|
|
2088
|
-
if (identifier$1 == null) {
|
|
2089
|
-
logger.error("Actor {username} not found.", { username });
|
|
2090
|
-
return null;
|
|
2091
|
-
}
|
|
2092
|
-
return identifier$1;
|
|
2093
|
-
}
|
|
2094
|
-
let identifier = null;
|
|
2095
|
-
const uriParsed = context$2.parseUri(resourceUrl);
|
|
2096
|
-
if (uriParsed?.type != "actor") {
|
|
2097
|
-
const match = /^acct:([^@]+)@([^@]+)$/.exec(resource);
|
|
2098
|
-
if (match == null) {
|
|
2099
|
-
const result = await actorAliasMapper?.(context$2, resourceUrl);
|
|
2100
|
-
if (result == null) return await onNotFound(request);
|
|
2101
|
-
if ("identifier" in result) identifier = result.identifier;
|
|
2102
|
-
else identifier = await mapUsernameToIdentifier(result.username);
|
|
2103
|
-
} else {
|
|
2104
|
-
const portMatch = /:\d+$/.exec(match[2]);
|
|
2105
|
-
const normalizedHost = portMatch == null ? (0, node_url.domainToASCII)(match[2].toLowerCase()) : (0, node_url.domainToASCII)(match[2].substring(0, portMatch.index).toLowerCase()) + portMatch[0];
|
|
2106
|
-
if (normalizedHost != context$2.url.host && normalizedHost != host) return await onNotFound(request);
|
|
2107
|
-
else {
|
|
2108
|
-
identifier = await mapUsernameToIdentifier(match[1]);
|
|
2109
|
-
resourceUrl = new URL(`acct:${match[1]}@${normalizedHost}`);
|
|
2110
|
-
}
|
|
2111
|
-
}
|
|
2112
|
-
} else identifier = uriParsed.identifier;
|
|
2113
|
-
if (identifier == null) return await onNotFound(request);
|
|
2114
|
-
const actor = await actorDispatcher(context$2, identifier);
|
|
2115
|
-
if (actor == null) {
|
|
2116
|
-
logger.error("Actor {identifier} not found.", { identifier });
|
|
2117
|
-
return await onNotFound(request);
|
|
2118
|
-
}
|
|
2119
|
-
const links = [{
|
|
2120
|
-
rel: "self",
|
|
2121
|
-
href: context$2.getActorUri(identifier).href,
|
|
2122
|
-
type: "application/activity+json"
|
|
2123
|
-
}];
|
|
2124
|
-
for (const url of actor.urls) if (url instanceof require_actor.Link && url.href != null) links.push({
|
|
2125
|
-
rel: url.rel ?? "http://webfinger.net/rel/profile-page",
|
|
2126
|
-
href: url.href.href,
|
|
2127
|
-
type: url.mediaType == null ? void 0 : url.mediaType
|
|
2128
|
-
});
|
|
2129
|
-
else if (url instanceof URL) links.push({
|
|
2130
|
-
rel: "http://webfinger.net/rel/profile-page",
|
|
2131
|
-
href: url.href
|
|
2132
|
-
});
|
|
2133
|
-
for await (const image of actor.getIcons()) {
|
|
2134
|
-
if (image.url?.href == null) continue;
|
|
2135
|
-
const link = {
|
|
2136
|
-
rel: "http://webfinger.net/rel/avatar",
|
|
2137
|
-
href: image.url.href.toString()
|
|
2138
|
-
};
|
|
2139
|
-
if (image.mediaType != null) link.type = image.mediaType;
|
|
2140
|
-
links.push(link);
|
|
2141
|
-
}
|
|
2142
|
-
if (webFingerLinksDispatcher != null) {
|
|
2143
|
-
const customLinks = await webFingerLinksDispatcher(context$2, resourceUrl);
|
|
2144
|
-
if (customLinks != null) for (const link of customLinks) links.push(link);
|
|
2145
|
-
}
|
|
2146
|
-
const aliases = [];
|
|
2147
|
-
if (resourceUrl.protocol != "acct:" && actor.preferredUsername != null) {
|
|
2148
|
-
aliases.push(`acct:${actor.preferredUsername}@${host ?? context$2.url.host}`);
|
|
2149
|
-
if (host != null && host !== context$2.url.host) aliases.push(`acct:${actor.preferredUsername}@${context$2.url.host}`);
|
|
2150
|
-
}
|
|
2151
|
-
if (resourceUrl.href !== context$2.getActorUri(identifier).href) aliases.push(context$2.getActorUri(identifier).href);
|
|
2152
|
-
if (resourceUrl.protocol === "acct:" && host != null && host !== context$2.url.host && !resourceUrl.href.endsWith(`@${host}`)) {
|
|
2153
|
-
const username = resourceUrl.href.replace(/^acct:/, "").replace(/@.*$/, "");
|
|
2154
|
-
aliases.push(`acct:${username}@${host}`);
|
|
2155
|
-
}
|
|
2156
|
-
const jrd = {
|
|
2157
|
-
subject: resourceUrl.href,
|
|
2158
|
-
aliases,
|
|
2159
|
-
links
|
|
2160
|
-
};
|
|
2161
|
-
return new Response(JSON.stringify(jrd), { headers: {
|
|
2162
|
-
"Content-Type": "application/jrd+json",
|
|
2163
|
-
"Access-Control-Allow-Origin": "*"
|
|
2164
|
-
} });
|
|
2165
|
-
}
|
|
2166
|
-
|
|
2167
2040
|
//#endregion
|
|
2168
2041
|
//#region src/federation/retry.ts
|
|
2169
2042
|
/**
|
|
@@ -2232,7 +2105,7 @@ function extractInboxes({ recipients, preferSharedInbox, excludeBaseUris }) {
|
|
|
2232
2105
|
*/
|
|
2233
2106
|
function sendActivity(options) {
|
|
2234
2107
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
|
2235
|
-
const tracer = tracerProvider.getTracer(
|
|
2108
|
+
const tracer = tracerProvider.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
2236
2109
|
return tracer.startActiveSpan("activitypub.send_activity", {
|
|
2237
2110
|
kind: __opentelemetry_api.SpanKind.CLIENT,
|
|
2238
2111
|
attributes: { "activitypub.shared_inbox": options.sharedInbox ?? false }
|
|
@@ -2243,7 +2116,7 @@ function sendActivity(options) {
|
|
|
2243
2116
|
await sendActivityInternal({
|
|
2244
2117
|
...options,
|
|
2245
2118
|
tracerProvider
|
|
2246
|
-
});
|
|
2119
|
+
}, span);
|
|
2247
2120
|
} catch (e) {
|
|
2248
2121
|
span.setStatus({
|
|
2249
2122
|
code: __opentelemetry_api.SpanStatusCode.ERROR,
|
|
@@ -2255,7 +2128,7 @@ function sendActivity(options) {
|
|
|
2255
2128
|
}
|
|
2256
2129
|
});
|
|
2257
2130
|
}
|
|
2258
|
-
async function sendActivityInternal({ activity, activityId, keys, inbox, headers, specDeterminer, tracerProvider }) {
|
|
2131
|
+
async function sendActivityInternal({ activity, activityId, keys, inbox, headers, specDeterminer, tracerProvider }, span) {
|
|
2259
2132
|
const logger$1 = (0, __logtape_logtape.getLogger)([
|
|
2260
2133
|
"fedify",
|
|
2261
2134
|
"federation",
|
|
@@ -2310,6 +2183,143 @@ async function sendActivityInternal({ activity, activityId, keys, inbox, headers
|
|
|
2310
2183
|
});
|
|
2311
2184
|
throw new Error(`Failed to send activity ${activityId} to ${inbox.href} (${response.status} ${response.statusText}):\n${error}`);
|
|
2312
2185
|
}
|
|
2186
|
+
span.addEvent("activitypub.activity.sent", {
|
|
2187
|
+
"activitypub.activity.json": JSON.stringify(activity),
|
|
2188
|
+
"activitypub.inbox.url": inbox.href,
|
|
2189
|
+
"activitypub.activity.id": activityId ?? ""
|
|
2190
|
+
});
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
//#endregion
|
|
2194
|
+
//#region src/federation/webfinger.ts
|
|
2195
|
+
const logger = (0, __logtape_logtape.getLogger)([
|
|
2196
|
+
"fedify",
|
|
2197
|
+
"webfinger",
|
|
2198
|
+
"server"
|
|
2199
|
+
]);
|
|
2200
|
+
/**
|
|
2201
|
+
* Handles a WebFinger request. You would not typically call this function
|
|
2202
|
+
* directly, but instead use {@link Federation.fetch} method.
|
|
2203
|
+
* @param request The WebFinger request to handle.
|
|
2204
|
+
* @param parameters The parameters for handling the request.
|
|
2205
|
+
* @returns The response to the request.
|
|
2206
|
+
*/
|
|
2207
|
+
async function handleWebFinger(request, options) {
|
|
2208
|
+
if (options.tracer == null) return await handleWebFingerInternal(request, options);
|
|
2209
|
+
return await options.tracer.startActiveSpan("webfinger.handle", { kind: __opentelemetry_api.SpanKind.SERVER }, async (span) => {
|
|
2210
|
+
try {
|
|
2211
|
+
const response = await handleWebFingerInternal(request, options);
|
|
2212
|
+
span.setStatus({ code: response.ok ? __opentelemetry_api.SpanStatusCode.UNSET : __opentelemetry_api.SpanStatusCode.ERROR });
|
|
2213
|
+
return response;
|
|
2214
|
+
} catch (error) {
|
|
2215
|
+
span.setStatus({
|
|
2216
|
+
code: __opentelemetry_api.SpanStatusCode.ERROR,
|
|
2217
|
+
message: String(error)
|
|
2218
|
+
});
|
|
2219
|
+
throw error;
|
|
2220
|
+
} finally {
|
|
2221
|
+
span.end();
|
|
2222
|
+
}
|
|
2223
|
+
});
|
|
2224
|
+
}
|
|
2225
|
+
async function handleWebFingerInternal(request, { context: context$2, host, actorDispatcher, actorHandleMapper, actorAliasMapper, onNotFound, span, webFingerLinksDispatcher }) {
|
|
2226
|
+
if (actorDispatcher == null) {
|
|
2227
|
+
logger.error("Actor dispatcher is not set.");
|
|
2228
|
+
return await onNotFound(request);
|
|
2229
|
+
}
|
|
2230
|
+
const resource = context$2.url.searchParams.get("resource");
|
|
2231
|
+
if (resource == null) return new Response("Missing resource parameter.", { status: 400 });
|
|
2232
|
+
span?.setAttribute("webfinger.resource", resource);
|
|
2233
|
+
let resourceUrl;
|
|
2234
|
+
try {
|
|
2235
|
+
resourceUrl = new URL(resource);
|
|
2236
|
+
} catch (e) {
|
|
2237
|
+
if (e instanceof TypeError) return new Response("Invalid resource URL.", { status: 400 });
|
|
2238
|
+
throw e;
|
|
2239
|
+
}
|
|
2240
|
+
span?.setAttribute("webfinger.resource.scheme", resourceUrl.protocol.replace(/:$/, ""));
|
|
2241
|
+
async function mapUsernameToIdentifier(username) {
|
|
2242
|
+
if (actorHandleMapper == null) {
|
|
2243
|
+
logger.error("No actor handle mapper is set; use the WebFinger username {username} as the actor's internal identifier.", { username });
|
|
2244
|
+
return username;
|
|
2245
|
+
}
|
|
2246
|
+
const identifier$1 = await actorHandleMapper(context$2, username);
|
|
2247
|
+
if (identifier$1 == null) {
|
|
2248
|
+
logger.error("Actor {username} not found.", { username });
|
|
2249
|
+
return null;
|
|
2250
|
+
}
|
|
2251
|
+
return identifier$1;
|
|
2252
|
+
}
|
|
2253
|
+
let identifier = null;
|
|
2254
|
+
const uriParsed = context$2.parseUri(resourceUrl);
|
|
2255
|
+
if (uriParsed?.type != "actor") {
|
|
2256
|
+
const match = /^acct:([^@]+)@([^@]+)$/.exec(resource);
|
|
2257
|
+
if (match == null) {
|
|
2258
|
+
const result = await actorAliasMapper?.(context$2, resourceUrl);
|
|
2259
|
+
if (result == null) return await onNotFound(request);
|
|
2260
|
+
if ("identifier" in result) identifier = result.identifier;
|
|
2261
|
+
else identifier = await mapUsernameToIdentifier(result.username);
|
|
2262
|
+
} else {
|
|
2263
|
+
const portMatch = /:\d+$/.exec(match[2]);
|
|
2264
|
+
const normalizedHost = portMatch == null ? (0, node_url.domainToASCII)(match[2].toLowerCase()) : (0, node_url.domainToASCII)(match[2].substring(0, portMatch.index).toLowerCase()) + portMatch[0];
|
|
2265
|
+
if (normalizedHost != context$2.url.host && normalizedHost != host) return await onNotFound(request);
|
|
2266
|
+
else {
|
|
2267
|
+
identifier = await mapUsernameToIdentifier(match[1]);
|
|
2268
|
+
resourceUrl = new URL(`acct:${match[1]}@${normalizedHost}`);
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
} else identifier = uriParsed.identifier;
|
|
2272
|
+
if (identifier == null) return await onNotFound(request);
|
|
2273
|
+
const actor = await actorDispatcher(context$2, identifier);
|
|
2274
|
+
if (actor == null) {
|
|
2275
|
+
logger.error("Actor {identifier} not found.", { identifier });
|
|
2276
|
+
return await onNotFound(request);
|
|
2277
|
+
}
|
|
2278
|
+
const links = [{
|
|
2279
|
+
rel: "self",
|
|
2280
|
+
href: context$2.getActorUri(identifier).href,
|
|
2281
|
+
type: "application/activity+json"
|
|
2282
|
+
}];
|
|
2283
|
+
for (const url of actor.urls) if (url instanceof __fedify_vocab.Link && url.href != null) links.push({
|
|
2284
|
+
rel: url.rel ?? "http://webfinger.net/rel/profile-page",
|
|
2285
|
+
href: url.href.href,
|
|
2286
|
+
type: url.mediaType == null ? void 0 : url.mediaType
|
|
2287
|
+
});
|
|
2288
|
+
else if (url instanceof URL) links.push({
|
|
2289
|
+
rel: "http://webfinger.net/rel/profile-page",
|
|
2290
|
+
href: url.href
|
|
2291
|
+
});
|
|
2292
|
+
for await (const image of actor.getIcons()) {
|
|
2293
|
+
if (image.url?.href == null) continue;
|
|
2294
|
+
links.push({
|
|
2295
|
+
rel: "http://webfinger.net/rel/avatar",
|
|
2296
|
+
href: image.url.href.toString(),
|
|
2297
|
+
...image.mediaType != null && { type: image.mediaType }
|
|
2298
|
+
});
|
|
2299
|
+
}
|
|
2300
|
+
if (webFingerLinksDispatcher != null) {
|
|
2301
|
+
const customLinks = await webFingerLinksDispatcher(context$2, resourceUrl);
|
|
2302
|
+
if (customLinks != null) for (const link of customLinks) links.push(link);
|
|
2303
|
+
}
|
|
2304
|
+
const aliases = [];
|
|
2305
|
+
if (resourceUrl.protocol != "acct:" && actor.preferredUsername != null) {
|
|
2306
|
+
aliases.push(`acct:${actor.preferredUsername}@${host ?? context$2.url.host}`);
|
|
2307
|
+
if (host != null && host !== context$2.url.host) aliases.push(`acct:${actor.preferredUsername}@${context$2.url.host}`);
|
|
2308
|
+
}
|
|
2309
|
+
if (resourceUrl.href !== context$2.getActorUri(identifier).href) aliases.push(context$2.getActorUri(identifier).href);
|
|
2310
|
+
if (resourceUrl.protocol === "acct:" && host != null && host !== context$2.url.host && !resourceUrl.href.endsWith(`@${host}`)) {
|
|
2311
|
+
const username = resourceUrl.href.replace(/^acct:/, "").replace(/@.*$/, "");
|
|
2312
|
+
aliases.push(`acct:${username}@${host}`);
|
|
2313
|
+
}
|
|
2314
|
+
const jrd = {
|
|
2315
|
+
subject: resourceUrl.href,
|
|
2316
|
+
aliases,
|
|
2317
|
+
links
|
|
2318
|
+
};
|
|
2319
|
+
return new Response(JSON.stringify(jrd), { headers: {
|
|
2320
|
+
"Content-Type": "application/jrd+json",
|
|
2321
|
+
"Access-Control-Allow-Origin": "*"
|
|
2322
|
+
} });
|
|
2313
2323
|
}
|
|
2314
2324
|
|
|
2315
2325
|
//#endregion
|
|
@@ -2434,7 +2444,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2434
2444
|
this.router.add("/.well-known/nodeinfo", "nodeInfoJrd");
|
|
2435
2445
|
}
|
|
2436
2446
|
_getTracer() {
|
|
2437
|
-
return this.tracerProvider.getTracer(
|
|
2447
|
+
return this.tracerProvider.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
2438
2448
|
}
|
|
2439
2449
|
async _startQueueInternal(ctxData, signal, queue) {
|
|
2440
2450
|
if (this.inboxQueue == null && this.outboxQueue == null) return;
|
|
@@ -2534,7 +2544,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2534
2544
|
keyId: new URL(keyId),
|
|
2535
2545
|
privateKey: await require_http.importJwk(privateKey, "private")
|
|
2536
2546
|
})));
|
|
2537
|
-
const activity = await
|
|
2547
|
+
const activity = await __fedify_vocab.Activity.fromJsonLd(message.activity, {
|
|
2538
2548
|
contextLoader: this.contextLoaderFactory({
|
|
2539
2549
|
allowPrivateAddress: this.allowPrivateAddress,
|
|
2540
2550
|
userAgent: this.userAgent
|
|
@@ -2596,7 +2606,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2596
2606
|
message: String(error)
|
|
2597
2607
|
});
|
|
2598
2608
|
const loaderOptions = this.#getLoaderOptions(message.baseUrl);
|
|
2599
|
-
const activity = await
|
|
2609
|
+
const activity = await __fedify_vocab.Activity.fromJsonLd(message.activity, {
|
|
2600
2610
|
contextLoader: this.contextLoaderFactory(loaderOptions),
|
|
2601
2611
|
documentLoader: rsaKeyPair == null ? this.documentLoaderFactory(loaderOptions) : this.authenticatedDocumentLoaderFactory(rsaKeyPair, loaderOptions),
|
|
2602
2612
|
tracerProvider: this.tracerProvider
|
|
@@ -2650,8 +2660,8 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2650
2660
|
const identity = await this.sharedInboxKeyDispatcher(context$2);
|
|
2651
2661
|
if (identity != null) context$2 = this.#createContext(baseUrl, ctxData, { documentLoader: "identifier" in identity || "username" in identity || "handle" in identity ? await context$2.getDocumentLoader(identity) : context$2.getDocumentLoader(identity) });
|
|
2652
2662
|
}
|
|
2653
|
-
const activity = await
|
|
2654
|
-
span.setAttribute("activitypub.activity.type",
|
|
2663
|
+
const activity = await __fedify_vocab.Activity.fromJsonLd(message.activity, context$2);
|
|
2664
|
+
span.setAttribute("activitypub.activity.type", (0, __fedify_vocab.getTypeId)(activity).href);
|
|
2655
2665
|
if (activity.id != null) span.setAttribute("activitypub.activity.id", activity.id.href);
|
|
2656
2666
|
const cacheKey = activity.id == null ? null : [
|
|
2657
2667
|
...this.kvPrefixes.activityIdempotence,
|
|
@@ -2680,7 +2690,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2680
2690
|
});
|
|
2681
2691
|
span$1.setStatus({
|
|
2682
2692
|
code: __opentelemetry_api.SpanStatusCode.ERROR,
|
|
2683
|
-
message: `Unsupported activity type: ${
|
|
2693
|
+
message: `Unsupported activity type: ${(0, __fedify_vocab.getTypeId)(activity).href}`
|
|
2684
2694
|
});
|
|
2685
2695
|
span$1.end();
|
|
2686
2696
|
return;
|
|
@@ -2688,7 +2698,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2688
2698
|
const { class: cls, listener } = dispatched;
|
|
2689
2699
|
span$1.updateName(`activitypub.dispatch_inbox_listener ${cls.name}`);
|
|
2690
2700
|
try {
|
|
2691
|
-
await listener(context$2.toInboxContext(message.identifier, message.activity, activity.id?.href,
|
|
2701
|
+
await listener(context$2.toInboxContext(message.identifier, message.activity, activity.id?.href, (0, __fedify_vocab.getTypeId)(activity).href), activity);
|
|
2692
2702
|
} catch (error) {
|
|
2693
2703
|
try {
|
|
2694
2704
|
await this.inboxErrorHandler?.(context$2, error);
|
|
@@ -2860,7 +2870,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2860
2870
|
keys,
|
|
2861
2871
|
activity: jsonLd,
|
|
2862
2872
|
activityId: activity.id?.href,
|
|
2863
|
-
activityType:
|
|
2873
|
+
activityType: (0, __fedify_vocab.getTypeId)(activity).href,
|
|
2864
2874
|
inbox: new URL(inbox),
|
|
2865
2875
|
sharedInbox: inboxes[inbox].sharedInbox,
|
|
2866
2876
|
headers: collectionSync == null ? void 0 : new Headers({ "Collection-Synchronization": await buildCollectionSynchronizationHeader(collectionSync, inboxes[inbox].actorIds) }),
|
|
@@ -2894,7 +2904,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2894
2904
|
keys: keyJwkPairs,
|
|
2895
2905
|
activity: jsonLd,
|
|
2896
2906
|
activityId: activity.id?.href,
|
|
2897
|
-
activityType:
|
|
2907
|
+
activityType: (0, __fedify_vocab.getTypeId)(activity).href,
|
|
2898
2908
|
inbox,
|
|
2899
2909
|
sharedInbox: inboxes[inbox].sharedInbox,
|
|
2900
2910
|
started: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -3449,12 +3459,12 @@ var ContextImpl = class ContextImpl {
|
|
|
3449
3459
|
for (const keyPair of keyPairs) {
|
|
3450
3460
|
const newPair = {
|
|
3451
3461
|
...keyPair,
|
|
3452
|
-
cryptographicKey: new
|
|
3462
|
+
cryptographicKey: new __fedify_vocab.CryptographicKey({
|
|
3453
3463
|
id: keyPair.keyId,
|
|
3454
3464
|
owner,
|
|
3455
3465
|
publicKey: keyPair.publicKey
|
|
3456
3466
|
}),
|
|
3457
|
-
multikey: new
|
|
3467
|
+
multikey: new __fedify_vocab.Multikey({
|
|
3458
3468
|
id: keyPair.keyId,
|
|
3459
3469
|
controller: owner,
|
|
3460
3470
|
publicKey: keyPair.publicKey
|
|
@@ -3540,7 +3550,7 @@ var ContextImpl = class ContextImpl {
|
|
|
3540
3550
|
return this.federation.authenticatedDocumentLoaderFactory(identity);
|
|
3541
3551
|
}
|
|
3542
3552
|
lookupObject(identifier, options = {}) {
|
|
3543
|
-
return
|
|
3553
|
+
return (0, __fedify_vocab.lookupObject)(identifier, {
|
|
3544
3554
|
...options,
|
|
3545
3555
|
documentLoader: options.documentLoader ?? this.documentLoader,
|
|
3546
3556
|
contextLoader: options.contextLoader ?? this.contextLoader,
|
|
@@ -3550,7 +3560,7 @@ var ContextImpl = class ContextImpl {
|
|
|
3550
3560
|
});
|
|
3551
3561
|
}
|
|
3552
3562
|
traverseCollection(collection, options = {}) {
|
|
3553
|
-
return
|
|
3563
|
+
return (0, __fedify_vocab.traverseCollection)(collection, {
|
|
3554
3564
|
...options,
|
|
3555
3565
|
documentLoader: options.documentLoader ?? this.documentLoader,
|
|
3556
3566
|
contextLoader: options.contextLoader ?? this.contextLoader
|
|
@@ -3568,7 +3578,7 @@ var ContextImpl = class ContextImpl {
|
|
|
3568
3578
|
});
|
|
3569
3579
|
}
|
|
3570
3580
|
lookupWebFinger(resource, options = {}) {
|
|
3571
|
-
return
|
|
3581
|
+
return (0, __fedify_webfinger.lookupWebFinger)(resource, {
|
|
3572
3582
|
...options,
|
|
3573
3583
|
userAgent: options.userAgent ?? this.federation.userAgent,
|
|
3574
3584
|
tracerProvider: options.tracerProvider ?? this.tracerProvider,
|
|
@@ -3576,11 +3586,11 @@ var ContextImpl = class ContextImpl {
|
|
|
3576
3586
|
});
|
|
3577
3587
|
}
|
|
3578
3588
|
sendActivity(sender, recipients, activity, options = {}) {
|
|
3579
|
-
const tracer = this.tracerProvider.getTracer(
|
|
3589
|
+
const tracer = this.tracerProvider.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
3580
3590
|
return tracer.startActiveSpan(this.federation.outboxQueue == null || options.immediate ? "activitypub.outbox" : "activitypub.fanout", {
|
|
3581
3591
|
kind: this.federation.outboxQueue == null || options.immediate ? __opentelemetry_api.SpanKind.CLIENT : __opentelemetry_api.SpanKind.PRODUCER,
|
|
3582
3592
|
attributes: {
|
|
3583
|
-
"activitypub.activity.type":
|
|
3593
|
+
"activitypub.activity.type": (0, __fedify_vocab.getTypeId)(activity).href,
|
|
3584
3594
|
"activitypub.activity.to": activity.toIds.map((to) => to.href),
|
|
3585
3595
|
"activitypub.activity.cc": activity.toIds.map((cc) => cc.href),
|
|
3586
3596
|
"activitypub.activity.bto": activity.btoIds.map((bto) => bto.href),
|
|
@@ -3692,7 +3702,7 @@ var ContextImpl = class ContextImpl {
|
|
|
3692
3702
|
contextLoader: this.contextLoader
|
|
3693
3703
|
}),
|
|
3694
3704
|
activityId: activity.id?.href,
|
|
3695
|
-
activityType:
|
|
3705
|
+
activityType: (0, __fedify_vocab.getTypeId)(activity).href,
|
|
3696
3706
|
collectionSync: opts.collectionSync,
|
|
3697
3707
|
traceContext: carrier
|
|
3698
3708
|
};
|
|
@@ -3722,10 +3732,10 @@ var ContextImpl = class ContextImpl {
|
|
|
3722
3732
|
}
|
|
3723
3733
|
routeActivity(recipient, activity, options = {}) {
|
|
3724
3734
|
const tracerProvider = this.tracerProvider ?? this.tracerProvider;
|
|
3725
|
-
const tracer = tracerProvider.getTracer(
|
|
3735
|
+
const tracer = tracerProvider.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
3726
3736
|
return tracer.startActiveSpan("activitypub.inbox", {
|
|
3727
3737
|
kind: this.federation.inboxQueue == null || options.immediate ? __opentelemetry_api.SpanKind.INTERNAL : __opentelemetry_api.SpanKind.PRODUCER,
|
|
3728
|
-
attributes: { "activitypub.activity.type":
|
|
3738
|
+
attributes: { "activitypub.activity.type": (0, __fedify_vocab.getTypeId)(activity).href }
|
|
3729
3739
|
}, async (span) => {
|
|
3730
3740
|
if (activity.id != null) span.setAttribute("activitypub.activity.id", activity.id.href);
|
|
3731
3741
|
if (activity.toIds.length > 0) span.setAttribute("activitypub.activity.to", activity.toIds.map((to) => to.href));
|
|
@@ -3759,7 +3769,7 @@ var ContextImpl = class ContextImpl {
|
|
|
3759
3769
|
const contextLoader = options.contextLoader ?? this.contextLoader;
|
|
3760
3770
|
const json = await activity.toJsonLd({ contextLoader });
|
|
3761
3771
|
const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, this);
|
|
3762
|
-
const verified = await require_proof.verifyObject(
|
|
3772
|
+
const verified = await require_proof.verifyObject(__fedify_vocab.Activity, json, {
|
|
3763
3773
|
contextLoader,
|
|
3764
3774
|
documentLoader: options.documentLoader ?? this.documentLoader,
|
|
3765
3775
|
tracerProvider: options.tracerProvider ?? this.tracerProvider,
|
|
@@ -3785,7 +3795,7 @@ var ContextImpl = class ContextImpl {
|
|
|
3785
3795
|
activityId: activity.id.href
|
|
3786
3796
|
});
|
|
3787
3797
|
return false;
|
|
3788
|
-
} else if (!(fetched instanceof
|
|
3798
|
+
} else if (!(fetched instanceof __fedify_vocab.Activity)) {
|
|
3789
3799
|
logger$1.debug("Fetched object is not an Activity.", {
|
|
3790
3800
|
recipient,
|
|
3791
3801
|
activity: await fetched.toJsonLd({ contextLoader })
|
|
@@ -3940,7 +3950,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
|
3940
3950
|
});
|
|
3941
3951
|
}
|
|
3942
3952
|
forwardActivity(forwarder, recipients, options) {
|
|
3943
|
-
const tracer = this.tracerProvider.getTracer(
|
|
3953
|
+
const tracer = this.tracerProvider.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
3944
3954
|
return tracer.startActiveSpan("activitypub.outbox", {
|
|
3945
3955
|
kind: this.federation.outboxQueue == null || options?.immediate ? __opentelemetry_api.SpanKind.CLIENT : __opentelemetry_api.SpanKind.PRODUCER,
|
|
3946
3956
|
attributes: { "activitypub.activity.type": this.activityType }
|
|
@@ -3992,7 +4002,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
|
3992
4002
|
if (!require_proof.hasSignature(this.activity)) {
|
|
3993
4003
|
let hasProof;
|
|
3994
4004
|
try {
|
|
3995
|
-
const activity = await
|
|
4005
|
+
const activity = await __fedify_vocab.Activity.fromJsonLd(this.activity, this);
|
|
3996
4006
|
hasProof = await activity.getProof() != null;
|
|
3997
4007
|
} catch {
|
|
3998
4008
|
hasProof = false;
|
|
@@ -4211,6 +4221,12 @@ Object.defineProperty(exports, 'digest', {
|
|
|
4211
4221
|
return digest;
|
|
4212
4222
|
}
|
|
4213
4223
|
});
|
|
4224
|
+
Object.defineProperty(exports, 'handleWebFinger', {
|
|
4225
|
+
enumerable: true,
|
|
4226
|
+
get: function () {
|
|
4227
|
+
return handleWebFinger;
|
|
4228
|
+
}
|
|
4229
|
+
});
|
|
4214
4230
|
Object.defineProperty(exports, 'respondWithObject', {
|
|
4215
4231
|
enumerable: true,
|
|
4216
4232
|
get: function () {
|