Unverified Commit c2a40f54 authored by Hong Minhee's avatar Hong Minhee
Browse files

Merge tag '1.1.9' into 1.2-maintenance

Fedify 1.1.9
parents 6c9ac032 d7814b20
Loading
Loading
Loading
Loading
+25 −4
Original line number Diff line number Diff line
@@ -9,6 +9,9 @@ Version 1.2.9

To be released.

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


Version 1.2.8
-------------
@@ -216,6 +219,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
-------------

@@ -301,7 +313,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]]
@@ -463,10 +475,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]]
@@ -475,7 +496,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
@@ -532,7 +553,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]]
+5 −3
Original line number Diff line number Diff line
@@ -524,9 +524,11 @@ export async function handleInbox<TContextData>(
    }
    activity = await Activity.fromJsonLd(jsonWithoutSig, context);
  }
  const cacheKey = activity.id == null
    ? null
    : [...kvPrefixes.activityIdempotence, activity.id.href] satisfies KvKey;
  const cacheKey = activity.id == null ? null : [
    ...kvPrefixes.activityIdempotence,
    context.origin,
    activity.id.href,
  ] satisfies KvKey;
  if (cacheKey != null) {
    const cached = await kv.get(cacheKey);
    if (cached === true) {
+33 −1
Original line number Diff line number Diff line
@@ -665,10 +665,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,
@@ -687,6 +688,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", {
+1 −0
Original line number Diff line number Diff line
@@ -514,6 +514,7 @@ export class FederationImpl<TContextData> implements Federation<TContextData> {
    const activity = await Activity.fromJsonLd(message.activity, context);
    const cacheKey = activity.id == null ? null : [
      ...this.kvPrefixes.activityIdempotence,
      context.origin,
      activity.id.href,
    ] satisfies KvKey;
    if (cacheKey != null) {