@fedify/fedify 1.3.0-dev.509 → 1.3.0-dev.510

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGES.md CHANGED
@@ -39,6 +39,19 @@ To be released.
39
39
  - Added `-u`/--user-agent` option to `fedify lookup` subcommand.
40
40
  - Added `-u`/--user-agent` option to `fedify node` subcommand.
41
41
 
42
+ - Fedify now caches unavailable keys of remote actors as well to avoid
43
+ trying fetching the same unavailable key multiple times.
44
+
45
+ - The return type of the `KeyCache.get()` method became
46
+ `Promise<CryptographicKey | MultiKey | null | undefined>` (was
47
+ `Promise<CryptographicKey | MultiKey | null>`).
48
+ - The type of the `KeyCache.set()` method's second parameter became
49
+ `CryptographicKey | MultiKey | null` (was `CryptographicKey | MultiKey`).
50
+ - Added `fetchKey()` function.
51
+ - Added `FetchKeyOptions` interface.
52
+ - Added `FetchKeyResult` interface.
53
+
54
+
42
55
  [#162]: https://github.com/dahlia/fedify/issues/162
43
56
 
44
57
 
@@ -1794,8 +1807,6 @@ is now distributed under the [MIT License] to encourage wider adoption.
1794
1807
  - Added `VerifyObjectOptions` interface.
1795
1808
  - Added `verifyProof()` function.
1796
1809
  - Added `VerifyProofOptions` interface.
1797
- - Added `fetchKey()` function.
1798
- - Added `FetchKeyOptions` interface.
1799
1810
  - Added `SenderKeyPair` interface.
1800
1811
  - The type of `Federation.sendActivity()` method's first parameter became
1801
1812
  `SenderKeyPair[]` (was `{ keyId: URL; privateKey: CryptoKey }`).
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "@fedify/fedify",
3
- "version": "1.3.0-dev.509+2400eeb4",
3
+ "version": "1.3.0-dev.510+3d98cde5",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./mod.ts",
@@ -220,26 +220,37 @@ export async function handleInbox(request, { recipient, context, inboxContextFac
220
220
  });
221
221
  }
222
222
  const keyCache = {
223
+ nullKeys: new Set(),
223
224
  async get(keyId) {
225
+ if (this.nullKeys.has(keyId.href))
226
+ return null;
224
227
  const serialized = await kv.get([
225
228
  ...kvPrefixes.publicKey,
226
229
  keyId.href,
227
230
  ]);
228
231
  if (serialized == null)
229
- return null;
232
+ return undefined;
230
233
  let object;
231
234
  try {
232
235
  object = await Object.fromJsonLd(serialized, context);
233
236
  }
234
237
  catch {
235
- return null;
238
+ await kv.delete([...kvPrefixes.publicKey, keyId.href]);
239
+ return undefined;
236
240
  }
237
241
  if (object instanceof CryptographicKey || object instanceof Multikey) {
238
242
  return object;
239
243
  }
240
- return null;
244
+ await kv.delete([...kvPrefixes.publicKey, keyId.href]);
245
+ return undefined;
241
246
  },
242
247
  async set(keyId, key) {
248
+ if (key == null) {
249
+ this.nullKeys.add(keyId.href);
250
+ await kv.delete([...kvPrefixes.publicKey, keyId.href]);
251
+ return;
252
+ }
253
+ this.nullKeys.delete(keyId.href);
243
254
  const serialized = await key.toJsonLd(context);
244
255
  await kv.set([...kvPrefixes.publicKey, keyId.href], serialized);
245
256
  },
package/esm/sig/http.js CHANGED
@@ -164,14 +164,13 @@ export async function verifyRequest(request, { documentLoader, contextLoader, ti
164
164
  return null;
165
165
  }
166
166
  const { keyId, headers, signature } = sigValues;
167
- const keyResult = await fetchKey(new URL(keyId), CryptographicKey, {
167
+ const { key, cached } = await fetchKey(new URL(keyId), CryptographicKey, {
168
168
  documentLoader,
169
169
  contextLoader,
170
170
  keyCache,
171
171
  });
172
- if (keyResult == null)
172
+ if (key == null)
173
173
  return null;
174
- const { key, cached } = keyResult;
175
174
  const headerNames = headers.split(/\s+/g);
176
175
  if (!headerNames.includes("(request-target)") || !headerNames.includes("date")) {
177
176
  logger.debug("Failed to verify; required headers missing in the Signature header: " +
@@ -202,7 +201,7 @@ export async function verifyRequest(request, { documentLoader, contextLoader, ti
202
201
  timeWindow,
203
202
  currentTime,
204
203
  keyCache: {
205
- get: () => Promise.resolve(null),
204
+ get: () => Promise.resolve(undefined),
206
205
  set: async (keyId, key) => await keyCache?.set(keyId, key),
207
206
  },
208
207
  });
package/esm/sig/key.js CHANGED
@@ -102,7 +102,7 @@ export async function importJwk(jwk, type) {
102
102
  * or {@link Multikey}.
103
103
  * @param options Options for fetching the key. See {@link FetchKeyOptions}.
104
104
  * @returns The fetched key or `null` if the key is not found.
105
- * @since 0.10.0
105
+ * @since 1.3.0
106
106
  */
107
107
  export async function fetchKey(keyId,
108
108
  // deno-lint-ignore no-explicit-any
@@ -119,6 +119,10 @@ cls, { documentLoader, contextLoader, keyCache } = {}) {
119
119
  cached: true,
120
120
  };
121
121
  }
122
+ else if (cachedKey === null) {
123
+ logger.debug("Entry {keyId} found in cache, but it is unavailable.", { keyId });
124
+ return { key: null, cached: true };
125
+ }
122
126
  }
123
127
  logger.debug("Fetching key {keyId} to verify signature...", { keyId });
124
128
  let document;
@@ -128,7 +132,8 @@ cls, { documentLoader, contextLoader, keyCache } = {}) {
128
132
  }
129
133
  catch (_) {
130
134
  logger.debug("Failed to fetch key {keyId}.", { keyId });
131
- return null;
135
+ await keyCache?.set(cacheKey, null);
136
+ return { key: null, cached: false };
132
137
  }
133
138
  let object;
134
139
  try {
@@ -149,7 +154,8 @@ cls, { documentLoader, contextLoader, keyCache } = {}) {
149
154
  catch (e) {
150
155
  if (e instanceof TypeError) {
151
156
  logger.debug("Failed to verify; key {keyId} returned an invalid object.", { keyId });
152
- return null;
157
+ await keyCache?.set(cacheKey, null);
158
+ return { key: null, cached: false };
153
159
  }
154
160
  throw e;
155
161
  }
@@ -171,16 +177,19 @@ cls, { documentLoader, contextLoader, keyCache } = {}) {
171
177
  if (key == null) {
172
178
  logger.debug("Failed to verify; object {keyId} returned an {actorType}, " +
173
179
  "but has no key matching {keyId}.", { keyId, actorType: object.constructor.name });
174
- return null;
180
+ await keyCache?.set(cacheKey, null);
181
+ return { key: null, cached: false };
175
182
  }
176
183
  }
177
184
  else {
178
185
  logger.debug("Failed to verify; key {keyId} returned an invalid object.", { keyId });
179
- return null;
186
+ await keyCache?.set(cacheKey, null);
187
+ return { key: null, cached: false };
180
188
  }
181
189
  if (key.publicKey == null) {
182
190
  logger.debug("Failed to verify; key {keyId} has no publicKeyPem field.", { keyId });
183
- return null;
191
+ await keyCache?.set(cacheKey, null);
192
+ return { key: null, cached: false };
184
193
  }
185
194
  if (keyCache != null) {
186
195
  await keyCache.set(cacheKey, key);
package/esm/sig/ld.js CHANGED
@@ -128,10 +128,9 @@ export async function verifySignature(jsonLd, options = {}) {
128
128
  logger.debug("Failed to verify; invalid base64 signatureValue: {signatureValue}", { ...sig, error });
129
129
  return null;
130
130
  }
131
- const keyResult = await fetchKey(new URL(sig.creator), CryptographicKey, options);
132
- if (keyResult == null)
131
+ const { key, cached } = await fetchKey(new URL(sig.creator), CryptographicKey, options);
132
+ if (key == null)
133
133
  return null;
134
- const { key, cached } = keyResult;
135
134
  const sigOpts = {
136
135
  ...sig,
137
136
  "@context": "https://w3id.org/identity/v1",
@@ -167,10 +166,15 @@ export async function verifySignature(jsonLd, options = {}) {
167
166
  logger.debug("Failed to verify with the cached key {keyId}; " +
168
167
  "signature {signatureValue} is invalid. " +
169
168
  "Retrying with the freshly fetched key...", { keyId: sig.creator, ...sig });
170
- const keyResult = await fetchKey(new URL(sig.creator), CryptographicKey, { ...options, keyCache: undefined });
171
- if (keyResult == null)
169
+ const { key } = await fetchKey(new URL(sig.creator), CryptographicKey, {
170
+ ...options,
171
+ keyCache: {
172
+ get: () => Promise.resolve(undefined),
173
+ set: async (keyId, key) => await options.keyCache?.set(keyId, key),
174
+ },
175
+ });
176
+ if (key == null)
172
177
  return null;
173
- const { key } = keyResult;
174
178
  const verified = await dntShim.crypto.subtle.verify("RSASSA-PKCS1-v1_5", key.publicKey, signature, messageBytes);
175
179
  return verified ? key : null;
176
180
  }
package/esm/sig/mod.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * @module
5
5
  */
6
6
  export { signRequest, verifyRequest, } from "./http.js";
7
- export { exportJwk, generateCryptoKeyPair, importJwk, } from "./key.js";
7
+ export { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, } from "./key.js";
8
8
  export { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature, } from "./ld.js";
9
9
  export { doesActorOwnKey, getKeyOwner, } from "./owner.js";
10
10
  export * from "./proof.js";
package/esm/sig/proof.js CHANGED
@@ -123,11 +123,11 @@ export async function verifyProof(jsonLd, proof, options = {}) {
123
123
  logger.debug("Failed to get the key (verificationMethod) for the proof:\n{proof}", { proof, keyId: proof.verificationMethodId.href, error });
124
124
  return null;
125
125
  }
126
- if (fetchedKey == null) {
126
+ const publicKey = fetchedKey.key;
127
+ if (publicKey == null) {
127
128
  logger.debug("Failed to get the key (verificationMethod) for the proof:\n{proof}", { proof, keyId: proof.verificationMethodId.href });
128
129
  return null;
129
130
  }
130
- const publicKey = fetchedKey.key;
131
131
  if (publicKey.publicKey.algorithm.name !== "Ed25519") {
132
132
  if (fetchedKey.cached) {
133
133
  logger.debug("The cached key (verificationMethod) for the proof is not a valid " +
@@ -152,7 +152,7 @@ export async function verifyProof(jsonLd, proof, options = {}) {
152
152
  return await verifyProof(jsonLd, proof, {
153
153
  ...options,
154
154
  keyCache: {
155
- get: () => Promise.resolve(null),
155
+ get: () => Promise.resolve(undefined),
156
156
  set: async (keyId, key) => await options.keyCache?.set(keyId, key),
157
157
  },
158
158
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "1.3.0-dev.509+2400eeb4",
3
+ "version": "1.3.0-dev.510+3d98cde5",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -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,MAAM,yBAAyB,CAAC;AAM9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OA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,EAAE,cAAc,CAAC;IAE/B;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,YAAY,GAAG,KAAK,CAAC;IAE/E;;;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,CAiNlC"}
@@ -37,7 +37,7 @@ export declare function exportJwk(key: dntShim.CryptoKey): Promise<dntShim.JsonW
37
37
  export declare function importJwk(jwk: dntShim.JsonWebKey, type: "public" | "private"): Promise<dntShim.CryptoKey>;
38
38
  /**
39
39
  * Options for {@link fetchKey}.
40
- * @since 0.10.0
40
+ * @since 1.3.0
41
41
  */
42
42
  export interface FetchKeyOptions {
43
43
  /**
@@ -56,7 +56,7 @@ export interface FetchKeyOptions {
56
56
  }
57
57
  /**
58
58
  * The result of {@link fetchKey}.
59
- * @since 0.12.0
59
+ * @since 1.3.0
60
60
  */
61
61
  export interface FetchKeyResult<T extends CryptographicKey | Multikey> {
62
62
  /**
@@ -64,7 +64,7 @@ export interface FetchKeyResult<T extends CryptographicKey | Multikey> {
64
64
  */
65
65
  readonly key: T & {
66
66
  publicKey: dntShim.CryptoKey;
67
- };
67
+ } | null;
68
68
  /**
69
69
  * Whether the key is fetched from the cache.
70
70
  */
@@ -81,14 +81,14 @@ export interface FetchKeyResult<T extends CryptographicKey | Multikey> {
81
81
  * or {@link Multikey}.
82
82
  * @param options Options for fetching the key. See {@link FetchKeyOptions}.
83
83
  * @returns The fetched key or `null` if the key is not found.
84
- * @since 0.10.0
84
+ * @since 1.3.0
85
85
  */
86
86
  export declare function fetchKey<T extends CryptographicKey | Multikey>(keyId: URL | string, cls: (new (...args: any[]) => T) & {
87
87
  fromJsonLd(jsonLd: unknown, options: {
88
88
  documentLoader?: DocumentLoader;
89
89
  contextLoader?: DocumentLoader;
90
90
  }): Promise<T>;
91
- }, { documentLoader, contextLoader, keyCache }?: FetchKeyOptions): Promise<FetchKeyResult<T> | null>;
91
+ }, { documentLoader, contextLoader, keyCache }?: FetchKeyOptions): Promise<FetchKeyResult<T>>;
92
92
  /**
93
93
  * A cache for storing cryptographic keys.
94
94
  * @since 0.12.0
@@ -97,13 +97,20 @@ export interface KeyCache {
97
97
  /**
98
98
  * Gets a key from the cache.
99
99
  * @param keyId The key ID.
100
+ * @returns The key if found, `null` if the key is not available (e.g.,
101
+ * fetching the key was tried but failed), or `undefined`
102
+ * if the cache is not available.
100
103
  */
101
- get(keyId: URL): Promise<CryptographicKey | Multikey | null>;
104
+ get(keyId: URL): Promise<CryptographicKey | Multikey | null | undefined>;
102
105
  /**
103
106
  * Sets a key to the cache.
107
+ *
108
+ * Note that this caches unavailable keys (i.e., `null`) as well,
109
+ * and it is recommended to make unavailable keys expire after a short period.
104
110
  * @param keyId The key ID.
105
- * @param key The key to cache.
111
+ * @param key The key to cache. `null` means the key is not available
112
+ * (e.g., fetching the key was tried but failed).
106
113
  */
107
- set(keyId: URL, key: CryptographicKey | Multikey): Promise<void>;
114
+ set(keyId: URL, key: CryptographicKey | Multikey | null): Promise<void>;
108
115
  }
109
116
  //# sourceMappingURL=key.d.ts.map
@@ -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,mBAA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,GAAG,MAAM,IAAI,YAAY,CAYpE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAKxD;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;OAEG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,OAAO,EACf,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAkGlC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB;CAClE;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,OAAO,EACf,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,OAAO,CAAC,CAsBlB"}
@@ -4,7 +4,7 @@
4
4
  * @module
5
5
  */
6
6
  export { signRequest, verifyRequest, type VerifyRequestOptions, } from "./http.js";
7
- export { exportJwk, generateCryptoKeyPair, importJwk, type KeyCache, } from "./key.js";
7
+ export { exportJwk, fetchKey, type FetchKeyOptions, type FetchKeyResult, generateCryptoKeyPair, importJwk, type KeyCache, } from "./key.js";
8
8
  export { attachSignature, createSignature, type CreateSignatureOptions, detachSignature, signJsonLd, type SignJsonLdOptions, verifyJsonLd, type VerifyJsonLdOptions, verifySignature, type VerifySignatureOptions, } from "./ld.js";
9
9
  export { doesActorOwnKey, type DoesActorOwnKeyOptions, getKeyOwner, type GetKeyOwnerOptions, } from "./owner.js";
10
10
  export * from "./proof.js";
@@ -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,EACL,SAAS,EACT,qBAAqB,EACrB,SAAS,EACT,KAAK,QAAQ,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,eAAe,EACf,eAAe,EACf,KAAK,sBAAsB,EAC3B,eAAe,EACf,UAAU,EACV,KAAK,iBAAiB,EACtB,YAAY,EACZ,KAAK,mBAAmB,EACxB,eAAe,EACf,KAAK,sBAAsB,GAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,eAAe,EACf,KAAK,sBAAsB,EAC3B,WAAW,EACX,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC;AACpB,cAAc,YAAY,CAAC"}
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,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,qBAAqB,EACrB,SAAS,EACT,KAAK,QAAQ,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,eAAe,EACf,eAAe,EACf,KAAK,sBAAsB,EAC3B,eAAe,EACf,UAAU,EACV,KAAK,iBAAiB,EACtB,YAAY,EACZ,KAAK,mBAAmB,EACxB,eAAe,EACf,KAAK,sBAAsB,GAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,eAAe,EACf,KAAK,sBAAsB,EAC3B,WAAW,EACX,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC;AACpB,cAAc,YAAY,CAAC"}