@fedify/fedify 2.5.0-dev.2420 → 2.5.0-dev.2432
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/dist/{builder-Cwc3Eu59.mjs → builder-nME5sBeL.mjs} +2 -2
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{compound-proof-Dtwrhs1I.mjs → compound-proof-C-tPcb-r.mjs} +2 -2
- package/dist/{deno-D4J5fszd.mjs → deno-Cqkt-KD5.mjs} +1 -1
- package/dist/{docloader-ChK1DQkj.mjs → docloader-CGBUQXUP.mjs} +5 -3
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/compound-fanout.test.mjs +3 -3
- package/dist/federation/handler-compound-proof.test.mjs +3 -3
- package/dist/federation/handler.test.mjs +4 -4
- package/dist/federation/hashlink-media.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox-report.test.mjs +5 -5
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/keycache.test.mjs +20 -9
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +90 -9
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/outgoing-proof.test.mjs +4 -4
- package/dist/federation/portable-actor.test.mjs +3 -3
- package/dist/federation/portable-chain.test.mjs +3 -3
- package/dist/federation/portable-collection.test.mjs +4 -4
- package/dist/federation/portable-delivery.test.mjs +2 -2
- package/dist/federation/portable-gateway-keys.test.mjs +5 -5
- package/dist/federation/portable-inbox.test.mjs +4 -4
- package/dist/federation/portable-parse-uri.test.mjs +1 -1
- package/dist/federation/portable-route-activity.test.mjs +2 -2
- package/dist/federation/portable.test.mjs +3 -3
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/tasks/enqueue.test.mjs +1 -1
- package/dist/federation/tasks/tasks.test.mjs +2 -2
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{federation-DxQI9dSY.cjs → federation-CM-zrOdz.cjs} +12 -5
- package/dist/{http-SBTDzPkh.cjs → http-C88K-3A8.cjs} +17 -3
- package/dist/{http-C8rIQ1pK.js → http-KKViNOVp.js} +17 -3
- package/dist/{http--kHQomKT.mjs → http-VRVl77qN.mjs} +4 -4
- package/dist/{inbox-BGD7K-Ra.mjs → inbox-Blrwn114.mjs} +2 -2
- package/dist/{keycache-D-MNltOk.mjs → keycache-N2opu4-3.mjs} +1 -1
- package/dist/{kv-cache-DSUypZWS.js → kv-cache-DBnYVLSn.js} +4 -2
- package/dist/{kv-cache-B8LMKVe8.mjs → kv-cache-Dt0qeX6M.mjs} +1 -1
- package/dist/{kv-cache-Dp_dDR1f.cjs → kv-cache-trql9zWb.cjs} +4 -2
- package/dist/{ld-BeBdBDAY.mjs → ld-C13upTHv.mjs} +18 -4
- package/dist/{metrics-Dtb81JxK.mjs → metrics-Ci3oTjhF.mjs} +1 -1
- package/dist/{middleware-DNjv5rBL.js → middleware-Ckc0daKd.js} +12 -5
- package/dist/{middleware-DhI-75xh.mjs → middleware-CzicgguP.mjs} +1 -1
- package/dist/{middleware-rQqAHzIo.mjs → middleware-Defzf-30.mjs} +23 -16
- package/dist/mod.cjs +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/{owner-u_-HQrgE.mjs → owner-BBB-PayE.mjs} +3 -3
- package/dist/{portable-collection-B-x4XwxP.cjs → portable-collection-Byajf90m.cjs} +1 -1
- package/dist/{portable-collection-BKkTJQTd.mjs → portable-collection-DKs8iX1J.mjs} +2 -2
- package/dist/{portable-collection-DReoGwZQ.js → portable-collection-sJBoBful.js} +1 -1
- package/dist/{portable-key-Bkm6sXJB.mjs → portable-key-zbE5iDhv.mjs} +1 -1
- package/dist/{proof-DOV4ZiAo.mjs → proof-DdI4I2Jg.mjs} +3 -3
- package/dist/{send-C_Fffu0I.mjs → send-DDSpf_ym.mjs} +3 -3
- package/dist/sig/compound-proof-discovery.test.mjs +1 -1
- package/dist/sig/compound-proof-producer.test.mjs +1 -1
- package/dist/sig/compound-proof-verification.test.mjs +2 -2
- package/dist/sig/compound-proof.test.mjs +2 -2
- package/dist/sig/http.test.mjs +3 -3
- package/dist/sig/key.test.mjs +196 -1
- package/dist/sig/ld.test.mjs +46 -1
- package/dist/sig/mitra-receive-interop.test.mjs +4 -4
- package/dist/sig/mitra-send-interop.test.mjs +3 -3
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +46 -1
- package/dist/sig/portable-collection.test.mjs +1 -1
- package/dist/sig/portable-interop.test.mjs +3 -3
- package/dist/sig/portable-key.test.mjs +6 -6
- package/dist/sig/proof.test.mjs +54 -3
- package/dist/sig/tootik-request-interop.test.mjs +4 -4
- package/dist/sig/tootik-send-interop.test.mjs +3 -3
- package/dist/sig/verification.test.mjs +3 -3
- package/dist/{temporal-BRgOZRRr.mjs → temporal-CGJWetE6.mjs} +1 -1
- package/dist/testing/kv.test.mjs +1 -1
- package/dist/utils/docloader.test.mjs +66 -2
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +6 -6
package/dist/testing/kv.test.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
6
6
|
import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
|
|
7
7
|
import { n as baseOptions, o as stringSchema, t as MockQueue } from "../tasks-IG3pHfvZ.mjs";
|
|
8
8
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
9
|
-
import { o as createFederation } from "../middleware-
|
|
9
|
+
import { o as createFederation } from "../middleware-Defzf-30.mjs";
|
|
10
10
|
//#region src/testing/kv.test.ts
|
|
11
11
|
test("ManualClockKvStore keeps an entry at its exact expiration instant", async () => {
|
|
12
12
|
const kv = new ManualClockKvStore();
|
|
@@ -5,9 +5,9 @@ import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
6
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
7
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
8
|
-
import { f as verifyRequest } from "../http
|
|
8
|
+
import { f as verifyRequest } from "../http-VRVl77qN.mjs";
|
|
9
9
|
import { i as rsaPrivateKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
10
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
10
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-CGBUQXUP.mjs";
|
|
11
11
|
import { configure, reset } from "@logtape/logtape";
|
|
12
12
|
import { FetchError, UrlError } from "@fedify/vocab-runtime";
|
|
13
13
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -635,6 +635,70 @@ const unsupportedUrls = [
|
|
|
635
635
|
"file:///collection",
|
|
636
636
|
`data:application/ld+json,${encodeURIComponent(JSON.stringify({ id: "https://example.com/data" }))}`
|
|
637
637
|
];
|
|
638
|
+
function isCredentialUrlError(error) {
|
|
639
|
+
return error instanceof UrlError && error.reason === "disallowed" && error.message === "URLs with credentials are not allowed";
|
|
640
|
+
}
|
|
641
|
+
test("getAuthenticatedDocumentLoader() rejects URLs with credentials", async (t) => {
|
|
642
|
+
const identity = {
|
|
643
|
+
keyId: new URL("https://example.com/key2"),
|
|
644
|
+
privateKey: rsaPrivateKey2
|
|
645
|
+
};
|
|
646
|
+
const start = "https://8.8.8.8/start";
|
|
647
|
+
const target = "https://user:pass@8.8.8.8/document";
|
|
648
|
+
for (const allowPrivateAddress of [false, true]) {
|
|
649
|
+
const loader = getAuthenticatedDocumentLoader(identity, { allowPrivateAddress });
|
|
650
|
+
for (const path of [
|
|
651
|
+
"direct",
|
|
652
|
+
"redirect",
|
|
653
|
+
"Link",
|
|
654
|
+
"HTML"
|
|
655
|
+
]) await t.step(`${path}, allowPrivateAddress=${allowPrivateAddress}`, async () => {
|
|
656
|
+
await withFetchStub((request) => {
|
|
657
|
+
if (request.url !== start) return Response.json({});
|
|
658
|
+
if (path === "redirect") return Response.redirect(target, 302);
|
|
659
|
+
if (path === "HTML") return new Response(`<link rel="alternate" type="application/activity+json" href="${target}">`, { headers: { "Content-Type": "text/html" } });
|
|
660
|
+
return new Response("", { headers: {
|
|
661
|
+
"Content-Type": "text/plain",
|
|
662
|
+
Link: `<${target}>; rel="alternate"; type="application/activity+json"`
|
|
663
|
+
} });
|
|
664
|
+
}, async (fetched) => {
|
|
665
|
+
await rejects(loader(path === "direct" ? target : start), isCredentialUrlError);
|
|
666
|
+
deepStrictEqual(fetched.map((r) => r.url), path === "direct" ? [] : [start]);
|
|
667
|
+
});
|
|
668
|
+
});
|
|
669
|
+
for (const url of [
|
|
670
|
+
"https://user@8.8.8.8/document",
|
|
671
|
+
"https://:pass@8.8.8.8/document",
|
|
672
|
+
"https://%75ser:p%40ss@8.8.8.8/document",
|
|
673
|
+
"http://user:pass@8.8.8.8/document"
|
|
674
|
+
]) await t.step(`${url}, allowPrivateAddress=${allowPrivateAddress}`, async () => {
|
|
675
|
+
await withFetchStub(() => Response.json({}), async (fetched) => {
|
|
676
|
+
await rejects(loader(url), isCredentialUrlError);
|
|
677
|
+
deepStrictEqual(fetched, []);
|
|
678
|
+
});
|
|
679
|
+
});
|
|
680
|
+
for (const url of ["https://:@8.8.8.8/document", "https://8.8.8.8/@user?q=@pass"]) await t.step(`allows ${url}, allowPrivateAddress=${allowPrivateAddress}`, async () => {
|
|
681
|
+
await withFetchStub(() => Response.json({ done: true }), async (fetched) => {
|
|
682
|
+
deepStrictEqual((await loader(url)).document, { done: true });
|
|
683
|
+
deepStrictEqual(fetched.map((r) => r.url), [new URL(url).href]);
|
|
684
|
+
});
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
for (const firstSpec of ["rfc9421", "draft-cavage-http-signatures-12"]) await t.step(`redirect after fallback from ${firstSpec}`, async () => {
|
|
688
|
+
const loader = getAuthenticatedDocumentLoader(identity, {
|
|
689
|
+
allowPrivateAddress: true,
|
|
690
|
+
specDeterminer: {
|
|
691
|
+
determineSpec: () => firstSpec,
|
|
692
|
+
rememberSpec: () => {}
|
|
693
|
+
}
|
|
694
|
+
});
|
|
695
|
+
await withFetchStub((request) => request.url !== start ? Response.json({}) : request.headers.has("Signature-Input") === (firstSpec === "rfc9421") ? new Response(null, { status: 401 }) : Response.redirect(target, 302), async (fetched) => {
|
|
696
|
+
await rejects(loader(start), isCredentialUrlError);
|
|
697
|
+
deepStrictEqual(fetched.map((r) => r.url), [start, start]);
|
|
698
|
+
deepStrictEqual(fetched.map((r) => r.headers.has("Signature-Input")), [firstSpec === "rfc9421", firstSpec !== "rfc9421"]);
|
|
699
|
+
});
|
|
700
|
+
});
|
|
701
|
+
});
|
|
638
702
|
function isUnsupportedProtocolError(error, url) {
|
|
639
703
|
return error instanceof UrlError && error.message === `Unsupported protocol: ${new URL(url).protocol}` && error.reason === "disallowed";
|
|
640
704
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as kvCache, t as MockKvStore } from "../kv-cache-
|
|
4
|
+
import { n as kvCache, t as MockKvStore } from "../kv-cache-Dt0qeX6M.mjs";
|
|
5
5
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
6
6
|
import { deepStrictEqual, throws } from "node:assert";
|
|
7
7
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
package/dist/utils/mod.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_kv_cache = require("../kv-cache-
|
|
3
|
+
const require_kv_cache = require("../kv-cache-trql9zWb.cjs");
|
|
4
4
|
exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
|
|
5
5
|
exports.kvCache = require_kv_cache.kvCache;
|
package/dist/utils/mod.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-
|
|
3
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-DBnYVLSn.js";
|
|
4
4
|
export { getAuthenticatedDocumentLoader, kvCache };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/fedify",
|
|
3
|
-
"version": "2.5.0-dev.
|
|
3
|
+
"version": "2.5.0-dev.2432+f56118e1",
|
|
4
4
|
"description": "An ActivityPub server framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ActivityPub",
|
|
@@ -151,10 +151,10 @@
|
|
|
151
151
|
"structured-field-values": "^2.0.4",
|
|
152
152
|
"temporal-polyfill": "^1.0.1",
|
|
153
153
|
"urlpattern-polyfill": "^10.1.0",
|
|
154
|
-
"@fedify/uri-template": "2.5.0-dev.
|
|
155
|
-
"@fedify/vocab
|
|
156
|
-
"@fedify/vocab": "2.5.0-dev.
|
|
157
|
-
"@fedify/webfinger": "2.5.0-dev.
|
|
154
|
+
"@fedify/uri-template": "2.5.0-dev.2432+f56118e1",
|
|
155
|
+
"@fedify/vocab": "2.5.0-dev.2432+f56118e1",
|
|
156
|
+
"@fedify/vocab-runtime": "2.5.0-dev.2432+f56118e1",
|
|
157
|
+
"@fedify/webfinger": "2.5.0-dev.2432+f56118e1"
|
|
158
158
|
},
|
|
159
159
|
"devDependencies": {
|
|
160
160
|
"@std/assert": "npm:@jsr/std__assert@^0.226.0",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"typescript": "^6.0.0",
|
|
168
168
|
"wrangler": "^4.17.0",
|
|
169
169
|
"@fedify/fixture": "2.0.0",
|
|
170
|
-
"@fedify/vocab-tools": "^2.5.0-dev.
|
|
170
|
+
"@fedify/vocab-tools": "^2.5.0-dev.2432+f56118e1"
|
|
171
171
|
},
|
|
172
172
|
"scripts": {
|
|
173
173
|
"build:self": "tsdown",
|