@fedify/fedify 1.3.0-dev.492 → 1.3.0-dev.507

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. package/CHANGES.md +308 -0
  2. package/esm/deno.js +1 -1
  3. package/esm/federation/handler.js +15 -1
  4. package/esm/runtime/key.js +1 -1
  5. package/esm/sig/http.js +9 -1
  6. package/esm/testing/fixtures/example.com/orderedcollectionpage +24 -0
  7. package/esm/vocab/application.yaml +2 -0
  8. package/esm/vocab/group.yaml +2 -0
  9. package/esm/vocab/organization.yaml +2 -0
  10. package/esm/vocab/person.yaml +2 -0
  11. package/esm/vocab/service.yaml +2 -0
  12. package/esm/vocab/vocab.js +450 -110
  13. package/package.json +1 -1
  14. package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/concat.d.ts.map +1 -1
  15. package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/copy.d.ts.map +1 -1
  16. package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/ends_with.d.ts.map +1 -1
  17. package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/equals.d.ts.map +1 -1
  18. package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/includes_needle.d.ts.map +1 -1
  19. package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/index_of_needle.d.ts.map +1 -1
  20. package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/last_index_of_needle.d.ts.map +1 -1
  21. package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/mod.d.ts.map +1 -1
  22. package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/repeat.d.ts.map +1 -1
  23. package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/starts_with.d.ts.map +1 -1
  24. package/types/deps/jsr.io/@std/http/1.0.10/_negotiation/common.d.ts.map +1 -0
  25. package/types/deps/jsr.io/@std/http/1.0.10/_negotiation/encoding.d.ts.map +1 -0
  26. package/types/deps/jsr.io/@std/http/1.0.10/_negotiation/language.d.ts.map +1 -0
  27. package/types/deps/jsr.io/@std/http/1.0.10/_negotiation/media_type.d.ts.map +1 -0
  28. package/types/deps/jsr.io/@std/http/1.0.10/negotiation.d.ts.map +1 -0
  29. package/types/federation/handler.d.ts.map +1 -1
  30. package/types/sig/http.d.ts.map +1 -1
  31. package/types/vocab/vocab.d.ts +30 -30
  32. package/types/vocab/vocab.d.ts.map +1 -1
  33. package/types/deps/jsr.io/@std/http/1.0.9/_negotiation/common.d.ts.map +0 -1
  34. package/types/deps/jsr.io/@std/http/1.0.9/_negotiation/encoding.d.ts.map +0 -1
  35. package/types/deps/jsr.io/@std/http/1.0.9/_negotiation/language.d.ts.map +0 -1
  36. package/types/deps/jsr.io/@std/http/1.0.9/_negotiation/media_type.d.ts.map +0 -1
  37. package/types/deps/jsr.io/@std/http/1.0.9/negotiation.d.ts.map +0 -1
  38. /package/esm/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/concat.js +0 -0
  39. /package/esm/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/copy.js +0 -0
  40. /package/esm/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/ends_with.js +0 -0
  41. /package/esm/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/equals.js +0 -0
  42. /package/esm/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/includes_needle.js +0 -0
  43. /package/esm/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/index_of_needle.js +0 -0
  44. /package/esm/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/last_index_of_needle.js +0 -0
  45. /package/esm/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/mod.js +0 -0
  46. /package/esm/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/repeat.js +0 -0
  47. /package/esm/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/starts_with.js +0 -0
  48. /package/esm/deps/jsr.io/@std/http/{1.0.9 → 1.0.10}/_negotiation/common.js +0 -0
  49. /package/esm/deps/jsr.io/@std/http/{1.0.9 → 1.0.10}/_negotiation/encoding.js +0 -0
  50. /package/esm/deps/jsr.io/@std/http/{1.0.9 → 1.0.10}/_negotiation/language.js +0 -0
  51. /package/esm/deps/jsr.io/@std/http/{1.0.9 → 1.0.10}/_negotiation/media_type.js +0 -0
  52. /package/esm/deps/jsr.io/@std/http/{1.0.9 → 1.0.10}/negotiation.js +0 -0
  53. /package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/concat.d.ts +0 -0
  54. /package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/copy.d.ts +0 -0
  55. /package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/ends_with.d.ts +0 -0
  56. /package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/equals.d.ts +0 -0
  57. /package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/includes_needle.d.ts +0 -0
  58. /package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/index_of_needle.d.ts +0 -0
  59. /package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/last_index_of_needle.d.ts +0 -0
  60. /package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/mod.d.ts +0 -0
  61. /package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/repeat.d.ts +0 -0
  62. /package/types/deps/jsr.io/@std/bytes/{1.0.3 → 1.0.4}/starts_with.d.ts +0 -0
  63. /package/types/deps/jsr.io/@std/http/{1.0.9 → 1.0.10}/_negotiation/common.d.ts +0 -0
  64. /package/types/deps/jsr.io/@std/http/{1.0.9 → 1.0.10}/_negotiation/encoding.d.ts +0 -0
  65. /package/types/deps/jsr.io/@std/http/{1.0.9 → 1.0.10}/_negotiation/language.d.ts +0 -0
  66. /package/types/deps/jsr.io/@std/http/{1.0.9 → 1.0.10}/_negotiation/media_type.d.ts +0 -0
  67. /package/types/deps/jsr.io/@std/http/{1.0.9 → 1.0.10}/negotiation.d.ts +0 -0
package/CHANGES.md CHANGED
@@ -33,6 +33,82 @@ To be released.
33
33
  [#162]: https://github.com/dahlia/fedify/issues/162
34
34
 
35
35
 
36
+ Version 1.2.6
37
+ -------------
38
+
39
+ Released on December 19, 2024.
40
+
41
+ - Fix a bug where `Actor`'s `inbox` and `outbox` properties had not been
42
+ able to be set to an `OrderedCollectionPage` object, even though it is
43
+ a subtype of `OrderedCollection` according to Activity Vocabulary
44
+ specification. [[#165]]
45
+
46
+ - The type of `Application()` constructor's `inbox` and `outbox` options
47
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
48
+ (was `OrderedCollection | null | undefined`).
49
+ - The type of `Application.clone()` method's `inbox` and `outbox` options
50
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
51
+ (was `OrderedCollection | null | undefined`).
52
+ - The return type of `Application.getInbox()` and
53
+ `Application.getOutbox()` methods is now `OrderedCollection |
54
+ OrderedCollectionPage | null` (was `OrderedCollection | null`).
55
+ - The type of `Group()` constructor's `inbox` and `outbox` options is
56
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
57
+ `OrderedCollection | null | undefined`).
58
+ - The type of `Group.clone()` method's `inbox` and `outbox` options is
59
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
60
+ `OrderedCollection | null | undefined`).
61
+ - The return type of `Group.getInbox()` and `Group.getOutbox()` methods
62
+ is now `OrderedCollection | OrderedCollectionPage | null` (was
63
+ `OrderedCollection | null`).
64
+ - The type of `Organization()` constructor's `inbox` and `outbox` options
65
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
66
+ (was `OrderedCollection | null | undefined`).
67
+ - The type of `Organization.clone()` method's `inbox` and `outbox` options
68
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
69
+ (was `OrderedCollection | null | undefined`).
70
+ - The return type of `Organization.getInbox()` and
71
+ `Organization.getOutbox()` methods is now `OrderedCollection |
72
+ OrderedCollectionPage | null` (was `OrderedCollection | null`).
73
+ - The type of `Person()` constructor's `inbox` and `outbox` options is
74
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
75
+ `OrderedCollection | null | undefined`).
76
+ - The type of `Person.clone()` method's `inbox` and `outbox` options is
77
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
78
+ `OrderedCollection | null | undefined`).
79
+ - The return type of `Person.getInbox()` and `Person.getOutbox()` methods
80
+ is now `OrderedCollection | OrderedCollectionPage | null` (was
81
+ `OrderedCollection | null`).
82
+ - The type of `Service()` constructor's `inbox` and `outbox` options is
83
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
84
+ `OrderedCollection | null | undefined`).
85
+ - The type of `Service.clone()` method's `inbox` and `outbox` options is
86
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
87
+ `OrderedCollection | null | undefined`).
88
+ - The return type of `Service.getInbox()` and `Service.getOutbox()`
89
+ methods is now `OrderedCollection | OrderedCollectionPage | null` (was
90
+ `OrderedCollection | null`).
91
+
92
+
93
+ Version 1.2.5
94
+ -------------
95
+
96
+ Released on November 14, 2024.
97
+
98
+ - Suppressed a `TypeError` with a message <q>unusable</q> due to Node.js's
99
+ mysterious behavior. [[#159]]
100
+
101
+ - The `verifyRequest()` function no longer throws a `TypeError`
102
+ when a given `Request` object's body is already consumed or locked.
103
+ Instead, it logs an error message to the `["fedify", "sig", "http"]`
104
+ logger category and returns `null`.
105
+ - The `Federation.fetch()` method no longer throws a `TypeError`
106
+ when a given `Request` object's body is already consumed or locked.
107
+ Instead, it logs an error message to the `["fedify", "federation",
108
+ "inbox"]` logger category and responds with a `500 Internal Server
109
+ Error`.
110
+
111
+
36
112
  Version 1.2.4
37
113
  -------------
38
114
 
@@ -138,6 +214,82 @@ Released on October 31, 2024.
138
214
  [#118]: https://github.com/dahlia/fedify/issues/118
139
215
 
140
216
 
217
+ Version 1.1.6
218
+ -------------
219
+
220
+ Released on November 19, 2024.
221
+
222
+ - Fix a bug where `Actor`'s `inbox` and `outbox` properties had not been
223
+ able to be set to an `OrderedCollectionPage` object, even though it is
224
+ a subtype of `OrderedCollection` according to Activity Vocabulary
225
+ specification. [[#165]]
226
+
227
+ - The type of `Application()` constructor's `inbox` and `outbox` options
228
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
229
+ (was `OrderedCollection | null | undefined`).
230
+ - The type of `Application.clone()` method's `inbox` and `outbox` options
231
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
232
+ (was `OrderedCollection | null | undefined`).
233
+ - The return type of `Application.getInbox()` and
234
+ `Application.getOutbox()` methods is now `OrderedCollection |
235
+ OrderedCollectionPage | null` (was `OrderedCollection | null`).
236
+ - The type of `Group()` constructor's `inbox` and `outbox` options is
237
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
238
+ `OrderedCollection | null | undefined`).
239
+ - The type of `Group.clone()` method's `inbox` and `outbox` options is
240
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
241
+ `OrderedCollection | null | undefined`).
242
+ - The return type of `Group.getInbox()` and `Group.getOutbox()` methods
243
+ is now `OrderedCollection | OrderedCollectionPage | null` (was
244
+ `OrderedCollection | null`).
245
+ - The type of `Organization()` constructor's `inbox` and `outbox` options
246
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
247
+ (was `OrderedCollection | null | undefined`).
248
+ - The type of `Organization.clone()` method's `inbox` and `outbox` options
249
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
250
+ (was `OrderedCollection | null | undefined`).
251
+ - The return type of `Organization.getInbox()` and
252
+ `Organization.getOutbox()` methods is now `OrderedCollection |
253
+ OrderedCollectionPage | null` (was `OrderedCollection | null`).
254
+ - The type of `Person()` constructor's `inbox` and `outbox` options is
255
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
256
+ `OrderedCollection | null | undefined`).
257
+ - The type of `Person.clone()` method's `inbox` and `outbox` options is
258
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
259
+ `OrderedCollection | null | undefined`).
260
+ - The return type of `Person.getInbox()` and `Person.getOutbox()` methods
261
+ is now `OrderedCollection | OrderedCollectionPage | null` (was
262
+ `OrderedCollection | null`).
263
+ - The type of `Service()` constructor's `inbox` and `outbox` options is
264
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
265
+ `OrderedCollection | null | undefined`).
266
+ - The type of `Service.clone()` method's `inbox` and `outbox` options is
267
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
268
+ `OrderedCollection | null | undefined`).
269
+ - The return type of `Service.getInbox()` and `Service.getOutbox()`
270
+ methods is now `OrderedCollection | OrderedCollectionPage | null` (was
271
+ `OrderedCollection | null`).
272
+
273
+
274
+ Version 1.1.5
275
+ -------------
276
+
277
+ Released on December 14, 2024.
278
+
279
+ - Suppressed a `TypeError` with a message <q>unusable</q> due to Node.js's
280
+ mysterious behavior. [[#159]]
281
+
282
+ - The `verifyRequest()` function no longer throws a `TypeError`
283
+ when a given `Request` object's body is already consumed or locked.
284
+ Instead, it logs an error message to the `["fedify", "sig", "http"]`
285
+ logger category and returns `null`.
286
+ - The `Federation.fetch()` method no longer throws a `TypeError`
287
+ when a given `Request` object's body is already consumed or locked.
288
+ Instead, it logs an error message to the `["fedify", "federation",
289
+ "inbox"]` logger category and responds with a `500 Internal Server
290
+ Error`.
291
+
292
+
141
293
  Version 1.1.4
142
294
  -------------
143
295
 
@@ -284,6 +436,82 @@ Released on October 20, 2024.
284
436
  [#150]: https://github.com/dahlia/fedify/issues/150
285
437
 
286
438
 
439
+ Version 1.0.10
440
+ --------------
441
+
442
+ Released on December 19, 2024.
443
+
444
+ - Fix a bug where `Actor`'s `inbox` and `outbox` properties had not been
445
+ able to be set to an `OrderedCollectionPage` object, even though it is
446
+ a subtype of `OrderedCollection` according to Activity Vocabulary
447
+ specification. [[#165]]
448
+
449
+ - The type of `Application()` constructor's `inbox` and `outbox` options
450
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
451
+ (was `OrderedCollection | null | undefined`).
452
+ - The type of `Application.clone()` method's `inbox` and `outbox` options
453
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
454
+ (was `OrderedCollection | null | undefined`).
455
+ - The return type of `Application.getInbox()` and
456
+ `Application.getOutbox()` methods is now `OrderedCollection |
457
+ OrderedCollectionPage | null` (was `OrderedCollection | null`).
458
+ - The type of `Group()` constructor's `inbox` and `outbox` options is
459
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
460
+ `OrderedCollection | null | undefined`).
461
+ - The type of `Group.clone()` method's `inbox` and `outbox` options is
462
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
463
+ `OrderedCollection | null | undefined`).
464
+ - The return type of `Group.getInbox()` and `Group.getOutbox()` methods
465
+ is now `OrderedCollection | OrderedCollectionPage | null` (was
466
+ `OrderedCollection | null`).
467
+ - The type of `Organization()` constructor's `inbox` and `outbox` options
468
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
469
+ (was `OrderedCollection | null | undefined`).
470
+ - The type of `Organization.clone()` method's `inbox` and `outbox` options
471
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
472
+ (was `OrderedCollection | null | undefined`).
473
+ - The return type of `Organization.getInbox()` and
474
+ `Organization.getOutbox()` methods is now `OrderedCollection |
475
+ OrderedCollectionPage | null` (was `OrderedCollection | null`).
476
+ - The type of `Person()` constructor's `inbox` and `outbox` options is
477
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
478
+ `OrderedCollection | null | undefined`).
479
+ - The type of `Person.clone()` method's `inbox` and `outbox` options is
480
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
481
+ `OrderedCollection | null | undefined`).
482
+ - The return type of `Person.getInbox()` and `Person.getOutbox()` methods
483
+ is now `OrderedCollection | OrderedCollectionPage | null` (was
484
+ `OrderedCollection | null`).
485
+ - The type of `Service()` constructor's `inbox` and `outbox` options is
486
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
487
+ `OrderedCollection | null | undefined`).
488
+ - The type of `Service.clone()` method's `inbox` and `outbox` options is
489
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
490
+ `OrderedCollection | null | undefined`).
491
+ - The return type of `Service.getInbox()` and `Service.getOutbox()`
492
+ methods is now `OrderedCollection | OrderedCollectionPage | null` (was
493
+ `OrderedCollection | null`).
494
+
495
+
496
+ Version 1.0.9
497
+ -------------
498
+
499
+ Released on December 14, 2024.
500
+
501
+ - Suppressed a `TypeError` with a message <q>unusable</q> due to Node.js's
502
+ mysterious behavior. [[#159]]
503
+
504
+ - The `verifyRequest()` function no longer throws a `TypeError`
505
+ when a given `Request` object's body is already consumed or locked.
506
+ Instead, it logs an error message to the `["fedify", "sig", "http"]`
507
+ logger category and returns `null`.
508
+ - The `Federation.fetch()` method no longer throws a `TypeError`
509
+ when a given `Request` object's body is already consumed or locked.
510
+ Instead, it logs an error message to the `["fedify", "federation",
511
+ "inbox"]` logger category and responds with a `500 Internal Server
512
+ Error`.
513
+
514
+
287
515
  Version 1.0.8
288
516
  -------------
289
517
 
@@ -549,6 +777,86 @@ Released on September 26, 2024.
549
777
  [#137]: https://github.com/dahlia/fedify/issues/137
550
778
 
551
779
 
780
+ Version 0.15.8
781
+ --------------
782
+
783
+ Released on November 159, 2024.
784
+
785
+ - Fix a bug where `Actor`'s `inbox` and `outbox` properties had not been
786
+ able to be set to an `OrderedCollectionPage` object, even though it is
787
+ a subtype of `OrderedCollection` according to Activity Vocabulary
788
+ specification. [[#165]]
789
+
790
+ - The type of `Application()` constructor's `inbox` and `outbox` options
791
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
792
+ (was `OrderedCollection | null | undefined`).
793
+ - The type of `Application.clone()` method's `inbox` and `outbox` options
794
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
795
+ (was `OrderedCollection | null | undefined`).
796
+ - The return type of `Application.getInbox()` and
797
+ `Application.getOutbox()` methods is now `OrderedCollection |
798
+ OrderedCollectionPage | null` (was `OrderedCollection | null`).
799
+ - The type of `Group()` constructor's `inbox` and `outbox` options is
800
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
801
+ `OrderedCollection | null | undefined`).
802
+ - The type of `Group.clone()` method's `inbox` and `outbox` options is
803
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
804
+ `OrderedCollection | null | undefined`).
805
+ - The return type of `Group.getInbox()` and `Group.getOutbox()` methods
806
+ is now `OrderedCollection | OrderedCollectionPage | null` (was
807
+ `OrderedCollection | null`).
808
+ - The type of `Organization()` constructor's `inbox` and `outbox` options
809
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
810
+ (was `OrderedCollection | null | undefined`).
811
+ - The type of `Organization.clone()` method's `inbox` and `outbox` options
812
+ is now `OrderedCollection | OrderedCollectionPage | null | undefined`
813
+ (was `OrderedCollection | null | undefined`).
814
+ - The return type of `Organization.getInbox()` and
815
+ `Organization.getOutbox()` methods is now `OrderedCollection |
816
+ OrderedCollectionPage | null` (was `OrderedCollection | null`).
817
+ - The type of `Person()` constructor's `inbox` and `outbox` options is
818
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
819
+ `OrderedCollection | null | undefined`).
820
+ - The type of `Person.clone()` method's `inbox` and `outbox` options is
821
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
822
+ `OrderedCollection | null | undefined`).
823
+ - The return type of `Person.getInbox()` and `Person.getOutbox()` methods
824
+ is now `OrderedCollection | OrderedCollectionPage | null` (was
825
+ `OrderedCollection | null`).
826
+ - The type of `Service()` constructor's `inbox` and `outbox` options is
827
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
828
+ `OrderedCollection | null | undefined`).
829
+ - The type of `Service.clone()` method's `inbox` and `outbox` options is
830
+ now `OrderedCollection | OrderedCollectionPage | null | undefined` (was
831
+ `OrderedCollection | null | undefined`).
832
+ - The return type of `Service.getInbox()` and `Service.getOutbox()`
833
+ methods is now `OrderedCollection | OrderedCollectionPage | null` (was
834
+ `OrderedCollection | null`).
835
+
836
+ [#165]: https://github.com/dahlia/fedify/issues/165
837
+
838
+
839
+ Version 0.15.7
840
+ --------------
841
+
842
+ Released on November 14, 2024.
843
+
844
+ - Suppressed a `TypeError` with a message <q>unusable</q> due to Node.js's
845
+ mysterious behavior. [[#159]]
846
+
847
+ - The `verifyRequest()` function no longer throws a `TypeError`
848
+ when a given `Request` object's body is already consumed or locked.
849
+ Instead, it logs an error message to the `["fedify", "sig", "http"]`
850
+ logger category and returns `null`.
851
+ - The `Federation.fetch()` method no longer throws a `TypeError`
852
+ when a given `Request` object's body is already consumed or locked.
853
+ Instead, it logs an error message to the `["fedify", "federation",
854
+ "inbox"]` logger category and responds with a `500 Internal Server
855
+ Error`.
856
+
857
+ [#159]: https://github.com/dahlia/fedify/issues/159
858
+
859
+
552
860
  Version 0.15.6
553
861
  --------------
554
862
 
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "@fedify/fedify",
3
- "version": "1.3.0-dev.492+450a6939",
3
+ "version": "1.3.0-dev.507+369ed297",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./mod.ts",
@@ -1,6 +1,6 @@
1
1
  import * as dntShim from "../_dnt.shims.js";
2
2
  import { getLogger } from "@logtape/logtape";
3
- import { accepts } from "../deps/jsr.io/@std/http/1.0.9/negotiation.js";
3
+ import { accepts } from "../deps/jsr.io/@std/http/1.0.10/negotiation.js";
4
4
  import { verifyRequest } from "../sig/http.js";
5
5
  import { detachSignature, verifyJsonLd } from "../sig/ld.js";
6
6
  import { doesActorOwnKey } from "../sig/owner.js";
@@ -188,6 +188,20 @@ export async function handleInbox(request, { recipient, context, inboxContextFac
188
188
  return await onNotFound(request);
189
189
  }
190
190
  }
191
+ if (request.bodyUsed) {
192
+ logger.error("Request body has already been read.", { recipient });
193
+ return new Response("Internal server error.", {
194
+ status: 500,
195
+ headers: { "Content-Type": "text/plain; charset=utf-8" },
196
+ });
197
+ }
198
+ else if (request.body?.locked) {
199
+ logger.error("Request body is locked.", { recipient });
200
+ return new Response("Internal server error.", {
201
+ status: 500,
202
+ headers: { "Content-Type": "text/plain; charset=utf-8" },
203
+ });
204
+ }
191
205
  let json;
192
206
  try {
193
207
  json = await request.clone().json();
@@ -1,6 +1,6 @@
1
1
  import * as dntShim from "../_dnt.shims.js";
2
2
  import { createPublicKey } from "node:crypto";
3
- import { concat } from "../deps/jsr.io/@std/bytes/1.0.3/concat.js";
3
+ import { concat } from "../deps/jsr.io/@std/bytes/1.0.4/concat.js";
4
4
  import { decodeBase64, encodeBase64 } from "../deps/jsr.io/@std/encoding/1.0.5/base64.js";
5
5
  import { decodeBase64Url } from "../deps/jsr.io/@std/encoding/1.0.5/base64url.js";
6
6
  import { decodeHex } from "../deps/jsr.io/@std/encoding/1.0.5/hex.js";
package/esm/sig/http.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as dntShim from "../_dnt.shims.js";
2
2
  import { getLogger } from "@logtape/logtape";
3
- import { equals } from "../deps/jsr.io/@std/bytes/1.0.3/mod.js";
3
+ import { equals } from "../deps/jsr.io/@std/bytes/1.0.4/mod.js";
4
4
  import { decodeBase64, encodeBase64 } from "../deps/jsr.io/@std/encoding/1.0.5/base64.js";
5
5
  import { CryptographicKey } from "../vocab/vocab.js";
6
6
  import { fetchKey, validateCryptoKey } from "./key.js";
@@ -69,6 +69,14 @@ const supportedHashAlgorithms = {
69
69
  */
70
70
  export async function verifyRequest(request, { documentLoader, contextLoader, timeWindow, currentTime, keyCache } = {}) {
71
71
  const logger = getLogger(["fedify", "sig", "http"]);
72
+ if (request.bodyUsed) {
73
+ logger.error("Failed to verify; the request body is already consumed.", { url: request.url });
74
+ return null;
75
+ }
76
+ else if (request.body?.locked) {
77
+ logger.error("Failed to verify; the request body is locked.", { url: request.url });
78
+ return null;
79
+ }
72
80
  const originalRequest = request;
73
81
  request = request.clone();
74
82
  const dateHeader = request.headers.get("Date");
@@ -0,0 +1,24 @@
1
+ {
2
+ "@context": "https://www.w3.org/ns/activitystreams",
3
+ "id": "https://example.com/orderedcollectionpage",
4
+ "type": "OrderedCollectionPage",
5
+ "partOf": "https://example.com/orderedcollectionpage",
6
+ "totalItems": 1,
7
+ "orderedItems": [
8
+ {
9
+ "id": "https://example.com/activities/1",
10
+ "type": "Create",
11
+ "published": "2024-11-19T15:24:56Z",
12
+ "actor": "https://example.com/users/1",
13
+ "to": "https://www.w3.org/ns/activitystreams#Public",
14
+ "object": {
15
+ "id": "https://example.com/notes/1",
16
+ "type": "Note",
17
+ "content": "This is a simple note",
18
+ "attributedTo": "https://example.com/users/1",
19
+ "to": "https://www.w3.org/ns/activitystreams#Public",
20
+ "published": "2024-11-19T15:24:56Z"
21
+ }
22
+ }
23
+ ]
24
+ }
@@ -106,6 +106,7 @@ properties:
106
106
  and dropping any activities already seen.
107
107
  range:
108
108
  - "https://www.w3.org/ns/activitystreams#OrderedCollection"
109
+ - "https://www.w3.org/ns/activitystreams#OrderedCollectionPage"
109
110
 
110
111
  - singularName: outbox
111
112
  functional: true
@@ -124,6 +125,7 @@ properties:
124
125
  implementing and deploying the server.
125
126
  range:
126
127
  - "https://www.w3.org/ns/activitystreams#OrderedCollection"
128
+ - "https://www.w3.org/ns/activitystreams#OrderedCollectionPage"
127
129
 
128
130
  - singularName: following
129
131
  functional: true
@@ -106,6 +106,7 @@ properties:
106
106
  and dropping any activities already seen.
107
107
  range:
108
108
  - "https://www.w3.org/ns/activitystreams#OrderedCollection"
109
+ - "https://www.w3.org/ns/activitystreams#OrderedCollectionPage"
109
110
 
110
111
  - singularName: outbox
111
112
  functional: true
@@ -124,6 +125,7 @@ properties:
124
125
  implementing and deploying the server.
125
126
  range:
126
127
  - "https://www.w3.org/ns/activitystreams#OrderedCollection"
128
+ - "https://www.w3.org/ns/activitystreams#OrderedCollectionPage"
127
129
 
128
130
  - singularName: following
129
131
  functional: true
@@ -106,6 +106,7 @@ properties:
106
106
  and dropping any activities already seen.
107
107
  range:
108
108
  - "https://www.w3.org/ns/activitystreams#OrderedCollection"
109
+ - "https://www.w3.org/ns/activitystreams#OrderedCollectionPage"
109
110
 
110
111
  - singularName: outbox
111
112
  functional: true
@@ -124,6 +125,7 @@ properties:
124
125
  implementing and deploying the server.
125
126
  range:
126
127
  - "https://www.w3.org/ns/activitystreams#OrderedCollection"
128
+ - "https://www.w3.org/ns/activitystreams#OrderedCollectionPage"
127
129
 
128
130
  - singularName: following
129
131
  functional: true
@@ -106,6 +106,7 @@ properties:
106
106
  and dropping any activities already seen.
107
107
  range:
108
108
  - "https://www.w3.org/ns/activitystreams#OrderedCollection"
109
+ - "https://www.w3.org/ns/activitystreams#OrderedCollectionPage"
109
110
 
110
111
  - singularName: outbox
111
112
  functional: true
@@ -124,6 +125,7 @@ properties:
124
125
  implementing and deploying the server.
125
126
  range:
126
127
  - "https://www.w3.org/ns/activitystreams#OrderedCollection"
128
+ - "https://www.w3.org/ns/activitystreams#OrderedCollectionPage"
127
129
 
128
130
  - singularName: following
129
131
  functional: true
@@ -106,6 +106,7 @@ properties:
106
106
  and dropping any activities already seen.
107
107
  range:
108
108
  - "https://www.w3.org/ns/activitystreams#OrderedCollection"
109
+ - "https://www.w3.org/ns/activitystreams#OrderedCollectionPage"
109
110
 
110
111
  - singularName: outbox
111
112
  functional: true
@@ -124,6 +125,7 @@ properties:
124
125
  implementing and deploying the server.
125
126
  range:
126
127
  - "https://www.w3.org/ns/activitystreams#OrderedCollection"
128
+ - "https://www.w3.org/ns/activitystreams#OrderedCollectionPage"
127
129
 
128
130
  - singularName: following
129
131
  functional: true