@fedify/fedify 2.0.28-dev.1979 → 2.0.28
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_instance_of-C4Ri6VuN.mjs → assert-BhQd8QHP.mjs} +19 -1
- package/dist/{builder-CAAXTNeK.mjs → builder-DrLogDNE.mjs} +3 -3
- package/dist/{client-HLLGHiTU.mjs → client-glFHmpn4.mjs} +78 -4
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/transformers.test.mjs +3 -4
- package/dist/{context-DJ5oMnte.d.ts → context-B21klrfz.d.ts} +2 -2
- package/dist/{context-zLLwVY_G.d.cts → context-M_MxoQgC.d.cts} +2 -2
- package/dist/{deno-D3gZ1DsB.mjs → deno-BwjczLpP.mjs} +1 -1
- package/dist/{docloader-DIk3fEXZ.mjs → docloader-BKABwzJs.mjs} +2 -2
- package/dist/federation/builder.test.mjs +2 -2
- package/dist/federation/collection.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +125 -8
- package/dist/federation/idempotency.test.mjs +4 -4
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/keycache.test.mjs +44 -10
- package/dist/federation/kv.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +66 -10
- 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/mq.test.mjs +1 -1
- package/dist/federation/negotiation.test.mjs +2 -2
- package/dist/federation/retry.test.mjs +1 -1
- package/dist/federation/router.test.mjs +1 -1
- package/dist/federation/send.test.mjs +5 -6
- package/dist/federation/temporal.test.mjs +2 -2
- package/dist/federation/webfinger.test.mjs +2 -2
- package/dist/{http-Cx5dD1D_.js → http-Bl2-swIy.js} +152 -4
- package/dist/{http-C4D0ajx0.d.ts → http-Bs6thuCC.d.cts} +2 -2
- package/dist/{http-RYvZHWMc.d.cts → http-CDupyfOc.d.ts} +2 -2
- package/dist/{http-Bn3-am6C.mjs → http-CWG2X7S-.mjs} +2 -2
- package/dist/{http-BLqv_3ue.cjs → http-nKwQ0FzA.cjs} +163 -3
- package/dist/{inbox-DC8NbYIj.mjs → inbox-D39xUdAp.mjs} +1 -1
- package/dist/{key-BQUnVMwc.mjs → key-GYVCBSzo.mjs} +152 -4
- package/dist/{keycache-DaQ3ndaJ.mjs → keycache-D239uGT9.mjs} +12 -4
- package/dist/{kv-cache-CCEitzFw.cjs → kv-cache-COqju2MA.cjs} +1 -1
- package/dist/{kv-cache-DI4m-4xy.js → kv-cache-Dwdnp4S8.js} +1 -1
- package/dist/{ld-CVbwQ8Fz.mjs → ld-CsYiVIbF.mjs} +2 -2
- package/dist/{middleware-Fcpx7tz6.cjs → middleware-12JY8Jki.cjs} +26 -10
- package/dist/{middleware-BqkNe0c6.mjs → middleware-B7rpKC37.mjs} +1 -1
- package/dist/{middleware-2Qp34eTb.js → middleware-BDkg4n5s.js} +25 -9
- package/dist/{middleware-D3a1JsO1.mjs → middleware-D5I4RTqd.mjs} +27 -19
- package/dist/{middleware-C7Afa66S.cjs → middleware-DnPJ5AqT.cjs} +1 -1
- package/dist/{mod-B2zB0rDg.d.cts → mod-Bt0eg_Lv.d.cts} +1 -1
- package/dist/{mod-Du-UVCX_.d.ts → mod-D24V_w-K.d.ts} +1 -1
- package/dist/{mod-BtvLkCgb.d.cts → mod-Dp5dfH-i.d.cts} +1 -1
- package/dist/{mod-CiQNNAQL.d.ts → mod-E7YM72JZ.d.ts} +1 -1
- package/dist/{mod-CB6pc2pw.d.cts → mod-IOWUF5Yr.d.cts} +1 -1
- package/dist/{mod-CD1youdZ.d.ts → mod-XucBiDNd.d.ts} +1 -1
- package/dist/mod.cjs +5 -5
- package/dist/mod.d.cts +6 -6
- package/dist/mod.d.ts +6 -6
- package/dist/mod.js +5 -5
- package/dist/nodeinfo/client.test.mjs +28 -1
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/nodeinfo/mod.cjs +1 -1
- package/dist/nodeinfo/mod.js +1 -1
- package/dist/nodeinfo/types.test.mjs +1 -1
- package/dist/otel/exporter.test.mjs +1 -1
- package/dist/{owner-CnngXDNJ.d.ts → owner-B3hNQCG8.d.cts} +12 -1
- package/dist/{owner-DEvZuyOE.d.cts → owner-CiBPcC6F.d.ts} +12 -1
- package/dist/owner-xshWf7Pw.mjs +175 -0
- package/dist/{proof-EY-uItWr.js → proof-D-B0IDLS.js} +112 -58
- package/dist/{proof-liMyPvsb.cjs → proof-DL58LftU.cjs} +112 -58
- package/dist/{proof-DZWmoF6Z.mjs → proof-yKZAPs7k.mjs} +2 -2
- package/dist/{send-IMhmEkun.mjs → send-BRIl5BFM.mjs} +2 -2
- package/dist/sig/http.test.mjs +4 -4
- package/dist/sig/key.test.mjs +169 -2
- package/dist/sig/ld.test.mjs +56 -4
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.d.cts +3 -3
- package/dist/sig/mod.d.ts +3 -3
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +105 -6
- package/dist/sig/proof.test.mjs +72 -3
- package/dist/{temporal-BovRWwqL.mjs → temporal-BG59xtYa.mjs} +1 -1
- package/dist/{types-m8u9L86X.cjs → types-DWs-qZaY.cjs} +94 -2
- package/dist/{types-DTONwNqL.js → types-sXITXcWa.js} +78 -4
- package/dist/utils/docloader.test.mjs +28 -4
- 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 +5 -5
- package/dist/assert-ddO5KLpe.mjs +0 -23
- package/dist/owner-D9CjMxWb.mjs +0 -120
- /package/dist/{collection-ChgDTHLz.mjs → collection-DI6YzYpd.mjs} +0 -0
- /package/dist/{keys-CtZLJq76.mjs → keys-CCxRJhWa.mjs} +0 -0
- /package/dist/{kv-cache-DqEKe5E0.mjs → kv-cache-BrjuJue8.mjs} +0 -0
- /package/dist/{kv-BrZHNugx.mjs → kv-mI4Ix2EU.mjs} +0 -0
- /package/dist/{negotiation-BehA2uul.mjs → negotiation-TWEs6Cl8.mjs} +0 -0
- /package/dist/{retry-B_E3V_Dx.mjs → retry-Ddbq3AcK.mjs} +0 -0
- /package/dist/{types-C37hquWI.mjs → types-MNlFfxjv.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
4
|
+
import { n as version, t as name } from "./deno-BwjczLpP.mjs";
|
|
5
5
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
6
6
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
7
7
|
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
@@ -86,6 +86,118 @@ async function importJwk(jwk, type) {
|
|
|
86
86
|
return key;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
+
* Fetches the document that the given actor URI dereferences to, and returns
|
|
90
|
+
* the actor only if the host that served the document is authoritative for
|
|
91
|
+
* the id the document claims.
|
|
92
|
+
*
|
|
93
|
+
* Only the origin that serves an actor id can speak for it. Without that
|
|
94
|
+
* rule any host could serve a document describing somebody else's actor—and
|
|
95
|
+
* listing its own keys as that actor's.
|
|
96
|
+
*
|
|
97
|
+
* @param actorId The URI of the actor to fetch.
|
|
98
|
+
* @param options Options for fetching the document.
|
|
99
|
+
* @returns The actor, or `null` if the document cannot be fetched, is not an
|
|
100
|
+
* actor, or belongs to another origin.
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
async function fetchActorDocument(actorId, options = {}) {
|
|
104
|
+
const logger = getLogger([
|
|
105
|
+
"fedify",
|
|
106
|
+
"sig",
|
|
107
|
+
"key"
|
|
108
|
+
]);
|
|
109
|
+
const documentLoader = options.documentLoader ?? getDocumentLoader();
|
|
110
|
+
const contextLoader = options.contextLoader ?? getDocumentLoader();
|
|
111
|
+
const { tracerProvider } = options;
|
|
112
|
+
let document;
|
|
113
|
+
let documentUrl = actorId;
|
|
114
|
+
try {
|
|
115
|
+
const remoteDocument = await documentLoader(actorId.href);
|
|
116
|
+
document = remoteDocument.document;
|
|
117
|
+
documentUrl = new URL(remoteDocument.documentUrl ?? "", actorId);
|
|
118
|
+
} catch (error) {
|
|
119
|
+
logger.debug("Failed to fetch the actor {actorId}: {error}", {
|
|
120
|
+
actorId: actorId.href,
|
|
121
|
+
error
|
|
122
|
+
});
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
let object;
|
|
126
|
+
try {
|
|
127
|
+
object = await Object$1.fromJsonLd(document, {
|
|
128
|
+
documentLoader,
|
|
129
|
+
contextLoader,
|
|
130
|
+
tracerProvider,
|
|
131
|
+
baseUrl: documentUrl
|
|
132
|
+
});
|
|
133
|
+
} catch (error) {
|
|
134
|
+
if (!(error instanceof TypeError)) throw error;
|
|
135
|
+
logger.debug("The document served at {documentUrl} is not a valid object: {error}", {
|
|
136
|
+
documentUrl: documentUrl.href,
|
|
137
|
+
error
|
|
138
|
+
});
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
if (!isActor(object)) return null;
|
|
142
|
+
if (object.id == null || object.id.origin !== documentUrl.origin) {
|
|
143
|
+
logger.debug("The document served at {documentUrl} claims to be the actor {actorId}, which belongs to another origin; refusing to treat it as that actor's document.", {
|
|
144
|
+
documentUrl: documentUrl.href,
|
|
145
|
+
actorId: object.id?.href
|
|
146
|
+
});
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
return object;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Resolves the owner that the given key claims, and returns it only if the
|
|
153
|
+
* claim holds.
|
|
154
|
+
*
|
|
155
|
+
* The `owner` of a {@link CryptographicKey}, like the `controller` of
|
|
156
|
+
* a {@link Multikey}, proves nothing on its own: the key document and the
|
|
157
|
+
* claim inside it are served by the same host, so anyone able to serve a key
|
|
158
|
+
* document can name any actor in the world as its owner. The claim becomes
|
|
159
|
+
* meaningful only once the named actor's own document is fetched and turns
|
|
160
|
+
* out to link back to the key. This function performs that mutual-link
|
|
161
|
+
* check, which is the only sound way to learn a fetched key's owner.
|
|
162
|
+
*
|
|
163
|
+
* The claimed owner is always dereferenced, never read out of the key
|
|
164
|
+
* document: an owner embedded there is written by whoever wrote the key.
|
|
165
|
+
*
|
|
166
|
+
* @param key The key whose ownership claim is to be verified. It must carry
|
|
167
|
+
* an `id`, as that is what the owner has to link back to.
|
|
168
|
+
* @param options Options for fetching the claimed owner.
|
|
169
|
+
* @returns The verified owner, or `null` if the key claims no owner, the
|
|
170
|
+
* owner cannot be fetched, or the owner does not link back to
|
|
171
|
+
* the key.
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
174
|
+
async function verifyKeyOwnership(key, options = {}) {
|
|
175
|
+
const logger = getLogger([
|
|
176
|
+
"fedify",
|
|
177
|
+
"sig",
|
|
178
|
+
"key"
|
|
179
|
+
]);
|
|
180
|
+
const keyId = key.id;
|
|
181
|
+
if (keyId == null) return null;
|
|
182
|
+
const claimedOwnerId = key instanceof CryptographicKey ? key.ownerId : key.controllerId;
|
|
183
|
+
if (claimedOwnerId == null) return null;
|
|
184
|
+
const owner = await fetchActorDocument(claimedOwnerId, options);
|
|
185
|
+
if (owner == null) {
|
|
186
|
+
logger.debug("The owner ({claimedOwnerId}) that key {keyId} claims could not be resolved.", {
|
|
187
|
+
keyId: keyId.href,
|
|
188
|
+
claimedOwnerId: claimedOwnerId.href
|
|
189
|
+
});
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
const linkedKeyIds = key instanceof CryptographicKey ? owner.publicKeyIds : owner.assertionMethodIds;
|
|
193
|
+
for (const linkedKeyId of linkedKeyIds) if (linkedKeyId.href === keyId.href) return owner;
|
|
194
|
+
logger.debug("The owner ({claimedOwnerId}) that key {keyId} claims does not list the key as its own.", {
|
|
195
|
+
keyId: keyId.href,
|
|
196
|
+
claimedOwnerId: claimedOwnerId.href
|
|
197
|
+
});
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
89
201
|
* Fetches a {@link CryptographicKey} or {@link Multikey} from the given URL.
|
|
90
202
|
* If the given URL contains an {@link Actor} object, it tries to find
|
|
91
203
|
* the corresponding key in the `publicKey` or `assertionMethod` property.
|
|
@@ -154,8 +266,11 @@ async function fetchKeyInternal(keyId, cls, { documentLoader, contextLoader, key
|
|
|
154
266
|
}
|
|
155
267
|
logger.debug("Fetching key {keyId} to verify signature...", { keyId });
|
|
156
268
|
let document;
|
|
269
|
+
let documentUrl = cacheKey;
|
|
157
270
|
try {
|
|
158
|
-
|
|
271
|
+
const remoteDocument = await (documentLoader ?? getDocumentLoader())(keyId);
|
|
272
|
+
document = remoteDocument.document;
|
|
273
|
+
documentUrl = new URL(remoteDocument.documentUrl ?? "", cacheKey);
|
|
159
274
|
} catch (_) {
|
|
160
275
|
logger.debug("Failed to fetch key {keyId}.", { keyId });
|
|
161
276
|
await keyCache?.set(cacheKey, null);
|
|
@@ -192,8 +307,22 @@ async function fetchKeyInternal(keyId, cls, { documentLoader, contextLoader, key
|
|
|
192
307
|
}
|
|
193
308
|
}
|
|
194
309
|
let key = null;
|
|
195
|
-
|
|
310
|
+
let ownerDocument = null;
|
|
311
|
+
if (object instanceof cls && (object.id == null || object.id.href === keyId)) key = object.id == null ? object.clone({ id: cacheKey }) : object;
|
|
196
312
|
else if (isActor(object)) {
|
|
313
|
+
if (object.id == null || object.id.origin !== documentUrl.origin) {
|
|
314
|
+
logger.debug("Failed to verify; the document served at {documentUrl} claims to be the actor {actorId}, which belongs to another origin.", {
|
|
315
|
+
keyId,
|
|
316
|
+
documentUrl: documentUrl.href,
|
|
317
|
+
actorId: object.id?.href
|
|
318
|
+
});
|
|
319
|
+
await keyCache?.set(cacheKey, null);
|
|
320
|
+
return {
|
|
321
|
+
key: null,
|
|
322
|
+
cached: false
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
ownerDocument = object;
|
|
197
326
|
const keys = cls === CryptographicKey ? object.getPublicKeys({
|
|
198
327
|
documentLoader,
|
|
199
328
|
contextLoader,
|
|
@@ -252,6 +381,25 @@ async function fetchKeyInternal(keyId, cls, { documentLoader, contextLoader, key
|
|
|
252
381
|
cached: false
|
|
253
382
|
};
|
|
254
383
|
}
|
|
384
|
+
const claimedOwnerId = key instanceof CryptographicKey ? key.ownerId : key.controllerId;
|
|
385
|
+
if (ownerDocument != null && claimedOwnerId == null) key = key instanceof CryptographicKey ? key.clone({ owner: ownerDocument.id }) : key.clone({ controller: ownerDocument.id });
|
|
386
|
+
else if (claimedOwnerId != null && claimedOwnerId.href !== ownerDocument?.id?.href) {
|
|
387
|
+
if (await verifyKeyOwnership(key, {
|
|
388
|
+
documentLoader,
|
|
389
|
+
contextLoader,
|
|
390
|
+
tracerProvider
|
|
391
|
+
}) == null) {
|
|
392
|
+
logger.debug("Failed to verify; the owner {claimedOwnerId} that key {keyId} claims does not list the key as its own.", {
|
|
393
|
+
keyId,
|
|
394
|
+
claimedOwnerId: claimedOwnerId.href
|
|
395
|
+
});
|
|
396
|
+
await keyCache?.set(cacheKey, null);
|
|
397
|
+
return {
|
|
398
|
+
key: null,
|
|
399
|
+
cached: false
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
}
|
|
255
403
|
if (keyCache != null) {
|
|
256
404
|
await keyCache.set(cacheKey, key);
|
|
257
405
|
logger.debug("Key {keyId} cached.", { keyId });
|
|
@@ -262,4 +410,4 @@ async function fetchKeyInternal(keyId, cls, { documentLoader, contextLoader, key
|
|
|
262
410
|
};
|
|
263
411
|
}
|
|
264
412
|
//#endregion
|
|
265
|
-
export {
|
|
413
|
+
export { importJwk as a, generateCryptoKeyPair as i, fetchActorDocument as n, validateCryptoKey as o, fetchKey as r, verifyKeyOwnership as s, exportJwk as t };
|
|
@@ -5,6 +5,7 @@ import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
|
5
5
|
//#region src/federation/keycache.ts
|
|
6
6
|
const NULL_KEY_CACHE_VALUE = { _fedify: "key-unavailable" };
|
|
7
7
|
const NULL_KEY_CACHE_TTL = Temporal.Duration.from({ minutes: 5 });
|
|
8
|
+
const KEY_CACHE_GENERATION = "2";
|
|
8
9
|
function isNullKeyCacheValue(value) {
|
|
9
10
|
return typeof value === "object" && value != null && "_fedify" in value && value._fedify === NULL_KEY_CACHE_VALUE._fedify;
|
|
10
11
|
}
|
|
@@ -19,9 +20,16 @@ var KvKeyCache = class {
|
|
|
19
20
|
this.nullKeys = /* @__PURE__ */ new Set();
|
|
20
21
|
this.options = options;
|
|
21
22
|
}
|
|
23
|
+
#entryKey(keyId) {
|
|
24
|
+
return [
|
|
25
|
+
...this.prefix,
|
|
26
|
+
KEY_CACHE_GENERATION,
|
|
27
|
+
keyId.href
|
|
28
|
+
];
|
|
29
|
+
}
|
|
22
30
|
async get(keyId) {
|
|
23
31
|
if (this.nullKeys.has(keyId.href)) return null;
|
|
24
|
-
const serialized = await this.kv.get(
|
|
32
|
+
const serialized = await this.kv.get(this.#entryKey(keyId));
|
|
25
33
|
if (serialized == null) return void 0;
|
|
26
34
|
if (isNullKeyCacheValue(serialized)) {
|
|
27
35
|
this.nullKeys.add(keyId.href);
|
|
@@ -33,7 +41,7 @@ var KvKeyCache = class {
|
|
|
33
41
|
try {
|
|
34
42
|
return await Multikey.fromJsonLd(serialized, this.options);
|
|
35
43
|
} catch {
|
|
36
|
-
await this.kv.delete(
|
|
44
|
+
await this.kv.delete(this.#entryKey(keyId));
|
|
37
45
|
return;
|
|
38
46
|
}
|
|
39
47
|
}
|
|
@@ -41,12 +49,12 @@ var KvKeyCache = class {
|
|
|
41
49
|
async set(keyId, key) {
|
|
42
50
|
if (key == null) {
|
|
43
51
|
this.nullKeys.add(keyId.href);
|
|
44
|
-
await this.kv.set(
|
|
52
|
+
await this.kv.set(this.#entryKey(keyId), NULL_KEY_CACHE_VALUE, { ttl: NULL_KEY_CACHE_TTL });
|
|
45
53
|
return;
|
|
46
54
|
}
|
|
47
55
|
this.nullKeys.delete(keyId.href);
|
|
48
56
|
const serialized = await key.toJsonLd(this.options);
|
|
49
|
-
await this.kv.set(
|
|
57
|
+
await this.kv.set(this.#entryKey(keyId), serialized);
|
|
50
58
|
}
|
|
51
59
|
};
|
|
52
60
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
require("./chunk-DDcVe30Y.cjs");
|
|
4
|
-
const require_http = require("./http-
|
|
4
|
+
const require_http = require("./http-nKwQ0FzA.cjs");
|
|
5
5
|
let _logtape_logtape = require("@logtape/logtape");
|
|
6
6
|
let es_toolkit = require("es-toolkit");
|
|
7
7
|
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import {
|
|
3
|
+
import { l as validateCryptoKey, t as doubleKnock } from "./http-Bl2-swIy.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { curry } from "es-toolkit";
|
|
6
6
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
@@ -1,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 {
|
|
4
|
+
import { n as version, t as name } from "./deno-BwjczLpP.mjs";
|
|
5
|
+
import { o as validateCryptoKey, r as fetchKey } from "./key-GYVCBSzo.mjs";
|
|
6
6
|
import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
|
|
7
7
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
@@ -2,10 +2,10 @@ const { Temporal } = require("@js-temporal/polyfill");
|
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
const require_chunk = require("./chunk-DDcVe30Y.cjs");
|
|
4
4
|
const require_transformers = require("./transformers-NeAONrAq.cjs");
|
|
5
|
-
const require_http = require("./http-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const require_kv_cache = require("./kv-cache-
|
|
5
|
+
const require_http = require("./http-nKwQ0FzA.cjs");
|
|
6
|
+
const require_types = require("./types-DWs-qZaY.cjs");
|
|
7
|
+
const require_proof = require("./proof-DL58LftU.cjs");
|
|
8
|
+
const require_kv_cache = require("./kv-cache-COqju2MA.cjs");
|
|
9
9
|
let _logtape_logtape = require("@logtape/logtape");
|
|
10
10
|
let _fedify_vocab = require("@fedify/vocab");
|
|
11
11
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
@@ -335,7 +335,7 @@ var FederationBuilderImpl = class {
|
|
|
335
335
|
this.collectionTypeIds = {};
|
|
336
336
|
}
|
|
337
337
|
async build(options) {
|
|
338
|
-
const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-
|
|
338
|
+
const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-DnPJ5AqT.cjs"));
|
|
339
339
|
const f = new FederationImpl(options);
|
|
340
340
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
341
341
|
f.router = this.router.clone();
|
|
@@ -858,6 +858,7 @@ async function buildCollectionSynchronizationHeader(collectionId, actorIds) {
|
|
|
858
858
|
//#region src/federation/keycache.ts
|
|
859
859
|
const NULL_KEY_CACHE_VALUE = { _fedify: "key-unavailable" };
|
|
860
860
|
const NULL_KEY_CACHE_TTL = Temporal.Duration.from({ minutes: 5 });
|
|
861
|
+
const KEY_CACHE_GENERATION = "2";
|
|
861
862
|
function isNullKeyCacheValue(value) {
|
|
862
863
|
return typeof value === "object" && value != null && "_fedify" in value && value._fedify === NULL_KEY_CACHE_VALUE._fedify;
|
|
863
864
|
}
|
|
@@ -872,9 +873,16 @@ var KvKeyCache = class {
|
|
|
872
873
|
this.nullKeys = /* @__PURE__ */ new Set();
|
|
873
874
|
this.options = options;
|
|
874
875
|
}
|
|
876
|
+
#entryKey(keyId) {
|
|
877
|
+
return [
|
|
878
|
+
...this.prefix,
|
|
879
|
+
KEY_CACHE_GENERATION,
|
|
880
|
+
keyId.href
|
|
881
|
+
];
|
|
882
|
+
}
|
|
875
883
|
async get(keyId) {
|
|
876
884
|
if (this.nullKeys.has(keyId.href)) return null;
|
|
877
|
-
const serialized = await this.kv.get(
|
|
885
|
+
const serialized = await this.kv.get(this.#entryKey(keyId));
|
|
878
886
|
if (serialized == null) return void 0;
|
|
879
887
|
if (isNullKeyCacheValue(serialized)) {
|
|
880
888
|
this.nullKeys.add(keyId.href);
|
|
@@ -886,7 +894,7 @@ var KvKeyCache = class {
|
|
|
886
894
|
try {
|
|
887
895
|
return await _fedify_vocab.Multikey.fromJsonLd(serialized, this.options);
|
|
888
896
|
} catch {
|
|
889
|
-
await this.kv.delete(
|
|
897
|
+
await this.kv.delete(this.#entryKey(keyId));
|
|
890
898
|
return;
|
|
891
899
|
}
|
|
892
900
|
}
|
|
@@ -894,12 +902,12 @@ var KvKeyCache = class {
|
|
|
894
902
|
async set(keyId, key) {
|
|
895
903
|
if (key == null) {
|
|
896
904
|
this.nullKeys.add(keyId.href);
|
|
897
|
-
await this.kv.set(
|
|
905
|
+
await this.kv.set(this.#entryKey(keyId), NULL_KEY_CACHE_VALUE, { ttl: NULL_KEY_CACHE_TTL });
|
|
898
906
|
return;
|
|
899
907
|
}
|
|
900
908
|
this.nullKeys.delete(keyId.href);
|
|
901
909
|
const serialized = await key.toJsonLd(this.options);
|
|
902
|
-
await this.kv.set(
|
|
910
|
+
await this.kv.set(this.#entryKey(keyId), serialized);
|
|
903
911
|
}
|
|
904
912
|
};
|
|
905
913
|
//#endregion
|
|
@@ -1377,8 +1385,16 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
1377
1385
|
}
|
|
1378
1386
|
let json;
|
|
1379
1387
|
try {
|
|
1380
|
-
json = await request.clone().
|
|
1388
|
+
json = JSON.parse(await require_types.readBoundedText(request.clone(), require_types.MAX_BODY_SIZE, request.url));
|
|
1381
1389
|
} catch (error) {
|
|
1390
|
+
if (error instanceof require_types.BodyTooLargeError) {
|
|
1391
|
+
request.body?.cancel(error).catch(() => {});
|
|
1392
|
+
span.setStatus({
|
|
1393
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
1394
|
+
message: String(error)
|
|
1395
|
+
});
|
|
1396
|
+
return new Response("Inbox body too large.", { status: 413 });
|
|
1397
|
+
}
|
|
1382
1398
|
logger.error("Failed to parse JSON:\n{error}", {
|
|
1383
1399
|
recipient,
|
|
1384
1400
|
error
|
|
@@ -2,10 +2,10 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
import { t as __exportAll } from "./chunk-CRNNMoPX.js";
|
|
4
4
|
import { r as getDefaultActivityTransformers } from "./transformers-BGMIq1cs.js";
|
|
5
|
-
import { c as
|
|
6
|
-
import {
|
|
7
|
-
import { n as
|
|
8
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-
|
|
5
|
+
import { c as importJwk, d as name, f as version, i as exportJwk, l as validateCryptoKey, r as verifyRequest, t as doubleKnock } from "./http-Bl2-swIy.js";
|
|
6
|
+
import { a as MAX_BODY_SIZE, i as BodyTooLargeError, n as getNodeInfo, o as readBoundedText, t as nodeInfoToJson } from "./types-sXITXcWa.js";
|
|
7
|
+
import { _ as signJsonLd, a as doesActorOwnKey, c as assertSafeJsonLd, f as detachSignature, g as isInvalidUrlTypeError, h as isClearlyMalformedContextReference, m as hasSignature, n as signObject, o as getKeyOwner, p as getNormalizationContextLoader, r as verifyObject, s as InvalidContextReferenceError, u as compactJsonLd, v as verifyCompactJsonLd, x as wrapContextLoaderForJsonLd } from "./proof-D-B0IDLS.js";
|
|
8
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-Dwdnp4S8.js";
|
|
9
9
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
10
10
|
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
11
11
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
@@ -857,6 +857,7 @@ async function buildCollectionSynchronizationHeader(collectionId, actorIds) {
|
|
|
857
857
|
//#region src/federation/keycache.ts
|
|
858
858
|
const NULL_KEY_CACHE_VALUE = { _fedify: "key-unavailable" };
|
|
859
859
|
const NULL_KEY_CACHE_TTL = Temporal.Duration.from({ minutes: 5 });
|
|
860
|
+
const KEY_CACHE_GENERATION = "2";
|
|
860
861
|
function isNullKeyCacheValue(value) {
|
|
861
862
|
return typeof value === "object" && value != null && "_fedify" in value && value._fedify === NULL_KEY_CACHE_VALUE._fedify;
|
|
862
863
|
}
|
|
@@ -871,9 +872,16 @@ var KvKeyCache = class {
|
|
|
871
872
|
this.nullKeys = /* @__PURE__ */ new Set();
|
|
872
873
|
this.options = options;
|
|
873
874
|
}
|
|
875
|
+
#entryKey(keyId) {
|
|
876
|
+
return [
|
|
877
|
+
...this.prefix,
|
|
878
|
+
KEY_CACHE_GENERATION,
|
|
879
|
+
keyId.href
|
|
880
|
+
];
|
|
881
|
+
}
|
|
874
882
|
async get(keyId) {
|
|
875
883
|
if (this.nullKeys.has(keyId.href)) return null;
|
|
876
|
-
const serialized = await this.kv.get(
|
|
884
|
+
const serialized = await this.kv.get(this.#entryKey(keyId));
|
|
877
885
|
if (serialized == null) return void 0;
|
|
878
886
|
if (isNullKeyCacheValue(serialized)) {
|
|
879
887
|
this.nullKeys.add(keyId.href);
|
|
@@ -885,7 +893,7 @@ var KvKeyCache = class {
|
|
|
885
893
|
try {
|
|
886
894
|
return await Multikey.fromJsonLd(serialized, this.options);
|
|
887
895
|
} catch {
|
|
888
|
-
await this.kv.delete(
|
|
896
|
+
await this.kv.delete(this.#entryKey(keyId));
|
|
889
897
|
return;
|
|
890
898
|
}
|
|
891
899
|
}
|
|
@@ -893,12 +901,12 @@ var KvKeyCache = class {
|
|
|
893
901
|
async set(keyId, key) {
|
|
894
902
|
if (key == null) {
|
|
895
903
|
this.nullKeys.add(keyId.href);
|
|
896
|
-
await this.kv.set(
|
|
904
|
+
await this.kv.set(this.#entryKey(keyId), NULL_KEY_CACHE_VALUE, { ttl: NULL_KEY_CACHE_TTL });
|
|
897
905
|
return;
|
|
898
906
|
}
|
|
899
907
|
this.nullKeys.delete(keyId.href);
|
|
900
908
|
const serialized = await key.toJsonLd(this.options);
|
|
901
|
-
await this.kv.set(
|
|
909
|
+
await this.kv.set(this.#entryKey(keyId), serialized);
|
|
902
910
|
}
|
|
903
911
|
};
|
|
904
912
|
//#endregion
|
|
@@ -1376,8 +1384,16 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
1376
1384
|
}
|
|
1377
1385
|
let json;
|
|
1378
1386
|
try {
|
|
1379
|
-
json = await request.clone().
|
|
1387
|
+
json = JSON.parse(await readBoundedText(request.clone(), MAX_BODY_SIZE, request.url));
|
|
1380
1388
|
} catch (error) {
|
|
1389
|
+
if (error instanceof BodyTooLargeError) {
|
|
1390
|
+
request.body?.cancel(error).catch(() => {});
|
|
1391
|
+
span.setStatus({
|
|
1392
|
+
code: SpanStatusCode.ERROR,
|
|
1393
|
+
message: String(error)
|
|
1394
|
+
});
|
|
1395
|
+
return new Response("Inbox body too large.", { status: 413 });
|
|
1396
|
+
}
|
|
1381
1397
|
logger.error("Failed to parse JSON:\n{error}", {
|
|
1382
1398
|
recipient,
|
|
1383
1399
|
error
|
|
@@ -2,24 +2,24 @@ 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-
|
|
6
|
-
import { a as
|
|
7
|
-
import { l as verifyRequest } from "./http-
|
|
8
|
-
import { t as getAuthenticatedDocumentLoader } from "./docloader-
|
|
9
|
-
import { n as kvCache } from "./kv-cache-
|
|
10
|
-
import { a as compactJsonLd, c as getNormalizationContextLoader, d as isInvalidUrlTypeError, f as signJsonLd, g as wrapContextLoaderForJsonLd, l as hasSignature, p as verifyCompactJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as isClearlyMalformedContextReference } from "./ld-
|
|
11
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-
|
|
12
|
-
import { n as signObject, r as verifyObject } from "./proof-
|
|
13
|
-
import { t as getNodeInfo } from "./client-
|
|
14
|
-
import { t as nodeInfoToJson } from "./types-
|
|
15
|
-
import { n as routeActivity } from "./inbox-
|
|
16
|
-
import { t as FederationBuilderImpl } from "./builder-
|
|
17
|
-
import { t as buildCollectionSynchronizationHeader } from "./collection-
|
|
18
|
-
import { t as KvKeyCache } from "./keycache-
|
|
19
|
-
import { t as acceptsJsonLd } from "./negotiation-
|
|
20
|
-
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-
|
|
21
|
-
import { t as createExponentialBackoffPolicy } from "./retry-
|
|
22
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-
|
|
5
|
+
import { n as version, t as name } from "./deno-BwjczLpP.mjs";
|
|
6
|
+
import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-GYVCBSzo.mjs";
|
|
7
|
+
import { l as verifyRequest } from "./http-CWG2X7S-.mjs";
|
|
8
|
+
import { t as getAuthenticatedDocumentLoader } from "./docloader-BKABwzJs.mjs";
|
|
9
|
+
import { n as kvCache } from "./kv-cache-BrjuJue8.mjs";
|
|
10
|
+
import { a as compactJsonLd, c as getNormalizationContextLoader, d as isInvalidUrlTypeError, f as signJsonLd, g as wrapContextLoaderForJsonLd, l as hasSignature, p as verifyCompactJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as isClearlyMalformedContextReference } from "./ld-CsYiVIbF.mjs";
|
|
11
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-xshWf7Pw.mjs";
|
|
12
|
+
import { n as signObject, r as verifyObject } from "./proof-yKZAPs7k.mjs";
|
|
13
|
+
import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-glFHmpn4.mjs";
|
|
14
|
+
import { t as nodeInfoToJson } from "./types-MNlFfxjv.mjs";
|
|
15
|
+
import { n as routeActivity } from "./inbox-D39xUdAp.mjs";
|
|
16
|
+
import { t as FederationBuilderImpl } from "./builder-DrLogDNE.mjs";
|
|
17
|
+
import { t as buildCollectionSynchronizationHeader } from "./collection-DI6YzYpd.mjs";
|
|
18
|
+
import { t as KvKeyCache } from "./keycache-D239uGT9.mjs";
|
|
19
|
+
import { t as acceptsJsonLd } from "./negotiation-TWEs6Cl8.mjs";
|
|
20
|
+
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-BG59xtYa.mjs";
|
|
21
|
+
import { t as createExponentialBackoffPolicy } from "./retry-Ddbq3AcK.mjs";
|
|
22
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-BRIl5BFM.mjs";
|
|
23
23
|
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
24
24
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
25
25
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
@@ -474,8 +474,16 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
474
474
|
}
|
|
475
475
|
let json;
|
|
476
476
|
try {
|
|
477
|
-
json = await request.clone().
|
|
477
|
+
json = JSON.parse(await readBoundedText(request.clone(), MAX_BODY_SIZE, request.url));
|
|
478
478
|
} catch (error) {
|
|
479
|
+
if (error instanceof BodyTooLargeError) {
|
|
480
|
+
request.body?.cancel(error).catch(() => {});
|
|
481
|
+
span.setStatus({
|
|
482
|
+
code: SpanStatusCode.ERROR,
|
|
483
|
+
message: String(error)
|
|
484
|
+
});
|
|
485
|
+
return new Response("Inbox body too large.", { status: 413 });
|
|
486
|
+
}
|
|
479
487
|
logger.error("Failed to parse JSON:\n{error}", {
|
|
480
488
|
recipient,
|
|
481
489
|
error
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
-
const require_middleware = require("./middleware-
|
|
3
|
+
const require_middleware = require("./middleware-12JY8Jki.cjs");
|
|
4
4
|
exports.FederationImpl = require_middleware.FederationImpl;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { n as HttpMessageSignaturesSpecDeterminer } from "./http-
|
|
2
|
+
import { n as HttpMessageSignaturesSpecDeterminer } from "./http-Bs6thuCC.cjs";
|
|
3
3
|
import { n as KvStore, t as KvKey } from "./kv-gJ8LYbxX.cjs";
|
|
4
4
|
import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
|
|
5
5
|
import { TracerProvider } from "@opentelemetry/api";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, mt as WebFingerLinksDispatcher, s as RequestContext } from "./context-
|
|
2
|
+
import { X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, mt as WebFingerLinksDispatcher, s as RequestContext } from "./context-B21klrfz.js";
|
|
3
3
|
import { Span, Tracer } from "@opentelemetry/api";
|
|
4
4
|
|
|
5
5
|
//#region src/federation/webfinger.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, mt as WebFingerLinksDispatcher, s as RequestContext } from "./context-
|
|
2
|
+
import { X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, mt as WebFingerLinksDispatcher, s as RequestContext } from "./context-M_MxoQgC.cjs";
|
|
3
3
|
import { Span, Tracer } from "@opentelemetry/api";
|
|
4
4
|
|
|
5
5
|
//#region src/federation/webfinger.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { l as KeyCache } from "./http-
|
|
2
|
+
import { l as KeyCache } from "./http-CDupyfOc.js";
|
|
3
3
|
import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "@fedify/vocab";
|
|
4
4
|
import { TracerProvider } from "@opentelemetry/api";
|
|
5
5
|
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { l as KeyCache } from "./http-
|
|
2
|
+
import { l as KeyCache } from "./http-Bs6thuCC.cjs";
|
|
3
3
|
import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "@fedify/vocab";
|
|
4
4
|
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
5
5
|
import { TracerProvider } from "@opentelemetry/api";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { n as HttpMessageSignaturesSpecDeterminer } from "./http-
|
|
2
|
+
import { n as HttpMessageSignaturesSpecDeterminer } from "./http-CDupyfOc.js";
|
|
3
3
|
import { n as KvStore, t as KvKey } from "./kv-D6hNiMTK.js";
|
|
4
4
|
import { TracerProvider } from "@opentelemetry/api";
|
|
5
5
|
import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
|
package/dist/mod.cjs
CHANGED
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
require("./chunk-DDcVe30Y.cjs");
|
|
5
5
|
const require_transformers = require("./transformers-NeAONrAq.cjs");
|
|
6
6
|
require("./compat/mod.cjs");
|
|
7
|
-
const require_http = require("./http-
|
|
8
|
-
const require_middleware = require("./middleware-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const require_kv_cache = require("./kv-cache-
|
|
7
|
+
const require_http = require("./http-nKwQ0FzA.cjs");
|
|
8
|
+
const require_middleware = require("./middleware-12JY8Jki.cjs");
|
|
9
|
+
const require_types = require("./types-DWs-qZaY.cjs");
|
|
10
|
+
const require_proof = require("./proof-DL58LftU.cjs");
|
|
11
|
+
const require_kv_cache = require("./kv-cache-COqju2MA.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.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-CAM_bQXx.cjs";
|
|
3
|
-
import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryptoKeyPair, i as VerifyRequestOptions, l as KeyCache, n as HttpMessageSignaturesSpecDeterminer, o as verifyRequest, p as importJwk, r as SignRequestOptions, s as FetchKeyOptions, t as HttpMessageSignaturesSpec, u as exportJwk } from "./http-
|
|
4
|
-
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-
|
|
5
|
-
import { $ as AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, bt as ActivityTransformer, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "./context-
|
|
3
|
+
import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryptoKeyPair, i as VerifyRequestOptions, l as KeyCache, n as HttpMessageSignaturesSpecDeterminer, o as verifyRequest, p as importJwk, r as SignRequestOptions, s as FetchKeyOptions, t as HttpMessageSignaturesSpec, u as exportJwk } from "./http-Bs6thuCC.cjs";
|
|
4
|
+
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-B3hNQCG8.cjs";
|
|
5
|
+
import { $ as AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, bt as ActivityTransformer, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "./context-M_MxoQgC.cjs";
|
|
6
6
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-gJ8LYbxX.cjs";
|
|
7
7
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
|
|
8
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-
|
|
9
|
-
import { _ as verifyJsonLd, a as createProof, c as verifyProof, d as VerifyJsonLdOptions, f as VerifySignatureOptions, g as signJsonLd, h as detachSignature, i as VerifyProofOptions, l as CreateSignatureOptions, m as createSignature, n as SignObjectOptions, o as signObject, p as attachSignature, r as VerifyObjectOptions, s as verifyObject, t as CreateProofOptions, u as SignJsonLdOptions, v as verifySignature } from "./mod-
|
|
10
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-
|
|
8
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-Dp5dfH-i.cjs";
|
|
9
|
+
import { _ as verifyJsonLd, a as createProof, c as verifyProof, d as VerifyJsonLdOptions, f as VerifySignatureOptions, g as signJsonLd, h as detachSignature, i as VerifyProofOptions, l as CreateSignatureOptions, m as createSignature, n as SignObjectOptions, o as signObject, p as attachSignature, r as VerifyObjectOptions, s as verifyObject, t as CreateProofOptions, u as SignJsonLdOptions, v as verifySignature } from "./mod-IOWUF5Yr.cjs";
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-Bt0eg_Lv.cjs";
|
|
11
11
|
export * from "@fedify/vocab-runtime";
|
|
12
12
|
|
|
13
13
|
//#region src/mod.d.ts
|