@fedify/fedify 1.6.0-dev.798 → 1.6.0-dev.808

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.
Files changed (38) hide show
  1. package/CHANGES.md +86 -0
  2. package/README.md +1 -1
  3. package/SPONSORS.md +1 -1
  4. package/esm/deno.js +1 -1
  5. package/esm/federation/handler.js +20 -7
  6. package/esm/runtime/key.js +1 -1
  7. package/esm/sig/http.js +1 -1
  8. package/esm/vocab/lookup.js +1 -1
  9. package/esm/vocab/vocab.js +176 -176
  10. package/package.json +1 -1
  11. package/types/deps/jsr.io/@std/async/{1.0.12 → 1.0.13}/delay.d.ts.map +1 -1
  12. package/types/deps/jsr.io/@std/bytes/{1.0.5 → 1.0.6}/_types.d.ts.map +1 -1
  13. package/types/deps/jsr.io/@std/bytes/{1.0.5 → 1.0.6}/concat.d.ts +1 -1
  14. package/types/deps/jsr.io/@std/bytes/{1.0.5 → 1.0.6}/concat.d.ts.map +1 -1
  15. package/types/deps/jsr.io/@std/crypto/{1.0.4 → 1.0.5}/timing_safe_equal.d.ts.map +1 -1
  16. package/types/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/_negotiation/common.d.ts.map +1 -1
  17. package/types/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/_negotiation/encoding.d.ts.map +1 -1
  18. package/types/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/_negotiation/language.d.ts.map +1 -1
  19. package/types/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/_negotiation/media_type.d.ts.map +1 -1
  20. package/types/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/negotiation.d.ts.map +1 -1
  21. package/types/federation/handler.d.ts.map +1 -1
  22. /package/esm/deps/jsr.io/@std/async/{1.0.12 → 1.0.13}/delay.js +0 -0
  23. /package/esm/deps/jsr.io/@std/bytes/{1.0.5 → 1.0.6}/_types.js +0 -0
  24. /package/esm/deps/jsr.io/@std/bytes/{1.0.5 → 1.0.6}/concat.js +0 -0
  25. /package/esm/deps/jsr.io/@std/crypto/{1.0.4 → 1.0.5}/timing_safe_equal.js +0 -0
  26. /package/esm/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/_negotiation/common.js +0 -0
  27. /package/esm/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/_negotiation/encoding.js +0 -0
  28. /package/esm/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/_negotiation/language.js +0 -0
  29. /package/esm/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/_negotiation/media_type.js +0 -0
  30. /package/esm/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/negotiation.js +0 -0
  31. /package/types/deps/jsr.io/@std/async/{1.0.12 → 1.0.13}/delay.d.ts +0 -0
  32. /package/types/deps/jsr.io/@std/bytes/{1.0.5 → 1.0.6}/_types.d.ts +0 -0
  33. /package/types/deps/jsr.io/@std/crypto/{1.0.4 → 1.0.5}/timing_safe_equal.d.ts +0 -0
  34. /package/types/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/_negotiation/common.d.ts +0 -0
  35. /package/types/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/_negotiation/encoding.d.ts +0 -0
  36. /package/types/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/_negotiation/language.d.ts +0 -0
  37. /package/types/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/_negotiation/media_type.d.ts +0 -0
  38. /package/types/deps/jsr.io/@std/http/{1.0.15 → 1.0.16}/negotiation.d.ts +0 -0
package/CHANGES.md CHANGED
@@ -39,6 +39,20 @@ To be released.
39
39
  [#227]: https://github.com/fedify-dev/fedify/issues/227
40
40
 
41
41
 
42
+ Version 1.5.3
43
+ -------------
44
+
45
+ Released on May 16, 2025.
46
+
47
+ - Fixed a bug where inbox handler had thrown a `jsonld.SyntaxError` which
48
+ caused a `500 Internal Server Error` when the received activity had
49
+ an invalid JSON-LD syntax. Now it logs the error and responds with
50
+ a `400 Bad Request` error instead. [[#232]]
51
+
52
+ - The `exportJwk()` function now populates the `alg` property of a returned
53
+ `JsonWebKey` object with `"Ed25519"` if the input key is an Ed25519 key.
54
+
55
+
42
56
  Version 1.5.2
43
57
  -------------
44
58
 
@@ -188,6 +202,20 @@ Released on March 28, 2025.
188
202
  [multibase]: https://github.com/multiformats/js-multibase
189
203
 
190
204
 
205
+ Version 1.4.11
206
+ --------------
207
+
208
+ Released on May 16, 2025.
209
+
210
+ - Fixed a bug where inbox handler had thrown a `jsonld.SyntaxError` which
211
+ caused a `500 Internal Server Error` when the received activity had
212
+ an invalid JSON-LD syntax. Now it logs the error and responds with
213
+ a `400 Bad Request` error instead. [[#232]]
214
+
215
+ - The `exportJwk()` function now populates the `alg` property of a returned
216
+ `JsonWebKey` object with `"Ed25519"` if the input key is an Ed25519 key.
217
+
218
+
191
219
  Version 1.4.10
192
220
  --------------
193
221
 
@@ -412,6 +440,20 @@ Released on February 5, 2025.
412
440
  [#195]: https://github.com/fedify-dev/fedify/issues/195
413
441
 
414
442
 
443
+ Version 1.3.18
444
+ --------------
445
+
446
+ Released on May 16, 2025.
447
+
448
+ - Fixed a bug where inbox handler had thrown a `jsonld.SyntaxError` which
449
+ caused a `500 Internal Server Error` when the received activity had
450
+ an invalid JSON-LD syntax. Now it logs the error and responds with
451
+ a `400 Bad Request` error instead. [[#232]]
452
+
453
+ - The `exportJwk()` function now populates the `alg` property of a returned
454
+ `JsonWebKey` object with `"Ed25519"` if the input key is an Ed25519 key.
455
+
456
+
415
457
  Version 1.3.17
416
458
  --------------
417
459
 
@@ -752,6 +794,20 @@ Released on November 30, 2024.
752
794
  [#193]: https://github.com/fedify-dev/fedify/issues/193
753
795
 
754
796
 
797
+ Version 1.2.22
798
+ --------------
799
+
800
+ Released on May 16, 2025.
801
+
802
+ - Fixed a bug where inbox handler had thrown a `jsonld.SyntaxError` which
803
+ caused a `500 Internal Server Error` when the received activity had
804
+ an invalid JSON-LD syntax. Now it logs the error and responds with
805
+ a `400 Bad Request` error instead. [[#232]]
806
+
807
+ - The `exportJwk()` function now populates the `alg` property of a returned
808
+ `JsonWebKey` object with `"Ed25519"` if the input key is an Ed25519 key.
809
+
810
+
755
811
  Version 1.2.21
756
812
  --------------
757
813
 
@@ -1140,6 +1196,20 @@ Released on October 31, 2024.
1140
1196
  [#118]: https://github.com/fedify-dev/fedify/issues/118
1141
1197
 
1142
1198
 
1199
+ Version 1.1.22
1200
+ --------------
1201
+
1202
+ Released on May 16, 2025.
1203
+
1204
+ - Fixed a bug where inbox handler had thrown a `jsonld.SyntaxError` which
1205
+ caused a `500 Internal Server Error` when the received activity had
1206
+ an invalid JSON-LD syntax. Now it logs the error and responds with
1207
+ a `400 Bad Request` error instead. [[#232]]
1208
+
1209
+ - The `exportJwk()` function now populates the `alg` property of a returned
1210
+ `JsonWebKey` object with `"Ed25519"` if the input key is an Ed25519 key.
1211
+
1212
+
1143
1213
  Version 1.1.21
1144
1214
  --------------
1145
1215
 
@@ -1569,6 +1639,22 @@ Released on October 20, 2024.
1569
1639
  [#150]: https://github.com/fedify-dev/fedify/issues/150
1570
1640
 
1571
1641
 
1642
+ Version 1.0.25
1643
+ --------------
1644
+
1645
+ Released on May 16, 2025.
1646
+
1647
+ - Fixed a bug where inbox handler had thrown a `jsonld.SyntaxError` which
1648
+ caused a `500 Internal Server Error` when the received activity had
1649
+ an invalid JSON-LD syntax. Now it logs the error and responds with
1650
+ a `400 Bad Request` error instead. [[#232]]
1651
+
1652
+ - The `exportJwk()` function now populates the `alg` property of a returned
1653
+ `JsonWebKey` object with `"Ed25519"` if the input key is an Ed25519 key.
1654
+
1655
+ [#232]: https://github.com/fedify-dev/fedify/issues/232
1656
+
1657
+
1572
1658
  Version 1.0.24
1573
1659
  --------------
1574
1660
 
package/README.md CHANGED
@@ -106,7 +106,7 @@ financial contributors:[^2]
106
106
 
107
107
  ### Backers
108
108
 
109
- Robin Riley, yamanoku, taye, Encyclia, okin, Andy Piper, box464, Evan Prodromou, Rafael Goulart, malte
109
+ Robin Riley, yamanoku, Encyclia, taye, okin, Andy Piper, box464, Evan Prodromou, Rafael Goulart, malte
110
110
 
111
111
  ### One-time donations
112
112
 
package/SPONSORS.md CHANGED
@@ -26,7 +26,7 @@ Supporters
26
26
  Backers
27
27
  -------
28
28
 
29
- Robin Riley, yamanoku, taye, Encyclia, okin, Andy Piper, box464, Evan Prodromou, Rafael Goulart, malte
29
+ Robin Riley, yamanoku, Encyclia, taye, okin, Andy Piper, box464, Evan Prodromou, Rafael Goulart, malte
30
30
 
31
31
  One-time donations
32
32
  ------------------
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "@fedify/fedify",
3
- "version": "1.6.0-dev.798+10c851d3",
3
+ "version": "1.6.0-dev.808+214560bd",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./mod.ts",
@@ -1,6 +1,6 @@
1
1
  import { getLogger } from "@logtape/logtape";
2
2
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
3
- import { accepts } from "../deps/jsr.io/@std/http/1.0.15/negotiation.js";
3
+ import { accepts } from "../deps/jsr.io/@std/http/1.0.16/negotiation.js";
4
4
  import metadata from "../deno.js";
5
5
  import { verifyRequest } from "../sig/http.js";
6
6
  import { detachSignature, verifyJsonLd } from "../sig/ld.js";
@@ -376,12 +376,25 @@ async function handleInboxInternal(request, { recipient, context: ctx, inboxCont
376
376
  });
377
377
  }
378
378
  const keyCache = new KvKeyCache(kv, kvPrefixes.publicKey, ctx);
379
- const ldSigVerified = await verifyJsonLd(json, {
380
- contextLoader: ctx.contextLoader,
381
- documentLoader: ctx.documentLoader,
382
- keyCache,
383
- tracerProvider,
384
- });
379
+ let ldSigVerified;
380
+ try {
381
+ ldSigVerified = await verifyJsonLd(json, {
382
+ contextLoader: ctx.contextLoader,
383
+ documentLoader: ctx.documentLoader,
384
+ keyCache,
385
+ tracerProvider,
386
+ });
387
+ }
388
+ catch (error) {
389
+ if (error instanceof Error && error.name === "jsonld.SyntaxError") {
390
+ logger.error("Failed to parse JSON-LD:\n{error}", { recipient, error });
391
+ return new Response("Invalid JSON-LD.", {
392
+ status: 400,
393
+ headers: { "Content-Type": "text/plain; charset=utf-8" },
394
+ });
395
+ }
396
+ ldSigVerified = false;
397
+ }
385
398
  const jsonWithoutSig = detachSignature(json);
386
399
  let activity = null;
387
400
  if (ldSigVerified) {
@@ -1,5 +1,5 @@
1
1
  import * as dntShim from "../_dnt.shims.js";
2
- import { concat } from "../deps/jsr.io/@std/bytes/1.0.5/concat.js";
2
+ import { concat } from "../deps/jsr.io/@std/bytes/1.0.6/concat.js";
3
3
  import { decodeBase64, encodeBase64 } from "../deps/jsr.io/@std/encoding/1.0.7/base64.js";
4
4
  import { decodeBase64Url } from "../deps/jsr.io/@std/encoding/1.0.7/base64url.js";
5
5
  import { decodeHex } from "../deps/jsr.io/@std/encoding/1.0.7/hex.js";
package/esm/sig/http.js CHANGED
@@ -2,7 +2,7 @@ import * as dntShim from "../_dnt.shims.js";
2
2
  import { getLogger } from "@logtape/logtape";
3
3
  import { SpanStatusCode, trace, } from "@opentelemetry/api";
4
4
  import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL, } from "@opentelemetry/semantic-conventions";
5
- import { timingSafeEqual } from "../deps/jsr.io/@std/crypto/1.0.4/timing_safe_equal.js";
5
+ import { timingSafeEqual } from "../deps/jsr.io/@std/crypto/1.0.5/timing_safe_equal.js";
6
6
  import { decodeBase64, encodeBase64 } from "../deps/jsr.io/@std/encoding/1.0.7/base64.js";
7
7
  import { encodeHex } from "../deps/jsr.io/@std/encoding/1.0.7/hex.js";
8
8
  import { decodeDict, encodeItem, Item, } from "structured-field-values";
@@ -1,7 +1,7 @@
1
1
  import * as dntShim from "../_dnt.shims.js";
2
2
  import { getLogger } from "@logtape/logtape";
3
3
  import { SpanStatusCode, trace } from "@opentelemetry/api";
4
- import { delay } from "../deps/jsr.io/@std/async/1.0.12/delay.js";
4
+ import { delay } from "../deps/jsr.io/@std/async/1.0.13/delay.js";
5
5
  import metadata from "../deno.js";
6
6
  import { getDocumentLoader, } from "../runtime/docloader.js";
7
7
  import { lookupWebFinger } from "../webfinger/lookup.js";