@fedify/fedify 2.2.0-dev.735 → 2.2.0-dev.748
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/{builder-2jI6hegp.mjs → builder-BGzN0XIV.mjs} +5 -4
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{context-C0fssarc.d.ts → context-78ecvxf5.d.ts} +60 -5
- package/dist/{context-LmrZPwti.d.cts → context-DYDPdoCb.d.cts} +60 -5
- package/dist/{deno-DNUSPY7U.mjs → deno-BGpYBBba.mjs} +1 -1
- package/dist/{docloader-B8ck-wER.mjs → docloader-B_eTYGFt.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +77 -5
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +58 -7
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +1 -1
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/webfinger.test.mjs +37 -4
- package/dist/{http-IIaVPAl2.cjs → http-BA8U-rJX.cjs} +1 -1
- package/dist/{http-B8WmNdHN.js → http-BX8Se31Z.js} +1 -1
- package/dist/{http-Cv2XDsCQ.mjs → http-DukFwiXf.mjs} +2 -2
- package/dist/{inbox-DybrQJ_p.mjs → inbox-wiVtdLY9.mjs} +1 -1
- package/dist/{key-BUolsx1b.mjs → key-CC3yOGF0.mjs} +1 -1
- package/dist/{kv-cache-De67QZby.js → kv-cache-BSseaVt8.js} +1 -1
- package/dist/{kv-cache-BOJJaBI3.cjs → kv-cache-Baf0LigI.cjs} +1 -1
- package/dist/{ld-Cf1yTEdR.mjs → ld-D67kDIA0.mjs} +2 -2
- package/dist/{middleware-DhJ6OSCJ.mjs → middleware-BfOPomng.mjs} +35 -17
- package/dist/{middleware-Dgc7SDvm.cjs → middleware-CP-fzmy_.cjs} +29 -10
- package/dist/{middleware-DzM_lYXe.js → middleware-CXkoAB0x.js} +29 -10
- package/dist/{middleware-C0fVsqQ6.mjs → middleware-DBWbTLAi.mjs} +1 -1
- package/dist/{middleware-D3YnKcat.cjs → middleware-DLm4eyx-.cjs} +1 -1
- package/dist/{mod-Cgpc49fA.d.cts → mod-CEohtXhV.d.cts} +1 -1
- package/dist/{mod-CnwZoDzx.d.ts → mod-CokIUYDr.d.ts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +4 -4
- package/dist/mod.d.ts +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/{owner-W4ABJwPB.mjs → owner-CxO6322k.mjs} +2 -2
- package/dist/{proof-BrpuZcsU.cjs → proof-9C09_l2r.cjs} +1 -1
- package/dist/{proof-Cy8xM0Tx.js → proof-DaPEktCl.js} +1 -1
- package/dist/{proof-DPq6vDHh.mjs → proof-Dfy2T5tG.mjs} +2 -2
- package/dist/{send-IBbCEOU_.mjs → send-urWboKs6.mjs} +2 -2
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key.test.mjs +1 -1
- package/dist/sig/ld.test.mjs +2 -2
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/proof.test.mjs +3 -4
- package/dist/testing/mod.d.mts +59 -4
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as ActorHandleMapper, A as FederationQueueOptions, B as RouterOptions, C as IdempotencyStrategy, Ct as digest, D as Rfc6570Expression, E as ObjectCallbackSetters, F as createExponentialBackoffPolicy, G as InProcessMessageQueue, H as RespondWithObjectOptions, I as Message, J as MessageQueueEnqueueOptions, K as InProcessMessageQueueOptions, L as createFederationBuilder, M as CreateExponentialBackoffPolicyOptions, N as RetryContext, O as FederationKvPrefixes, P as RetryPolicy, Q as ActorDispatcher, R as Router, S as IdempotencyKeyCallback, St as buildCollectionSynchronizationHeader, T as InboxListenerSetters, U as respondWithObject, V as RouterRouteResult, W as respondWithObjectIfAcceptable, X as ParallelMessageQueue, Y as MessageQueueListenOptions, Z as ActorAliasMapper, _ as Federation, _t as UnverifiedActivityReason, a as GetSignedKeyOptions, at as CustomCollectionCounter, b as FederationOptions, bt as SenderKeyPair, c as RequestContext, ct as InboxErrorHandler, d as SendActivityOptionsForCollection, dt as ObjectAuthorizePredicate, et as ActorKeyPairsDispatcher, f as ActorCallbackSetters, ft as ObjectDispatcher, g as Federatable, gt as UnverifiedActivityHandler, h as CustomCollectionCallbackSetters, ht as SharedInboxKeyDispatcher, i as GetActorOptions, it as CollectionDispatcher, j as createFederation, k as FederationOrigin, l as RouteActivityOptions, lt as InboxListener, m as ConstructorWithTypeId, mt as OutboxPermanentFailureHandler, n as Context, nt as CollectionCounter, o as InboxContext, ot as CustomCollectionCursor, p as CollectionCallbackSetters, pt as OutboxErrorHandler, q as MessageQueue, r as ForwardActivityOptions, rt as CollectionCursor, s as ParseUriResult, st as CustomCollectionDispatcher, t as ActorKeyPair, tt as AuthorizePredicate, u as SendActivityOptions, ut as NodeInfoDispatcher, v as FederationBuilder, vt as WebFingerLinksDispatcher, w as InboxChallengePolicy, x as FederationStartQueueOptions, xt as PageItems, y as FederationFetchOptions, yt as SendActivityError, z as RouterError } from "../context-DYDPdoCb.cjs";
|
|
2
2
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-CbLNp3zQ.cjs";
|
|
3
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-
|
|
4
|
-
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
|
3
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-CEohtXhV.cjs";
|
|
4
|
+
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as ActorHandleMapper, A as FederationQueueOptions, B as RouterOptions, C as IdempotencyStrategy, Ct as digest, D as Rfc6570Expression, E as ObjectCallbackSetters, F as createExponentialBackoffPolicy, G as InProcessMessageQueue, H as RespondWithObjectOptions, I as Message, J as MessageQueueEnqueueOptions, K as InProcessMessageQueueOptions, L as createFederationBuilder, M as CreateExponentialBackoffPolicyOptions, N as RetryContext, O as FederationKvPrefixes, P as RetryPolicy, Q as ActorDispatcher, R as Router, S as IdempotencyKeyCallback, St as buildCollectionSynchronizationHeader, T as InboxListenerSetters, U as respondWithObject, V as RouterRouteResult, W as respondWithObjectIfAcceptable, X as ParallelMessageQueue, Y as MessageQueueListenOptions, Z as ActorAliasMapper, _ as Federation, _t as UnverifiedActivityReason, a as GetSignedKeyOptions, at as CustomCollectionCounter, b as FederationOptions, bt as SenderKeyPair, c as RequestContext, ct as InboxErrorHandler, d as SendActivityOptionsForCollection, dt as ObjectAuthorizePredicate, et as ActorKeyPairsDispatcher, f as ActorCallbackSetters, ft as ObjectDispatcher, g as Federatable, gt as UnverifiedActivityHandler, h as CustomCollectionCallbackSetters, ht as SharedInboxKeyDispatcher, i as GetActorOptions, it as CollectionDispatcher, j as createFederation, k as FederationOrigin, l as RouteActivityOptions, lt as InboxListener, m as ConstructorWithTypeId, mt as OutboxPermanentFailureHandler, n as Context, nt as CollectionCounter, o as InboxContext, ot as CustomCollectionCursor, p as CollectionCallbackSetters, pt as OutboxErrorHandler, q as MessageQueue, r as ForwardActivityOptions, rt as CollectionCursor, s as ParseUriResult, st as CustomCollectionDispatcher, t as ActorKeyPair, tt as AuthorizePredicate, u as SendActivityOptions, ut as NodeInfoDispatcher, v as FederationBuilder, vt as WebFingerLinksDispatcher, w as InboxChallengePolicy, x as FederationStartQueueOptions, xt as PageItems, y as FederationFetchOptions, yt as SendActivityError, z as RouterError } from "../context-78ecvxf5.js";
|
|
4
4
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-GFYnFoOl.js";
|
|
5
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-
|
|
6
|
-
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
|
5
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-CokIUYDr.js";
|
|
6
|
+
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
|
-
import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "../middleware-
|
|
3
|
+
import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "../middleware-CXkoAB0x.js";
|
|
4
4
|
import { isEqual } from "es-toolkit";
|
|
5
5
|
//#region src/federation/kv.ts
|
|
6
6
|
/**
|
|
@@ -8,10 +8,10 @@ import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z
|
|
|
8
8
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
9
9
|
import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
|
|
10
10
|
import { t as assert } from "../assert-ddO5KLpe.mjs";
|
|
11
|
-
import { l as verifyRequest } from "../http-
|
|
11
|
+
import { l as verifyRequest } from "../http-DukFwiXf.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
|
|
13
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
14
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-
|
|
13
|
+
import { t as doesActorOwnKey } from "../owner-CxO6322k.mjs";
|
|
14
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-urWboKs6.mjs";
|
|
15
15
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
17
17
|
//#region src/federation/send.test.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "@js-temporal/polyfill";
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { n as createRequestContext } from "../context-Juj6bdHC.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-Duiq_YC9.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
|
|
8
|
-
import { a as createFederation, o as handleWebFinger } from "../middleware-
|
|
8
|
+
import { a as createFederation, o as handleWebFinger } from "../middleware-BfOPomng.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
|
-
import { Image, Link, Person } from "@fedify/vocab";
|
|
10
|
+
import { Image, Link, Person, Tombstone } from "@fedify/vocab";
|
|
11
11
|
//#region src/federation/webfinger.test.ts
|
|
12
12
|
test("handleWebFinger()", async (t) => {
|
|
13
13
|
const url = new URL("https://example.com/.well-known/webfinger");
|
|
@@ -20,7 +20,8 @@ test("handleWebFinger()", async (t) => {
|
|
|
20
20
|
return new URL(`${url.origin}/users/${identifier}`);
|
|
21
21
|
},
|
|
22
22
|
async getActor(handle) {
|
|
23
|
-
|
|
23
|
+
const actor = await actorDispatcher(context, handle);
|
|
24
|
+
return actor instanceof Tombstone ? null : actor;
|
|
24
25
|
},
|
|
25
26
|
parseUri(uri) {
|
|
26
27
|
if (uri == null) return null;
|
|
@@ -36,6 +37,10 @@ test("handleWebFinger()", async (t) => {
|
|
|
36
37
|
return context;
|
|
37
38
|
}
|
|
38
39
|
const actorDispatcher = (ctx, identifier) => {
|
|
40
|
+
if (identifier === "gone") return new Tombstone({
|
|
41
|
+
id: ctx.getActorUri(identifier),
|
|
42
|
+
deleted: Temporal.Instant.from("2024-01-15T00:00:00Z")
|
|
43
|
+
});
|
|
39
44
|
if (identifier !== "someone" && identifier !== "someone2") return null;
|
|
40
45
|
const actorUri = ctx.getActorUri(identifier);
|
|
41
46
|
return new Person({
|
|
@@ -185,6 +190,34 @@ test("handleWebFinger()", async (t) => {
|
|
|
185
190
|
assertEquals(response.status, 200);
|
|
186
191
|
assertEquals(await response.json(), expected2);
|
|
187
192
|
});
|
|
193
|
+
await t.step("gone: resource=acct:...", async () => {
|
|
194
|
+
const u = new URL(url);
|
|
195
|
+
u.searchParams.set("resource", "acct:gone@example.com");
|
|
196
|
+
const context = createContext(u);
|
|
197
|
+
const request = context.request;
|
|
198
|
+
const response = await handleWebFinger(request, {
|
|
199
|
+
context,
|
|
200
|
+
actorDispatcher,
|
|
201
|
+
onNotFound
|
|
202
|
+
});
|
|
203
|
+
assertEquals(response.status, 410);
|
|
204
|
+
assertEquals(response.headers.get("Access-Control-Allow-Origin"), "*");
|
|
205
|
+
assertEquals(onNotFoundCalled, null);
|
|
206
|
+
});
|
|
207
|
+
await t.step("gone: resource=https:...", async () => {
|
|
208
|
+
const u = new URL(url);
|
|
209
|
+
u.searchParams.set("resource", "https://example.com/users/gone");
|
|
210
|
+
const context = createContext(u);
|
|
211
|
+
const request = context.request;
|
|
212
|
+
const response = await handleWebFinger(request, {
|
|
213
|
+
context,
|
|
214
|
+
actorDispatcher,
|
|
215
|
+
onNotFound
|
|
216
|
+
});
|
|
217
|
+
assertEquals(response.status, 410);
|
|
218
|
+
assertEquals(response.headers.get("Access-Control-Allow-Origin"), "*");
|
|
219
|
+
assertEquals(onNotFoundCalled, null);
|
|
220
|
+
});
|
|
188
221
|
await t.step("not found: resource=acct:...", async () => {
|
|
189
222
|
const u = new URL(url);
|
|
190
223
|
u.searchParams.set("resource", "acct:no-one@example.com");
|
|
@@ -11,7 +11,7 @@ let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conve
|
|
|
11
11
|
let byte_encodings_base64 = require("byte-encodings/base64");
|
|
12
12
|
//#region deno.json
|
|
13
13
|
var name = "@fedify/fedify";
|
|
14
|
-
var version = "2.2.0-dev.
|
|
14
|
+
var version = "2.2.0-dev.748+977bbf1d";
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/sig/accept.ts
|
|
17
17
|
/**
|
|
@@ -10,7 +10,7 @@ import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } fro
|
|
|
10
10
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
11
11
|
//#region deno.json
|
|
12
12
|
var name = "@fedify/fedify";
|
|
13
|
-
var version = "2.2.0-dev.
|
|
13
|
+
var version = "2.2.0-dev.748+977bbf1d";
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/sig/accept.ts
|
|
16
16
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
4
|
+
import { n as version, t as name } from "./deno-BGpYBBba.mjs";
|
|
5
5
|
import { i as validateAcceptSignature, n as fulfillAcceptSignature, r as parseAcceptSignature } from "./accept-Dd__NiUL.mjs";
|
|
6
|
-
import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-
|
|
6
|
+
import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-CC3yOGF0.mjs";
|
|
7
7
|
import { CryptographicKey } from "@fedify/vocab";
|
|
8
8
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
9
9
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
4
|
+
import { n as version, t as name } from "./deno-BGpYBBba.mjs";
|
|
5
5
|
import { Activity, getTypeId } from "@fedify/vocab";
|
|
6
6
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
4
|
+
import { n as version, t as name } from "./deno-BGpYBBba.mjs";
|
|
5
5
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
6
6
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
7
7
|
import { FetchError, getDocumentLoader } from "@fedify/vocab-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { d as validateCryptoKey, t as doubleKnock } from "./http-
|
|
3
|
+
import { d as validateCryptoKey, t as doubleKnock } from "./http-BX8Se31Z.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { curry } from "es-toolkit";
|
|
6
6
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
require("./chunk-DDcVe30Y.cjs");
|
|
4
|
-
const require_http = require("./http-
|
|
4
|
+
const require_http = require("./http-BA8U-rJX.cjs");
|
|
5
5
|
let _logtape_logtape = require("@logtape/logtape");
|
|
6
6
|
let es_toolkit = require("es-toolkit");
|
|
7
7
|
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { n as fetchKey, o as validateCryptoKey } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-BGpYBBba.mjs";
|
|
5
|
+
import { n as fetchKey, o as validateCryptoKey } from "./key-CC3yOGF0.mjs";
|
|
6
6
|
import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
|
|
7
7
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
@@ -2,25 +2,25 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { n as RouterError } from "./router-CrMLXoOr.mjs";
|
|
5
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
+
import { n as version, t as name } from "./deno-BGpYBBba.mjs";
|
|
6
6
|
import { t as formatAcceptSignature } from "./accept-Dd__NiUL.mjs";
|
|
7
|
-
import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-
|
|
8
|
-
import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-
|
|
9
|
-
import { t as getAuthenticatedDocumentLoader } from "./docloader-
|
|
7
|
+
import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-CC3yOGF0.mjs";
|
|
8
|
+
import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-DukFwiXf.mjs";
|
|
9
|
+
import { t as getAuthenticatedDocumentLoader } from "./docloader-B_eTYGFt.mjs";
|
|
10
10
|
import { n as kvCache } from "./kv-cache-B01V7s3h.mjs";
|
|
11
|
-
import { a as signJsonLd, i as hasSignature, o as verifyJsonLd, r as detachSignature } from "./ld-
|
|
12
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-
|
|
13
|
-
import { n as signObject, r as verifyObject } from "./proof-
|
|
11
|
+
import { a as signJsonLd, i as hasSignature, o as verifyJsonLd, r as detachSignature } from "./ld-D67kDIA0.mjs";
|
|
12
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-CxO6322k.mjs";
|
|
13
|
+
import { n as signObject, r as verifyObject } from "./proof-Dfy2T5tG.mjs";
|
|
14
14
|
import { t as getNodeInfo } from "./client-DEpOVgY1.mjs";
|
|
15
15
|
import { t as nodeInfoToJson } from "./types-DCP0WLdt.mjs";
|
|
16
|
-
import { n as routeActivity } from "./inbox-
|
|
17
|
-
import { t as FederationBuilderImpl } from "./builder-
|
|
16
|
+
import { n as routeActivity } from "./inbox-wiVtdLY9.mjs";
|
|
17
|
+
import { t as FederationBuilderImpl } from "./builder-BGzN0XIV.mjs";
|
|
18
18
|
import { t as buildCollectionSynchronizationHeader } from "./collection-BD6-SZ6O.mjs";
|
|
19
19
|
import { t as KvKeyCache } from "./keycache-CCSwkQcY.mjs";
|
|
20
20
|
import { t as acceptsJsonLd } from "./negotiation-DnsfFF8I.mjs";
|
|
21
21
|
import { t as createExponentialBackoffPolicy } from "./retry-B_E3V_Dx.mjs";
|
|
22
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-
|
|
23
|
-
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
22
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-urWboKs6.mjs";
|
|
23
|
+
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
24
24
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
25
25
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
26
26
|
import { uniq } from "es-toolkit";
|
|
@@ -179,6 +179,16 @@ async function handleActor(request, { identifier, context, actorDispatcher, auth
|
|
|
179
179
|
if (authorizePredicate != null) {
|
|
180
180
|
if (!await authorizePredicate(context, identifier)) return await onUnauthorized(request);
|
|
181
181
|
}
|
|
182
|
+
if (actor instanceof Tombstone) {
|
|
183
|
+
const jsonLd = await actor.toJsonLd(context);
|
|
184
|
+
return new Response(JSON.stringify(jsonLd), {
|
|
185
|
+
status: 410,
|
|
186
|
+
headers: {
|
|
187
|
+
"Content-Type": "application/activity+json",
|
|
188
|
+
Vary: "Accept"
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
182
192
|
const jsonLd = await actor.toJsonLd(context);
|
|
183
193
|
return new Response(JSON.stringify(jsonLd), { headers: {
|
|
184
194
|
"Content-Type": "application/activity+json",
|
|
@@ -416,7 +426,8 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
416
426
|
});
|
|
417
427
|
return await onNotFound(request);
|
|
418
428
|
} else if (recipient != null) {
|
|
419
|
-
|
|
429
|
+
const actor = await actorDispatcher(ctx, recipient);
|
|
430
|
+
if (actor == null || actor instanceof Tombstone) {
|
|
420
431
|
logger.error("Actor {recipient} not found.", { recipient });
|
|
421
432
|
span.setStatus({
|
|
422
433
|
code: SpanStatusCode.ERROR,
|
|
@@ -1291,6 +1302,10 @@ async function handleWebFingerInternal(request, { context, host, actorDispatcher
|
|
|
1291
1302
|
logger.error("Actor {identifier} not found.", { identifier });
|
|
1292
1303
|
return await onNotFound(request);
|
|
1293
1304
|
}
|
|
1305
|
+
if (actor instanceof Tombstone) return new Response(null, {
|
|
1306
|
+
status: 410,
|
|
1307
|
+
headers: { "Access-Control-Allow-Origin": "*" }
|
|
1308
|
+
});
|
|
1294
1309
|
const links = [{
|
|
1295
1310
|
rel: "self",
|
|
1296
1311
|
href: context.getActorUri(identifier).href,
|
|
@@ -1318,9 +1333,10 @@ async function handleWebFingerInternal(request, { context, host, actorDispatcher
|
|
|
1318
1333
|
if (customLinks != null) for (const link of customLinks) links.push(link);
|
|
1319
1334
|
}
|
|
1320
1335
|
const aliases = [];
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1336
|
+
const preferredUsername = actor.preferredUsername;
|
|
1337
|
+
if (resourceUrl.protocol != "acct:" && preferredUsername != null) {
|
|
1338
|
+
aliases.push(`acct:${preferredUsername}@${host ?? context.url.host}`);
|
|
1339
|
+
if (host != null && host !== context.url.host) aliases.push(`acct:${preferredUsername}@${context.url.host}`);
|
|
1324
1340
|
}
|
|
1325
1341
|
if (resourceUrl.href !== context.getActorUri(identifier).href) aliases.push(context.getActorUri(identifier).href);
|
|
1326
1342
|
if (resourceUrl.protocol === "acct:" && host != null && host !== context.url.host && !resourceUrl.href.endsWith(`@${host}`)) {
|
|
@@ -2912,7 +2928,7 @@ var RequestContextImpl = class RequestContextImpl extends ContextImpl {
|
|
|
2912
2928
|
request: this.request
|
|
2913
2929
|
});
|
|
2914
2930
|
}
|
|
2915
|
-
async getActor(identifier) {
|
|
2931
|
+
async getActor(identifier, options) {
|
|
2916
2932
|
if (this.federation.actorCallbacks == null || this.federation.actorCallbacks.dispatcher == null) throw new Error("No actor dispatcher registered.");
|
|
2917
2933
|
if (this.#invokedFromActorDispatcher != null) getLogger([
|
|
2918
2934
|
"fedify",
|
|
@@ -2922,10 +2938,12 @@ var RequestContextImpl = class RequestContextImpl extends ContextImpl {
|
|
|
2922
2938
|
getActorIdentifier: identifier,
|
|
2923
2939
|
actorDispatcherIdentifier: this.#invokedFromActorDispatcher.identifier
|
|
2924
2940
|
});
|
|
2925
|
-
|
|
2941
|
+
const actor = await this.federation.actorCallbacks.dispatcher(new RequestContextImpl({
|
|
2926
2942
|
...this,
|
|
2927
2943
|
invokedFromActorDispatcher: { identifier }
|
|
2928
2944
|
}), identifier);
|
|
2945
|
+
if (actor instanceof Tombstone && options?.tombstone !== "passthrough") return null;
|
|
2946
|
+
return actor;
|
|
2929
2947
|
}
|
|
2930
2948
|
async getObject(cls, values) {
|
|
2931
2949
|
const callbacks = this.federation.objectCallbacks[cls.typeId.href];
|
|
@@ -2,10 +2,10 @@ const { Temporal } = require("@js-temporal/polyfill");
|
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
require("./chunk-DDcVe30Y.cjs");
|
|
4
4
|
const require_transformers = require("./transformers-NeAONrAq.cjs");
|
|
5
|
-
const require_http = require("./http-
|
|
6
|
-
const require_proof = require("./proof-
|
|
5
|
+
const require_http = require("./http-BA8U-rJX.cjs");
|
|
6
|
+
const require_proof = require("./proof-9C09_l2r.cjs");
|
|
7
7
|
const require_types = require("./types-KC4QAoxe.cjs");
|
|
8
|
-
const require_kv_cache = require("./kv-cache-
|
|
8
|
+
const require_kv_cache = require("./kv-cache-Baf0LigI.cjs");
|
|
9
9
|
let _logtape_logtape = require("@logtape/logtape");
|
|
10
10
|
let _fedify_vocab = require("@fedify/vocab");
|
|
11
11
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
@@ -331,7 +331,7 @@ var FederationBuilderImpl = class {
|
|
|
331
331
|
this.collectionTypeIds = {};
|
|
332
332
|
}
|
|
333
333
|
async build(options) {
|
|
334
|
-
const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-
|
|
334
|
+
const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-DLm4eyx-.cjs"));
|
|
335
335
|
const f = new FederationImpl(options);
|
|
336
336
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
337
337
|
f.router = this.router.clone();
|
|
@@ -394,6 +394,7 @@ var FederationBuilderImpl = class {
|
|
|
394
394
|
]);
|
|
395
395
|
if (actor.id == null) logger.warn("Actor dispatcher returned an actor without an id property. Set the property with Context.getActorUri(identifier).");
|
|
396
396
|
else if (actor.id.href != context.getActorUri(identifier).href) logger.warn("Actor dispatcher returned an actor with an id property that does not match the actor URI. Set the property with Context.getActorUri(identifier).");
|
|
397
|
+
if (actor instanceof _fedify_vocab.Tombstone) return actor;
|
|
397
398
|
if (this.followingCallbacks != null && this.followingCallbacks.dispatcher != null) {
|
|
398
399
|
if (actor.followingId == null) logger.warn("You configured a following collection dispatcher, but the actor does not have a following property. Set the property with Context.getFollowingUri(identifier).");
|
|
399
400
|
else if (actor.followingId.href != context.getFollowingUri(identifier).href) logger.warn("You configured a following collection dispatcher, but the actor's following property does not match the following collection URI. Set the property with Context.getFollowingUri(identifier).");
|
|
@@ -1035,6 +1036,16 @@ async function handleActor(request, { identifier, context, actorDispatcher, auth
|
|
|
1035
1036
|
if (authorizePredicate != null) {
|
|
1036
1037
|
if (!await authorizePredicate(context, identifier)) return await onUnauthorized(request);
|
|
1037
1038
|
}
|
|
1039
|
+
if (actor instanceof _fedify_vocab.Tombstone) {
|
|
1040
|
+
const jsonLd = await actor.toJsonLd(context);
|
|
1041
|
+
return new Response(JSON.stringify(jsonLd), {
|
|
1042
|
+
status: 410,
|
|
1043
|
+
headers: {
|
|
1044
|
+
"Content-Type": "application/activity+json",
|
|
1045
|
+
Vary: "Accept"
|
|
1046
|
+
}
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1038
1049
|
const jsonLd = await actor.toJsonLd(context);
|
|
1039
1050
|
return new Response(JSON.stringify(jsonLd), { headers: {
|
|
1040
1051
|
"Content-Type": "application/activity+json",
|
|
@@ -1272,7 +1283,8 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
1272
1283
|
});
|
|
1273
1284
|
return await onNotFound(request);
|
|
1274
1285
|
} else if (recipient != null) {
|
|
1275
|
-
|
|
1286
|
+
const actor = await actorDispatcher(ctx, recipient);
|
|
1287
|
+
if (actor == null || actor instanceof _fedify_vocab.Tombstone) {
|
|
1276
1288
|
logger.error("Actor {recipient} not found.", { recipient });
|
|
1277
1289
|
span.setStatus({
|
|
1278
1290
|
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
@@ -2397,6 +2409,10 @@ async function handleWebFingerInternal(request, { context, host, actorDispatcher
|
|
|
2397
2409
|
logger.error("Actor {identifier} not found.", { identifier });
|
|
2398
2410
|
return await onNotFound(request);
|
|
2399
2411
|
}
|
|
2412
|
+
if (actor instanceof _fedify_vocab.Tombstone) return new Response(null, {
|
|
2413
|
+
status: 410,
|
|
2414
|
+
headers: { "Access-Control-Allow-Origin": "*" }
|
|
2415
|
+
});
|
|
2400
2416
|
const links = [{
|
|
2401
2417
|
rel: "self",
|
|
2402
2418
|
href: context.getActorUri(identifier).href,
|
|
@@ -2424,9 +2440,10 @@ async function handleWebFingerInternal(request, { context, host, actorDispatcher
|
|
|
2424
2440
|
if (customLinks != null) for (const link of customLinks) links.push(link);
|
|
2425
2441
|
}
|
|
2426
2442
|
const aliases = [];
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2443
|
+
const preferredUsername = actor.preferredUsername;
|
|
2444
|
+
if (resourceUrl.protocol != "acct:" && preferredUsername != null) {
|
|
2445
|
+
aliases.push(`acct:${preferredUsername}@${host ?? context.url.host}`);
|
|
2446
|
+
if (host != null && host !== context.url.host) aliases.push(`acct:${preferredUsername}@${context.url.host}`);
|
|
2430
2447
|
}
|
|
2431
2448
|
if (resourceUrl.href !== context.getActorUri(identifier).href) aliases.push(context.getActorUri(identifier).href);
|
|
2432
2449
|
if (resourceUrl.protocol === "acct:" && host != null && host !== context.url.host && !resourceUrl.href.endsWith(`@${host}`)) {
|
|
@@ -4018,7 +4035,7 @@ var RequestContextImpl = class RequestContextImpl extends ContextImpl {
|
|
|
4018
4035
|
request: this.request
|
|
4019
4036
|
});
|
|
4020
4037
|
}
|
|
4021
|
-
async getActor(identifier) {
|
|
4038
|
+
async getActor(identifier, options) {
|
|
4022
4039
|
if (this.federation.actorCallbacks == null || this.federation.actorCallbacks.dispatcher == null) throw new Error("No actor dispatcher registered.");
|
|
4023
4040
|
if (this.#invokedFromActorDispatcher != null) (0, _logtape_logtape.getLogger)([
|
|
4024
4041
|
"fedify",
|
|
@@ -4028,10 +4045,12 @@ var RequestContextImpl = class RequestContextImpl extends ContextImpl {
|
|
|
4028
4045
|
getActorIdentifier: identifier,
|
|
4029
4046
|
actorDispatcherIdentifier: this.#invokedFromActorDispatcher.identifier
|
|
4030
4047
|
});
|
|
4031
|
-
|
|
4048
|
+
const actor = await this.federation.actorCallbacks.dispatcher(new RequestContextImpl({
|
|
4032
4049
|
...this,
|
|
4033
4050
|
invokedFromActorDispatcher: { identifier }
|
|
4034
4051
|
}), identifier);
|
|
4052
|
+
if (actor instanceof _fedify_vocab.Tombstone && options?.tombstone !== "passthrough") return null;
|
|
4053
|
+
return actor;
|
|
4035
4054
|
}
|
|
4036
4055
|
async getObject(cls, values) {
|
|
4037
4056
|
const callbacks = this.federation.objectCallbacks[cls.typeId.href];
|
|
@@ -2,12 +2,12 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
import { t as __exportAll } from "./chunk-nlSIicah.js";
|
|
4
4
|
import { r as getDefaultActivityTransformers } from "./transformers-ve6e2xcg.js";
|
|
5
|
-
import { _ as version, a as verifyRequestDetailed, d as validateCryptoKey, f as formatAcceptSignature, g as name, i as verifyRequest, n as parseRfc9421SignatureInput, o as exportJwk, t as doubleKnock, u as importJwk } from "./http-
|
|
6
|
-
import { a as doesActorOwnKey, d as signJsonLd, f as verifyJsonLd, l as detachSignature, n as signObject, o as getKeyOwner, r as verifyObject, u as hasSignature } from "./proof-
|
|
5
|
+
import { _ as version, a as verifyRequestDetailed, d as validateCryptoKey, f as formatAcceptSignature, g as name, i as verifyRequest, n as parseRfc9421SignatureInput, o as exportJwk, t as doubleKnock, u as importJwk } from "./http-BX8Se31Z.js";
|
|
6
|
+
import { a as doesActorOwnKey, d as signJsonLd, f as verifyJsonLd, l as detachSignature, n as signObject, o as getKeyOwner, r as verifyObject, u as hasSignature } from "./proof-DaPEktCl.js";
|
|
7
7
|
import { n as getNodeInfo, t as nodeInfoToJson } from "./types-hvL8ElAs.js";
|
|
8
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-
|
|
8
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BSseaVt8.js";
|
|
9
9
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
10
|
-
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
10
|
+
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
11
11
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
12
12
|
import { cloneDeep, uniq } from "es-toolkit";
|
|
13
13
|
import { Router } from "uri-template-router";
|
|
@@ -394,6 +394,7 @@ var FederationBuilderImpl = class {
|
|
|
394
394
|
]);
|
|
395
395
|
if (actor.id == null) logger.warn("Actor dispatcher returned an actor without an id property. Set the property with Context.getActorUri(identifier).");
|
|
396
396
|
else if (actor.id.href != context.getActorUri(identifier).href) logger.warn("Actor dispatcher returned an actor with an id property that does not match the actor URI. Set the property with Context.getActorUri(identifier).");
|
|
397
|
+
if (actor instanceof Tombstone) return actor;
|
|
397
398
|
if (this.followingCallbacks != null && this.followingCallbacks.dispatcher != null) {
|
|
398
399
|
if (actor.followingId == null) logger.warn("You configured a following collection dispatcher, but the actor does not have a following property. Set the property with Context.getFollowingUri(identifier).");
|
|
399
400
|
else if (actor.followingId.href != context.getFollowingUri(identifier).href) logger.warn("You configured a following collection dispatcher, but the actor's following property does not match the following collection URI. Set the property with Context.getFollowingUri(identifier).");
|
|
@@ -1035,6 +1036,16 @@ async function handleActor(request, { identifier, context, actorDispatcher, auth
|
|
|
1035
1036
|
if (authorizePredicate != null) {
|
|
1036
1037
|
if (!await authorizePredicate(context, identifier)) return await onUnauthorized(request);
|
|
1037
1038
|
}
|
|
1039
|
+
if (actor instanceof Tombstone) {
|
|
1040
|
+
const jsonLd = await actor.toJsonLd(context);
|
|
1041
|
+
return new Response(JSON.stringify(jsonLd), {
|
|
1042
|
+
status: 410,
|
|
1043
|
+
headers: {
|
|
1044
|
+
"Content-Type": "application/activity+json",
|
|
1045
|
+
Vary: "Accept"
|
|
1046
|
+
}
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1038
1049
|
const jsonLd = await actor.toJsonLd(context);
|
|
1039
1050
|
return new Response(JSON.stringify(jsonLd), { headers: {
|
|
1040
1051
|
"Content-Type": "application/activity+json",
|
|
@@ -1272,7 +1283,8 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
1272
1283
|
});
|
|
1273
1284
|
return await onNotFound(request);
|
|
1274
1285
|
} else if (recipient != null) {
|
|
1275
|
-
|
|
1286
|
+
const actor = await actorDispatcher(ctx, recipient);
|
|
1287
|
+
if (actor == null || actor instanceof Tombstone) {
|
|
1276
1288
|
logger.error("Actor {recipient} not found.", { recipient });
|
|
1277
1289
|
span.setStatus({
|
|
1278
1290
|
code: SpanStatusCode.ERROR,
|
|
@@ -2397,6 +2409,10 @@ async function handleWebFingerInternal(request, { context, host, actorDispatcher
|
|
|
2397
2409
|
logger.error("Actor {identifier} not found.", { identifier });
|
|
2398
2410
|
return await onNotFound(request);
|
|
2399
2411
|
}
|
|
2412
|
+
if (actor instanceof Tombstone) return new Response(null, {
|
|
2413
|
+
status: 410,
|
|
2414
|
+
headers: { "Access-Control-Allow-Origin": "*" }
|
|
2415
|
+
});
|
|
2400
2416
|
const links = [{
|
|
2401
2417
|
rel: "self",
|
|
2402
2418
|
href: context.getActorUri(identifier).href,
|
|
@@ -2424,9 +2440,10 @@ async function handleWebFingerInternal(request, { context, host, actorDispatcher
|
|
|
2424
2440
|
if (customLinks != null) for (const link of customLinks) links.push(link);
|
|
2425
2441
|
}
|
|
2426
2442
|
const aliases = [];
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2443
|
+
const preferredUsername = actor.preferredUsername;
|
|
2444
|
+
if (resourceUrl.protocol != "acct:" && preferredUsername != null) {
|
|
2445
|
+
aliases.push(`acct:${preferredUsername}@${host ?? context.url.host}`);
|
|
2446
|
+
if (host != null && host !== context.url.host) aliases.push(`acct:${preferredUsername}@${context.url.host}`);
|
|
2430
2447
|
}
|
|
2431
2448
|
if (resourceUrl.href !== context.getActorUri(identifier).href) aliases.push(context.getActorUri(identifier).href);
|
|
2432
2449
|
if (resourceUrl.protocol === "acct:" && host != null && host !== context.url.host && !resourceUrl.href.endsWith(`@${host}`)) {
|
|
@@ -4025,7 +4042,7 @@ var RequestContextImpl = class RequestContextImpl extends ContextImpl {
|
|
|
4025
4042
|
request: this.request
|
|
4026
4043
|
});
|
|
4027
4044
|
}
|
|
4028
|
-
async getActor(identifier) {
|
|
4045
|
+
async getActor(identifier, options) {
|
|
4029
4046
|
if (this.federation.actorCallbacks == null || this.federation.actorCallbacks.dispatcher == null) throw new Error("No actor dispatcher registered.");
|
|
4030
4047
|
if (this.#invokedFromActorDispatcher != null) getLogger([
|
|
4031
4048
|
"fedify",
|
|
@@ -4035,10 +4052,12 @@ var RequestContextImpl = class RequestContextImpl extends ContextImpl {
|
|
|
4035
4052
|
getActorIdentifier: identifier,
|
|
4036
4053
|
actorDispatcherIdentifier: this.#invokedFromActorDispatcher.identifier
|
|
4037
4054
|
});
|
|
4038
|
-
|
|
4055
|
+
const actor = await this.federation.actorCallbacks.dispatcher(new RequestContextImpl({
|
|
4039
4056
|
...this,
|
|
4040
4057
|
invokedFromActorDispatcher: { identifier }
|
|
4041
4058
|
}), identifier);
|
|
4059
|
+
if (actor instanceof Tombstone && options?.tombstone !== "passthrough") return null;
|
|
4060
|
+
return actor;
|
|
4042
4061
|
}
|
|
4043
4062
|
async getObject(cls, values) {
|
|
4044
4063
|
const callbacks = this.federation.objectCallbacks[cls.typeId.href];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
-
const require_middleware = require("./middleware-
|
|
3
|
+
const require_middleware = require("./middleware-CP-fzmy_.cjs");
|
|
4
4
|
exports.FederationImpl = require_middleware.FederationImpl;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as ActorHandleMapper, Q as ActorDispatcher, Z as ActorAliasMapper, c as RequestContext, vt as WebFingerLinksDispatcher } from "./context-DYDPdoCb.cjs";
|
|
2
2
|
import { Span, Tracer } from "@opentelemetry/api";
|
|
3
3
|
|
|
4
4
|
//#region src/federation/webfinger.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import {
|
|
3
|
+
import { $ as ActorHandleMapper, Q as ActorDispatcher, Z as ActorAliasMapper, c as RequestContext, vt as WebFingerLinksDispatcher } from "./context-78ecvxf5.js";
|
|
4
4
|
import { Span, Tracer } from "@opentelemetry/api";
|
|
5
5
|
|
|
6
6
|
//#region src/federation/webfinger.d.ts
|
package/dist/mod.cjs
CHANGED
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
require("./chunk-DDcVe30Y.cjs");
|
|
5
5
|
const require_transformers = require("./transformers-NeAONrAq.cjs");
|
|
6
6
|
require("./compat/mod.cjs");
|
|
7
|
-
const require_http = require("./http-
|
|
8
|
-
const require_middleware = require("./middleware-
|
|
9
|
-
const require_proof = require("./proof-
|
|
7
|
+
const require_http = require("./http-BA8U-rJX.cjs");
|
|
8
|
+
const require_middleware = require("./middleware-CP-fzmy_.cjs");
|
|
9
|
+
const require_proof = require("./proof-9C09_l2r.cjs");
|
|
10
10
|
const require_types = require("./types-KC4QAoxe.cjs");
|
|
11
|
-
const require_kv_cache = require("./kv-cache-
|
|
11
|
+
const require_kv_cache = require("./kv-cache-Baf0LigI.cjs");
|
|
12
12
|
const require_federation_mod = require("./federation/mod.cjs");
|
|
13
13
|
require("./nodeinfo/mod.cjs");
|
|
14
14
|
require("./runtime/mod.cjs");
|