@fedify/fedify 0.12.0-dev.302 → 0.12.0-dev.305
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGES.md +16 -0
- package/README.md +3 -74
- package/esm/federation/handler.js +36 -5
- package/esm/federation/middleware.js +2 -1
- package/esm/sig/http.js +23 -6
- package/esm/sig/key.js +20 -2
- package/esm/sig/mod.js +2 -1
- package/esm/sig/proof.js +35 -8
- package/package.json +1 -1
- package/types/federation/handler.d.ts +5 -2
- package/types/federation/handler.d.ts.map +1 -1
- package/types/federation/middleware.d.ts +6 -0
- package/types/federation/middleware.d.ts.map +1 -1
- package/types/sig/http.d.ts +7 -1
- package/types/sig/http.d.ts.map +1 -1
- package/types/sig/key.d.ts +39 -3
- package/types/sig/key.d.ts.map +1 -1
- package/types/sig/mod.d.ts +2 -1
- package/types/sig/mod.d.ts.map +1 -1
- package/types/sig/proof.d.ts +6 -0
- package/types/sig/proof.d.ts.map +1 -1
package/CHANGES.md
CHANGED
@@ -73,6 +73,21 @@ To be released.
|
|
73
73
|
- The type of `ActorKeyPairsDispatcher<TContextData>`'s first parameter
|
74
74
|
became `Context` (was `TContextData`).
|
75
75
|
|
76
|
+
- During verifying HTTP Signatures and Object Integrity Proofs, once fetched
|
77
|
+
public keys are now cached. [[#107]]
|
78
|
+
|
79
|
+
- The `verifyRequest()` function now caches the fetched public keys
|
80
|
+
when the `keyCache` option is provided.
|
81
|
+
- The `verifyProof()` function now caches the fetched public keys
|
82
|
+
when the `keyCache` option is provided.
|
83
|
+
- The `verifyObject()` function now caches the fetched public keys
|
84
|
+
when the `keyCache` option is provided.
|
85
|
+
- Added `KeyCache` interface.
|
86
|
+
- Added `VerifyRequestOptions.keyCache` property.
|
87
|
+
- Added `VerifyProofOptions.keyCache` property.
|
88
|
+
- Added `VerifyObjectOptions.keyCache` property.
|
89
|
+
- Added `FederationKvPrefixes.publicKeyCache` property.
|
90
|
+
|
76
91
|
- The built-in document loaders now recognize JSON-LD context provided in
|
77
92
|
an HTTP `Link` header. [[#6]]
|
78
93
|
|
@@ -141,6 +156,7 @@ To be released.
|
|
141
156
|
[#92]: https://github.com/dahlia/fedify/pull/92
|
142
157
|
[#104]: https://github.com/dahlia/fedify/issues/104
|
143
158
|
[#105]: https://github.com/dahlia/fedify/issues/105
|
159
|
+
[#107]: https://github.com/dahlia/fedify/issues/107
|
144
160
|
[Astro]: https://astro.build/
|
145
161
|
|
146
162
|
|
package/README.md
CHANGED
@@ -36,7 +36,8 @@ Currently, Fedify provides the following features out of the box:
|
|
36
36
|
If you want to know more about the project, please take a look at the following
|
37
37
|
resources:
|
38
38
|
|
39
|
-
- [
|
39
|
+
- [Installation](https://fedify.dev/install)
|
40
|
+
- [In-depth tutorial](https://fedify.dev/tutorial)
|
40
41
|
- [API reference][JSR]
|
41
42
|
- [Examples](https://github.com/dahlia/fedify/tree/main/examples)
|
42
43
|
|
@@ -54,7 +55,7 @@ join our [Matrix chat space][Matrix] or [GitHub Discussions]. Or tag
|
|
54
55
|
[GitHub Actions]: https://github.com/dahlia/fedify/actions/workflows/build.yaml
|
55
56
|
[GitHub Actions badge]: https://github.com/dahlia/fedify/actions/workflows/build.yaml/badge.svg
|
56
57
|
[Matrix]: https://matrix.to/#/#fedify:matrix.org
|
57
|
-
[Matrix badge]: https://img.shields.io/matrix/fedify%3Amatrix.org
|
58
|
+
[Matrix badge]: https://img.shields.io/matrix/fedify%3Amatrix.org?logo=matrix
|
58
59
|
[@fedify@hollo.social badge]: https://fedi-badge.deno.dev/@fedify@hollo.social/followers.svg
|
59
60
|
[@fedify@hollo.social]: https://hollo.social/@fedify
|
60
61
|
[Fedify Demo]: https://dash.deno.com/playground/fedify-demo
|
@@ -71,75 +72,3 @@ join our [Matrix chat space][Matrix] or [GitHub Discussions]. Or tag
|
|
71
72
|
[Lemmy]: https://join-lemmy.org/
|
72
73
|
[Pixelfed]: https://pixelfed.org/
|
73
74
|
[PeerTube]: https://joinpeertube.org/
|
74
|
-
|
75
|
-
|
76
|
-
Installation
|
77
|
-
------------
|
78
|
-
|
79
|
-
Fedify is available on [JSR] for [Deno] and on [npm] for [Node.js] and [Bun].
|
80
|
-
|
81
|
-
> [!TIP]
|
82
|
-
> We recommend using Deno or Bun (which are TypeScript-first) for the best
|
83
|
-
> experience, but you can use Node.js if you prefer.
|
84
|
-
|
85
|
-
[JSR]: https://jsr.io/@fedify/fedify
|
86
|
-
[Deno]: https://deno.com/
|
87
|
-
[npm]: https://www.npmjs.com/package/@fedify/fedify
|
88
|
-
[Node.js]: https://nodejs.org/
|
89
|
-
[Bun]: https://bun.sh/
|
90
|
-
|
91
|
-
### Deno
|
92
|
-
|
93
|
-
[Deno] is the primary runtime for Fedify. As a prerequisite, you need to have
|
94
|
-
Deno 1.41.0 or later installed on your system. Then you can install Fedify
|
95
|
-
via the following command:
|
96
|
-
|
97
|
-
~~~~ sh
|
98
|
-
deno add @fedify/fedify
|
99
|
-
~~~~
|
100
|
-
|
101
|
-
Since Fedify requires [`Temporal`] API, which is an unstable feature in Deno as
|
102
|
-
of May 2024, you need to add the `"temporal"` to the `"unstable"` field of
|
103
|
-
the *deno.json* file:
|
104
|
-
|
105
|
-
~~~~ json
|
106
|
-
{
|
107
|
-
"imports": {
|
108
|
-
"@fedify/fedify": "jsr:@fedify/fedify"
|
109
|
-
},
|
110
|
-
"unstable": ["temporal"]
|
111
|
-
}
|
112
|
-
~~~~
|
113
|
-
|
114
|
-
[`Temporal`]: https://tc39.es/proposal-temporal/docs/
|
115
|
-
|
116
|
-
### Node.js
|
117
|
-
|
118
|
-
Fedify can also be used in Node.js. As a prerequisite, you need to have Node.js
|
119
|
-
20.0.0 or later installed on your system. Then you can install Fedify via
|
120
|
-
the following command:
|
121
|
-
|
122
|
-
~~~~ sh
|
123
|
-
npm add @fedify/fedify
|
124
|
-
~~~~
|
125
|
-
|
126
|
-
Fedify is an ESM-only package, so you need to add `"type": "module"` to the
|
127
|
-
*package.json* file:
|
128
|
-
|
129
|
-
~~~~ json
|
130
|
-
{
|
131
|
-
"type": "module",
|
132
|
-
"dependencies": {
|
133
|
-
"@fedify/fedify": "^0.12.0"
|
134
|
-
}
|
135
|
-
}
|
136
|
-
~~~~
|
137
|
-
|
138
|
-
### Bun
|
139
|
-
|
140
|
-
Fedify can also be used in Bun. You can install it via the following
|
141
|
-
command:
|
142
|
-
|
143
|
-
~~~~ sh
|
144
|
-
bun add @fedify/fedify
|
145
|
-
~~~~
|
@@ -4,7 +4,7 @@ import { accepts } from "../deps/jsr.io/@std/http/0.224.5/negotiation.js";
|
|
4
4
|
import { verifyRequest } from "../sig/http.js";
|
5
5
|
import { doesActorOwnKey } from "../sig/owner.js";
|
6
6
|
import { verifyObject } from "../sig/proof.js";
|
7
|
-
import { Activity, Link, Object, OrderedCollection, OrderedCollectionPage, } from "../vocab/vocab.js";
|
7
|
+
import { Activity, CryptographicKey, Link, Multikey, Object, OrderedCollection, OrderedCollectionPage, } from "../vocab/vocab.js";
|
8
8
|
export function acceptsJsonLd(request) {
|
9
9
|
const types = accepts(request);
|
10
10
|
if (types == null)
|
@@ -166,7 +166,7 @@ function filterCollectionItems(items, collectionName, filterPredicate) {
|
|
166
166
|
}
|
167
167
|
return result;
|
168
168
|
}
|
169
|
-
export async function handleInbox(request, { handle, context, kv,
|
169
|
+
export async function handleInbox(request, { handle, context, kv, kvPrefixes, queue, actorDispatcher, inboxListeners, inboxErrorHandler, onNotFound, signatureTimeWindow, }) {
|
170
170
|
const logger = getLogger(["fedify", "federation", "inbox"]);
|
171
171
|
if (actorDispatcher == null) {
|
172
172
|
logger.error("Actor dispatcher is not set.", { handle });
|
@@ -196,9 +196,38 @@ export async function handleInbox(request, { handle, context, kv, kvPrefix, queu
|
|
196
196
|
headers: { "Content-Type": "text/plain; charset=utf-8" },
|
197
197
|
});
|
198
198
|
}
|
199
|
+
const keyCache = {
|
200
|
+
async get(keyId) {
|
201
|
+
const serialized = await kv.get([
|
202
|
+
...kvPrefixes.publicKeyCache,
|
203
|
+
keyId.href,
|
204
|
+
]);
|
205
|
+
if (serialized == null)
|
206
|
+
return null;
|
207
|
+
let object;
|
208
|
+
try {
|
209
|
+
object = await Object.fromJsonLd(serialized, context);
|
210
|
+
}
|
211
|
+
catch {
|
212
|
+
return null;
|
213
|
+
}
|
214
|
+
if (object instanceof CryptographicKey || object instanceof Multikey) {
|
215
|
+
return object;
|
216
|
+
}
|
217
|
+
return null;
|
218
|
+
},
|
219
|
+
async set(keyId, key) {
|
220
|
+
const serialized = await key.toJsonLd(context);
|
221
|
+
await kv.set([...kvPrefixes.publicKeyCache, keyId.href], serialized);
|
222
|
+
},
|
223
|
+
};
|
199
224
|
let activity;
|
200
225
|
try {
|
201
|
-
activity = await verifyObject(Activity, json,
|
226
|
+
activity = await verifyObject(Activity, json, {
|
227
|
+
contextLoader: context.contextLoader,
|
228
|
+
documentLoader: context.documentLoader,
|
229
|
+
keyCache,
|
230
|
+
});
|
202
231
|
}
|
203
232
|
catch (error) {
|
204
233
|
logger.error("Failed to parse activity:\n{error}", { handle, json, error });
|
@@ -216,8 +245,10 @@ export async function handleInbox(request, { handle, context, kv, kvPrefix, queu
|
|
216
245
|
let httpSigKey = null;
|
217
246
|
if (activity == null) {
|
218
247
|
const key = await verifyRequest(request, {
|
219
|
-
|
248
|
+
contextLoader: context.contextLoader,
|
249
|
+
documentLoader: context.documentLoader,
|
220
250
|
timeWindow: signatureTimeWindow,
|
251
|
+
keyCache,
|
221
252
|
});
|
222
253
|
if (key == null) {
|
223
254
|
logger.error("Failed to verify the request signature.", { handle });
|
@@ -232,7 +263,7 @@ export async function handleInbox(request, { handle, context, kv, kvPrefix, queu
|
|
232
263
|
}
|
233
264
|
const cacheKey = activity.id == null
|
234
265
|
? null
|
235
|
-
: [...
|
266
|
+
: [...kvPrefixes.activityIdempotence, activity.id.href];
|
236
267
|
if (cacheKey != null) {
|
237
268
|
const cached = await kv.get(cacheKey);
|
238
269
|
if (cached === true) {
|
@@ -83,6 +83,7 @@ export class Federation {
|
|
83
83
|
...({
|
84
84
|
activityIdempotence: ["_fedify", "activityIdempotence"],
|
85
85
|
remoteDocument: ["_fedify", "remoteDocument"],
|
86
|
+
publicKeyCache: ["_fedify", "publicKey"],
|
86
87
|
}),
|
87
88
|
...(options.kvPrefixes ?? {}),
|
88
89
|
};
|
@@ -1197,7 +1198,7 @@ export class Federation {
|
|
1197
1198
|
handle: route.values.handle ?? null,
|
1198
1199
|
context,
|
1199
1200
|
kv: this.#kv,
|
1200
|
-
|
1201
|
+
kvPrefixes: this.#kvPrefixes,
|
1201
1202
|
actorDispatcher: this.#actorCallbacks?.dispatcher,
|
1202
1203
|
inboxListeners: this.#inboxListeners,
|
1203
1204
|
inboxErrorHandler: this.#inboxErrorHandler,
|
package/esm/sig/http.js
CHANGED
@@ -67,8 +67,9 @@ const supportedHashAlgorithms = {
|
|
67
67
|
* @returns The public key of the verified signature, or `null` if the signature
|
68
68
|
* could not be verified.
|
69
69
|
*/
|
70
|
-
export async function verifyRequest(request, { documentLoader, contextLoader, timeWindow, currentTime } = {}) {
|
70
|
+
export async function verifyRequest(request, { documentLoader, contextLoader, timeWindow, currentTime, keyCache } = {}) {
|
71
71
|
const logger = getLogger(["fedify", "sig", "http"]);
|
72
|
+
const originalRequest = request;
|
72
73
|
request = request.clone();
|
73
74
|
const dateHeader = request.headers.get("Date");
|
74
75
|
if (dateHeader == null) {
|
@@ -142,12 +143,14 @@ export async function verifyRequest(request, { documentLoader, contextLoader, ti
|
|
142
143
|
return null;
|
143
144
|
}
|
144
145
|
const { keyId, headers, signature } = sigValues;
|
145
|
-
const
|
146
|
+
const keyResult = await fetchKey(new URL(keyId), CryptographicKey, {
|
146
147
|
documentLoader,
|
147
148
|
contextLoader,
|
149
|
+
keyCache,
|
148
150
|
});
|
149
|
-
if (
|
151
|
+
if (keyResult == null)
|
150
152
|
return null;
|
153
|
+
const { key, cached } = keyResult;
|
151
154
|
const headerNames = headers.split(/\s+/g);
|
152
155
|
if (!headerNames.includes("(request-target)") || !headerNames.includes("date")) {
|
153
156
|
logger.debug("Failed to verify; required headers missing in the Signature header: " +
|
@@ -169,9 +172,23 @@ export async function verifyRequest(request, { documentLoader, contextLoader, ti
|
|
169
172
|
// TODO: support other than RSASSA-PKCS1-v1_5:
|
170
173
|
const verified = await dntShim.crypto.subtle.verify("RSASSA-PKCS1-v1_5", key.publicKey, sig, new TextEncoder().encode(message));
|
171
174
|
if (!verified) {
|
172
|
-
|
173
|
-
"
|
174
|
-
|
175
|
+
if (cached) {
|
176
|
+
logger.debug("Failed to verify with the cached key {keyId}; signature {signature} " +
|
177
|
+
"is invalid. Retrying with the freshly fetched key...", { keyId, signature, message });
|
178
|
+
return await verifyRequest(originalRequest, {
|
179
|
+
documentLoader,
|
180
|
+
contextLoader,
|
181
|
+
timeWindow,
|
182
|
+
currentTime,
|
183
|
+
keyCache: {
|
184
|
+
get: () => Promise.resolve(null),
|
185
|
+
set: async (keyId, key) => await keyCache?.set(keyId, key),
|
186
|
+
},
|
187
|
+
});
|
188
|
+
}
|
189
|
+
logger.debug("Failed to verify with the fetched key {keyId}; signature {signature} " +
|
190
|
+
"is invalid. Check if the key is correct or if the signed message " +
|
191
|
+
"is correct. The message to sign is:\n{message}", { keyId, signature, message });
|
175
192
|
return null;
|
176
193
|
}
|
177
194
|
return key;
|
package/esm/sig/key.js
CHANGED
@@ -106,9 +106,20 @@ export async function importJwk(jwk, type) {
|
|
106
106
|
*/
|
107
107
|
export async function fetchKey(keyId,
|
108
108
|
// deno-lint-ignore no-explicit-any
|
109
|
-
cls, { documentLoader, contextLoader } = {}) {
|
109
|
+
cls, { documentLoader, contextLoader, keyCache } = {}) {
|
110
110
|
const logger = getLogger(["fedify", "sig", "key"]);
|
111
|
+
const cacheKey = typeof keyId === "string" ? new URL(keyId) : keyId;
|
111
112
|
keyId = typeof keyId === "string" ? keyId : keyId.href;
|
113
|
+
if (keyCache != null) {
|
114
|
+
const cachedKey = await keyCache.get(cacheKey);
|
115
|
+
if (cachedKey instanceof cls && cachedKey.publicKey != null) {
|
116
|
+
logger.debug("Key {keyId} found in cache.", { keyId });
|
117
|
+
return {
|
118
|
+
key: cachedKey,
|
119
|
+
cached: true,
|
120
|
+
};
|
121
|
+
}
|
122
|
+
}
|
112
123
|
logger.debug("Fetching key {keyId} to verify signature...", { keyId });
|
113
124
|
let document;
|
114
125
|
try {
|
@@ -171,5 +182,12 @@ cls, { documentLoader, contextLoader } = {}) {
|
|
171
182
|
logger.debug("Failed to verify; key {keyId} has no publicKeyPem field.", { keyId });
|
172
183
|
return null;
|
173
184
|
}
|
174
|
-
|
185
|
+
if (keyCache != null) {
|
186
|
+
await keyCache.set(cacheKey, key);
|
187
|
+
logger.debug("Key {keyId} cached.", { keyId });
|
188
|
+
}
|
189
|
+
return {
|
190
|
+
key: key,
|
191
|
+
cached: false,
|
192
|
+
};
|
175
193
|
}
|
package/esm/sig/mod.js
CHANGED
@@ -4,5 +4,6 @@
|
|
4
4
|
* @module
|
5
5
|
*/
|
6
6
|
export { signRequest, verifyRequest, } from "./http.js";
|
7
|
-
export { exportJwk, generateCryptoKeyPair, importJwk } from "./key.js";
|
7
|
+
export { exportJwk, generateCryptoKeyPair, importJwk, } from "./key.js";
|
8
8
|
export { doesActorOwnKey, getKeyOwner, } from "./owner.js";
|
9
|
+
export * from "./proof.js";
|
package/esm/sig/proof.js
CHANGED
@@ -4,7 +4,7 @@ import { Activity, Multikey } from "../vocab/vocab.js";
|
|
4
4
|
// @ts-ignore: json-canon is not typed
|
5
5
|
import serialize from "json-canon";
|
6
6
|
import { DataIntegrityProof } from "../vocab/vocab.js";
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key.js";
|
7
|
+
import { fetchKey, validateCryptoKey, } from "./key.js";
|
8
8
|
const logger = getLogger(["fedify", "sig", "proof"]);
|
9
9
|
/**
|
10
10
|
* Creates a proof for the given object.
|
@@ -114,22 +114,49 @@ export async function verifyProof(jsonLd, proof, options = {}) {
|
|
114
114
|
const digest = new Uint8Array(proofDigest.byteLength + msgDigest.byteLength);
|
115
115
|
digest.set(new Uint8Array(proofDigest), 0);
|
116
116
|
digest.set(new Uint8Array(msgDigest), proofDigest.byteLength);
|
117
|
-
let
|
117
|
+
let fetchedKey;
|
118
118
|
try {
|
119
|
-
|
119
|
+
fetchedKey = await publicKeyPromise;
|
120
120
|
}
|
121
121
|
catch (error) {
|
122
|
-
logger.debug("Failed to get the key (verificationMethod) for the proof:\n{proof}", { proof, error });
|
122
|
+
logger.debug("Failed to get the key (verificationMethod) for the proof:\n{proof}", { proof, keyId: proof.verificationMethodId.href, error });
|
123
123
|
return null;
|
124
124
|
}
|
125
|
-
if (
|
126
|
-
logger.debug("
|
127
|
-
|
125
|
+
if (fetchedKey == null) {
|
126
|
+
logger.debug("Failed to get the key (verificationMethod) for the proof:\n{proof}", { proof, keyId: proof.verificationMethodId.href });
|
127
|
+
return null;
|
128
|
+
}
|
129
|
+
const publicKey = fetchedKey.key;
|
130
|
+
if (publicKey.publicKey.algorithm.name !== "Ed25519") {
|
131
|
+
if (fetchedKey.cached) {
|
132
|
+
logger.debug("The cached key (verificationMethod) for the proof is not a valid " +
|
133
|
+
"Ed25519 key:\n{keyId}; retrying with the freshly fetched key...", { proof, keyId: proof.verificationMethodId.href });
|
134
|
+
return await verifyProof(jsonLd, proof, {
|
135
|
+
...options,
|
136
|
+
keyCache: {
|
137
|
+
get: () => Promise.resolve(null),
|
138
|
+
set: async (keyId, key) => await options.keyCache?.set(keyId, key),
|
139
|
+
},
|
140
|
+
});
|
141
|
+
}
|
142
|
+
logger.debug("The fetched key (verificationMethod) for the proof is not a valid " +
|
143
|
+
"Ed25519 key:\n{keyId}", { proof, keyId: proof.verificationMethodId.href });
|
128
144
|
return null;
|
129
145
|
}
|
130
146
|
const verified = await dntShim.crypto.subtle.verify("Ed25519", publicKey.publicKey, proof.proofValue, digest);
|
131
147
|
if (!verified) {
|
132
|
-
|
148
|
+
if (fetchedKey.cached) {
|
149
|
+
logger.debug("Failed to verify the proof with the cached key {keyId}; retrying " +
|
150
|
+
"with the freshly fetched key...", { keyId: proof.verificationMethodId.href, proof });
|
151
|
+
return await verifyProof(jsonLd, proof, {
|
152
|
+
...options,
|
153
|
+
keyCache: {
|
154
|
+
get: () => Promise.resolve(null),
|
155
|
+
set: async (keyId, key) => await options.keyCache?.set(keyId, key),
|
156
|
+
},
|
157
|
+
});
|
158
|
+
}
|
159
|
+
logger.debug("Failed to verify the proof with the fetched key {keyId}:\n{proof}", { keyId: proof.verificationMethodId.href, proof });
|
133
160
|
return null;
|
134
161
|
}
|
135
162
|
return publicKey;
|
package/package.json
CHANGED
@@ -71,7 +71,10 @@ export interface InboxHandlerParameters<TContextData> {
|
|
71
71
|
handle: string | null;
|
72
72
|
context: RequestContext<TContextData>;
|
73
73
|
kv: KvStore;
|
74
|
-
|
74
|
+
kvPrefixes: {
|
75
|
+
activityIdempotence: KvKey;
|
76
|
+
publicKeyCache: KvKey;
|
77
|
+
};
|
75
78
|
queue?: MessageQueue;
|
76
79
|
actorDispatcher?: ActorDispatcher<TContextData>;
|
77
80
|
inboxListeners?: InboxListenerSet<TContextData>;
|
@@ -79,7 +82,7 @@ export interface InboxHandlerParameters<TContextData> {
|
|
79
82
|
onNotFound(request: Request): Response | Promise<Response>;
|
80
83
|
signatureTimeWindow: dntShim.Temporal.DurationLike;
|
81
84
|
}
|
82
|
-
export declare function handleInbox<TContextData>(request: Request, { handle, context, kv,
|
85
|
+
export declare function handleInbox<TContextData>(request: Request, { handle, context, kv, kvPrefixes, queue, actorDispatcher, inboxListeners, inboxErrorHandler, onNotFound, signatureTimeWindow, }: InboxHandlerParameters<TContextData>): Promise<Response>;
|
83
86
|
/**
|
84
87
|
* Options for the {@link respondWithObject} and
|
85
88
|
* {@link respondWithObjectIfAcceptable} functions.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/federation/handler.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAG5C,OAAO,KAAK,EAAE,cAAc,EAAE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wBAAwB,GACjC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAK1B"}
|
@@ -169,6 +169,12 @@ export interface FederationKvPrefixes {
|
|
169
169
|
* `["_fedify", "remoteDocument"]` by default.
|
170
170
|
*/
|
171
171
|
remoteDocument: KvKey;
|
172
|
+
/**
|
173
|
+
* The key prefix used for caching public keys. `["_fedify", "publicKey"]`
|
174
|
+
* by default.
|
175
|
+
* @since 0.12.0
|
176
|
+
*/
|
177
|
+
publicKeyCache: KvKey;
|
172
178
|
}
|
173
179
|
/**
|
174
180
|
* Create a new {@link Federation} instance.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/federation/middleware.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,cAAc,EAIpB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,QAAQ,EAER,KAAK,OAAO,EACZ,KAAK,IAAI,EAET,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAEV,OAAO,EAEP,cAAc,EACd,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAO5C,OAAO,EAAkC,KAAK,WA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;OAYG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,mBAAmB,EAAE,KAAK,CAAC;IAE3B;;;OAGG;IACH,cAAc,EAAE,KAAK,CAAC;CACvB;AAID;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAC3C,OAAO,EAAE,uBAAuB,GAC/B,UAAU,CAAC,YAAY,CAAC,CAM1B;AAID;;;;;;GAMG;AACH,qBAAa,UAAU,CAAC,YAAY;;IAmClC;;;;OAIG;gBACS,UAAU,EAAE,oBAAoB;
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/federation/middleware.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,cAAc,EAIpB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,QAAQ,EAER,KAAK,OAAO,EACZ,KAAK,IAAI,EAET,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAEV,OAAO,EAEP,cAAc,EACd,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAO5C,OAAO,EAAkC,KAAK,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C,YAAY,EAAE,OAAO,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB,CAAC,YAAY;IAChD;;;;;;OAMG;IACH,EAAE,CAAC,SAAS,SAAS,QAAQ,EAE3B,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,SAAS,EACvC,QAAQ,EAAE,aAAa,CAAC,YAAY,EAAE,SAAS,CAAC,GAC/C,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAEtC;;;;;;OAMG;IACH,OAAO,CACL,OAAO,EAAE,iBAAiB,CAAC,YAAY,CAAC,GACvC,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAEtC;;;;;;;;OAQG;IACH,sBAAsB,CACpB,UAAU,EAAE,wBAAwB,CAAC,YAAY,CAAC,GACjD,oBAAoB,CAAC,YAAY,CAAC,CAAC;CACvC;AAED,UAAU,2BAA2B,CAAC,YAAY,CAChD,SAAQ,mBAAmB;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,YAAY,CAAC;CAC3B"}
|
package/types/sig/http.d.ts
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
import * as dntShim from "../_dnt.shims.js";
|
4
4
|
import type { DocumentLoader } from "../runtime/docloader.js";
|
5
5
|
import { CryptographicKey } from "../vocab/vocab.js";
|
6
|
+
import { type KeyCache } from "./key.js";
|
6
7
|
/**
|
7
8
|
* Signs a request using the given private key.
|
8
9
|
* @param request The request to sign.
|
@@ -36,6 +37,11 @@ export interface VerifyRequestOptions {
|
|
36
37
|
* useful for testing.
|
37
38
|
*/
|
38
39
|
currentTime?: dntShim.Temporal.Instant;
|
40
|
+
/**
|
41
|
+
* The key cache to use for caching public keys.
|
42
|
+
* @since 0.12.0
|
43
|
+
*/
|
44
|
+
keyCache?: KeyCache;
|
39
45
|
}
|
40
46
|
/**
|
41
47
|
* Verifies the signature of a request.
|
@@ -50,5 +56,5 @@ export interface VerifyRequestOptions {
|
|
50
56
|
* @returns The public key of the verified signature, or `null` if the signature
|
51
57
|
* could not be verified.
|
52
58
|
*/
|
53
|
-
export declare function verifyRequest(request: Request, { documentLoader, contextLoader, timeWindow, currentTime }?: VerifyRequestOptions): Promise<CryptographicKey | null>;
|
59
|
+
export declare function verifyRequest(request: Request, { documentLoader, contextLoader, timeWindow, currentTime, keyCache }?: VerifyRequestOptions): Promise<CryptographicKey | null>;
|
54
60
|
//# sourceMappingURL=http.d.ts.map
|
package/types/sig/http.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/sig/http.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAI5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/sig/http.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAI5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAY,KAAK,QAAQ,EAAqB,MAAM,UAAU,CAAC;AAEtE;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,OAAO,CAAC,SAAS,EAC7B,KAAK,EAAE,GAAG,GACT,OAAO,CAAC,OAAO,CAAC,CA0ClB;AAQD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;OAEG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC;IAE/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAE3C;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAEvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,EAChB,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,GAClE,oBAAyB,GAC1B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAyLlC"}
|
package/types/sig/key.d.ts
CHANGED
@@ -48,6 +48,27 @@ export interface FetchKeyOptions {
|
|
48
48
|
* The context loader for loading remote JSON-LD contexts.
|
49
49
|
*/
|
50
50
|
contextLoader?: DocumentLoader;
|
51
|
+
/**
|
52
|
+
* The key cache to use for caching public keys.
|
53
|
+
* @since 0.12.0
|
54
|
+
*/
|
55
|
+
keyCache?: KeyCache;
|
56
|
+
}
|
57
|
+
/**
|
58
|
+
* The result of {@link fetchKey}.
|
59
|
+
* @since 0.12.0
|
60
|
+
*/
|
61
|
+
export interface FetchKeyResult<T extends CryptographicKey | Multikey> {
|
62
|
+
/**
|
63
|
+
* The fetched (or cached) key.
|
64
|
+
*/
|
65
|
+
readonly key: T & {
|
66
|
+
publicKey: dntShim.CryptoKey;
|
67
|
+
};
|
68
|
+
/**
|
69
|
+
* Whether the key is fetched from the cache.
|
70
|
+
*/
|
71
|
+
readonly cached: boolean;
|
51
72
|
}
|
52
73
|
/**
|
53
74
|
* Fetches a {@link CryptographicKey} or {@link Multikey} from the given URL.
|
@@ -67,7 +88,22 @@ export declare function fetchKey<T extends CryptographicKey | Multikey>(keyId: U
|
|
67
88
|
documentLoader?: DocumentLoader;
|
68
89
|
contextLoader?: DocumentLoader;
|
69
90
|
}): Promise<T>;
|
70
|
-
}, { documentLoader, contextLoader }?: FetchKeyOptions): Promise<T
|
71
|
-
|
72
|
-
|
91
|
+
}, { documentLoader, contextLoader, keyCache }?: FetchKeyOptions): Promise<FetchKeyResult<T> | null>;
|
92
|
+
/**
|
93
|
+
* A cache for storing cryptographic keys.
|
94
|
+
* @since 0.12.0
|
95
|
+
*/
|
96
|
+
export interface KeyCache {
|
97
|
+
/**
|
98
|
+
* Gets a key from the cache.
|
99
|
+
* @param keyId The key ID.
|
100
|
+
*/
|
101
|
+
get(keyId: URL): Promise<CryptographicKey | Multikey | null>;
|
102
|
+
/**
|
103
|
+
* Sets a key to the cache.
|
104
|
+
* @param keyId The key ID.
|
105
|
+
* @param key The key to cache.
|
106
|
+
*/
|
107
|
+
set(keyId: URL, key: CryptographicKey | Multikey): Promise<void>;
|
108
|
+
}
|
73
109
|
//# sourceMappingURL=key.d.ts.map
|
package/types/sig/key.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/sig/key.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,KAAK,QAAQ,EAAU,MAAM,mBAAmB,CAAC;AAE5E;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,OAAO,CAAC,SAAS,EACtB,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,GAC1B,IAAI,CA2BN;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,CAAC,EAAE,mBAAmB,GAAG,SAAS,GAC1C,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CA2BhC;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAGnF;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,GAAG,EAAE,OAAO,CAAC,UAAU,EACvB,I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G;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,gBAAgB,GAAG,QAAQ;IACnE;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG;QAAE,SAAS,EAAE,OAAO,CAAC,SAAS,CAAA;KAAE,CAAC;IAEnD;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,QAAQ,CAAC,CAAC,SAAS,gBAAgB,GAAG,QAAQ,EAClE,KAAK,EAAE,GAAG,GAAG,MAAM,EAEnB,GAAG,EAAE,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,GAAG;IACjC,UAAU,CACR,MAAM,EAAE,OAAO,EACf,OAAO,EAAE;QACP,cAAc,CAAC,EAAE,cAAc,CAAC;QAChC,aAAa,CAAC,EAAE,cAAc,CAAC;KAChC,GACA,OAAO,CAAC,CAAC,CAAC,CAAC;CACf,EACD,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAE,eAAoB,GAChE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CA0FnC;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,gBAAgB,GAAG,QAAQ,GAAG,IAAI,CAAC,CAAC;IAE7D;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,gBAAgB,GAAG,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE"}
|
package/types/sig/mod.d.ts
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
* @module
|
5
5
|
*/
|
6
6
|
export { signRequest, verifyRequest, type VerifyRequestOptions, } from "./http.js";
|
7
|
-
export { exportJwk, generateCryptoKeyPair, importJwk } from "./key.js";
|
7
|
+
export { exportJwk, generateCryptoKeyPair, importJwk, type KeyCache, } from "./key.js";
|
8
8
|
export { doesActorOwnKey, type DoesActorOwnKeyOptions, getKeyOwner, type GetKeyOwnerOptions, } from "./owner.js";
|
9
|
+
export * from "./proof.js";
|
9
10
|
//# sourceMappingURL=mod.d.ts.map
|
package/types/sig/mod.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/sig/mod.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,WAAW,EACX,aAAa,EACb,KAAK,oBAAoB,GAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/sig/mod.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,WAAW,EACX,aAAa,EACb,KAAK,oBAAoB,GAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,SAAS,EACT,KAAK,QAAQ,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,eAAe,EACf,KAAK,sBAAsB,EAC3B,WAAW,EACX,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC;AACpB,cAAc,YAAY,CAAC"}
|
package/types/sig/proof.d.ts
CHANGED
@@ -3,6 +3,7 @@ import * as dntShim from "../_dnt.shims.js";
|
|
3
3
|
import { Multikey } from "../vocab/vocab.js";
|
4
4
|
import type { DocumentLoader } from "../runtime/docloader.js";
|
5
5
|
import { DataIntegrityProof, type Object } from "../vocab/vocab.js";
|
6
|
+
import { type KeyCache } from "./key.js";
|
6
7
|
/**
|
7
8
|
* Options for {@link createProof}.
|
8
9
|
* @since 0.10.0
|
@@ -67,6 +68,11 @@ export interface VerifyProofOptions {
|
|
67
68
|
* The document loader for loading remote JSON-LD documents.
|
68
69
|
*/
|
69
70
|
documentLoader?: DocumentLoader;
|
71
|
+
/**
|
72
|
+
* The key cache to use for caching public keys.
|
73
|
+
* @since 0.12.0
|
74
|
+
*/
|
75
|
+
keyCache?: KeyCache;
|
70
76
|
}
|
71
77
|
/**
|
72
78
|
* Verifies the given proof for the object.
|
package/types/sig/proof.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"proof.d.ts","sourceRoot":"","sources":["../../src/sig/proof.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAY,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"proof.d.ts","sourceRoot":"","sources":["../../src/sig/proof.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAY,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAGL,KAAK,QAAQ,EAEd,MAAM,UAAU,CAAC;AAIlB;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC;IAE/B;;OAEG;IACH,OAAO,CAAC,EACJ,MAAM,GACN,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;IAExC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;CACpC;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,UAAU,EAA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