@fedify/fedify 0.14.0-dev.338 → 0.14.0-dev.344

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/CHANGES.md +55 -2
  2. package/esm/federation/middleware.js +2 -2
  3. package/esm/sig/key.js +1 -1
  4. package/esm/vocab/actor.js +3 -0
  5. package/esm/vocab/application.yaml +17 -0
  6. package/esm/vocab/group.yaml +17 -0
  7. package/esm/vocab/organization.yaml +17 -0
  8. package/esm/vocab/person.yaml +17 -0
  9. package/esm/vocab/service.yaml +17 -0
  10. package/esm/vocab/vocab.js +1528 -23
  11. package/package.json +1 -1
  12. package/types/federation/collection.d.ts +1 -0
  13. package/types/federation/collection.d.ts.map +1 -1
  14. package/types/federation/context.d.ts +2 -0
  15. package/types/federation/context.d.ts.map +1 -1
  16. package/types/federation/handler.d.ts +2 -0
  17. package/types/federation/handler.d.ts.map +1 -1
  18. package/types/federation/middleware.d.ts +2 -0
  19. package/types/federation/middleware.d.ts.map +1 -1
  20. package/types/federation/send.d.ts +2 -0
  21. package/types/federation/send.d.ts.map +1 -1
  22. package/types/nodeinfo/handler.d.ts +1 -0
  23. package/types/nodeinfo/handler.d.ts.map +1 -1
  24. package/types/nodeinfo/types.d.ts +1 -0
  25. package/types/nodeinfo/types.d.ts.map +1 -1
  26. package/types/runtime/docloader.d.ts +1 -0
  27. package/types/runtime/docloader.d.ts.map +1 -1
  28. package/types/sig/http.d.ts +2 -0
  29. package/types/sig/http.d.ts.map +1 -1
  30. package/types/sig/key.d.ts +2 -1
  31. package/types/sig/key.d.ts.map +1 -1
  32. package/types/sig/owner.d.ts +1 -0
  33. package/types/sig/owner.d.ts.map +1 -1
  34. package/types/sig/proof.d.ts +1 -0
  35. package/types/sig/proof.d.ts.map +1 -1
  36. package/types/vocab/actor.d.ts +1 -0
  37. package/types/vocab/actor.d.ts.map +1 -1
  38. package/types/vocab/constants.d.ts +1 -0
  39. package/types/vocab/constants.d.ts.map +1 -1
  40. package/types/vocab/lookup.d.ts +1 -0
  41. package/types/vocab/lookup.d.ts.map +1 -1
  42. package/types/vocab/vocab.d.ts +181 -0
  43. package/types/vocab/vocab.d.ts.map +1 -1
  44. package/types/webfinger/handler.d.ts +1 -0
  45. package/types/webfinger/handler.d.ts.map +1 -1
  46. package/types/webfinger/lookup.d.ts +1 -0
  47. package/types/webfinger/lookup.d.ts.map +1 -1
  48. package/types/x/hono.d.ts +1 -0
  49. package/types/x/hono.d.ts.map +1 -1
package/CHANGES.md CHANGED
@@ -34,6 +34,39 @@ To be released.
34
34
 
35
35
  - Added `Source` class to Activity Vocabulary API. [[#114]]
36
36
 
37
+ - Added `aliases` property to `Actor` type in Activity Vocabulary API.
38
+
39
+ - Added `Application.getAliases()` method.
40
+ - Added `Application.getAlias()` method.
41
+ - `new Application()` constructor now accepts `alias` option.
42
+ - `new Application()` constructor now accepts `aliases` option.
43
+ - `Application.clone()` method now accepts `alias` option.
44
+ - `Application.clone()` method now accepts `aliases` option.
45
+ - Added `Group.getAliases()` method.
46
+ - Added `Group.getAlias()` method.
47
+ - `new Group()` constructor now accepts `alias` option.
48
+ - `new Group()` constructor now accepts `aliases` option.
49
+ - `Group.clone()` method now accepts `alias` option.
50
+ - `Group.clone()` method now accepts `aliases` option.
51
+ - Added `Organization.getAliases()` method.
52
+ - Added `Organization.getAlias()` method.
53
+ - `new Organization()` constructor now accepts `alias` option.
54
+ - `new Organization()` constructor now accepts `aliases` option.
55
+ - `Organization.clone()` method now accepts `alias` option.
56
+ - `Organization.clone()` method now accepts `aliases` option.
57
+ - Added `Person.getAliases()` method.
58
+ - Added `Person.getAlias()` method.
59
+ - `new Person()` constructor now accepts `alias` option.
60
+ - `new Person()` constructor now accepts `aliases` option.
61
+ - `Person.clone()` method now accepts `alias` option.
62
+ - `Person.clone()` method now accepts `aliases` option.
63
+ - Added `Service.getAliases()` method.
64
+ - Added `Service.getAlias()` method.
65
+ - `new Service()` constructor now accepts `alias` option.
66
+ - `new Service()` constructor now accepts `aliases` option.
67
+ - `Service.clone()` method now accepts `alias` option.
68
+ - `Service.clone()` method now accepts `aliases` option.
69
+
37
70
  - Improved the performance of `Object.toJsonLd()` method.
38
71
 
39
72
  - `Object.toJsonLd()` method no longer guarantees that the returned
@@ -54,6 +87,16 @@ To be released.
54
87
  [#115]: https://github.com/dahlia/fedify/issues/115
55
88
 
56
89
 
90
+ Version 0.13.1
91
+ --------------
92
+
93
+ Released on August 18, 2024.
94
+
95
+ - Fixed a vulnerability where the `getActorHandle()` function had trusted
96
+ the hostname of WebFinger aliases that had not matched the hostname of the
97
+ actor ID (URI).
98
+
99
+
57
100
  Version 0.13.0
58
101
  --------------
59
102
 
@@ -71,7 +114,7 @@ Released on August 7, 2024.
71
114
  - `new Question()` constructor now accepts `voters` option.
72
115
  - `Question.clone()` method now accepts `voters` option.
73
116
 
74
- - HTTP Signatures verficiation now can be optionally skipped for the sake of
117
+ - HTTP Signatures verification now can be optionally skipped for the sake of
75
118
  testing. [[#110]]
76
119
 
77
120
  - The type of `CreateFederationOptions.signatureTimeWindow` property
@@ -128,6 +171,16 @@ Released on August 7, 2024.
128
171
  [Nitro]: https://nitro.unjs.io/
129
172
 
130
173
 
174
+ Version 0.12.3
175
+ --------------
176
+
177
+ Released on August 18, 2024.
178
+
179
+ - Fixed a vulnerability where the `getActorHandle()` function had trusted
180
+ the hostname of WebFinger aliases that had not matched the hostname of the
181
+ actor ID (URI).
182
+
183
+
131
184
  Version 0.12.2
132
185
  --------------
133
186
 
@@ -1313,4 +1366,4 @@ Version 0.1.0
1313
1366
 
1314
1367
  Initial release. Released on March 8, 2024.
1315
1368
 
1316
- <!-- cSpell: ignore Dogeon Wressell -->
1369
+ <!-- cSpell: ignore Dogeon Fabien Wressell -->
@@ -56,11 +56,11 @@ class FederationImpl {
56
56
  constructor(options) {
57
57
  this.kv = options.kv;
58
58
  this.kvPrefixes = {
59
- ...{
59
+ ...({
60
60
  activityIdempotence: ["_fedify", "activityIdempotence"],
61
61
  remoteDocument: ["_fedify", "remoteDocument"],
62
62
  publicKey: ["_fedify", "publicKey"],
63
- },
63
+ }),
64
64
  ...(options.kvPrefixes ?? {}),
65
65
  };
66
66
  this.queue = options.queue;
package/esm/sig/key.js CHANGED
@@ -73,7 +73,7 @@ export async function exportJwk(key) {
73
73
  /**
74
74
  * Imports a key from JWK format.
75
75
  * @param jwk The key in JWK format.
76
- * @param type Which type of key to import, either `"public"`" or `"private"`".
76
+ * @param type Which type of key to import, either `"public"` or `"private"`.
77
77
  * @returns The imported key.
78
78
  * @throws {TypeError} If the key is invalid or unsupported.
79
79
  */
@@ -86,6 +86,9 @@ export async function getActorHandle(actor, options = {}) {
86
86
  for (const alias of aliases) {
87
87
  const match = alias.match(/^acct:([^@]+)@([^@]+)$/);
88
88
  if (match != null) {
89
+ const hostname = new URL(`https://${match[2]}/`).hostname;
90
+ if (hostname !== actorId.hostname)
91
+ continue;
89
92
  return normalizeActorHandle(`@${match[1]}@${match[2]}`, options);
90
93
  }
91
94
  }
@@ -242,3 +242,20 @@ properties:
242
242
  description: Whether the actor allows to be indexed.
243
243
  range:
244
244
  - "http://www.w3.org/2001/XMLSchema#boolean"
245
+
246
+ - pluralName: aliases
247
+ singularName: alias
248
+ singularAccessor: true
249
+ compactName: alsoKnownAs
250
+ uri: "https://www.w3.org/ns/activitystreams#alsoKnownAs"
251
+ description: |
252
+ The `aliases` (`alsoKnownAs`) property is used to specify alternative names
253
+ or aliases for an entity. It can be used to provide additional identifiers
254
+ or labels for an entity, which can be useful in scenarios where an entity
255
+ may have multiple names or aliases.
256
+ range:
257
+ - "https://www.w3.org/ns/activitystreams#Application"
258
+ - "https://www.w3.org/ns/activitystreams#Group"
259
+ - "https://www.w3.org/ns/activitystreams#Organization"
260
+ - "https://www.w3.org/ns/activitystreams#Person"
261
+ - "https://www.w3.org/ns/activitystreams#Service"
@@ -242,3 +242,20 @@ properties:
242
242
  description: Whether the actor allows to be indexed.
243
243
  range:
244
244
  - "http://www.w3.org/2001/XMLSchema#boolean"
245
+
246
+ - pluralName: aliases
247
+ singularName: alias
248
+ singularAccessor: true
249
+ compactName: alsoKnownAs
250
+ uri: "https://www.w3.org/ns/activitystreams#alsoKnownAs"
251
+ description: |
252
+ The `aliases` (`alsoKnownAs`) property is used to specify alternative names
253
+ or aliases for an entity. It can be used to provide additional identifiers
254
+ or labels for an entity, which can be useful in scenarios where an entity
255
+ may have multiple names or aliases.
256
+ range:
257
+ - "https://www.w3.org/ns/activitystreams#Application"
258
+ - "https://www.w3.org/ns/activitystreams#Group"
259
+ - "https://www.w3.org/ns/activitystreams#Organization"
260
+ - "https://www.w3.org/ns/activitystreams#Person"
261
+ - "https://www.w3.org/ns/activitystreams#Service"
@@ -242,3 +242,20 @@ properties:
242
242
  description: Whether the actor allows to be indexed.
243
243
  range:
244
244
  - "http://www.w3.org/2001/XMLSchema#boolean"
245
+
246
+ - pluralName: aliases
247
+ singularName: alias
248
+ singularAccessor: true
249
+ compactName: alsoKnownAs
250
+ uri: "https://www.w3.org/ns/activitystreams#alsoKnownAs"
251
+ description: |
252
+ The `aliases` (`alsoKnownAs`) property is used to specify alternative names
253
+ or aliases for an entity. It can be used to provide additional identifiers
254
+ or labels for an entity, which can be useful in scenarios where an entity
255
+ may have multiple names or aliases.
256
+ range:
257
+ - "https://www.w3.org/ns/activitystreams#Application"
258
+ - "https://www.w3.org/ns/activitystreams#Group"
259
+ - "https://www.w3.org/ns/activitystreams#Organization"
260
+ - "https://www.w3.org/ns/activitystreams#Person"
261
+ - "https://www.w3.org/ns/activitystreams#Service"
@@ -242,3 +242,20 @@ properties:
242
242
  description: Whether the actor allows to be indexed.
243
243
  range:
244
244
  - "http://www.w3.org/2001/XMLSchema#boolean"
245
+
246
+ - pluralName: aliases
247
+ singularName: alias
248
+ singularAccessor: true
249
+ compactName: alsoKnownAs
250
+ uri: "https://www.w3.org/ns/activitystreams#alsoKnownAs"
251
+ description: |
252
+ The `aliases` (`alsoKnownAs`) property is used to specify alternative names
253
+ or aliases for an entity. It can be used to provide additional identifiers
254
+ or labels for an entity, which can be useful in scenarios where an entity
255
+ may have multiple names or aliases.
256
+ range:
257
+ - "https://www.w3.org/ns/activitystreams#Application"
258
+ - "https://www.w3.org/ns/activitystreams#Group"
259
+ - "https://www.w3.org/ns/activitystreams#Organization"
260
+ - "https://www.w3.org/ns/activitystreams#Person"
261
+ - "https://www.w3.org/ns/activitystreams#Service"
@@ -242,3 +242,20 @@ properties:
242
242
  description: Whether the actor allows to be indexed.
243
243
  range:
244
244
  - "http://www.w3.org/2001/XMLSchema#boolean"
245
+
246
+ - pluralName: aliases
247
+ singularName: alias
248
+ singularAccessor: true
249
+ compactName: alsoKnownAs
250
+ uri: "https://www.w3.org/ns/activitystreams#alsoKnownAs"
251
+ description: |
252
+ The `aliases` (`alsoKnownAs`) property is used to specify alternative names
253
+ or aliases for an entity. It can be used to provide additional identifiers
254
+ or labels for an entity, which can be useful in scenarios where an entity
255
+ may have multiple names or aliases.
256
+ range:
257
+ - "https://www.w3.org/ns/activitystreams#Application"
258
+ - "https://www.w3.org/ns/activitystreams#Group"
259
+ - "https://www.w3.org/ns/activitystreams#Organization"
260
+ - "https://www.w3.org/ns/activitystreams#Person"
261
+ - "https://www.w3.org/ns/activitystreams#Service"