@fedify/fedify 2.0.33-dev.2393 → 2.0.33-dev.2414
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/{assert_rejects-B-qJtC9Z.mjs → assert_rejects-WyYSTDDX.mjs} +2 -20
- package/dist/{assert_throws-4NwKEy2q.mjs → assert_throws-D4DNWrux.mjs} +19 -1
- package/dist/{builder-CXfNALL3.mjs → builder-oPN-KAgG.mjs} +3 -3
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{deno-gcSIfd7z.mjs → deno-v7kfTDw9.mjs} +1 -1
- package/dist/{docloader-BrE3qvhE.mjs → docloader-C40rdqSR.mjs} +4 -2
- package/dist/federation/builder.test.mjs +3 -3
- package/dist/federation/collection.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +258 -9
- package/dist/federation/idempotency.test.mjs +3 -3
- package/dist/federation/inbox.test.mjs +25 -2
- package/dist/federation/kv.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +128 -10
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/mq.test.mjs +2 -2
- package/dist/federation/negotiation.test.mjs +2 -2
- package/dist/federation/retry.test.mjs +1 -1
- package/dist/federation/router.test.mjs +2 -3
- package/dist/federation/send.test.mjs +7 -6
- package/dist/federation/temporal.test.mjs +3 -3
- package/dist/federation/webfinger.test.mjs +2 -2
- package/dist/{http-3dkQNA1w.mjs → http-BRdkmpRl.mjs} +2 -2
- package/dist/{http-DNB4QPDJ.cjs → http-CytEl2_x.cjs} +1 -1
- package/dist/{http-DN8o81eH.js → http-i02DDItX.js} +1 -1
- package/dist/{inbox-CfYQavNK.mjs → inbox-Bj-VABWa.mjs} +23 -10
- package/dist/{key-CA6cey0A.mjs → key-qe6uT5ER.mjs} +1 -1
- package/dist/{kv-cache-C1QP476R.cjs → kv-cache-CCCwr3Y2.cjs} +3 -1
- package/dist/{kv-cache-CCRkxYgt.js → kv-cache-DT2Fk4wy.js} +3 -1
- package/dist/{ld-CXDOgt96.mjs → ld-gf5riP2W.mjs} +2 -2
- package/dist/{middleware-CZLYu_JD.cjs → middleware-BDniN395.cjs} +1 -1
- package/dist/{middleware-Bzq026Pv.cjs → middleware-C_ybJNaa.cjs} +103 -33
- package/dist/{middleware-CTeSxNlY.mjs → middleware-GCF6LA-a.mjs} +1 -1
- package/dist/{middleware-_zoXQhgI.mjs → middleware-a9um4sWr.mjs} +89 -32
- package/dist/{middleware-Co6UpHXs.js → middleware-rrNFt8Ia.js} +102 -32
- package/dist/mod.cjs +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/client.test.mjs +1 -1
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/nodeinfo/types.test.mjs +2 -2
- package/dist/otel/exporter.test.mjs +1 -1
- package/dist/{owner-BjEWxmUB.mjs → owner-DRXYR3jY.mjs} +2 -2
- package/dist/{proof-BoU5V41s.cjs → proof-BS0ckB77.cjs} +1 -1
- package/dist/{proof-Bql3eTTO.mjs → proof-DYP1abqL.mjs} +2 -2
- package/dist/{proof-dP1Plnno.js → proof-PVc8vCvO.js} +1 -1
- package/dist/{send-C3QelZDB.mjs → send-CVlj4zuA.mjs} +2 -2
- package/dist/sig/http.test.mjs +5 -5
- package/dist/sig/key.test.mjs +5 -5
- package/dist/sig/ld.test.mjs +4 -4
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +3 -3
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/{std__assert-BUOJXi-Z.mjs → std__assert-DflMZha5.mjs} +2 -2
- package/dist/{temporal-DfRW9i0G.mjs → temporal-BwiXwu1s.mjs} +1 -1
- package/dist/utils/docloader.test.mjs +74 -4
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +5 -5
- /package/dist/{assert_not_equals--wG9hV7u.mjs → assert_not_equals-BkxW5QJI.mjs} +0 -0
package/dist/sig/owner.test.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import {
|
|
5
|
+
import "../std__assert-DflMZha5.mjs";
|
|
6
|
+
import { r as assertFalse } from "../assert_throws-D4DNWrux.mjs";
|
|
7
7
|
import { t as assert } from "../assert-BhQd8QHP.mjs";
|
|
8
8
|
import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-CCxRJhWa.mjs";
|
|
9
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-
|
|
9
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DRXYR3jY.mjs";
|
|
10
10
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
11
11
|
import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
|
|
12
12
|
//#region src/sig/owner.test.ts
|
package/dist/sig/proof.test.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
|
|
5
|
+
import "../std__assert-DflMZha5.mjs";
|
|
7
6
|
import { n as assertInstanceOf } from "../assert-BhQd8QHP.mjs";
|
|
7
|
+
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
8
8
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
|
|
9
|
-
import { i as verifyProof, n as signObject, r as verifyObject, t as createProof } from "../proof-
|
|
9
|
+
import { i as verifyProof, n as signObject, r as verifyObject, t as createProof } from "../proof-DYP1abqL.mjs";
|
|
10
10
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
11
11
|
import { Create, DataIntegrityProof, Multikey, Note, Place } from "@fedify/vocab";
|
|
12
12
|
import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
|
|
@@ -2,8 +2,8 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { a as red, i as buildMessage, l as AssertionError, n as diffStr, r as diff, s as format } from "./assert_equals-Ew3jOFa3.mjs";
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
5
|
+
import "./assert_throws-D4DNWrux.mjs";
|
|
6
|
+
import "./assert_rejects-WyYSTDDX.mjs";
|
|
7
7
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_exists.js
|
|
8
8
|
/**
|
|
9
9
|
* Make an assertion that actual is not null or undefined.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { c as getNormalizationContextLoader } from "./ld-
|
|
4
|
+
import { c as getNormalizationContextLoader } from "./ld-gf5riP2W.mjs";
|
|
5
5
|
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
6
6
|
//#region src/federation/temporal.ts
|
|
7
7
|
function isPlainObject(value) {
|
|
@@ -3,11 +3,11 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as esm_default } from "../esm-DVILvP5e.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
|
-
import "../std__assert-
|
|
7
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
8
|
-
import { l as verifyRequest } from "../http-
|
|
6
|
+
import "../std__assert-DflMZha5.mjs";
|
|
7
|
+
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
8
|
+
import { l as verifyRequest } from "../http-BRdkmpRl.mjs";
|
|
9
9
|
import { i as rsaPrivateKey2 } from "../keys-CCxRJhWa.mjs";
|
|
10
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
10
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-C40rdqSR.mjs";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
import { FetchError, UrlError } from "@fedify/vocab-runtime";
|
|
13
13
|
import { configure, reset } from "@logtape/logtape";
|
|
@@ -445,5 +445,75 @@ test("getAuthenticatedDocumentLoader() rejects cancellation before fetching", as
|
|
|
445
445
|
esm_default.hardReset();
|
|
446
446
|
}
|
|
447
447
|
});
|
|
448
|
+
const unsupportedUrls = [
|
|
449
|
+
"ftp://example.com/collection",
|
|
450
|
+
"file:///collection",
|
|
451
|
+
`data:application/ld+json,${encodeURIComponent(JSON.stringify({ id: "https://example.com/data" }))}`
|
|
452
|
+
];
|
|
453
|
+
function isUnsupportedProtocolError(error, url) {
|
|
454
|
+
return error instanceof UrlError && error.message === `Unsupported protocol: ${new URL(url).protocol}` && error.reason === "disallowed";
|
|
455
|
+
}
|
|
456
|
+
async function withFetchStub(respond, callback) {
|
|
457
|
+
const fetched = [];
|
|
458
|
+
const originalFetch = globalThis.fetch;
|
|
459
|
+
globalThis.fetch = ((input, init) => {
|
|
460
|
+
const request = input instanceof Request && init == null ? input : new Request(input, init);
|
|
461
|
+
fetched.push(request);
|
|
462
|
+
return Promise.resolve(respond(request));
|
|
463
|
+
});
|
|
464
|
+
try {
|
|
465
|
+
await callback(fetched);
|
|
466
|
+
} finally {
|
|
467
|
+
globalThis.fetch = originalFetch;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
for (const url of unsupportedUrls) {
|
|
471
|
+
const scheme = new URL(url).protocol;
|
|
472
|
+
const loader = getAuthenticatedDocumentLoader({
|
|
473
|
+
keyId: new URL("https://example.com/key2"),
|
|
474
|
+
privateKey: rsaPrivateKey2
|
|
475
|
+
}, { allowPrivateAddress: true });
|
|
476
|
+
test(`getAuthenticatedDocumentLoader() rejects ${scheme} URLs with private addresses allowed before fetching`, async () => {
|
|
477
|
+
await withFetchStub(() => Response.json({}), async (fetched) => {
|
|
478
|
+
await rejects(loader(url), (e) => isUnsupportedProtocolError(e, url));
|
|
479
|
+
deepStrictEqual(fetched, []);
|
|
480
|
+
});
|
|
481
|
+
});
|
|
482
|
+
test(`getAuthenticatedDocumentLoader() rejects redirects to ${scheme} URLs with private addresses allowed`, async () => {
|
|
483
|
+
const start = "https://example.com/redirect-to-unsupported";
|
|
484
|
+
await withFetchStub(() => Response.redirect(url, 302), async (fetched) => {
|
|
485
|
+
await rejects(loader(start), (e) => isUnsupportedProtocolError(e, url));
|
|
486
|
+
deepStrictEqual(fetched.map((r) => r.url), [start]);
|
|
487
|
+
});
|
|
488
|
+
});
|
|
489
|
+
for (const firstSpec of ["rfc9421", "draft-cavage-http-signatures-12"]) test(`getAuthenticatedDocumentLoader() rejects redirects to ${scheme} URLs after signature fallback from ${firstSpec}`, async () => {
|
|
490
|
+
const start = "https://example.com/fallback-redirect-to-unsupported";
|
|
491
|
+
const fallbackLoader = getAuthenticatedDocumentLoader({
|
|
492
|
+
keyId: new URL("https://example.com/key2"),
|
|
493
|
+
privateKey: rsaPrivateKey2
|
|
494
|
+
}, {
|
|
495
|
+
allowPrivateAddress: true,
|
|
496
|
+
specDeterminer: {
|
|
497
|
+
determineSpec: () => firstSpec,
|
|
498
|
+
rememberSpec: () => {}
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
await withFetchStub((request) => request.headers.has("Signature-Input") === (firstSpec === "rfc9421") ? new Response("Unauthorized", { status: 401 }) : Response.redirect(url, 302), async (fetched) => {
|
|
502
|
+
await rejects(fallbackLoader(start), (e) => isUnsupportedProtocolError(e, url));
|
|
503
|
+
deepStrictEqual(fetched.map((r) => r.url), [start, start]);
|
|
504
|
+
deepStrictEqual(fetched.map((r) => r.headers.has("Signature-Input")), [firstSpec === "rfc9421", firstSpec !== "rfc9421"]);
|
|
505
|
+
});
|
|
506
|
+
});
|
|
507
|
+
for (const html of [false, true]) test(`getAuthenticatedDocumentLoader() rejects ${html ? "HTML" : "Link header"} alternates to ${scheme} URLs with private addresses allowed`, async () => {
|
|
508
|
+
const start = "https://example.com/alternate-to-unsupported";
|
|
509
|
+
await withFetchStub(() => html ? new Response(`<link rel="alternate" type="application/activity+json" href="${url}">`, { headers: { "Content-Type": "text/html" } }) : new Response("", { headers: {
|
|
510
|
+
"Content-Type": "text/plain",
|
|
511
|
+
Link: `<${url}>; rel="alternate"; type="application/activity+json"`
|
|
512
|
+
} }), async (fetched) => {
|
|
513
|
+
await rejects(loader(start), (e) => isUnsupportedProtocolError(e, url));
|
|
514
|
+
deepStrictEqual(fetched.map((r) => r.url), [start]);
|
|
515
|
+
});
|
|
516
|
+
});
|
|
517
|
+
}
|
|
448
518
|
//#endregion
|
|
449
519
|
export {};
|
package/dist/utils/mod.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const require_kv_cache = require("../kv-cache-
|
|
4
|
+
const require_kv_cache = require("../kv-cache-CCCwr3Y2.cjs");
|
|
5
5
|
exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
|
|
6
6
|
exports.kvCache = require_kv_cache.kvCache;
|
package/dist/utils/mod.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Temporal } from "@js-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-DT2Fk4wy.js";
|
|
4
4
|
export { getAuthenticatedDocumentLoader, kvCache };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/fedify",
|
|
3
|
-
"version": "2.0.33-dev.
|
|
3
|
+
"version": "2.0.33-dev.2414+98deefa2",
|
|
4
4
|
"description": "An ActivityPub server framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ActivityPub",
|
|
@@ -144,9 +144,9 @@
|
|
|
144
144
|
"uri-template-router": "^1.0.0",
|
|
145
145
|
"url-template": "^3.1.1",
|
|
146
146
|
"urlpattern-polyfill": "^10.1.0",
|
|
147
|
-
"@fedify/vocab": "2.0.33-dev.
|
|
148
|
-
"@fedify/
|
|
149
|
-
"@fedify/
|
|
147
|
+
"@fedify/vocab": "2.0.33-dev.2414+98deefa2",
|
|
148
|
+
"@fedify/vocab-runtime": "2.0.33-dev.2414+98deefa2",
|
|
149
|
+
"@fedify/webfinger": "2.0.33-dev.2414+98deefa2"
|
|
150
150
|
},
|
|
151
151
|
"devDependencies": {
|
|
152
152
|
"@std/assert": "npm:@jsr/std__assert@^0.226.0",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"typescript": "^6.0.0",
|
|
160
160
|
"wrangler": "^4.17.0",
|
|
161
161
|
"@fedify/fixture": "2.0.0",
|
|
162
|
-
"@fedify/vocab-tools": "^2.0.33-dev.
|
|
162
|
+
"@fedify/vocab-tools": "^2.0.33-dev.2414+98deefa2"
|
|
163
163
|
},
|
|
164
164
|
"scripts": {
|
|
165
165
|
"build:self": "tsdown",
|
|
File without changes
|