@fedify/fedify 2.2.18-dev.2386 → 2.2.19
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/{assert_rejects-B-qJtC9Z.mjs → assert_rejects-WyYSTDDX.mjs} +2 -20
- package/dist/{assert_throws-4NwKEy2q.mjs → assert_throws-D4DNWrux.mjs} +19 -1
- package/dist/{builder-CiKYvR0I.mjs → builder-UmydCxtK.mjs} +2 -2
- package/dist/compat/public-audience.test.mjs +1 -1
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{deno-CkabM5bf.mjs → deno-CD-8UlUi.mjs} +1 -1
- package/dist/{docloader-B4Hk3LSj.mjs → docloader-D1ghurDJ.mjs} +6 -2
- package/dist/federation/builder.test.mjs +3 -3
- package/dist/federation/collection.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +261 -8
- package/dist/federation/idempotency.test.mjs +3 -3
- package/dist/federation/inbox.test.mjs +25 -1
- package/dist/federation/keycache.test.mjs +18 -7
- package/dist/federation/kv.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +128 -10
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/mq.test.mjs +2 -2
- package/dist/federation/negotiation.test.mjs +3 -3
- package/dist/federation/retry.test.mjs +2 -2
- package/dist/federation/router.test.mjs +2 -3
- package/dist/federation/send.test.mjs +7 -6
- package/dist/federation/temporal.test.mjs +3 -3
- package/dist/federation/webfinger.test.mjs +2 -2
- package/dist/{http-DovhI1VM.mjs → http-BBBUbwKh.mjs} +2 -2
- package/dist/{http-DP-vbG4o.js → http-DJK2udgX.js} +17 -3
- package/dist/{http-C_Qq0cNx.cjs → http-DrUG4fPS.cjs} +17 -3
- package/dist/inbox-Dca_0fwc.mjs +162 -0
- package/dist/{key-BtVvc9pe.mjs → key-DolXUaLH.mjs} +17 -3
- package/dist/{keycache-Dkc_sflV.mjs → keycache-BimEQucx.mjs} +1 -1
- package/dist/{kv-cache-Ds_adaor.cjs → kv-cache-Bk3V1Tiu.cjs} +5 -1
- package/dist/{kv-cache-D8yJIXRo.js → kv-cache-DDm80t1K.js} +5 -1
- package/dist/{ld-1J9cdTp0.mjs → ld-rTdIfZ63.mjs} +2 -2
- package/dist/{middleware-B_M6lcay.cjs → middleware-B4-Rzdi3.cjs} +1 -1
- package/dist/{middleware-BWXhlsuq.cjs → middleware-BWOwEGpy.cjs} +97 -27
- package/dist/{middleware-BrFMyQSp.js → middleware-BimXKBcP.js} +96 -26
- package/dist/{middleware-ruFPV2xR.mjs → middleware-CpXoRHs3.mjs} +85 -168
- package/dist/{middleware-DMkt5ShX.mjs → middleware-DYK_res8.mjs} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/client.test.mjs +1 -1
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/nodeinfo/types.test.mjs +2 -2
- package/dist/otel/exporter.test.mjs +1 -1
- package/dist/{owner-CgurOfJ9.mjs → owner-CVfzyM5V.mjs} +2 -2
- package/dist/{proof-BJ332wO_.js → proof-CaQ4KG6y.js} +1 -1
- package/dist/{proof-C6uAR-Hj.cjs → proof-DhaTTn-P.cjs} +1 -1
- package/dist/{proof-Dn4nm7pr.mjs → proof-gOGM-sJS.mjs} +2 -2
- package/dist/{send-iVwnK504.mjs → send-D35Va72B.mjs} +2 -2
- package/dist/sig/http.test.mjs +6 -6
- package/dist/sig/key.test.mjs +199 -5
- package/dist/sig/ld.test.mjs +49 -4
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +48 -3
- package/dist/sig/proof.test.mjs +55 -3
- package/dist/{std__assert-BVFj8-_V.mjs → std__assert-DNZ4Liil.mjs} +2 -2
- package/dist/{temporal-BZrzDMq2.mjs → temporal-CA4Y9hBJ.mjs} +1 -1
- package/dist/utils/docloader.test.mjs +178 -39
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +5 -5
- /package/dist/{assert_not_equals--wG9hV7u.mjs → assert_not_equals-BkxW5QJI.mjs} +0 -0
- /package/dist/{negotiation-BHtZN6Y1.mjs → negotiation-SQvQgUqe.mjs} +0 -0
- /package/dist/{retry-bMXBL97A.mjs → retry-v_sGLH1d.mjs} +0 -0
|
@@ -2,25 +2,26 @@ 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-CD-8UlUi.mjs";
|
|
6
6
|
import { t as formatAcceptSignature } from "./accept-Dd__NiUL.mjs";
|
|
7
|
-
import { o as importJwk, s 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 { o as importJwk, s as validateCryptoKey, t as exportJwk } from "./key-DolXUaLH.mjs";
|
|
8
|
+
import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-BBBUbwKh.mjs";
|
|
9
|
+
import { t as getAuthenticatedDocumentLoader } from "./docloader-D1ghurDJ.mjs";
|
|
10
10
|
import { n as kvCache } from "./kv-cache-FsT1ljhs.mjs";
|
|
11
|
-
import { t as KvKeyCache } from "./keycache-
|
|
12
|
-
import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-
|
|
13
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-
|
|
11
|
+
import { t as KvKeyCache } from "./keycache-BimEQucx.mjs";
|
|
12
|
+
import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-rTdIfZ63.mjs";
|
|
13
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-CVfzyM5V.mjs";
|
|
14
14
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-amccRMrV.mjs";
|
|
15
|
-
import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-
|
|
15
|
+
import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-gOGM-sJS.mjs";
|
|
16
16
|
import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-9F_u23dc.mjs";
|
|
17
17
|
import { t as nodeInfoToJson } from "./types-J53Kw7so.mjs";
|
|
18
|
-
import { t as FederationBuilderImpl } from "./builder-
|
|
18
|
+
import { t as FederationBuilderImpl } from "./builder-UmydCxtK.mjs";
|
|
19
19
|
import { t as buildCollectionSynchronizationHeader } from "./collection-D-HqUuA2.mjs";
|
|
20
|
-
import { t as
|
|
21
|
-
import { t as
|
|
22
|
-
import { t as
|
|
23
|
-
import {
|
|
20
|
+
import { n as routeActivity, t as actorsHaveSameOrigin } from "./inbox-Dca_0fwc.mjs";
|
|
21
|
+
import { t as acceptsJsonLd } from "./negotiation-SQvQgUqe.mjs";
|
|
22
|
+
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-CA4Y9hBJ.mjs";
|
|
23
|
+
import { t as createExponentialBackoffPolicy } from "./retry-v_sGLH1d.mjs";
|
|
24
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-D35Va72B.mjs";
|
|
24
25
|
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
25
26
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
26
27
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
@@ -154,147 +155,6 @@ function handleNodeInfoJrd(_request, context) {
|
|
|
154
155
|
return Promise.resolve(response);
|
|
155
156
|
}
|
|
156
157
|
//#endregion
|
|
157
|
-
//#region src/federation/inbox.ts
|
|
158
|
-
async function routeActivity({ context: ctx, json, originalJson, normalizedActivity, ldSignatureVerified, activity, recipient, inboxListeners, inboxContextFactory, listenerInboxContextFactory, inboxErrorHandler, kv, kvPrefixes, queue, span, tracerProvider, idempotencyStrategy }) {
|
|
159
|
-
const logger = getLogger([
|
|
160
|
-
"fedify",
|
|
161
|
-
"federation",
|
|
162
|
-
"inbox"
|
|
163
|
-
]);
|
|
164
|
-
let cacheKey = null;
|
|
165
|
-
if (activity.id != null) {
|
|
166
|
-
const inboxContext = inboxContextFactory(recipient, json, activity.id?.href, getTypeId(activity).href);
|
|
167
|
-
const strategy = idempotencyStrategy ?? "per-inbox";
|
|
168
|
-
let keyString;
|
|
169
|
-
if (typeof strategy === "function") keyString = await strategy(inboxContext, activity);
|
|
170
|
-
else switch (strategy) {
|
|
171
|
-
case "global":
|
|
172
|
-
keyString = activity.id.href;
|
|
173
|
-
break;
|
|
174
|
-
case "per-origin":
|
|
175
|
-
keyString = `${ctx.origin}\n${activity.id.href}`;
|
|
176
|
-
break;
|
|
177
|
-
case "per-inbox":
|
|
178
|
-
keyString = `${ctx.origin}\n${activity.id.href}\n${recipient == null ? "sharedInbox" : `inbox\n${recipient}`}`;
|
|
179
|
-
break;
|
|
180
|
-
default: keyString = `${ctx.origin}\n${activity.id.href}`;
|
|
181
|
-
}
|
|
182
|
-
if (keyString != null) cacheKey = [...kvPrefixes.activityIdempotence, keyString];
|
|
183
|
-
}
|
|
184
|
-
if (cacheKey != null) {
|
|
185
|
-
if (await kv.get(cacheKey) === true) {
|
|
186
|
-
logger.debug("Activity {activityId} has already been processed.", {
|
|
187
|
-
activityId: activity.id?.href,
|
|
188
|
-
activity: json,
|
|
189
|
-
recipient
|
|
190
|
-
});
|
|
191
|
-
span.setStatus({
|
|
192
|
-
code: SpanStatusCode.UNSET,
|
|
193
|
-
message: `Activity ${activity.id?.href} has already been processed.`
|
|
194
|
-
});
|
|
195
|
-
return "alreadyProcessed";
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
if (activity.actorId == null) {
|
|
199
|
-
logger.error("Missing actor.", { activity: json });
|
|
200
|
-
span.setStatus({
|
|
201
|
-
code: SpanStatusCode.ERROR,
|
|
202
|
-
message: "Missing actor."
|
|
203
|
-
});
|
|
204
|
-
return "missingActor";
|
|
205
|
-
}
|
|
206
|
-
span.setAttribute("activitypub.actor.id", activity.actorId.href);
|
|
207
|
-
if (queue != null) {
|
|
208
|
-
const carrier = {};
|
|
209
|
-
propagation.inject(context.active(), carrier);
|
|
210
|
-
try {
|
|
211
|
-
await queue.enqueue({
|
|
212
|
-
type: "inbox",
|
|
213
|
-
id: crypto.randomUUID(),
|
|
214
|
-
baseUrl: ctx.origin,
|
|
215
|
-
activity: originalJson ?? json,
|
|
216
|
-
...normalizedActivity == null ? {} : { normalizedActivity },
|
|
217
|
-
...ldSignatureVerified == null ? {} : { ldSignatureVerified },
|
|
218
|
-
identifier: recipient,
|
|
219
|
-
attempt: 0,
|
|
220
|
-
started: (/* @__PURE__ */ new Date()).toISOString(),
|
|
221
|
-
traceContext: carrier
|
|
222
|
-
});
|
|
223
|
-
} catch (error) {
|
|
224
|
-
logger.error("Failed to enqueue the incoming activity {activityId}:\n{error}", {
|
|
225
|
-
error,
|
|
226
|
-
activityId: activity.id?.href,
|
|
227
|
-
activity: json,
|
|
228
|
-
recipient
|
|
229
|
-
});
|
|
230
|
-
span.setStatus({
|
|
231
|
-
code: SpanStatusCode.ERROR,
|
|
232
|
-
message: `Failed to enqueue the incoming activity ${activity.id?.href}.`
|
|
233
|
-
});
|
|
234
|
-
throw error;
|
|
235
|
-
}
|
|
236
|
-
logger.info("Activity {activityId} is enqueued.", {
|
|
237
|
-
activityId: activity.id?.href,
|
|
238
|
-
activity: json,
|
|
239
|
-
recipient
|
|
240
|
-
});
|
|
241
|
-
return "enqueued";
|
|
242
|
-
}
|
|
243
|
-
tracerProvider = tracerProvider ?? trace.getTracerProvider();
|
|
244
|
-
return await tracerProvider.getTracer(name, version).startActiveSpan("activitypub.dispatch_inbox_listener", { kind: SpanKind.INTERNAL }, async (span) => {
|
|
245
|
-
const dispatched = inboxListeners?.dispatchWithClass(activity);
|
|
246
|
-
if (dispatched == null) {
|
|
247
|
-
logger.error("Unsupported activity type:\n{activity}", {
|
|
248
|
-
activity: json,
|
|
249
|
-
recipient
|
|
250
|
-
});
|
|
251
|
-
span.setStatus({
|
|
252
|
-
code: SpanStatusCode.UNSET,
|
|
253
|
-
message: `Unsupported activity type: ${getTypeId(activity).href}`
|
|
254
|
-
});
|
|
255
|
-
span.end();
|
|
256
|
-
return "unsupportedActivity";
|
|
257
|
-
}
|
|
258
|
-
const { class: cls, listener } = dispatched;
|
|
259
|
-
span.updateName(`activitypub.dispatch_inbox_listener ${cls.name}`);
|
|
260
|
-
try {
|
|
261
|
-
const contextFactory = listenerInboxContextFactory ?? inboxContextFactory;
|
|
262
|
-
await listener(contextFactory(recipient, contextFactory === inboxContextFactory ? json : originalJson ?? json, activity?.id?.href, getTypeId(activity).href), activity);
|
|
263
|
-
} catch (error) {
|
|
264
|
-
try {
|
|
265
|
-
await inboxErrorHandler?.(ctx, error);
|
|
266
|
-
} catch (error) {
|
|
267
|
-
logger.error("An unexpected error occurred in inbox error handler:\n{error}", {
|
|
268
|
-
error,
|
|
269
|
-
activityId: activity.id?.href,
|
|
270
|
-
activity: json,
|
|
271
|
-
recipient
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
logger.error("Failed to process the incoming activity {activityId}:\n{error}", {
|
|
275
|
-
error,
|
|
276
|
-
activityId: activity.id?.href,
|
|
277
|
-
activity: json,
|
|
278
|
-
recipient
|
|
279
|
-
});
|
|
280
|
-
span.setStatus({
|
|
281
|
-
code: SpanStatusCode.ERROR,
|
|
282
|
-
message: String(error)
|
|
283
|
-
});
|
|
284
|
-
span.end();
|
|
285
|
-
return "error";
|
|
286
|
-
}
|
|
287
|
-
if (cacheKey != null) await kv.set(cacheKey, true, { ttl: Temporal.Duration.from({ days: 1 }) });
|
|
288
|
-
logger.info("Activity {activityId} has been processed.", {
|
|
289
|
-
activityId: activity.id?.href,
|
|
290
|
-
activity: json,
|
|
291
|
-
recipient
|
|
292
|
-
});
|
|
293
|
-
span.end();
|
|
294
|
-
return "success";
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
//#endregion
|
|
298
158
|
//#region src/federation/handler.ts
|
|
299
159
|
const rawInboxContextFactorySymbol = Symbol("fedify.rawInboxContextFactory");
|
|
300
160
|
function isRemoteContextLoadingFailure$1(error) {
|
|
@@ -1160,6 +1020,36 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
1160
1020
|
return await getFailedSignatureResponse(inboxChallengePolicy, kv, kvPrefixes);
|
|
1161
1021
|
}
|
|
1162
1022
|
}
|
|
1023
|
+
if (activity.actorId == null) {
|
|
1024
|
+
logger.error("Missing actor.", {
|
|
1025
|
+
activity: json,
|
|
1026
|
+
recipient
|
|
1027
|
+
});
|
|
1028
|
+
span.setStatus({
|
|
1029
|
+
code: SpanStatusCode.ERROR,
|
|
1030
|
+
message: "Missing actor."
|
|
1031
|
+
});
|
|
1032
|
+
return new Response("Missing actor.", {
|
|
1033
|
+
status: 400,
|
|
1034
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
if (!skipSignatureVerification && activity.id != null && !actorsHaveSameOrigin(activity)) {
|
|
1038
|
+
logger.error("The activity ({activityId}) and its actors do not have the same origin.", {
|
|
1039
|
+
activity: json,
|
|
1040
|
+
recipient,
|
|
1041
|
+
activityId: activity.id.href,
|
|
1042
|
+
actorIds: activity.actorIds.map((actor) => actor.href)
|
|
1043
|
+
});
|
|
1044
|
+
span.setStatus({
|
|
1045
|
+
code: SpanStatusCode.ERROR,
|
|
1046
|
+
message: `The activity (${activity.id.href}) and its actors do not have the same origin.`
|
|
1047
|
+
});
|
|
1048
|
+
return new Response("The activity and its actors do not have the same origin.", {
|
|
1049
|
+
status: 401,
|
|
1050
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1163
1053
|
const routeResult = await routeActivity({
|
|
1164
1054
|
context: ctx,
|
|
1165
1055
|
json,
|
|
@@ -2360,6 +2250,33 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2360
2250
|
activity = await Activity.fromJsonLd(parseInput, parseContext);
|
|
2361
2251
|
span.setAttribute("activitypub.activity.type", getTypeId(activity).href);
|
|
2362
2252
|
if (activity.id != null) span.setAttribute("activitypub.activity.id", activity.id.href);
|
|
2253
|
+
if (activity.actorId == null) {
|
|
2254
|
+
logger.error("Missing actor in queued incoming activity.", {
|
|
2255
|
+
activityId: activity.id?.href,
|
|
2256
|
+
activity: message.activity,
|
|
2257
|
+
recipient: message.identifier
|
|
2258
|
+
});
|
|
2259
|
+
span.setStatus({
|
|
2260
|
+
code: SpanStatusCode.ERROR,
|
|
2261
|
+
message: "Missing actor."
|
|
2262
|
+
});
|
|
2263
|
+
span.end();
|
|
2264
|
+
return;
|
|
2265
|
+
}
|
|
2266
|
+
if (!this.skipSignatureVerification && activity.id != null && !actorsHaveSameOrigin(activity)) {
|
|
2267
|
+
logger.error("The queued activity ({activityId}) and its actors do not have the same origin.", {
|
|
2268
|
+
activityId: activity.id.href,
|
|
2269
|
+
actorIds: activity.actorIds.map((actor) => actor.href),
|
|
2270
|
+
activity: message.activity,
|
|
2271
|
+
recipient: message.identifier
|
|
2272
|
+
});
|
|
2273
|
+
span.setStatus({
|
|
2274
|
+
code: SpanStatusCode.ERROR,
|
|
2275
|
+
message: `The activity (${activity.id.href}) and its actors do not have the same origin.`
|
|
2276
|
+
});
|
|
2277
|
+
span.end();
|
|
2278
|
+
return;
|
|
2279
|
+
}
|
|
2363
2280
|
cacheKey = activity.id == null ? null : [
|
|
2364
2281
|
...this.kvPrefixes.activityIdempotence,
|
|
2365
2282
|
context.origin,
|
|
@@ -3521,20 +3438,6 @@ var ContextImpl = class ContextImpl {
|
|
|
3521
3438
|
activity: await fetched.toJsonLd({ contextLoader })
|
|
3522
3439
|
});
|
|
3523
3440
|
return false;
|
|
3524
|
-
} else if (fetched.actorIds.length < 1) {
|
|
3525
|
-
logger.debug("Fetched activity object is missing an actor; unable to verify.", {
|
|
3526
|
-
recipient,
|
|
3527
|
-
activity: await fetched.toJsonLd({ contextLoader })
|
|
3528
|
-
});
|
|
3529
|
-
return false;
|
|
3530
|
-
}
|
|
3531
|
-
const activityId = fetched.id;
|
|
3532
|
-
if (!fetched.actorIds.every((actor) => actor.origin === activityId.origin)) {
|
|
3533
|
-
logger.debug("Fetched activity object has actors from different origins; unable to verify.", {
|
|
3534
|
-
recipient,
|
|
3535
|
-
activity: await fetched.toJsonLd({ contextLoader })
|
|
3536
|
-
});
|
|
3537
|
-
return false;
|
|
3538
3441
|
}
|
|
3539
3442
|
logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
|
|
3540
3443
|
activity = fetched;
|
|
@@ -3543,6 +3446,20 @@ var ContextImpl = class ContextImpl {
|
|
|
3543
3446
|
recipient,
|
|
3544
3447
|
activity: json
|
|
3545
3448
|
});
|
|
3449
|
+
if (activity.actorId == null) {
|
|
3450
|
+
logger.debug("Activity is missing an actor; unable to verify.", {
|
|
3451
|
+
recipient,
|
|
3452
|
+
activity: json
|
|
3453
|
+
});
|
|
3454
|
+
return false;
|
|
3455
|
+
}
|
|
3456
|
+
if (activity.id != null && !actorsHaveSameOrigin(activity)) {
|
|
3457
|
+
logger.debug("Activity has actors from different origins; unable to verify.", {
|
|
3458
|
+
recipient,
|
|
3459
|
+
activity: json
|
|
3460
|
+
});
|
|
3461
|
+
return false;
|
|
3462
|
+
}
|
|
3546
3463
|
const routeResult = await routeActivity({
|
|
3547
3464
|
context: this,
|
|
3548
3465
|
json,
|
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-
|
|
7
|
+
const require_http = require("./http-DrUG4fPS.cjs");
|
|
8
|
+
const require_middleware = require("./middleware-BWOwEGpy.cjs");
|
|
9
9
|
const require_types = require("./types-DRPjmHVV.cjs");
|
|
10
|
-
const require_proof = require("./proof-
|
|
11
|
-
const require_kv_cache = require("./kv-cache-
|
|
10
|
+
const require_proof = require("./proof-DhaTTn-P.cjs");
|
|
11
|
+
const require_kv_cache = require("./kv-cache-Bk3V1Tiu.cjs");
|
|
12
12
|
const require_federation_mod = require("./federation/mod.cjs");
|
|
13
13
|
require("./nodeinfo/mod.cjs");
|
|
14
14
|
require("./runtime/mod.cjs");
|
package/dist/mod.js
CHANGED
|
@@ -3,11 +3,11 @@ import { URLPattern } from "urlpattern-polyfill";
|
|
|
3
3
|
import "./chunk-CRNNMoPX.js";
|
|
4
4
|
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-BGMIq1cs.js";
|
|
5
5
|
import "./compat/mod.js";
|
|
6
|
-
import { _ as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, g as parseAcceptSignature, h as fulfillAcceptSignature, i as verifyRequest, l as fetchKeyDetailed, m as formatAcceptSignature, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "./http-
|
|
7
|
-
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-
|
|
6
|
+
import { _ as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, g as parseAcceptSignature, h as fulfillAcceptSignature, i as verifyRequest, l as fetchKeyDetailed, m as formatAcceptSignature, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "./http-DJK2udgX.js";
|
|
7
|
+
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-BimXKBcP.js";
|
|
8
8
|
import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-miAYfiGO.js";
|
|
9
|
-
import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-
|
|
10
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-
|
|
9
|
+
import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-CaQ4KG6y.js";
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-DDm80t1K.js";
|
|
11
11
|
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation/mod.js";
|
|
12
12
|
import "./nodeinfo/mod.js";
|
|
13
13
|
import "./runtime/mod.js";
|
|
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as esm_default } from "../esm-DVILvP5e.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
|
-
import "../std__assert-
|
|
6
|
+
import "../std__assert-DNZ4Liil.mjs";
|
|
7
7
|
import { n as assertInstanceOf } from "../assert-BhQd8QHP.mjs";
|
|
8
8
|
import { a as parseProtocol, c as parseUsage, i as parseOutboundService, n as parseInboundService, o as parseServices, r as parseNodeInfo, s as parseSoftware, t as getNodeInfo } from "../client-9F_u23dc.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
@@ -3,9 +3,9 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { r as createRequestContext } from "../context-Dk_tacqz.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
|
-
import "../std__assert-
|
|
6
|
+
import "../std__assert-DNZ4Liil.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
|
|
8
|
-
import { _ as handleNodeInfoJrd, g as handleNodeInfo, o as createFederation } from "../middleware-
|
|
8
|
+
import { _ as handleNodeInfoJrd, g as handleNodeInfo, o as createFederation } from "../middleware-CpXoRHs3.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
//#region src/nodeinfo/handler.test.ts
|
|
11
11
|
test("handleNodeInfo()", async () => {
|
|
@@ -2,8 +2,8 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as assertThrows } from "../assert_throws-
|
|
5
|
+
import "../std__assert-DNZ4Liil.mjs";
|
|
6
|
+
import { t as assertThrows } from "../assert_throws-D4DNWrux.mjs";
|
|
7
7
|
import { t as nodeInfoToJson } from "../types-J53Kw7so.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/nodeinfo/types.test.ts
|
|
@@ -2,7 +2,7 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
|
-
import "../std__assert-
|
|
5
|
+
import "../std__assert-DNZ4Liil.mjs";
|
|
6
6
|
import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
|
|
7
7
|
import { test } from "@fedify/fixture";
|
|
8
8
|
import { SpanKind, SpanStatusCode, TraceFlags } from "@opentelemetry/api";
|
|
@@ -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 { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-CD-8UlUi.mjs";
|
|
5
|
+
import { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-DolXUaLH.mjs";
|
|
6
6
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
7
7
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
import { 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 { c as fetchKey, f as validateCryptoKey, o as exportJwk, p as verifyKeyOwnership, s as fetchActorDocument, v as name, y as version } from "./http-
|
|
3
|
+
import { c as fetchKey, f as validateCryptoKey, o as exportJwk, p as verifyKeyOwnership, s as fetchActorDocument, v as name, y as version } from "./http-DJK2udgX.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, PUBLIC_COLLECTION, getTypeId, isActor } from "@fedify/vocab";
|
|
6
6
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
const require_chunk = require("./chunk-DDcVe30Y.cjs");
|
|
4
|
-
const require_http = require("./http-
|
|
4
|
+
const require_http = require("./http-DrUG4fPS.cjs");
|
|
5
5
|
let _logtape_logtape = require("@logtape/logtape");
|
|
6
6
|
let _fedify_vocab = require("@fedify/vocab");
|
|
7
7
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
5
|
-
import { r as fetchKey, s as validateCryptoKey } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-CD-8UlUi.mjs";
|
|
5
|
+
import { r as fetchKey, s as validateCryptoKey } from "./key-DolXUaLH.mjs";
|
|
6
6
|
import { n as preloadedOnlyDocumentLoader } from "./public-audience-DpJqzPuh.mjs";
|
|
7
7
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-amccRMrV.mjs";
|
|
8
8
|
import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
|
|
@@ -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 doubleKnock } from "./http-
|
|
4
|
+
import { n as version, t as name } from "./deno-CD-8UlUi.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-BBBUbwKh.mjs";
|
|
6
6
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
7
7
|
import { FetchError, UrlError, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
package/dist/sig/http.test.mjs
CHANGED
|
@@ -3,14 +3,14 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as esm_default } from "../esm-DVILvP5e.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
|
-
import { r as assertExists, t as assertStringIncludes } from "../std__assert-
|
|
7
|
-
import {
|
|
6
|
+
import { r as assertExists, t as assertStringIncludes } from "../std__assert-DNZ4Liil.mjs";
|
|
7
|
+
import { r as assertFalse, t as assertThrows } from "../assert_throws-D4DNWrux.mjs";
|
|
8
8
|
import { t as assert } from "../assert-BhQd8QHP.mjs";
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as exportJwk } from "../key-
|
|
11
|
-
import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-
|
|
9
|
+
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
10
|
+
import { t as exportJwk } from "../key-DolXUaLH.mjs";
|
|
11
|
+
import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-BBBUbwKh.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-BAK-tUlf.mjs";
|
|
13
|
-
import { t as KvKeyCache } from "../keycache-
|
|
13
|
+
import { t as KvKeyCache } from "../keycache-BimEQucx.mjs";
|
|
14
14
|
import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
|
|
15
15
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { FetchError, UrlError, exportSpki } from "@fedify/vocab-runtime";
|