@fedify/fedify 2.4.0-dev.2115 → 2.4.0-dev.2122
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-CZcBWrBd.mjs → builder-BCXywsZF.mjs} +3 -3
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{compound-proof-CDuP9MIX.mjs → compound-proof-Fxd45Oy5.mjs} +2 -2
- package/dist/{deno-CCABdw7r.mjs → deno-BZrnW0Qz.mjs} +1 -1
- package/dist/{docloader-Bby5g2iu.mjs → docloader-3BHaS20Z.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/compound-fanout.test.mjs +3 -3
- package/dist/federation/handler-compound-proof.test.mjs +3 -3
- package/dist/federation/handler.test.mjs +5 -5
- package/dist/federation/hashlink-media.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +7 -7
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/outgoing-proof.test.mjs +5 -5
- package/dist/federation/portable-actor.test.mjs +52 -5
- package/dist/federation/portable-gateway-keys.test.mjs +3 -3
- package/dist/federation/portable-inbox.test.mjs +4 -4
- package/dist/federation/portable.test.mjs +127 -30
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/tasks/enqueue.test.mjs +1 -1
- package/dist/federation/tasks/tasks.test.mjs +2 -2
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{federation-DYr384xz.cjs → federation-Ml6NrgRV.cjs} +30 -18
- package/dist/{http-B4mQvNcv.cjs → http-4bmgw-mA.cjs} +1 -1
- package/dist/{http-BcLnr2do.mjs → http-B9BQDNIy.mjs} +4 -4
- package/dist/{http-Ce6_Lf7k.js → http-BETASGl0.js} +1 -1
- package/dist/{key-CkNxztNV.mjs → key-PyYvun0F.mjs} +2 -2
- package/dist/{kv-cache-DwzXzchj.js → kv-cache-C4mv2ZFQ.js} +1 -1
- package/dist/{kv-cache-iFaRIcIL.mjs → kv-cache-CPqUxRL3.mjs} +1 -1
- package/dist/{kv-cache-Dqp_E-1g.cjs → kv-cache-D2Bz6t_c.cjs} +1 -1
- package/dist/{ld-CnT0f1nU.mjs → ld-u4JOD4iO.mjs} +3 -3
- package/dist/{metrics-em_7lwhG.mjs → metrics-DCLoLvLz.mjs} +1 -1
- package/dist/{middleware-U9IuzvDO.mjs → middleware-B7bmtONC.mjs} +1 -1
- package/dist/{middleware-BpwKvOpU.mjs → middleware-CgOqRkK-.mjs} +47 -35
- package/dist/{middleware-DhIBngkj.js → middleware-DWlAGlyP.js} +38 -26
- package/dist/mod.cjs +5 -5
- package/dist/mod.js +5 -5
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/{owner-9LiHmOv1.mjs → owner-CPFM-sqo.mjs} +3 -3
- package/dist/{owner-BtoMCv6Z.cjs → owner-DkA0Lz7v.cjs} +1 -1
- package/dist/{owner-Cb3ytrlq.js → owner-wNinn7RK.js} +1 -1
- package/dist/{portable-key-9ck61lI0.mjs → portable-key-DyylakVV.mjs} +1 -1
- package/dist/{proof-xdPYGPaA.mjs → proof-BCOg7Njv.mjs} +4 -4
- package/dist/{send-Bf8rSWch.mjs → send-C8eOPat3.mjs} +3 -3
- package/dist/sig/compound-proof-discovery.test.mjs +1 -1
- package/dist/sig/compound-proof-producer.test.mjs +1 -1
- package/dist/sig/compound-proof-verification.test.mjs +2 -2
- package/dist/sig/compound-proof.test.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 +3 -3
- package/dist/sig/mod.js +3 -3
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/portable-collection.test.mjs +2 -2
- package/dist/sig/portable-key.test.mjs +5 -5
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/{sig-DN9pOglI.js → sig-C1xOA4ml.js} +2 -2
- package/dist/{sig-Bj3fHnv0.cjs → sig-Cb9VSeiF.cjs} +2 -2
- package/dist/{temporal-tAtwv6vX.mjs → temporal-vjHOhBpy.mjs} +1 -1
- package/dist/testing/kv.test.mjs +1 -1
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "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-BZrnW0Qz.mjs";
|
|
5
5
|
import { s as isPortableId } from "./portable-key-id-T7lecIbt.mjs";
|
|
6
6
|
import { t as ActivityListenerSet } from "./activity-listener-C-BSbKI7.mjs";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
@@ -89,7 +89,7 @@ var FederationBuilderImpl = class {
|
|
|
89
89
|
* specified.
|
|
90
90
|
*/
|
|
91
91
|
async build(options) {
|
|
92
|
-
const { FederationImpl } = await import("./middleware-
|
|
92
|
+
const { FederationImpl } = await import("./middleware-B7bmtONC.mjs");
|
|
93
93
|
const f = new FederationImpl(options);
|
|
94
94
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
95
95
|
f.router = this.router.clone();
|
|
@@ -705,7 +705,7 @@ function warnMismatchedTombstoneId(context, cls, values, tombstone) {
|
|
|
705
705
|
});
|
|
706
706
|
return;
|
|
707
707
|
}
|
|
708
|
-
if (tombstone.id
|
|
708
|
+
if (isPortableId(tombstone.id)) return;
|
|
709
709
|
const expected = context.getObjectUri(cls, values);
|
|
710
710
|
if (tombstone.id.href !== expected.href) logger.warn("Object dispatcher for {class} returned a tombstone with an id property {tombstoneId} that does not match the object URI {objectUri}. Set the property with Context.getObjectUri().", {
|
|
711
711
|
class: cls.name,
|
|
@@ -5,7 +5,7 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
6
|
import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
7
7
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
8
|
-
import { E as autoIdAssigner, T as actorDehydrator, n as FederationImpl } from "../middleware-
|
|
8
|
+
import { E as autoIdAssigner, T as actorDehydrator, n as FederationImpl } from "../middleware-CgOqRkK-.mjs";
|
|
9
9
|
import { Follow, Person } from "@fedify/vocab";
|
|
10
10
|
import { test } from "@fedify/fixture";
|
|
11
11
|
//#region src/compat/transformers.test.ts
|
|
@@ -3,8 +3,8 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { s as isPortableId, t as getCanonicalPortableId } from "./portable-key-id-T7lecIbt.mjs";
|
|
5
5
|
import { n as preloadedOnlyDocumentLoader } from "./public-audience--klBIOk1.mjs";
|
|
6
|
-
import { c as getNormalizationContextLoader } from "./ld-
|
|
7
|
-
import { a as verifyMapLocalProof, c as verifyPortableObjectProofPolicy } from "./proof-
|
|
6
|
+
import { c as getNormalizationContextLoader } from "./ld-u4JOD4iO.mjs";
|
|
7
|
+
import { a as verifyMapLocalProof, c as verifyPortableObjectProofPolicy } from "./proof-BCOg7Njv.mjs";
|
|
8
8
|
import { fromCompatibleEf61Id, parseIri } from "@fedify/vocab-runtime";
|
|
9
9
|
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
10
10
|
//#region src/sig/compound-proof.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { c as validateCryptoKey } from "./key-
|
|
5
|
-
import { n as doubleKnock } from "./http-
|
|
4
|
+
import { c as validateCryptoKey } from "./key-PyYvun0F.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-B9BQDNIy.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { curry } from "es-toolkit";
|
|
8
8
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
@@ -6,7 +6,7 @@ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
|
6
6
|
import { t as assertExists } from "../assert_exists-cffSpJ7X.mjs";
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
8
8
|
import "../std__assert-DvMDRPes.mjs";
|
|
9
|
-
import { r as createFederationBuilder } from "../builder-
|
|
9
|
+
import { r as createFederationBuilder } from "../builder-BCXywsZF.mjs";
|
|
10
10
|
import { DisallowedOperatorError, DisallowedVarSpecModifierError, DuplicateRouteVariableError, RouteTemplateOptionsNotMatchedError, RouterError } from "@fedify/uri-template";
|
|
11
11
|
import { Activity, Note, Person } from "@fedify/vocab";
|
|
12
12
|
import { test } from "@fedify/fixture";
|
|
@@ -6,11 +6,11 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
7
|
import "../std__assert-DvMDRPes.mjs";
|
|
8
8
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
9
|
-
import { n as exportJwk } from "../key-
|
|
9
|
+
import { n as exportJwk } from "../key-PyYvun0F.mjs";
|
|
10
10
|
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
|
|
11
|
-
import { i as signObject, u as verifyProof } from "../proof-
|
|
11
|
+
import { i as signObject, u as verifyProof } from "../proof-BCOg7Njv.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
13
|
-
import { n as FederationImpl } from "../middleware-
|
|
13
|
+
import { n as FederationImpl } from "../middleware-CgOqRkK-.mjs";
|
|
14
14
|
import { Create, DataIntegrityProof, Note } from "@fedify/vocab";
|
|
15
15
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { exportDidKey, parseIri } from "@fedify/vocab-runtime";
|
|
@@ -5,10 +5,10 @@ import { r as createRequestContext, t as createInboxContext } from "../context-C
|
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
7
|
import "../std__assert-DvMDRPes.mjs";
|
|
8
|
-
import { a as compactJsonLd, m as verifyCompactJsonLd, p as signJsonLd } from "../ld-
|
|
9
|
-
import { l as signRequest } from "../http-
|
|
8
|
+
import { a as compactJsonLd, m as verifyCompactJsonLd, p as signJsonLd } from "../ld-u4JOD4iO.mjs";
|
|
9
|
+
import { l as signRequest } from "../http-B9BQDNIy.mjs";
|
|
10
10
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
11
|
-
import { f as handleInbox, o as createFederation } from "../middleware-
|
|
11
|
+
import { f as handleInbox, o as createFederation } from "../middleware-CgOqRkK-.mjs";
|
|
12
12
|
import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
|
|
13
13
|
import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
|
|
14
14
|
import { Create } from "@fedify/vocab";
|
|
@@ -10,12 +10,12 @@ import "../std__assert-DvMDRPes.mjs";
|
|
|
10
10
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
11
11
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
12
12
|
import { r as parseAcceptSignature } from "../accept-CPVqki78.mjs";
|
|
13
|
-
import { o as generateCryptoKeyPair } from "../key-
|
|
14
|
-
import { a as compactJsonLd, p as signJsonLd } from "../ld-
|
|
15
|
-
import { i as signObject } from "../proof-
|
|
16
|
-
import { l as signRequest } from "../http-
|
|
13
|
+
import { o as generateCryptoKeyPair } from "../key-PyYvun0F.mjs";
|
|
14
|
+
import { a as compactJsonLd, p as signJsonLd } from "../ld-u4JOD4iO.mjs";
|
|
15
|
+
import { i as signObject } from "../proof-BCOg7Njv.mjs";
|
|
16
|
+
import { l as signRequest } from "../http-B9BQDNIy.mjs";
|
|
17
17
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
18
|
-
import { d as handleCustomCollection, f as handleInbox, g as respondWithObjectIfAcceptable, h as respondWithObject, l as handleActor, m as handleOutbox, o as createFederation, p as handleObject, u as handleCollection } from "../middleware-
|
|
18
|
+
import { d as handleCustomCollection, f as handleInbox, g as respondWithObjectIfAcceptable, h as respondWithObject, l as handleActor, m as handleOutbox, o as createFederation, p as handleObject, u as handleCollection } from "../middleware-CgOqRkK-.mjs";
|
|
19
19
|
import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
|
|
20
20
|
import { Activity, Create, CryptographicKey, Multikey, Note, Person, Tombstone } from "@fedify/vocab";
|
|
21
21
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -10,8 +10,8 @@ import "../std__assert-DvMDRPes.mjs";
|
|
|
10
10
|
import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
|
|
11
11
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
12
12
|
import { r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
13
|
-
import { o as createFederation, x as parseHashlinkGatewayRequest } from "../middleware-
|
|
14
|
-
import { r as createFederationBuilder } from "../builder-
|
|
13
|
+
import { o as createFederation, x as parseHashlinkGatewayRequest } from "../middleware-CgOqRkK-.mjs";
|
|
14
|
+
import { r as createFederationBuilder } from "../builder-BCXywsZF.mjs";
|
|
15
15
|
import { n as RouterError } from "../router-u5O5KCQr.mjs";
|
|
16
16
|
import { Note } from "@fedify/vocab";
|
|
17
17
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
6
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
|
-
import { i as signObject } from "../proof-
|
|
7
|
+
import { i as signObject } from "../proof-BCOg7Njv.mjs";
|
|
8
8
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
9
|
-
import { o as createFederation } from "../middleware-
|
|
9
|
+
import { o as createFederation } from "../middleware-CgOqRkK-.mjs";
|
|
10
10
|
import { Create, Follow, Person } from "@fedify/vocab";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
//#region src/federation/idempotency.test.ts
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
6
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
7
|
-
import { _ as recordKeyLookup, a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-
|
|
7
|
+
import { _ as recordKeyLookup, a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-DCLoLvLz.mjs";
|
|
8
8
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
9
9
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
10
10
|
import { DataPointType, MeterProvider, MetricReader } from "@opentelemetry/sdk-metrics";
|
|
@@ -16,14 +16,14 @@ import "../std__assert-DvMDRPes.mjs";
|
|
|
16
16
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
17
17
|
import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
|
|
18
18
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
19
|
-
import { g as recordInboxActivity } from "../metrics-
|
|
20
|
-
import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-
|
|
21
|
-
import { i as signObject, o as verifyObject } from "../proof-
|
|
22
|
-
import { d as verifyRequest, l as signRequest } from "../http-
|
|
19
|
+
import { g as recordInboxActivity } from "../metrics-DCLoLvLz.mjs";
|
|
20
|
+
import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-u4JOD4iO.mjs";
|
|
21
|
+
import { i as signObject, o as verifyObject } from "../proof-BCOg7Njv.mjs";
|
|
22
|
+
import { d as verifyRequest, l as signRequest } from "../http-B9BQDNIy.mjs";
|
|
23
23
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
24
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
25
|
-
import { S as handleBenchmarkTrigger, i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-
|
|
26
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
24
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-3BHaS20Z.mjs";
|
|
25
|
+
import { S as handleBenchmarkTrigger, i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-CgOqRkK-.mjs";
|
|
26
|
+
import { t as doesActorOwnKey } from "../owner-CPFM-sqo.mjs";
|
|
27
27
|
import { t as CircuitBreaker } from "../circuit-breaker-C5NqoLBJ.mjs";
|
|
28
28
|
import { t as TaskCodec } from "../codec-C6rTrpIp.mjs";
|
|
29
29
|
import { t as markCircuitBreakerLegacySweepDone } from "../circuit-breaker-test-utils-DW6YC_Pe.mjs";
|
package/dist/federation/mod.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_federation = require("../federation-
|
|
3
|
+
const require_federation = require("../federation-Ml6NrgRV.cjs");
|
|
4
4
|
exports.CircuitBreaker = require_federation.CircuitBreaker;
|
|
5
5
|
exports.InProcessMessageQueue = require_federation.InProcessMessageQueue;
|
|
6
6
|
exports.MemoryKvStore = require_federation.MemoryKvStore;
|
package/dist/federation/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { a as respondWithObjectIfAcceptable, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as respondWithObject, l as CircuitBreaker, n as handleWebFinger, o as SendActivityError, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "../middleware-
|
|
3
|
+
import { a as respondWithObjectIfAcceptable, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as respondWithObject, l as CircuitBreaker, n as handleWebFinger, o as SendActivityError, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "../middleware-DWlAGlyP.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { Router as Router$1, RouterError as RouterError$1, assertPath, isPath } from "@fedify/uri-template";
|
|
6
6
|
import { isEqual } from "es-toolkit";
|
|
@@ -7,12 +7,12 @@ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
|
7
7
|
import "../std__assert-DvMDRPes.mjs";
|
|
8
8
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
9
9
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
10
|
-
import { n as exportJwk } from "../key-
|
|
11
|
-
import { s as detachSignature } from "../ld-
|
|
12
|
-
import { i as signObject } from "../proof-
|
|
10
|
+
import { n as exportJwk } from "../key-PyYvun0F.mjs";
|
|
11
|
+
import { s as detachSignature } from "../ld-u4JOD4iO.mjs";
|
|
12
|
+
import { i as signObject } from "../proof-BCOg7Njv.mjs";
|
|
13
13
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
14
|
-
import { c as assertPortableActorActivity, n as FederationImpl, o as createFederation } from "../middleware-
|
|
15
|
-
import { a as verifyCompoundPortableObjectProofs } from "../compound-proof-
|
|
14
|
+
import { c as assertPortableActorActivity, n as FederationImpl, o as createFederation } from "../middleware-CgOqRkK-.mjs";
|
|
15
|
+
import { a as verifyCompoundPortableObjectProofs } from "../compound-proof-Fxd45Oy5.mjs";
|
|
16
16
|
import { configure, reset } from "@logtape/logtape";
|
|
17
17
|
import { Create, Note, Person } from "@fedify/vocab";
|
|
18
18
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "temporal-polyfill";
|
|
1
|
+
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
@@ -8,10 +8,10 @@ import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
|
8
8
|
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
9
9
|
import "../std__assert-DvMDRPes.mjs";
|
|
10
10
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
11
|
-
import { i as signObject, s as verifyPortableObjectProof } from "../proof-
|
|
12
|
-
import { d as verifyRequest, l as signRequest } from "../http-
|
|
11
|
+
import { i as signObject, s as verifyPortableObjectProof } from "../proof-BCOg7Njv.mjs";
|
|
12
|
+
import { d as verifyRequest, l as signRequest } from "../http-B9BQDNIy.mjs";
|
|
13
13
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
14
|
-
import { b as PORTABLE_OBJECT_CONTENT_TYPE, o as createFederation } from "../middleware-
|
|
14
|
+
import { b as PORTABLE_OBJECT_CONTENT_TYPE, o as createFederation } from "../middleware-CgOqRkK-.mjs";
|
|
15
15
|
import { n as RouterError } from "../router-u5O5KCQr.mjs";
|
|
16
16
|
import { configure, reset } from "@logtape/logtape";
|
|
17
17
|
import { Note, Person, Tombstone, lookupObject } from "@fedify/vocab";
|
|
@@ -53,6 +53,8 @@ const users = {
|
|
|
53
53
|
tampered: did,
|
|
54
54
|
https: did,
|
|
55
55
|
tombstone: did,
|
|
56
|
+
"signed-tombstone": did,
|
|
57
|
+
"wrong-key-tombstone": did,
|
|
56
58
|
"mutated-id": did,
|
|
57
59
|
compatible: did,
|
|
58
60
|
"a b/ç": did
|
|
@@ -88,6 +90,12 @@ function createTestFederation(options = {}) {
|
|
|
88
90
|
return await sign(actor.clone({ id: toCompatibleEf61Id(actor.id, ORIGIN) }));
|
|
89
91
|
}
|
|
90
92
|
case "tombstone": return new Tombstone({ id: ctx.getPortableActorUri(identifier, userDid) });
|
|
93
|
+
case "signed-tombstone": return await sign(new Tombstone({
|
|
94
|
+
id: ctx.getPortableActorUri(identifier, userDid),
|
|
95
|
+
formerType: Person,
|
|
96
|
+
deleted: Temporal.Instant.from("2026-01-01T00:00:00Z")
|
|
97
|
+
}));
|
|
98
|
+
case "wrong-key-tombstone": return await sign(new Tombstone({ id: ctx.getPortableActorUri(identifier, userDid) }), otherKeyPair.privateKey, otherKeyId);
|
|
91
99
|
case "unsigned": return await portableActor(ctx, identifier, userDid);
|
|
92
100
|
case "wrong-key": return await sign(await portableActor(ctx, identifier, userDid), otherKeyPair.privateKey, otherKeyId);
|
|
93
101
|
case "tampered": return (await sign(await portableActor(ctx, identifier, userDid))).clone({ name: "Tampered" });
|
|
@@ -260,6 +268,7 @@ test("Federation.fetch() serves portable actors through the actor dispatcher", a
|
|
|
260
268
|
gatewayRequest("/users/missing"),
|
|
261
269
|
gatewayRequest("/users/https"),
|
|
262
270
|
gatewayRequest("/users/tombstone"),
|
|
271
|
+
gatewayRequest("/users/tombstone", { method: "HEAD" }),
|
|
263
272
|
gatewayRequest("/users/alice", { authority: otherDid }),
|
|
264
273
|
gatewayRequest("/users/mutated-id")
|
|
265
274
|
]) {
|
|
@@ -278,13 +287,36 @@ test("Federation.fetch() serves portable actors through the actor dispatcher", a
|
|
|
278
287
|
for (const identifier of [
|
|
279
288
|
"unsigned",
|
|
280
289
|
"wrong-key",
|
|
281
|
-
"tampered"
|
|
290
|
+
"tampered",
|
|
291
|
+
"wrong-key-tombstone"
|
|
282
292
|
]) {
|
|
283
293
|
const response = await federation.fetch(gatewayRequest(`/users/${identifier}`), { contextData: void 0 });
|
|
284
294
|
assertEquals(response.status, 500, identifier);
|
|
285
295
|
assertEquals(await response.text(), "Internal server error.");
|
|
286
296
|
}
|
|
287
297
|
});
|
|
298
|
+
await t.step("serves a signed tombstone with 410 Gone", async () => {
|
|
299
|
+
const response = await federation.fetch(gatewayRequest("/users/signed-tombstone"), { contextData: void 0 });
|
|
300
|
+
assertEquals(response.status, 410);
|
|
301
|
+
assertEquals(response.headers.get("Content-Type"), PORTABLE_OBJECT_CONTENT_TYPE);
|
|
302
|
+
assertEquals(response.headers.get("Vary"), "Accept");
|
|
303
|
+
const json = await response.json();
|
|
304
|
+
assertEquals(json.type, "Tombstone");
|
|
305
|
+
assertEquals(json.id, `ap+ef61://${did}/users/signed-tombstone`);
|
|
306
|
+
assertEquals(json.deleted, "2026-01-01T00:00:00Z");
|
|
307
|
+
assertEquals((await verifyPortableObjectProof(json, { contextLoader: mockDocumentLoader })).verified, true);
|
|
308
|
+
});
|
|
309
|
+
await t.step("responds to HEAD for a tombstone without a body", async () => {
|
|
310
|
+
const response = await federation.fetch(gatewayRequest("/users/signed-tombstone", { method: "HEAD" }), { contextData: void 0 });
|
|
311
|
+
assertEquals(response.status, 410);
|
|
312
|
+
assertEquals(response.headers.get("Content-Type"), PORTABLE_OBJECT_CONTENT_TYPE);
|
|
313
|
+
assertEquals(response.body, null);
|
|
314
|
+
});
|
|
315
|
+
await t.step("keeps ordinary tombstone requests unchanged", async () => {
|
|
316
|
+
const response = await federation.fetch(new Request(`${ORIGIN}/users/signed-tombstone`, { headers: { Accept: ACCEPT } }), { contextData: void 0 });
|
|
317
|
+
assertEquals(response.status, 410);
|
|
318
|
+
assertEquals(response.headers.get("Content-Type"), "application/activity+json");
|
|
319
|
+
});
|
|
288
320
|
await t.step("keeps ordinary actor requests unchanged", async () => {
|
|
289
321
|
const response = await federation.fetch(new Request(`${ORIGIN}/users/https`, { headers: { Accept: ACCEPT } }), { contextData: void 0 });
|
|
290
322
|
assertEquals(response.status, 200);
|
|
@@ -329,6 +361,21 @@ test("Federation.fetch() authorizes portable actor requests", async (t) => {
|
|
|
329
361
|
})).status, 401);
|
|
330
362
|
assertEquals(unauthorized, true);
|
|
331
363
|
});
|
|
364
|
+
await t.step("authorizes before serving a tombstone", async () => {
|
|
365
|
+
for (const identifier of ["signed-tombstone", "tombstone"]) {
|
|
366
|
+
identifiers.length = 0;
|
|
367
|
+
let unauthorized = false;
|
|
368
|
+
assertEquals((await federation.fetch(gatewayRequest(`/users/${identifier}`), {
|
|
369
|
+
contextData: void 0,
|
|
370
|
+
onUnauthorized() {
|
|
371
|
+
unauthorized = true;
|
|
372
|
+
return new Response("Unauthorized", { status: 401 });
|
|
373
|
+
}
|
|
374
|
+
})).status, 401, identifier);
|
|
375
|
+
assertEquals(unauthorized, true, identifier);
|
|
376
|
+
assertEquals(identifiers, [identifier]);
|
|
377
|
+
}
|
|
378
|
+
});
|
|
332
379
|
await t.step("denies a request whose target was tampered with", async () => {
|
|
333
380
|
const signed = await signRequest(gatewayRequest("/users/alice"), rsaPrivateKey3, rsaPublicKey3.id);
|
|
334
381
|
assertEquals((await federation.fetch(new Request(gatewayUrl("/actor"), { headers: signed.headers }), { contextData: void 0 })).status, 401);
|
|
@@ -7,10 +7,10 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
7
7
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
8
8
|
import "../std__assert-DvMDRPes.mjs";
|
|
9
9
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
10
|
-
import { p as signJsonLd } from "../ld-
|
|
11
|
-
import { l as signRequest } from "../http-
|
|
10
|
+
import { p as signJsonLd } from "../ld-u4JOD4iO.mjs";
|
|
11
|
+
import { l as signRequest } from "../http-B9BQDNIy.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
13
|
-
import { f as handleInbox, n as FederationImpl, o as createFederation } from "../middleware-
|
|
13
|
+
import { f as handleInbox, n as FederationImpl, o as createFederation } from "../middleware-CgOqRkK-.mjs";
|
|
14
14
|
import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
|
|
15
15
|
import { t as KvKeyCache } from "../keycache-BInaECGj.mjs";
|
|
16
16
|
import { Create, CryptographicKey, Person } from "@fedify/vocab";
|
|
@@ -8,11 +8,11 @@ import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
|
8
8
|
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
9
9
|
import "../std__assert-DvMDRPes.mjs";
|
|
10
10
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
11
|
-
import { p as signJsonLd } from "../ld-
|
|
12
|
-
import { i as signObject } from "../proof-
|
|
13
|
-
import { f as verifyRequestDetailed, l as signRequest } from "../http-
|
|
11
|
+
import { p as signJsonLd } from "../ld-u4JOD4iO.mjs";
|
|
12
|
+
import { i as signObject } from "../proof-BCOg7Njv.mjs";
|
|
13
|
+
import { f as verifyRequestDetailed, l as signRequest } from "../http-B9BQDNIy.mjs";
|
|
14
14
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
15
|
-
import { _ as coversDelivery, o as createFederation, v as forwardPortableInboxActivity, y as resolvePortableInboxForwardingOptions } from "../middleware-
|
|
15
|
+
import { _ as coversDelivery, o as createFederation, v as forwardPortableInboxActivity, y as resolvePortableInboxForwardingOptions } from "../middleware-CgOqRkK-.mjs";
|
|
16
16
|
import { Create, CryptographicKey, Follow, Note, Person, Tombstone } from "@fedify/vocab";
|
|
17
17
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
18
18
|
import { exportDidKey, formatIri, parseIri } from "@fedify/vocab-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "temporal-polyfill";
|
|
1
|
+
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
@@ -8,10 +8,10 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
|
8
8
|
import "../std__assert-DvMDRPes.mjs";
|
|
9
9
|
import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
|
|
10
10
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
11
|
-
import { i as signObject, s as verifyPortableObjectProof } from "../proof-
|
|
12
|
-
import { l as signRequest } from "../http-
|
|
11
|
+
import { i as signObject, s as verifyPortableObjectProof } from "../proof-BCOg7Njv.mjs";
|
|
12
|
+
import { l as signRequest } from "../http-B9BQDNIy.mjs";
|
|
13
13
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
14
|
-
import { b as PORTABLE_OBJECT_CONTENT_TYPE, o as createFederation } from "../middleware-
|
|
14
|
+
import { b as PORTABLE_OBJECT_CONTENT_TYPE, o as createFederation } from "../middleware-CgOqRkK-.mjs";
|
|
15
15
|
import { configure, reset } from "@logtape/logtape";
|
|
16
16
|
import { Collection, Create, Note, Object as Object$1, Person, Tombstone, lookupObject } from "@fedify/vocab";
|
|
17
17
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -220,18 +220,6 @@ test("Federation.fetch() applies the FEP-ef61 proof policy to portable objects",
|
|
|
220
220
|
inbox: parseIri(`ap+ef61://${did}/objects/unsigned-actor/inbox`),
|
|
221
221
|
outbox: parseIri(`ap+ef61://${did}/objects/unsigned-actor/outbox`),
|
|
222
222
|
gateways: [new URL("https://example.com/")]
|
|
223
|
-
})),
|
|
224
|
-
"tombstone": () => sign(new Tombstone({
|
|
225
|
-
id: parseIri(`ap+ef61://${did}/objects/tombstone`),
|
|
226
|
-
formerType: Note
|
|
227
|
-
})),
|
|
228
|
-
"unsigned-tombstone": () => Promise.resolve(new Tombstone({
|
|
229
|
-
id: parseIri(`ap+ef61://${did}/objects/unsigned-tombstone`),
|
|
230
|
-
formerType: Note
|
|
231
|
-
})),
|
|
232
|
-
"mismatched-tombstone": () => sign(new Tombstone({
|
|
233
|
-
id: parseIri(`ap+ef61://${did}/objects/other`),
|
|
234
|
-
formerType: Note
|
|
235
223
|
}))
|
|
236
224
|
};
|
|
237
225
|
federation.setObjectDispatcher(Object$1, "/objects/{id}", (_ctx, { id }) => objects[id]?.() ?? null);
|
|
@@ -246,10 +234,7 @@ test("Federation.fetch() applies the FEP-ef61 proof policy to portable objects",
|
|
|
246
234
|
"activity": 200,
|
|
247
235
|
"actor": 200,
|
|
248
236
|
"mutated-id": 404,
|
|
249
|
-
"unsigned-actor": 500
|
|
250
|
-
"tombstone": 200,
|
|
251
|
-
"unsigned-tombstone": 500,
|
|
252
|
-
"mismatched-tombstone": 404
|
|
237
|
+
"unsigned-actor": 500
|
|
253
238
|
})) await t.step(`${id} → ${status}`, async () => {
|
|
254
239
|
const response = await federation.fetch(gatewayRequest(`/objects/${id}`), { contextData: void 0 });
|
|
255
240
|
assertEquals(response.status, status);
|
|
@@ -260,17 +245,129 @@ test("Federation.fetch() applies the FEP-ef61 proof policy to portable objects",
|
|
|
260
245
|
assertEquals(response.status, 500);
|
|
261
246
|
assertEquals(response.body, null);
|
|
262
247
|
});
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
248
|
+
});
|
|
249
|
+
test("Federation.fetch() serves tombstones of portable objects", async (t) => {
|
|
250
|
+
const federation = createTestFederation();
|
|
251
|
+
const compatible = (path) => new URL(`https://example.com/.well-known/apgateway/${did}${path}`);
|
|
252
|
+
const tombstoneFromJsonLd = (path, properties) => Tombstone.fromJsonLd({
|
|
253
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
254
|
+
type: "Tombstone",
|
|
255
|
+
id: `ap+ef61://${did}${path}`,
|
|
256
|
+
...properties
|
|
257
|
+
}, {
|
|
258
|
+
contextLoader: mockDocumentLoader,
|
|
259
|
+
documentLoader: mockDocumentLoader
|
|
269
260
|
});
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
261
|
+
const tombstones = {
|
|
262
|
+
"signed": () => sign(new Tombstone({
|
|
263
|
+
id: parseIri(`ap+ef61://${did}/notes/signed`),
|
|
264
|
+
formerType: Note,
|
|
265
|
+
deleted: Temporal.Instant.from("2026-01-01T00:00:00Z")
|
|
266
|
+
})),
|
|
267
|
+
"compatible": () => sign(new Tombstone({
|
|
268
|
+
id: compatible("/notes/compatible"),
|
|
269
|
+
formerType: Note
|
|
270
|
+
})),
|
|
271
|
+
"signed-collection": async () => sign(await tombstoneFromJsonLd("/notes/signed-collection", { totalItems: 0 })),
|
|
272
|
+
"unsigned": () => Promise.resolve(new Tombstone({
|
|
273
|
+
id: parseIri(`ap+ef61://${did}/notes/unsigned`),
|
|
274
|
+
formerType: Note
|
|
275
|
+
})),
|
|
276
|
+
"wrong-did": () => sign(new Tombstone({ id: parseIri(`ap+ef61://${did}/notes/wrong-did`) }), otherKeyPair.privateKey, otherKeyId),
|
|
277
|
+
"tampered": async () => (await sign(new Tombstone({ id: parseIri(`ap+ef61://${did}/notes/tampered`) }))).clone({ formerType: Note }),
|
|
278
|
+
"unsigned-collection": () => tombstoneFromJsonLd("/notes/unsigned-collection", { totalItems: 0 }),
|
|
279
|
+
"link": () => tombstoneFromJsonLd("/notes/link", { href: "https://example.com/" }),
|
|
280
|
+
"mismatched": () => sign(new Tombstone({ id: parseIri(`ap+ef61://${did}/notes/other`) })),
|
|
281
|
+
"mutated-id": async () => {
|
|
282
|
+
const signed = await sign(new Tombstone({ id: parseIri(`ap+ef61://${did}/notes/original`) }));
|
|
283
|
+
const tombstone = await Tombstone.fromJsonLd(await signed.toJsonLd({ contextLoader: mockDocumentLoader }), {
|
|
284
|
+
contextLoader: mockDocumentLoader,
|
|
285
|
+
documentLoader: mockDocumentLoader
|
|
286
|
+
});
|
|
287
|
+
tombstone.id.pathname = tombstone.id.pathname.replace(/original$/, "mutated-id");
|
|
288
|
+
return tombstone;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
federation.setObjectDispatcher(Note, "/notes/{id}", (_ctx, { id }) => tombstones[id]?.() ?? null).authorize((ctx) => ctx.request.headers.get("X-Deny") == null);
|
|
292
|
+
for (const [id, reason] of globalThis.Object.entries({
|
|
293
|
+
"unsigned": "missingProof",
|
|
294
|
+
"wrong-did": "verificationMethodMismatch",
|
|
295
|
+
"tampered": "invalidProof",
|
|
296
|
+
"unsigned-collection": "unsecuredCollection",
|
|
297
|
+
"link": "unsupportedObjectType"
|
|
298
|
+
})) {
|
|
299
|
+
const result = await verifyPortableObjectProof(await (await tombstones[id]()).toJsonLd({ contextLoader: mockDocumentLoader }), { contextLoader: mockDocumentLoader });
|
|
300
|
+
assert(!result.verified, id);
|
|
301
|
+
assertEquals(result.reason.type, reason, id);
|
|
302
|
+
}
|
|
303
|
+
for (const [id, status] of globalThis.Object.entries({
|
|
304
|
+
"signed": 410,
|
|
305
|
+
"compatible": 410,
|
|
306
|
+
"signed-collection": 410,
|
|
307
|
+
"unsigned": 404,
|
|
308
|
+
"wrong-did": 500,
|
|
309
|
+
"tampered": 500,
|
|
310
|
+
"unsigned-collection": 500,
|
|
311
|
+
"link": 500,
|
|
312
|
+
"mismatched": 404,
|
|
313
|
+
"mutated-id": 404
|
|
314
|
+
})) await t.step(`${id} → ${status}`, async () => {
|
|
315
|
+
let notFound = false;
|
|
316
|
+
const response = await federation.fetch(gatewayRequest(`/notes/${id}`), {
|
|
317
|
+
contextData: void 0,
|
|
318
|
+
onNotFound() {
|
|
319
|
+
notFound = true;
|
|
320
|
+
return new Response("Not found", { status: 404 });
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
assertEquals(response.status, status);
|
|
324
|
+
assertEquals(notFound, status === 404);
|
|
325
|
+
if (status === 410) {
|
|
326
|
+
assertEquals(response.headers.get("Content-Type"), PORTABLE_OBJECT_CONTENT_TYPE);
|
|
327
|
+
assertEquals(response.headers.get("Vary"), "Accept");
|
|
328
|
+
const body = await response.json();
|
|
329
|
+
assertEquals(body.type, "Tombstone");
|
|
330
|
+
assert((await verifyPortableObjectProof(body, { contextLoader: mockDocumentLoader })).verified);
|
|
331
|
+
} else if (status === 500) assertEquals(await response.text(), "Internal server error.");
|
|
332
|
+
});
|
|
333
|
+
await t.step("serves the tombstone as the dispatcher returns it", async () => {
|
|
334
|
+
let response = await federation.fetch(gatewayRequest("/notes/signed"), { contextData: void 0 });
|
|
335
|
+
let body = await response.json();
|
|
336
|
+
assertEquals(body.id, `ap+ef61://${did}/notes/signed`);
|
|
337
|
+
assertEquals(body.formerType, "as:Note");
|
|
338
|
+
assertEquals(body.deleted, "2026-01-01T00:00:00Z");
|
|
339
|
+
response = await federation.fetch(gatewayRequest("/notes/compatible"), { contextData: void 0 });
|
|
340
|
+
body = await response.json();
|
|
341
|
+
assertEquals(body.id, compatible("/notes/compatible").href);
|
|
342
|
+
});
|
|
343
|
+
await t.step("responds to HEAD without a body", async () => {
|
|
344
|
+
for (const [id, status] of [["signed", 410], ["unsigned", 404]]) {
|
|
345
|
+
const response = await federation.fetch(gatewayRequest(`/notes/${id}`, { method: "HEAD" }), { contextData: void 0 });
|
|
346
|
+
assertEquals(response.status, status, id);
|
|
347
|
+
assertEquals(response.body, null, id);
|
|
348
|
+
if (status === 410) {
|
|
349
|
+
assertEquals(response.headers.get("Content-Type"), PORTABLE_OBJECT_CONTENT_TYPE);
|
|
350
|
+
assertEquals(response.headers.get("Vary"), "Accept");
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
await t.step("authorizes before serving a tombstone", async () => {
|
|
355
|
+
for (const id of ["signed", "unsigned"]) {
|
|
356
|
+
let unauthorized = false;
|
|
357
|
+
assertEquals((await federation.fetch(gatewayRequest(`/notes/${id}`, { headers: { "X-Deny": "1" } }), {
|
|
358
|
+
contextData: void 0,
|
|
359
|
+
onUnauthorized() {
|
|
360
|
+
unauthorized = true;
|
|
361
|
+
return new Response("Unauthorized", { status: 401 });
|
|
362
|
+
}
|
|
363
|
+
})).status, 401, id);
|
|
364
|
+
assertEquals(unauthorized, true, id);
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
await t.step("does not warn about tombstones with compatible IDs", async () => {
|
|
368
|
+
assertEquals((await captureWarnings(async () => {
|
|
369
|
+
assertEquals((await federation.fetch(gatewayRequest("/notes/compatible"), { contextData: void 0 })).status, 410);
|
|
370
|
+
})).filter((record) => record.category[2] === "object"), []);
|
|
274
371
|
});
|
|
275
372
|
});
|
|
276
373
|
test("Federation.fetch() authorizes portable object requests", async (t) => {
|
|
@@ -10,10 +10,10 @@ import { t as assertNotEquals } from "../assert_not_equals-CpPK2t89.mjs";
|
|
|
10
10
|
import "../std__assert-DvMDRPes.mjs";
|
|
11
11
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
12
12
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
13
|
-
import { d as verifyRequest } from "../http-
|
|
13
|
+
import { d as verifyRequest } from "../http-B9BQDNIy.mjs";
|
|
14
14
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
15
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
16
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-
|
|
15
|
+
import { t as doesActorOwnKey } from "../owner-CPFM-sqo.mjs";
|
|
16
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-C8eOPat3.mjs";
|
|
17
17
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
18
18
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
19
19
|
import { FetchError, UrlError } from "@fedify/vocab-runtime";
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
|
|
5
5
|
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../tasks-dbCShlCb.mjs";
|
|
6
6
|
import "../../testing-BWq1dCzx.mjs";
|
|
7
|
-
import { o as createFederation } from "../../middleware-
|
|
7
|
+
import { o as createFederation } from "../../middleware-CgOqRkK-.mjs";
|
|
8
8
|
import { n as ParallelMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
|
|
9
9
|
import { configure, reset } from "@logtape/logtape";
|
|
10
10
|
import { delay } from "es-toolkit";
|
|
@@ -4,8 +4,8 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
|
|
5
5
|
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../tasks-dbCShlCb.mjs";
|
|
6
6
|
import "../../testing-BWq1dCzx.mjs";
|
|
7
|
-
import { o as createFederation } from "../../middleware-
|
|
8
|
-
import { r as createFederationBuilder } from "../../builder-
|
|
7
|
+
import { o as createFederation } from "../../middleware-CgOqRkK-.mjs";
|
|
8
|
+
import { r as createFederationBuilder } from "../../builder-BCXywsZF.mjs";
|
|
9
9
|
import { t as TaskCodec } from "../../codec-C6rTrpIp.mjs";
|
|
10
10
|
import { t as InProcessMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
|
|
11
11
|
import { W3CTraceContextPropagator } from "@opentelemetry/core";
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
6
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
7
|
-
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-
|
|
7
|
+
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-vjHOhBpy.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/federation/temporal.test.ts
|
|
10
10
|
test("hasMalformedKnownTemporalLiteral() detects expanded proof timestamps", async () => {
|