@fedify/fedify 2.4.0-dev.2108 → 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-BRlYEsrV.mjs → builder-BCXywsZF.mjs} +4 -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/{compound-proof-CHGINiJg.mjs → compound-proof-Fxd45Oy5.mjs} +3 -3
- package/dist/{context-Cqx9M_zO.d.cts → context-SMNOiiY6.d.cts} +1 -1
- package/dist/{context-B4F4kGJq.d.ts → context-tOiJfBoD.d.ts} +1 -1
- package/dist/{deno-CC4RKEEp.mjs → deno-BZrnW0Qz.mjs} +1 -1
- package/dist/{docloader-D3_m98fe.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/keycache.test.mjs +67 -1
- 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.d.cts +2 -2
- package/dist/federation/mod.d.ts +2 -2
- 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 +24 -7
- 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-dqo6ZzgT.cjs → federation-Ml6NrgRV.cjs} +98 -18
- package/dist/{http-B7wEqv49.cjs → http-4bmgw-mA.cjs} +140 -55
- package/dist/{http-CHEYA5fH.mjs → http-B9BQDNIy.mjs} +6 -12
- package/dist/{http-CaUBCHYJ.js → http-BETASGl0.js} +140 -55
- package/dist/{http-xlG-jRdB.d.cts → http-BrQgkJay.d.ts} +12 -7
- package/dist/{http-n2v6DPxu.d.ts → http-D76Py0M4.d.cts} +12 -7
- package/dist/{key-B8u1vdvF.mjs → key-PyYvun0F.mjs} +107 -16
- package/dist/{keycache-BUDHB5rY.mjs → keycache-BInaECGj.mjs} +68 -0
- package/dist/{kv-cache-ibncHN1D.js → kv-cache-C4mv2ZFQ.js} +1 -1
- package/dist/{kv-cache-CTdvf_Iq.mjs → kv-cache-CPqUxRL3.mjs} +1 -1
- package/dist/{kv-cache-0pYMPrkL.cjs → kv-cache-D2Bz6t_c.cjs} +1 -1
- package/dist/{ld-BTMJHEGV.mjs → ld-u4JOD4iO.mjs} +4 -7
- package/dist/{metrics-CF1TEvdS.mjs → metrics-DCLoLvLz.mjs} +1 -1
- package/dist/{middleware-DCMTJT3_.mjs → middleware-B7bmtONC.mjs} +1 -1
- package/dist/{middleware-B-rZ7oE-.mjs → middleware-CgOqRkK-.mjs} +49 -37
- package/dist/{middleware-Dl-Y_ZlC.js → middleware-DWlAGlyP.js} +106 -26
- package/dist/{mod-4s_XgF17.d.ts → mod-COWgSo2v.d.ts} +1 -1
- package/dist/{mod-Coacostr.d.ts → mod-CTh7ijx5.d.ts} +1 -1
- package/dist/{mod-xGFCHqq_.d.cts → mod-Cr79cQlc.d.cts} +1 -1
- package/dist/{mod-CVZrXSdm.d.ts → mod-Cwdt_CWU.d.ts} +1 -1
- package/dist/{mod-C8LieBzF.d.cts → mod-DMdGFMEl.d.cts} +1 -1
- package/dist/{mod-BuFmStNT.d.cts → mod-DnElMslb.d.cts} +1 -1
- package/dist/mod.cjs +5 -5
- package/dist/mod.d.cts +5 -5
- package/dist/mod.d.ts +5 -5
- package/dist/mod.js +5 -5
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/{owner-CY--JSqO.mjs → owner-CPFM-sqo.mjs} +4 -4
- package/dist/{owner-CGnHPl4k.cjs → owner-DkA0Lz7v.cjs} +1 -1
- package/dist/{owner-M8dOKEl6.js → owner-wNinn7RK.js} +1 -1
- package/dist/{portable-key-C0-ghkgM.mjs → portable-key-DyylakVV.mjs} +5 -4
- package/dist/{portable-key-id-Bva5iT3W.mjs → portable-key-id-T7lecIbt.mjs} +3 -2
- package/dist/{proof-DDw0i9b1.mjs → proof-BCOg7Njv.mjs} +32 -31
- package/dist/{send-CU3sHGPt.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.d.cts +2 -2
- package/dist/sig/mod.d.ts +2 -2
- 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 +301 -23
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/{sig-fycq7sOr.js → sig-C1xOA4ml.js} +2 -2
- package/dist/{sig-C2CORtvg.cjs → sig-Cb9VSeiF.cjs} +2 -2
- package/dist/{temporal-NHiSpGcW.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.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +7 -7
|
@@ -4,6 +4,11 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
5
5
|
//#region src/federation/keycache.ts
|
|
6
6
|
const KEY_CACHE_GENERATION = "2";
|
|
7
|
+
const COMPATIBLE_KEY_SEGMENT = "__compatible";
|
|
8
|
+
const MAX_COMPATIBLE_KEY_TTL = Temporal.Duration.from({ hours: 1 });
|
|
9
|
+
function isCompatibleKeyEntry(value) {
|
|
10
|
+
return value != null && typeof value === "object" && "key" in value && "expires" in value && typeof value.expires === "number";
|
|
11
|
+
}
|
|
7
12
|
var KvKeyCache = class {
|
|
8
13
|
kv;
|
|
9
14
|
prefix;
|
|
@@ -66,6 +71,69 @@ var KvKeyCache = class {
|
|
|
66
71
|
const serialized = await key.toJsonLd(this.options);
|
|
67
72
|
await this.kv.set(this.#entryKey(keyId), serialized, { ttl: this.keyTtl });
|
|
68
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Returns the namespace of keys at FEP-ef61 compatible identifiers looked
|
|
76
|
+
* up for the given purpose. Its entries carry the time they expire, which
|
|
77
|
+
* is checked when they are read, so that an entry is never used after
|
|
78
|
+
* the proof that vouched for its key expired, however late the underlying
|
|
79
|
+
* store evicts it.
|
|
80
|
+
* @param scope The purpose of the lookups.
|
|
81
|
+
* @returns The namespace.
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
compatibleKeyScope(scope) {
|
|
85
|
+
const now = this.options.now ?? (() => Temporal.Now.instant());
|
|
86
|
+
const entryKey = (keyId) => [
|
|
87
|
+
...this.prefix,
|
|
88
|
+
COMPATIBLE_KEY_SEGMENT,
|
|
89
|
+
scope,
|
|
90
|
+
keyId.href
|
|
91
|
+
];
|
|
92
|
+
const isExpired = (entry) => entry.expires <= now().epochMilliseconds;
|
|
93
|
+
const keyTtl = Math.min(this.keyTtl.total("millisecond"), MAX_COMPATIBLE_KEY_TTL.total("millisecond"));
|
|
94
|
+
const unavailableKeyTtl = this.unavailableKeyTtl.total("millisecond");
|
|
95
|
+
return {
|
|
96
|
+
get: async (keyId) => {
|
|
97
|
+
const entry = await this.kv.get(entryKey(keyId));
|
|
98
|
+
if (entry === void 0) return void 0;
|
|
99
|
+
if (!isCompatibleKeyEntry(entry) || isExpired(entry)) {
|
|
100
|
+
await this.kv.delete(entryKey(keyId));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (entry.key === null) return null;
|
|
104
|
+
let key;
|
|
105
|
+
try {
|
|
106
|
+
key = await CryptographicKey.fromJsonLd(entry.key, this.options);
|
|
107
|
+
} catch {
|
|
108
|
+
try {
|
|
109
|
+
key = await Multikey.fromJsonLd(entry.key, this.options);
|
|
110
|
+
} catch {
|
|
111
|
+
await this.kv.delete(entryKey(keyId));
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return isExpired(entry) ? void 0 : key;
|
|
116
|
+
},
|
|
117
|
+
set: async (keyId, key, options) => {
|
|
118
|
+
const serialized = key == null ? null : await key.toJsonLd(this.options);
|
|
119
|
+
const current = now();
|
|
120
|
+
let expires = current.epochMilliseconds + (key == null ? unavailableKeyTtl : keyTtl);
|
|
121
|
+
if (options?.expires != null) expires = Math.min(expires, options.expires.epochMilliseconds);
|
|
122
|
+
const ttl = expires - current.epochMilliseconds;
|
|
123
|
+
if (ttl <= 0) {
|
|
124
|
+
await this.kv.delete(entryKey(keyId));
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
await this.kv.set(entryKey(keyId), {
|
|
128
|
+
key: serialized,
|
|
129
|
+
expires
|
|
130
|
+
}, { ttl: Temporal.Duration.from({ milliseconds: ttl }) });
|
|
131
|
+
},
|
|
132
|
+
delete: async (keyId) => {
|
|
133
|
+
await this.kv.delete(entryKey(keyId));
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
}
|
|
69
137
|
async getFetchError(keyId) {
|
|
70
138
|
const cached = await this.kv.get(this.#getFetchErrorKey(keyId));
|
|
71
139
|
if (cached == null || typeof cached !== "object") return void 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { H as validateCryptoKey, et as recordDocumentCache, t as doubleKnock } from "./http-
|
|
3
|
+
import { H as validateCryptoKey, et as recordDocumentCache, t as doubleKnock } from "./http-BETASGl0.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
6
6
|
import { curry } from "es-toolkit";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { p as recordDocumentCache } from "./metrics-
|
|
4
|
+
import { p as recordDocumentCache } from "./metrics-DCLoLvLz.mjs";
|
|
5
5
|
import { getLogger } from "@logtape/logtape";
|
|
6
6
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
7
7
|
//#region src/utils/kv-cache.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
|
-
const require_http = require("./http-
|
|
2
|
+
const require_http = require("./http-4bmgw-mA.cjs");
|
|
3
3
|
let _logtape_logtape = require("@logtape/logtape");
|
|
4
4
|
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
5
5
|
let es_toolkit = require("es-toolkit");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "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 getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-
|
|
6
|
-
import {
|
|
4
|
+
import { n as version, t as name } from "./deno-BZrnW0Qz.mjs";
|
|
5
|
+
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-DCLoLvLz.mjs";
|
|
6
|
+
import { c as validateCryptoKey, i as fetchKey, t as bypassKeyCacheReads } from "./key-PyYvun0F.mjs";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
8
|
import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -503,10 +503,7 @@ async function verifySignature(jsonLd, options = {}) {
|
|
|
503
503
|
});
|
|
504
504
|
const { key } = await measureSignatureKeyFetch(options.meterProvider, "linked_data", () => fetchKey(new URL(sig.creator), CryptographicKey, {
|
|
505
505
|
...options,
|
|
506
|
-
keyCache:
|
|
507
|
-
get: () => Promise.resolve(void 0),
|
|
508
|
-
set: async (keyId, key) => await options.keyCache?.set(keyId, key)
|
|
509
|
-
}
|
|
506
|
+
keyCache: bypassKeyCacheReads(options.keyCache)
|
|
510
507
|
}));
|
|
511
508
|
if (key == null) return null;
|
|
512
509
|
return await crypto.subtle.verify("RSASSA-PKCS1-v1_5", key.publicKey, signature.slice(), messageBytes) ? key : null;
|
|
@@ -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 { metrics } from "@opentelemetry/api";
|
|
6
6
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
7
7
|
//#region src/federation/metrics.ts
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { 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, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-
|
|
4
|
+
import { n as version, t as name } from "./deno-BZrnW0Qz.mjs";
|
|
5
|
+
import { 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, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-DCLoLvLz.mjs";
|
|
6
6
|
import { t as formatAcceptSignature } from "./accept-CPVqki78.mjs";
|
|
7
|
-
import { a as isCompatibleKeyId, c as isPortableUri, i as hasPortableActor, n as getGatewayKeyBase, r as getPortableDid, s as isPortableId, t as getCanonicalPortableId } from "./portable-key-id-
|
|
8
|
-
import {
|
|
7
|
+
import { a as isCompatibleKeyId, c as isPortableUri, i as hasPortableActor, n as getGatewayKeyBase, r as getPortableDid, s as isPortableId, t as getCanonicalPortableId } from "./portable-key-id-T7lecIbt.mjs";
|
|
8
|
+
import { c as validateCryptoKey, n as exportJwk, s as importJwk } from "./key-PyYvun0F.mjs";
|
|
9
9
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
|
|
10
|
-
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-
|
|
11
|
-
import { i as signObject, l as verifyPortableObjectProofWithRoot, o as verifyObject, r as hasProofLike, s as verifyPortableObjectProof, t as InvalidPortableObjectIdError } from "./proof-
|
|
12
|
-
import { a as listRequestSignatures, c as selectRequestSignature, d as verifyRequest, f as verifyRequestDetailed, s as parseRfc9421SignatureInput } from "./http-
|
|
13
|
-
import { t as getAuthenticatedDocumentLoader } from "./docloader-
|
|
14
|
-
import { n as kvCache } from "./kv-cache-
|
|
10
|
+
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-u4JOD4iO.mjs";
|
|
11
|
+
import { i as signObject, l as verifyPortableObjectProofWithRoot, o as verifyObject, r as hasProofLike, s as verifyPortableObjectProof, t as InvalidPortableObjectIdError } from "./proof-BCOg7Njv.mjs";
|
|
12
|
+
import { a as listRequestSignatures, c as selectRequestSignature, d as verifyRequest, f as verifyRequestDetailed, s as parseRfc9421SignatureInput } from "./http-B9BQDNIy.mjs";
|
|
13
|
+
import { t as getAuthenticatedDocumentLoader } from "./docloader-3BHaS20Z.mjs";
|
|
14
|
+
import { n as kvCache } from "./kv-cache-CPqUxRL3.mjs";
|
|
15
15
|
import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-DpnpgjyX.mjs";
|
|
16
16
|
import { t as nodeInfoToJson } from "./types-DE_LV1JB.mjs";
|
|
17
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-
|
|
18
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-
|
|
19
|
-
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-
|
|
17
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-CPFM-sqo.mjs";
|
|
18
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-C8eOPat3.mjs";
|
|
19
|
+
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-BCXywsZF.mjs";
|
|
20
20
|
import { t as CircuitBreaker } from "./circuit-breaker-C5NqoLBJ.mjs";
|
|
21
21
|
import { t as buildCollectionSynchronizationHeader } from "./collection-CnnP1UAv.mjs";
|
|
22
|
-
import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "./compound-proof-
|
|
23
|
-
import { t as KvKeyCache } from "./keycache-
|
|
22
|
+
import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "./compound-proof-Fxd45Oy5.mjs";
|
|
23
|
+
import { t as KvKeyCache } from "./keycache-BInaECGj.mjs";
|
|
24
24
|
import { t as acceptsJsonLd } from "./negotiation-CCocWT_N.mjs";
|
|
25
|
-
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-
|
|
25
|
+
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-vjHOhBpy.mjs";
|
|
26
26
|
import { t as createExponentialBackoffPolicy } from "./retry-zX5xw5e0.mjs";
|
|
27
27
|
import { t as TaskCodec } from "./codec-C6rTrpIp.mjs";
|
|
28
28
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
@@ -1173,6 +1173,11 @@ async function handleObject(request, { values, context, objectDispatcher, author
|
|
|
1173
1173
|
* dispatcher, or the actor dispatcher adapted to one. The object is served
|
|
1174
1174
|
* only if its ID canonically matches the requested portable ID and it
|
|
1175
1175
|
* satisfies the FEP-ef61 proof policy.
|
|
1176
|
+
*
|
|
1177
|
+
* A {@link Tombstone} is served with `410 Gone` if it has an Object Integrity
|
|
1178
|
+
* Proof made with a key of the DID in its ID. An unsigned tombstone cannot
|
|
1179
|
+
* be served as a portable object, so the response is the same as for
|
|
1180
|
+
* an object that this server does not store, i.e., `404 Not Found`.
|
|
1176
1181
|
* @template TContextData The context data to pass to the context.
|
|
1177
1182
|
* @param request The HTTP request.
|
|
1178
1183
|
* @param parameters The parameters for handling the portable object.
|
|
@@ -1220,17 +1225,27 @@ async function handlePortableObject(request, { values, context, objectDispatcher
|
|
|
1220
1225
|
logger.debug("The serialized object does not match the requested portable object {portableId}.", { portableId: canonicalId });
|
|
1221
1226
|
return await onNotFound(request);
|
|
1222
1227
|
}
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1228
|
+
const tombstone = object instanceof Tombstone;
|
|
1229
|
+
if (!result.verified) {
|
|
1230
|
+
if (tombstone && result.reason.type === "missingProof") {
|
|
1231
|
+
logger.debug("Not serving the tombstone of the portable object {portableId}, as it has no Object Integrity Proof; responding as if this server did not store the object.", { portableId: canonicalId });
|
|
1232
|
+
return await onNotFound(request);
|
|
1233
|
+
}
|
|
1234
|
+
if (tombstone || result.reason.type !== "unsecuredCollection" && result.reason.type !== "unsupportedObjectType") {
|
|
1235
|
+
logger.error("Refusing to serve the portable object {portableId}, as it does not satisfy the FEP-ef61 proof policy: {reason}. Portable actors, activities, objects, and tombstones need an Object Integrity Proof made with a key of the DID in their ID.", {
|
|
1236
|
+
portableId: canonicalId,
|
|
1237
|
+
reason: result.reason.type
|
|
1238
|
+
});
|
|
1239
|
+
return portableObjectInternalServerError(request);
|
|
1240
|
+
}
|
|
1229
1241
|
}
|
|
1230
|
-
return new Response(request.method === "HEAD" ? null : JSON.stringify(jsonLd), {
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1242
|
+
return new Response(request.method === "HEAD" ? null : JSON.stringify(jsonLd), {
|
|
1243
|
+
status: tombstone ? 410 : 200,
|
|
1244
|
+
headers: {
|
|
1245
|
+
"Content-Type": PORTABLE_OBJECT_CONTENT_TYPE,
|
|
1246
|
+
Vary: "Accept"
|
|
1247
|
+
}
|
|
1248
|
+
});
|
|
1234
1249
|
}
|
|
1235
1250
|
function isRequestedPortableObject(object, canonicalId) {
|
|
1236
1251
|
return object.id != null && getCanonicalPortableId(object.id) === canonicalId;
|
|
@@ -1296,13 +1311,13 @@ function recordCollectionMetrics(meterProvider, base, result, options = {}) {
|
|
|
1296
1311
|
* @param parameters The parameters for handling the collection.
|
|
1297
1312
|
* @returns A promise that resolves to an HTTP response.
|
|
1298
1313
|
*/
|
|
1299
|
-
async function handleCollection(request, { name: name$
|
|
1300
|
-
const spanName = name$
|
|
1314
|
+
async function handleCollection(request, { name: name$1, identifier, uriGetter, filter, filterPredicate, context, collectionCallbacks, tracerProvider, meterProvider, onUnauthorized, onNotFound }) {
|
|
1315
|
+
const spanName = name$1.trim().replace(/\s+/g, "_");
|
|
1301
1316
|
tracerProvider = tracerProvider ?? trace.getTracerProvider();
|
|
1302
1317
|
const tracer = tracerProvider.getTracer(name, version);
|
|
1303
1318
|
const cursor = new URL(request.url).searchParams.get("cursor");
|
|
1304
1319
|
const metricBase = {
|
|
1305
|
-
kind: getCollectionMetricKind(name$
|
|
1320
|
+
kind: getCollectionMetricKind(name$1),
|
|
1306
1321
|
page: cursor != null,
|
|
1307
1322
|
dispatcher: "built_in"
|
|
1308
1323
|
};
|
|
@@ -1343,7 +1358,7 @@ async function handleCollection(request, { name: name$2, identifier, uriGetter,
|
|
|
1343
1358
|
span.setStatus({ code: SpanStatusCode.ERROR });
|
|
1344
1359
|
return await onNotFound(request);
|
|
1345
1360
|
}
|
|
1346
|
-
const items = filterCollectionItems(page.items, name$
|
|
1361
|
+
const items = filterCollectionItems(page.items, name$1, filterPredicate);
|
|
1347
1362
|
itemCount = items.length;
|
|
1348
1363
|
span.setAttribute("fedify.collection.items", itemCount);
|
|
1349
1364
|
return items;
|
|
@@ -1383,7 +1398,7 @@ async function handleCollection(request, { name: name$2, identifier, uriGetter,
|
|
|
1383
1398
|
} else {
|
|
1384
1399
|
const uri = new URL(baseUri);
|
|
1385
1400
|
uri.searchParams.set("cursor", cursor);
|
|
1386
|
-
const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name$
|
|
1401
|
+
const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name$1}`, {
|
|
1387
1402
|
kind: SpanKind.SERVER,
|
|
1388
1403
|
attributes: {
|
|
1389
1404
|
"activitypub.collection.id": uri.href,
|
|
@@ -1399,7 +1414,7 @@ async function handleCollection(request, { name: name$2, identifier, uriGetter,
|
|
|
1399
1414
|
span.setStatus({ code: SpanStatusCode.ERROR });
|
|
1400
1415
|
return await onNotFound(request);
|
|
1401
1416
|
}
|
|
1402
|
-
const items = filterCollectionItems(page.items, name$
|
|
1417
|
+
const items = filterCollectionItems(page.items, name$1, filterPredicate);
|
|
1403
1418
|
itemCount = items.length;
|
|
1404
1419
|
span.setAttribute("fedify.collection.items", itemCount);
|
|
1405
1420
|
return {
|
|
@@ -2587,8 +2602,8 @@ var CustomCollectionHandler = class {
|
|
|
2587
2602
|
* @param CollectionPage The CollectionPage constructor.
|
|
2588
2603
|
* @param filterPredicate Optional filter predicate for items.
|
|
2589
2604
|
*/
|
|
2590
|
-
constructor(name$
|
|
2591
|
-
this.name = name$
|
|
2605
|
+
constructor(name$2, values, context, callbacks, tracerProvider = trace.getTracerProvider(), meterProvider, Collection, CollectionPage, filterPredicate) {
|
|
2606
|
+
this.name = name$2;
|
|
2592
2607
|
this.values = values;
|
|
2593
2608
|
this.context = context;
|
|
2594
2609
|
this.callbacks = callbacks;
|
|
@@ -5525,10 +5540,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
5525
5540
|
return await handlePortableObject(request, {
|
|
5526
5541
|
values: { identifier },
|
|
5527
5542
|
context,
|
|
5528
|
-
objectDispatcher: actorDispatcher == null ? void 0 :
|
|
5529
|
-
const actor = await actorDispatcher(ctx, identifier);
|
|
5530
|
-
return actor instanceof Tombstone ? null : actor;
|
|
5531
|
-
},
|
|
5543
|
+
objectDispatcher: actorDispatcher == null ? void 0 : (ctx) => actorDispatcher(ctx, identifier),
|
|
5532
5544
|
authorizePredicate: authorizePredicate == null ? void 0 : (ctx) => authorizePredicate(ctx, identifier),
|
|
5533
5545
|
canonicalId: portable.canonicalId,
|
|
5534
5546
|
onUnauthorized,
|
|
@@ -2,10 +2,10 @@ import { Temporal } from "temporal-polyfill";
|
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
import { t as __exportAll } from "./rolldown-runtime-BC-Eo5Mj.js";
|
|
4
4
|
import { r as getDefaultActivityTransformers } from "./transformers-DAtXl_Kc.js";
|
|
5
|
-
import { $ as recordCollectionTotalItems, A as isInvalidUrlTypeError, C as compactJsonLd, D as hasSignature, E as getNormalizationContextLoader, F as wrapContextLoaderForJsonLd, G as getFederationMetrics, H as validateCryptoKey, I as exportJwk, J as isAbortError, K as getRemoteHost, M as verifyCompactJsonLd, O as hasSignatureLike, Q as recordCollectionRequest, T as detachSignature, V as importJwk, W as getDurationMs, X as recordCollectionDispatchDuration, Y as recordCircuitBreakerStateChange, Z as recordCollectionPageItems, _ as verifyPortableObjectProofWithRoot, _t as isPortableId, at as recordWebFingerHandle, b as InvalidContextReferenceError, bt as name, ct as formatAcceptSignature, d as hasProofLike, f as signObject, ft as getCanonicalPortableId, g as verifyPortableObjectProofPolicy, gt as isCompatibleKeyId, h as verifyPortableObjectProof, ht as hasPortableActor, i as selectRequestSignature, it as recordOutboxEnqueue, j as signJsonLd, k as isClearlyMalformedContextReference, l as InvalidPortableObjectIdError, m as verifyObject, mt as getPortableDid, n as listRequestSignatures, nt as recordInboxActivity, o as verifyRequest, ot as registerQueueDepthGauge, p as verifyMapLocalProof, pt as getGatewayKeyBase, q as instrumentDocumentLoader, r as parseRfc9421SignatureInput, rt as recordOutboxActivity, s as verifyRequestDetailed, st as preloadedOnlyDocumentLoader, t as doubleKnock, tt as recordFanoutRecipients, vt as isPortableUri, x as assertSafeJsonLd, xt as version, y as normalizeOutgoingActivityJsonLd } from "./http-
|
|
5
|
+
import { $ as recordCollectionTotalItems, A as isInvalidUrlTypeError, C as compactJsonLd, D as hasSignature, E as getNormalizationContextLoader, F as wrapContextLoaderForJsonLd, G as getFederationMetrics, H as validateCryptoKey, I as exportJwk, J as isAbortError, K as getRemoteHost, M as verifyCompactJsonLd, O as hasSignatureLike, Q as recordCollectionRequest, T as detachSignature, V as importJwk, W as getDurationMs, X as recordCollectionDispatchDuration, Y as recordCircuitBreakerStateChange, Z as recordCollectionPageItems, _ as verifyPortableObjectProofWithRoot, _t as isPortableId, at as recordWebFingerHandle, b as InvalidContextReferenceError, bt as name, ct as formatAcceptSignature, d as hasProofLike, f as signObject, ft as getCanonicalPortableId, g as verifyPortableObjectProofPolicy, gt as isCompatibleKeyId, h as verifyPortableObjectProof, ht as hasPortableActor, i as selectRequestSignature, it as recordOutboxEnqueue, j as signJsonLd, k as isClearlyMalformedContextReference, l as InvalidPortableObjectIdError, m as verifyObject, mt as getPortableDid, n as listRequestSignatures, nt as recordInboxActivity, o as verifyRequest, ot as registerQueueDepthGauge, p as verifyMapLocalProof, pt as getGatewayKeyBase, q as instrumentDocumentLoader, r as parseRfc9421SignatureInput, rt as recordOutboxActivity, s as verifyRequestDetailed, st as preloadedOnlyDocumentLoader, t as doubleKnock, tt as recordFanoutRecipients, vt as isPortableUri, x as assertSafeJsonLd, xt as version, y as normalizeOutgoingActivityJsonLd } from "./http-BETASGl0.js";
|
|
6
6
|
import { a as MAX_BODY_SIZE, i as BodyTooLargeError, n as getNodeInfo, o as readBoundedText, t as nodeInfoToJson } from "./types-C_cNlNVK.js";
|
|
7
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-
|
|
8
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-
|
|
7
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-wNinn7RK.js";
|
|
8
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-C4mv2ZFQ.js";
|
|
9
9
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
10
10
|
import { Router, RouterError, assertPath } from "@fedify/uri-template";
|
|
11
11
|
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
@@ -750,7 +750,7 @@ function warnMismatchedTombstoneId(context, cls, values, tombstone) {
|
|
|
750
750
|
});
|
|
751
751
|
return;
|
|
752
752
|
}
|
|
753
|
-
if (tombstone.id
|
|
753
|
+
if (isPortableId(tombstone.id)) return;
|
|
754
754
|
const expected = context.getObjectUri(cls, values);
|
|
755
755
|
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().", {
|
|
756
756
|
class: cls.name,
|
|
@@ -2233,6 +2233,11 @@ async function routeActivity({ context: ctx, json, originalJson, normalizedActiv
|
|
|
2233
2233
|
//#endregion
|
|
2234
2234
|
//#region src/federation/keycache.ts
|
|
2235
2235
|
const KEY_CACHE_GENERATION = "2";
|
|
2236
|
+
const COMPATIBLE_KEY_SEGMENT = "__compatible";
|
|
2237
|
+
const MAX_COMPATIBLE_KEY_TTL = Temporal.Duration.from({ hours: 1 });
|
|
2238
|
+
function isCompatibleKeyEntry(value) {
|
|
2239
|
+
return value != null && typeof value === "object" && "key" in value && "expires" in value && typeof value.expires === "number";
|
|
2240
|
+
}
|
|
2236
2241
|
var KvKeyCache = class {
|
|
2237
2242
|
kv;
|
|
2238
2243
|
prefix;
|
|
@@ -2295,6 +2300,69 @@ var KvKeyCache = class {
|
|
|
2295
2300
|
const serialized = await key.toJsonLd(this.options);
|
|
2296
2301
|
await this.kv.set(this.#entryKey(keyId), serialized, { ttl: this.keyTtl });
|
|
2297
2302
|
}
|
|
2303
|
+
/**
|
|
2304
|
+
* Returns the namespace of keys at FEP-ef61 compatible identifiers looked
|
|
2305
|
+
* up for the given purpose. Its entries carry the time they expire, which
|
|
2306
|
+
* is checked when they are read, so that an entry is never used after
|
|
2307
|
+
* the proof that vouched for its key expired, however late the underlying
|
|
2308
|
+
* store evicts it.
|
|
2309
|
+
* @param scope The purpose of the lookups.
|
|
2310
|
+
* @returns The namespace.
|
|
2311
|
+
* @internal
|
|
2312
|
+
*/
|
|
2313
|
+
compatibleKeyScope(scope) {
|
|
2314
|
+
const now = this.options.now ?? (() => Temporal.Now.instant());
|
|
2315
|
+
const entryKey = (keyId) => [
|
|
2316
|
+
...this.prefix,
|
|
2317
|
+
COMPATIBLE_KEY_SEGMENT,
|
|
2318
|
+
scope,
|
|
2319
|
+
keyId.href
|
|
2320
|
+
];
|
|
2321
|
+
const isExpired = (entry) => entry.expires <= now().epochMilliseconds;
|
|
2322
|
+
const keyTtl = Math.min(this.keyTtl.total("millisecond"), MAX_COMPATIBLE_KEY_TTL.total("millisecond"));
|
|
2323
|
+
const unavailableKeyTtl = this.unavailableKeyTtl.total("millisecond");
|
|
2324
|
+
return {
|
|
2325
|
+
get: async (keyId) => {
|
|
2326
|
+
const entry = await this.kv.get(entryKey(keyId));
|
|
2327
|
+
if (entry === void 0) return void 0;
|
|
2328
|
+
if (!isCompatibleKeyEntry(entry) || isExpired(entry)) {
|
|
2329
|
+
await this.kv.delete(entryKey(keyId));
|
|
2330
|
+
return;
|
|
2331
|
+
}
|
|
2332
|
+
if (entry.key === null) return null;
|
|
2333
|
+
let key;
|
|
2334
|
+
try {
|
|
2335
|
+
key = await CryptographicKey.fromJsonLd(entry.key, this.options);
|
|
2336
|
+
} catch {
|
|
2337
|
+
try {
|
|
2338
|
+
key = await Multikey.fromJsonLd(entry.key, this.options);
|
|
2339
|
+
} catch {
|
|
2340
|
+
await this.kv.delete(entryKey(keyId));
|
|
2341
|
+
return;
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
return isExpired(entry) ? void 0 : key;
|
|
2345
|
+
},
|
|
2346
|
+
set: async (keyId, key, options) => {
|
|
2347
|
+
const serialized = key == null ? null : await key.toJsonLd(this.options);
|
|
2348
|
+
const current = now();
|
|
2349
|
+
let expires = current.epochMilliseconds + (key == null ? unavailableKeyTtl : keyTtl);
|
|
2350
|
+
if (options?.expires != null) expires = Math.min(expires, options.expires.epochMilliseconds);
|
|
2351
|
+
const ttl = expires - current.epochMilliseconds;
|
|
2352
|
+
if (ttl <= 0) {
|
|
2353
|
+
await this.kv.delete(entryKey(keyId));
|
|
2354
|
+
return;
|
|
2355
|
+
}
|
|
2356
|
+
await this.kv.set(entryKey(keyId), {
|
|
2357
|
+
key: serialized,
|
|
2358
|
+
expires
|
|
2359
|
+
}, { ttl: Temporal.Duration.from({ milliseconds: ttl }) });
|
|
2360
|
+
},
|
|
2361
|
+
delete: async (keyId) => {
|
|
2362
|
+
await this.kv.delete(entryKey(keyId));
|
|
2363
|
+
}
|
|
2364
|
+
};
|
|
2365
|
+
}
|
|
2298
2366
|
async getFetchError(keyId) {
|
|
2299
2367
|
const cached = await this.kv.get(this.#getFetchErrorKey(keyId));
|
|
2300
2368
|
if (cached == null || typeof cached !== "object") return void 0;
|
|
@@ -3462,6 +3530,11 @@ async function handleObject(request, { values, context, objectDispatcher, author
|
|
|
3462
3530
|
* dispatcher, or the actor dispatcher adapted to one. The object is served
|
|
3463
3531
|
* only if its ID canonically matches the requested portable ID and it
|
|
3464
3532
|
* satisfies the FEP-ef61 proof policy.
|
|
3533
|
+
*
|
|
3534
|
+
* A {@link Tombstone} is served with `410 Gone` if it has an Object Integrity
|
|
3535
|
+
* Proof made with a key of the DID in its ID. An unsigned tombstone cannot
|
|
3536
|
+
* be served as a portable object, so the response is the same as for
|
|
3537
|
+
* an object that this server does not store, i.e., `404 Not Found`.
|
|
3465
3538
|
* @template TContextData The context data to pass to the context.
|
|
3466
3539
|
* @param request The HTTP request.
|
|
3467
3540
|
* @param parameters The parameters for handling the portable object.
|
|
@@ -3509,17 +3582,27 @@ async function handlePortableObject(request, { values, context, objectDispatcher
|
|
|
3509
3582
|
logger.debug("The serialized object does not match the requested portable object {portableId}.", { portableId: canonicalId });
|
|
3510
3583
|
return await onNotFound(request);
|
|
3511
3584
|
}
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3585
|
+
const tombstone = object instanceof Tombstone;
|
|
3586
|
+
if (!result.verified) {
|
|
3587
|
+
if (tombstone && result.reason.type === "missingProof") {
|
|
3588
|
+
logger.debug("Not serving the tombstone of the portable object {portableId}, as it has no Object Integrity Proof; responding as if this server did not store the object.", { portableId: canonicalId });
|
|
3589
|
+
return await onNotFound(request);
|
|
3590
|
+
}
|
|
3591
|
+
if (tombstone || result.reason.type !== "unsecuredCollection" && result.reason.type !== "unsupportedObjectType") {
|
|
3592
|
+
logger.error("Refusing to serve the portable object {portableId}, as it does not satisfy the FEP-ef61 proof policy: {reason}. Portable actors, activities, objects, and tombstones need an Object Integrity Proof made with a key of the DID in their ID.", {
|
|
3593
|
+
portableId: canonicalId,
|
|
3594
|
+
reason: result.reason.type
|
|
3595
|
+
});
|
|
3596
|
+
return portableObjectInternalServerError(request);
|
|
3597
|
+
}
|
|
3518
3598
|
}
|
|
3519
|
-
return new Response(request.method === "HEAD" ? null : JSON.stringify(jsonLd), {
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3599
|
+
return new Response(request.method === "HEAD" ? null : JSON.stringify(jsonLd), {
|
|
3600
|
+
status: tombstone ? 410 : 200,
|
|
3601
|
+
headers: {
|
|
3602
|
+
"Content-Type": PORTABLE_OBJECT_CONTENT_TYPE,
|
|
3603
|
+
Vary: "Accept"
|
|
3604
|
+
}
|
|
3605
|
+
});
|
|
3523
3606
|
}
|
|
3524
3607
|
function isRequestedPortableObject(object, canonicalId) {
|
|
3525
3608
|
return object.id != null && getCanonicalPortableId(object.id) === canonicalId;
|
|
@@ -3585,13 +3668,13 @@ function recordCollectionMetrics(meterProvider, base, result, options = {}) {
|
|
|
3585
3668
|
* @param parameters The parameters for handling the collection.
|
|
3586
3669
|
* @returns A promise that resolves to an HTTP response.
|
|
3587
3670
|
*/
|
|
3588
|
-
async function handleCollection(request, { name: name$
|
|
3589
|
-
const spanName = name$
|
|
3671
|
+
async function handleCollection(request, { name: name$1, identifier, uriGetter, filter, filterPredicate, context, collectionCallbacks, tracerProvider, meterProvider, onUnauthorized, onNotFound }) {
|
|
3672
|
+
const spanName = name$1.trim().replace(/\s+/g, "_");
|
|
3590
3673
|
tracerProvider = tracerProvider ?? trace.getTracerProvider();
|
|
3591
3674
|
const tracer = tracerProvider.getTracer(name, version);
|
|
3592
3675
|
const cursor = new URL(request.url).searchParams.get("cursor");
|
|
3593
3676
|
const metricBase = {
|
|
3594
|
-
kind: getCollectionMetricKind(name$
|
|
3677
|
+
kind: getCollectionMetricKind(name$1),
|
|
3595
3678
|
page: cursor != null,
|
|
3596
3679
|
dispatcher: "built_in"
|
|
3597
3680
|
};
|
|
@@ -3632,7 +3715,7 @@ async function handleCollection(request, { name: name$2, identifier, uriGetter,
|
|
|
3632
3715
|
span.setStatus({ code: SpanStatusCode.ERROR });
|
|
3633
3716
|
return await onNotFound(request);
|
|
3634
3717
|
}
|
|
3635
|
-
const items = filterCollectionItems(page.items, name$
|
|
3718
|
+
const items = filterCollectionItems(page.items, name$1, filterPredicate);
|
|
3636
3719
|
itemCount = items.length;
|
|
3637
3720
|
span.setAttribute("fedify.collection.items", itemCount);
|
|
3638
3721
|
return items;
|
|
@@ -3672,7 +3755,7 @@ async function handleCollection(request, { name: name$2, identifier, uriGetter,
|
|
|
3672
3755
|
} else {
|
|
3673
3756
|
const uri = new URL(baseUri);
|
|
3674
3757
|
uri.searchParams.set("cursor", cursor);
|
|
3675
|
-
const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name$
|
|
3758
|
+
const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name$1}`, {
|
|
3676
3759
|
kind: SpanKind.SERVER,
|
|
3677
3760
|
attributes: {
|
|
3678
3761
|
"activitypub.collection.id": uri.href,
|
|
@@ -3688,7 +3771,7 @@ async function handleCollection(request, { name: name$2, identifier, uriGetter,
|
|
|
3688
3771
|
span.setStatus({ code: SpanStatusCode.ERROR });
|
|
3689
3772
|
return await onNotFound(request);
|
|
3690
3773
|
}
|
|
3691
|
-
const items = filterCollectionItems(page.items, name$
|
|
3774
|
+
const items = filterCollectionItems(page.items, name$1, filterPredicate);
|
|
3692
3775
|
itemCount = items.length;
|
|
3693
3776
|
span.setAttribute("fedify.collection.items", itemCount);
|
|
3694
3777
|
return {
|
|
@@ -4876,8 +4959,8 @@ var CustomCollectionHandler = class {
|
|
|
4876
4959
|
* @param CollectionPage The CollectionPage constructor.
|
|
4877
4960
|
* @param filterPredicate Optional filter predicate for items.
|
|
4878
4961
|
*/
|
|
4879
|
-
constructor(name$
|
|
4880
|
-
this.name = name$
|
|
4962
|
+
constructor(name$2, values, context, callbacks, tracerProvider = trace.getTracerProvider(), meterProvider, Collection, CollectionPage, filterPredicate) {
|
|
4963
|
+
this.name = name$2;
|
|
4881
4964
|
this.values = values;
|
|
4882
4965
|
this.context = context;
|
|
4883
4966
|
this.callbacks = callbacks;
|
|
@@ -8223,10 +8306,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
8223
8306
|
return await handlePortableObject(request, {
|
|
8224
8307
|
values: { identifier },
|
|
8225
8308
|
context,
|
|
8226
|
-
objectDispatcher: actorDispatcher == null ? void 0 :
|
|
8227
|
-
const actor = await actorDispatcher(ctx, identifier);
|
|
8228
|
-
return actor instanceof Tombstone ? null : actor;
|
|
8229
|
-
},
|
|
8309
|
+
objectDispatcher: actorDispatcher == null ? void 0 : (ctx) => actorDispatcher(ctx, identifier),
|
|
8230
8310
|
authorizePredicate: authorizePredicate == null ? void 0 : (ctx) => authorizePredicate(ctx, identifier),
|
|
8231
8311
|
canonicalId: portable.canonicalId,
|
|
8232
8312
|
onUnauthorized,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { Gt as WebFingerLinksDispatcher, bt as ActorHandleMapper, d as RequestContext, vt as ActorAliasMapper, yt as ActorDispatcher } from "./context-
|
|
2
|
+
import { Gt as WebFingerLinksDispatcher, bt as ActorHandleMapper, d as RequestContext, vt as ActorAliasMapper, yt as ActorDispatcher } from "./context-tOiJfBoD.js";
|
|
3
3
|
import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
|
|
4
4
|
import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { S as KeyCache } from "./http-
|
|
2
|
+
import { S as KeyCache } from "./http-BrQgkJay.js";
|
|
3
3
|
import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "@fedify/vocab";
|
|
4
4
|
import { MeterProvider, TracerProvider } from "@opentelemetry/api";
|
|
5
5
|
import { DocumentLoader, PortableObjectVerifierOptions } from "@fedify/vocab-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { n as HttpMessageSignaturesSpecDeterminer } from "./http-
|
|
2
|
+
import { n as HttpMessageSignaturesSpecDeterminer } from "./http-D76Py0M4.cjs";
|
|
3
3
|
import { n as KvStore, t as KvKey } from "./kv-BhNbN8Ed.cjs";
|
|
4
4
|
import { t as DocumentFetchKind } from "./metrics-DVKYY6K1.cjs";
|
|
5
5
|
import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { n as HttpMessageSignaturesSpecDeterminer } from "./http-
|
|
2
|
+
import { n as HttpMessageSignaturesSpecDeterminer } from "./http-BrQgkJay.js";
|
|
3
3
|
import { n as KvStore, t as KvKey } from "./kv-BhNbN8Ed.js";
|
|
4
4
|
import { t as DocumentFetchKind } from "./metrics-DoRtI0qU.js";
|
|
5
5
|
import { MeterProvider, TracerProvider } from "@opentelemetry/api";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { S as KeyCache } from "./http-
|
|
2
|
+
import { S as KeyCache } from "./http-D76Py0M4.cjs";
|
|
3
3
|
import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "@fedify/vocab";
|
|
4
4
|
import { DocumentLoader, PortableObjectVerifierOptions } from "@fedify/vocab-runtime";
|
|
5
5
|
import { MeterProvider, TracerProvider } from "@opentelemetry/api";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { Gt as WebFingerLinksDispatcher, bt as ActorHandleMapper, d as RequestContext, vt as ActorAliasMapper, yt as ActorDispatcher } from "./context-
|
|
2
|
+
import { Gt as WebFingerLinksDispatcher, bt as ActorHandleMapper, d as RequestContext, vt as ActorAliasMapper, yt as ActorDispatcher } from "./context-SMNOiiY6.cjs";
|
|
3
3
|
import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
|
|
4
4
|
import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
|
|
5
5
|
|
package/dist/mod.cjs
CHANGED
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
require("./rolldown-runtime-Dmm3t92W.cjs");
|
|
4
4
|
const require_transformers = require("./transformers-BalCrSsr.cjs");
|
|
5
5
|
require("./compat/mod.cjs");
|
|
6
|
-
const require_http = require("./http-
|
|
7
|
-
const require_federation = require("./federation-
|
|
6
|
+
const require_http = require("./http-4bmgw-mA.cjs");
|
|
7
|
+
const require_federation = require("./federation-Ml6NrgRV.cjs");
|
|
8
8
|
const require_types = require("./types-Be2zbyeG.cjs");
|
|
9
|
-
const require_owner = require("./owner-
|
|
10
|
-
const require_kv_cache = require("./kv-cache-
|
|
9
|
+
const require_owner = require("./owner-DkA0Lz7v.cjs");
|
|
10
|
+
const require_kv_cache = require("./kv-cache-D2Bz6t_c.cjs");
|
|
11
11
|
require("./nodeinfo/mod.cjs");
|
|
12
12
|
require("./runtime/mod.cjs");
|
|
13
|
-
const require_sig = require("./sig-
|
|
13
|
+
const require_sig = require("./sig-Cb9VSeiF.cjs");
|
|
14
14
|
require("./utils/mod.cjs");
|
|
15
15
|
//#endregion
|
|
16
16
|
exports.CircuitBreaker = require_federation.CircuitBreaker;
|