Loading CHANGES.md +15 −3 Original line number Diff line number Diff line Loading @@ -8,6 +8,9 @@ Version 1.1.9 To be released. - Fixed idempotence check in inbox listeners to ensure activities for different origins are processed correctly. Version 1.1.8 ------------- Loading Loading @@ -256,10 +259,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]] Loading @@ -268,7 +280,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 Loading Loading @@ -325,7 +337,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]] Loading src/federation/handler.ts +5 −3 Original line number Diff line number Diff line Loading @@ -523,9 +523,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) { Loading src/federation/middleware.test.ts +33 −1 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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", { Loading src/federation/middleware.ts +1 −0 Original line number Diff line number Diff line Loading @@ -512,6 +512,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) { Loading Loading
CHANGES.md +15 −3 Original line number Diff line number Diff line Loading @@ -8,6 +8,9 @@ Version 1.1.9 To be released. - Fixed idempotence check in inbox listeners to ensure activities for different origins are processed correctly. Version 1.1.8 ------------- Loading Loading @@ -256,10 +259,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]] Loading @@ -268,7 +280,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 Loading Loading @@ -325,7 +337,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]] Loading
src/federation/handler.ts +5 −3 Original line number Diff line number Diff line Loading @@ -523,9 +523,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) { Loading
src/federation/middleware.test.ts +33 −1 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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", { Loading
src/federation/middleware.ts +1 −0 Original line number Diff line number Diff line Loading @@ -512,6 +512,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) { Loading