Skip to content

Commit

Permalink
Merge tag '1.3.1'
Browse files Browse the repository at this point in the history
Fedify 1.3.1
  • Loading branch information
dahlia committed Dec 11, 2024
2 parents 466e708 + befb38d commit a2aa108
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 7 deletions.
48 changes: 42 additions & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ Version 1.4.0
To be released.


Version 1.3.1
-------------

Released on December 11, 2024.

- Fixed idempotence check in inbox listeners to ensure activities for
different origins are processed correctly.


Version 1.3.0
-------------

Expand Down Expand Up @@ -126,6 +135,15 @@ Released on November 30, 2024.
[#193]: https://github.com/dahlia/fedify/issues/193


Version 1.2.9
-------------

Released on December 11, 2024.

- Fixed idempotence check in inbox listeners to ensure activities for
different origins are processed correctly.


Version 1.2.8
-------------

Expand All @@ -145,7 +163,7 @@ Released on November 23, 2024.
Version 1.2.7
-------------

Released on December 22, 2024.
Released on November 22, 2024.

- Fixed a bug where `lookupWebFinger()` function had thrown a `TypeError`
when the *.well-known/webfinger* redirects to a relative URI. [[#166]]
Expand All @@ -154,7 +172,7 @@ Released on December 22, 2024.
Version 1.2.6
-------------

Released on December 19, 2024.
Released on November 19, 2024.

- Fix a bug where `Actor`'s `inbox` and `outbox` properties had not been
able to be set to an `OrderedCollectionPage` object, even though it is
Expand Down Expand Up @@ -332,6 +350,15 @@ Released on October 31, 2024.
[#118]: https://github.com/dahlia/fedify/issues/118


Version 1.1.9
-------------

Released on December 11, 2024.

- Fixed idempotence check in inbox listeners to ensure activities for
different origins are processed correctly.


Version 1.1.8
-------------

Expand Down Expand Up @@ -417,7 +444,7 @@ Released on November 19, 2024.
Version 1.1.5
-------------

Released on December 14, 2024.
Released on November 14, 2024.

- Suppressed a `TypeError` with a message <q>unusable</q> due to Node.js's
mysterious behavior. [[#159]]
Expand Down Expand Up @@ -579,10 +606,19 @@ Released on October 20, 2024.
[#150]: https://github.com/dahlia/fedify/issues/150


Version 1.0.12
--------------

Released on December 11, 2024.

- Fixed idempotence check in inbox listeners to ensure activities for
different origins are processed correctly.


Version 1.0.11
--------------

Released on December 22, 2024.
Released on November 22, 2024.

- Fixed a bug where `lookupWebFinger()` function had thrown a `TypeError`
when the *.well-known/webfinger* redirects to a relative URI. [[#166]]
Expand All @@ -591,7 +627,7 @@ Released on December 22, 2024.
Version 1.0.10
--------------

Released on December 19, 2024.
Released on November 19, 2024.

- Fix a bug where `Actor`'s `inbox` and `outbox` properties had not been
able to be set to an `OrderedCollectionPage` object, even though it is
Expand Down Expand Up @@ -648,7 +684,7 @@ Released on December 19, 2024.
Version 1.0.9
-------------

Released on December 14, 2024.
Released on November 14, 2024.

- Suppressed a `TypeError` with a message <q>unusable</q> due to Node.js's
mysterious behavior. [[#159]]
Expand Down
1 change: 1 addition & 0 deletions src/federation/inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export async function routeActivity<TContextData>(
const logger = getLogger(["fedify", "federation", "inbox"]);
const cacheKey = activity.id == null ? null : [
...kvPrefixes.activityIdempotence,
ctx.origin,
activity.id.href,
] satisfies KvKey;
if (cacheKey != null) {
Expand Down
34 changes: 33 additions & 1 deletion src/federation/middleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,10 +671,11 @@ test("Federation.setInboxListeners()", async (t) => {
assertEquals(response.status, 401);

// Personal inbox + HTTP Signatures (RSA)
const activityPayload = await activity().toJsonLd(options);
let request = new Request("https://example.com/users/john/inbox", {
method: "POST",
headers: { "Content-Type": "application/activity+json" },
body: JSON.stringify(await activity().toJsonLd(options)),
body: JSON.stringify(activityPayload),
});
request = await signRequest(
request,
Expand All @@ -693,6 +694,37 @@ test("Federation.setInboxListeners()", async (t) => {
["https://example.com/person", "https://example.com/users/john#main-key"],
]);

// Idempotence check
response = await federation.fetch(request, { contextData: undefined });
assertEquals(inbox.length, 1);

// Idempotence check with different origin (host)
inbox.shift();
request = new Request("https://another.host/users/john/inbox", {
method: "POST",
headers: { "Content-Type": "application/activity+json" },
body: JSON.stringify(activityPayload),
});
request = await signRequest(
request,
rsaPrivateKey3,
new URL("https://example.com/person2#key3"),
);
response = await federation.fetch(request, { contextData: undefined });
assertEquals(inbox.length, 1);
assertEquals(inbox[0][1].actorId, new URL("https://example.com/person2"));
assertEquals(response.status, 202);

while (authenticatedRequests.length > 0) authenticatedRequests.shift();
assertEquals(authenticatedRequests, []);
await inbox[0][0].documentLoader("https://example.com/person");
assertEquals(authenticatedRequests, [
[
"https://example.com/person",
"https://another.host/users/john#main-key",
],
]);

// Shared inbox + HTTP Signatures (RSA)
inbox.shift();
request = new Request("https://example.com/inbox", {
Expand Down
1 change: 1 addition & 0 deletions src/federation/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ export class FederationImpl<TContextData> implements Federation<TContextData> {
}
const cacheKey = activity.id == null ? null : [
...this.kvPrefixes.activityIdempotence,
context.origin,
activity.id.href,
] satisfies KvKey;
if (cacheKey != null) {
Expand Down

0 comments on commit a2aa108

Please sign in to comment.