@fedify/fedify 1.1.0-dev.446 → 1.1.0

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.
package/CHANGES.md CHANGED
@@ -6,7 +6,7 @@ Fedify changelog
6
6
  Version 1.1.0
7
7
  -------------
8
8
 
9
- To be released.
9
+ Released on October 20, 2024.
10
10
 
11
11
  - Added utility functions for traversing remote collections. [[#150]]
12
12
 
@@ -16,6 +16,25 @@ To be released.
16
16
 
17
17
  - Added `EmojiReact` class to Activity Vocabulary API. [[FEP-c0e0]]
18
18
 
19
+ - Added `successor` property to the `Actor` types in the Activity
20
+ Vocabulary API.
21
+
22
+ - Added `Application.getSuccessor()` method.
23
+ - `new Application()` constructor now accepts `successor` option.
24
+ - `Application.clone()` method now accepts `successor` option.
25
+ - Added `Group.getSuccessor()` method.
26
+ - `new Group()` constructor now accepts `successor` option.
27
+ - `Group.clone()` method now accepts `successor` option.
28
+ - Added `Organization.getSuccessor()` method.
29
+ - `new Organization()` constructor now accepts `successor` option.
30
+ - `Organization.clone()` method now accepts `successor` option.
31
+ - Added `Person.getSuccessor()` method.
32
+ - `new Person()` constructor now accepts `successor` option.
33
+ - `Person.clone()` method now accepts `successor` option.
34
+ - Added `Service.getSuccessor()` method.
35
+ - `new Service()` constructor now accepts `successor` option.
36
+ - `Service.clone()` method now accepts `successor` option.
37
+
19
38
  - Added `DidService` class to Activity Vocabulary API.
20
39
  [[FEP-9091], [#146]]
21
40
 
@@ -56,11 +75,30 @@ To be released.
56
75
  - `Service.clone()` method now accepts `service` option.
57
76
  - `Service.clone()` method now accepts `services` option.
58
77
 
78
+ - The default time window for verifying HTTP Signatures of incoming requests
79
+ is now an hour (was a minute). This new default window is according to
80
+ the [ActivityPub and HTTP Signatures] document.
81
+
82
+ - The default value of `VerifyRequestOptions.timeWindow` option became
83
+ `{ hours: 1 }` (was `{ minutes: 1 }`).
84
+
85
+ - The default value of `CreateFederationOptions.signatureTimeWindow`
86
+ option became `{ hours: 1 }` (was `{ minutes: 1 }`).
87
+
88
+ - The type of `VerifyRequestOptions.timeWindow` property became
89
+ `Temporal.Duration | Temporal.DurationLike | false`
90
+ (was `Temporal.DurationLike | false`).
91
+
92
+ - The type of `CreateFederationOptions.signatureTimeWindow` property
93
+ became `Temporal.Duration | Temporal.DurationLike | false`
94
+ (was `Temporal.DurationLike | false`).
95
+
59
96
  - In the `fedify inbox` command's web interface, the *Raw Activity* tab is
60
97
  added to show the raw JSON object of the received activity.
61
98
 
62
99
  [FEP-c0e0]: https://w3id.org/fep/c0e0
63
100
  [FEP-9091]: https://w3id.org/fep/9091
101
+ [ActivityPub and HTTP Signatures]: https://swicg.github.io/activitypub-http-signature/
64
102
  [#146]: https://github.com/dahlia/fedify/issues/146
65
103
  [#150]: https://github.com/dahlia/fedify/issues/150
66
104
 
@@ -101,7 +101,7 @@ export class FederationImpl {
101
101
  ? (identity) => getAuthenticatedDocumentLoader(identity, true)
102
102
  : getAuthenticatedDocumentLoader);
103
103
  this.onOutboxError = options.onOutboxError;
104
- this.signatureTimeWindow = options.signatureTimeWindow ?? { minutes: 1 };
104
+ this.signatureTimeWindow = options.signatureTimeWindow ?? { hours: 1 };
105
105
  this.skipSignatureVerification = options.skipSignatureVerification ?? false;
106
106
  this.outboxRetryPolicy = options.outboxRetryPolicy ??
107
107
  createExponentialBackoffPolicy();
package/esm/sig/http.js CHANGED
@@ -131,7 +131,8 @@ export async function verifyRequest(request, { documentLoader, contextLoader, ti
131
131
  const date = dntShim.Temporal.Instant.from(new Date(dateHeader).toISOString());
132
132
  const now = currentTime ?? dntShim.Temporal.Now.instant();
133
133
  if (timeWindow !== false) {
134
- const tw = timeWindow ?? { minutes: 1 };
134
+ const tw = timeWindow ??
135
+ { hours: 1 };
135
136
  if (dntShim.Temporal.Instant.compare(date, now.add(tw)) > 0) {
136
137
  logger.debug("Failed to verify; Date is too far in the future.", { date: date.toString(), now: now.toString() });
137
138
  return null;
@@ -15,6 +15,9 @@ defaultContext:
15
15
  "@id": "as:alsoKnownAs"
16
16
  "@type": "@id"
17
17
  manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
18
+ movedTo:
19
+ "@id": "as:movedTo"
20
+ "@type": "@id"
18
21
  toot: "http://joinmastodon.org/ns#"
19
22
  featured:
20
23
  "@id": "toot:featured"
@@ -248,6 +251,23 @@ properties:
248
251
  range:
249
252
  - "http://www.w3.org/2001/XMLSchema#boolean"
250
253
 
254
+ - singularName: successor
255
+ functional: true
256
+ compactName: movedTo
257
+ uri: "https://www.w3.org/ns/activitystreams#movedTo"
258
+ description: >-
259
+ Signifies that an actor has been moved to a different ID.
260
+ Used in Mastodon-style data portability with the {@link Move} activity;
261
+ see [ActivityPub Data Portability/Move
262
+ Action](https://swicg.github.io/activitypub-data-portability/#move-action)
263
+ for more details.
264
+ range:
265
+ - "https://www.w3.org/ns/activitystreams#Application"
266
+ - "https://www.w3.org/ns/activitystreams#Group"
267
+ - "https://www.w3.org/ns/activitystreams#Organization"
268
+ - "https://www.w3.org/ns/activitystreams#Person"
269
+ - "https://www.w3.org/ns/activitystreams#Service"
270
+
251
271
  - pluralName: aliases
252
272
  singularName: alias
253
273
  singularAccessor: true
@@ -15,6 +15,9 @@ defaultContext:
15
15
  "@id": "as:alsoKnownAs"
16
16
  "@type": "@id"
17
17
  manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
18
+ movedTo:
19
+ "@id": "as:movedTo"
20
+ "@type": "@id"
18
21
  toot: "http://joinmastodon.org/ns#"
19
22
  featured:
20
23
  "@id": "toot:featured"
@@ -248,6 +251,23 @@ properties:
248
251
  range:
249
252
  - "http://www.w3.org/2001/XMLSchema#boolean"
250
253
 
254
+ - singularName: successor
255
+ functional: true
256
+ compactName: movedTo
257
+ uri: "https://www.w3.org/ns/activitystreams#movedTo"
258
+ description: >-
259
+ Signifies that an actor has been moved to a different ID.
260
+ Used in Mastodon-style data portability with the {@link Move} activity;
261
+ see [ActivityPub Data Portability/Move
262
+ Action](https://swicg.github.io/activitypub-data-portability/#move-action)
263
+ for more details.
264
+ range:
265
+ - "https://www.w3.org/ns/activitystreams#Application"
266
+ - "https://www.w3.org/ns/activitystreams#Group"
267
+ - "https://www.w3.org/ns/activitystreams#Organization"
268
+ - "https://www.w3.org/ns/activitystreams#Person"
269
+ - "https://www.w3.org/ns/activitystreams#Service"
270
+
251
271
  - pluralName: aliases
252
272
  singularName: alias
253
273
  singularAccessor: true
@@ -15,6 +15,9 @@ defaultContext:
15
15
  "@id": "as:alsoKnownAs"
16
16
  "@type": "@id"
17
17
  manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
18
+ movedTo:
19
+ "@id": "as:movedTo"
20
+ "@type": "@id"
18
21
  toot: "http://joinmastodon.org/ns#"
19
22
  featured:
20
23
  "@id": "toot:featured"
@@ -248,6 +251,23 @@ properties:
248
251
  range:
249
252
  - "http://www.w3.org/2001/XMLSchema#boolean"
250
253
 
254
+ - singularName: successor
255
+ functional: true
256
+ compactName: movedTo
257
+ uri: "https://www.w3.org/ns/activitystreams#movedTo"
258
+ description: >-
259
+ Signifies that an actor has been moved to a different ID.
260
+ Used in Mastodon-style data portability with the {@link Move} activity;
261
+ see [ActivityPub Data Portability/Move
262
+ Action](https://swicg.github.io/activitypub-data-portability/#move-action)
263
+ for more details.
264
+ range:
265
+ - "https://www.w3.org/ns/activitystreams#Application"
266
+ - "https://www.w3.org/ns/activitystreams#Group"
267
+ - "https://www.w3.org/ns/activitystreams#Organization"
268
+ - "https://www.w3.org/ns/activitystreams#Person"
269
+ - "https://www.w3.org/ns/activitystreams#Service"
270
+
251
271
  - pluralName: aliases
252
272
  singularName: alias
253
273
  singularAccessor: true
@@ -15,6 +15,9 @@ defaultContext:
15
15
  "@id": "as:alsoKnownAs"
16
16
  "@type": "@id"
17
17
  manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
18
+ movedTo:
19
+ "@id": "as:movedTo"
20
+ "@type": "@id"
18
21
  toot: "http://joinmastodon.org/ns#"
19
22
  featured:
20
23
  "@id": "toot:featured"
@@ -248,6 +251,23 @@ properties:
248
251
  range:
249
252
  - "http://www.w3.org/2001/XMLSchema#boolean"
250
253
 
254
+ - singularName: successor
255
+ functional: true
256
+ compactName: movedTo
257
+ uri: "https://www.w3.org/ns/activitystreams#movedTo"
258
+ description: >-
259
+ Signifies that an actor has been moved to a different ID.
260
+ Used in Mastodon-style data portability with the {@link Move} activity;
261
+ see [ActivityPub Data Portability/Move
262
+ Action](https://swicg.github.io/activitypub-data-portability/#move-action)
263
+ for more details.
264
+ range:
265
+ - "https://www.w3.org/ns/activitystreams#Application"
266
+ - "https://www.w3.org/ns/activitystreams#Group"
267
+ - "https://www.w3.org/ns/activitystreams#Organization"
268
+ - "https://www.w3.org/ns/activitystreams#Person"
269
+ - "https://www.w3.org/ns/activitystreams#Service"
270
+
251
271
  - pluralName: aliases
252
272
  singularName: alias
253
273
  singularAccessor: true
@@ -15,6 +15,9 @@ defaultContext:
15
15
  "@id": "as:alsoKnownAs"
16
16
  "@type": "@id"
17
17
  manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
18
+ movedTo:
19
+ "@id": "as:movedTo"
20
+ "@type": "@id"
18
21
  toot: "http://joinmastodon.org/ns#"
19
22
  featured:
20
23
  "@id": "toot:featured"
@@ -248,6 +251,23 @@ properties:
248
251
  range:
249
252
  - "http://www.w3.org/2001/XMLSchema#boolean"
250
253
 
254
+ - singularName: successor
255
+ functional: true
256
+ compactName: movedTo
257
+ uri: "https://www.w3.org/ns/activitystreams#movedTo"
258
+ description: >-
259
+ Signifies that an actor has been moved to a different ID.
260
+ Used in Mastodon-style data portability with the {@link Move} activity;
261
+ see [ActivityPub Data Portability/Move
262
+ Action](https://swicg.github.io/activitypub-data-portability/#move-action)
263
+ for more details.
264
+ range:
265
+ - "https://www.w3.org/ns/activitystreams#Application"
266
+ - "https://www.w3.org/ns/activitystreams#Group"
267
+ - "https://www.w3.org/ns/activitystreams#Organization"
268
+ - "https://www.w3.org/ns/activitystreams#Person"
269
+ - "https://www.w3.org/ns/activitystreams#Service"
270
+
251
271
  - pluralName: aliases
252
272
  singularName: alias
253
273
  singularAccessor: true