@fedify/fedify 2.0.7-pr.639.14 → 2.0.8
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-DDJvNdF6.js → builder-B5cKln9v.js} +3 -3
- package/dist/compat/transformers.test.js +12 -12
- package/dist/{deno-DRNouYGU.js → deno-4w047OFk.js} +1 -1
- package/dist/{docloader-azyNM4Y1.js → docloader-CBHh0rC5.js} +2 -2
- package/dist/federation/builder.test.js +3 -3
- package/dist/federation/handler.test.js +12 -12
- package/dist/federation/idempotency.test.js +12 -12
- package/dist/federation/inbox.test.js +2 -2
- package/dist/federation/keycache.test.js +5 -1
- package/dist/federation/middleware.test.js +12 -12
- package/dist/federation/mod.cjs +4 -4
- package/dist/federation/mod.js +4 -4
- package/dist/federation/send.test.js +5 -5
- package/dist/federation/webfinger.test.js +12 -12
- package/dist/{http-EGn7FcIM.js → http-Br3-1dRf.js} +18 -6
- package/dist/{http-BH8CU4ao.js → http-C_RwU_oN.js} +17 -6
- package/dist/{http-BYYABt7k.cjs → http-DGs_78tx.cjs} +17 -6
- package/dist/{inbox-CnmCW_8k.js → inbox-3bZUqDLE.js} +1 -1
- package/dist/{key-D0avVSWO.js → key-D7Y_J9kt.js} +1 -1
- package/dist/{keycache-DRxpZ5r9.js → keycache-BASM0rrX.js} +10 -1
- package/dist/{kv-cache-BKJvu3Pa.cjs → kv-cache-9PANi4tA.cjs} +1 -1
- package/dist/{kv-cache-CoNCzZp2.js → kv-cache-CMM5VJsc.js} +1 -1
- package/dist/{ld-CJtCj7TF.js → ld-Bjq9Z4St.js} +2 -2
- package/dist/{middleware-Dwcyv5Jd.js → middleware-B73ZyDmk.js} +4 -4
- package/dist/{middleware-CY9EW5RW.js → middleware-Bj30TZll.js} +15 -6
- package/dist/{middleware-C7IMURKV.cjs → middleware-CQeA5yF7.cjs} +15 -6
- package/dist/{middleware-CIiMan37.js → middleware-DozhKfB6.js} +11 -11
- package/dist/middleware-Dr61i4Jo.cjs +12 -0
- package/dist/{middleware-BdfGWA3u.js → middleware-_1PYruC5.js} +12 -12
- package/dist/mod.cjs +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.js +12 -12
- package/dist/{owner-BNhqTvp9.js → owner-CImU2dKz.js} +1 -1
- package/dist/{proof-Cl9IbZ-7.js → proof-BygvN4r5.js} +2 -2
- package/dist/{proof-CxmA6b9R.js → proof-DLL0MLmV.js} +2 -2
- package/dist/{proof-DTDfsYzH.cjs → proof-UhA5do8k.cjs} +2 -2
- package/dist/{send-wVMWF0hP.js → send-DbW03azY.js} +2 -2
- package/dist/sig/http.test.js +46 -3
- package/dist/sig/key.test.js +2 -2
- package/dist/sig/ld.test.js +3 -3
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.js +3 -3
- package/dist/sig/proof.test.js +3 -3
- package/dist/utils/docloader.test.js +4 -4
- package/dist/utils/mod.cjs +2 -2
- package/dist/utils/mod.js +2 -2
- package/package.json +5 -5
- package/dist/middleware-CSMjcpDB.cjs +0 -12
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./deno-
|
|
6
|
+
import { deno_default } from "./deno-4w047OFk.js";
|
|
7
7
|
import { Router, RouterError } from "./router-D9eI0s4b.js";
|
|
8
|
-
import { InboxListenerSet } from "./inbox-
|
|
8
|
+
import { InboxListenerSet } from "./inbox-3bZUqDLE.js";
|
|
9
9
|
import { getTypeId } from "@fedify/vocab";
|
|
10
10
|
import { getLogger } from "@logtape/logtape";
|
|
11
11
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -45,7 +45,7 @@ var FederationBuilderImpl = class {
|
|
|
45
45
|
this.collectionTypeIds = {};
|
|
46
46
|
}
|
|
47
47
|
async build(options) {
|
|
48
|
-
const { FederationImpl } = await import("./middleware-
|
|
48
|
+
const { FederationImpl } = await import("./middleware-_1PYruC5.js");
|
|
49
49
|
const f = new FederationImpl(options);
|
|
50
50
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
51
51
|
f.router = this.router.clone();
|
|
@@ -7,25 +7,25 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
7
7
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
8
8
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
9
9
|
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
10
|
-
import "../deno-
|
|
11
|
-
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-
|
|
10
|
+
import "../deno-4w047OFk.js";
|
|
11
|
+
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-DozhKfB6.js";
|
|
12
12
|
import "../client-CoCIaTNO.js";
|
|
13
13
|
import "../router-D9eI0s4b.js";
|
|
14
14
|
import "../types-CPz01LGH.js";
|
|
15
|
-
import "../key-
|
|
16
|
-
import "../http-
|
|
17
|
-
import "../ld-
|
|
18
|
-
import "../owner-
|
|
19
|
-
import "../proof-
|
|
20
|
-
import "../docloader-
|
|
15
|
+
import "../key-D7Y_J9kt.js";
|
|
16
|
+
import "../http-Br3-1dRf.js";
|
|
17
|
+
import "../ld-Bjq9Z4St.js";
|
|
18
|
+
import "../owner-CImU2dKz.js";
|
|
19
|
+
import "../proof-DLL0MLmV.js";
|
|
20
|
+
import "../docloader-CBHh0rC5.js";
|
|
21
21
|
import "../kv-cache-El7We5sy.js";
|
|
22
|
-
import "../inbox-
|
|
23
|
-
import "../builder-
|
|
22
|
+
import "../inbox-3bZUqDLE.js";
|
|
23
|
+
import "../builder-B5cKln9v.js";
|
|
24
24
|
import "../collection-CcnIw1qY.js";
|
|
25
|
-
import "../keycache-
|
|
25
|
+
import "../keycache-BASM0rrX.js";
|
|
26
26
|
import "../negotiation-5NPJL6zp.js";
|
|
27
27
|
import "../retry-D4GJ670a.js";
|
|
28
|
-
import "../send-
|
|
28
|
+
import "../send-DbW03azY.js";
|
|
29
29
|
import { test } from "@fedify/fixture";
|
|
30
30
|
import { Follow, Person } from "@fedify/vocab";
|
|
31
31
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { validateCryptoKey } from "./key-
|
|
7
|
-
import { doubleKnock } from "./http-
|
|
6
|
+
import { validateCryptoKey } from "./key-D7Y_J9kt.js";
|
|
7
|
+
import { doubleKnock } from "./http-Br3-1dRf.js";
|
|
8
8
|
import { curry } from "es-toolkit";
|
|
9
9
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
10
10
|
import { getLogger } from "@logtape/logtape";
|
|
@@ -7,10 +7,10 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
7
7
|
import "../assert-MZs1qjMx.js";
|
|
8
8
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
9
9
|
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
10
|
-
import "../deno-
|
|
10
|
+
import "../deno-4w047OFk.js";
|
|
11
11
|
import "../router-D9eI0s4b.js";
|
|
12
|
-
import "../inbox-
|
|
13
|
-
import { createFederationBuilder } from "../builder-
|
|
12
|
+
import "../inbox-3bZUqDLE.js";
|
|
13
|
+
import { createFederationBuilder } from "../builder-B5cKln9v.js";
|
|
14
14
|
import { assertExists } from "../std__assert-DWivtrGR.js";
|
|
15
15
|
import "../assert_rejects-Ce45JcFg.js";
|
|
16
16
|
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
|
@@ -7,25 +7,25 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
7
7
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
8
8
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
9
9
|
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
10
|
-
import "../deno-
|
|
11
|
-
import { createFederation, handleActor, handleCollection, handleCustomCollection, handleInbox, handleObject, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-
|
|
10
|
+
import "../deno-4w047OFk.js";
|
|
11
|
+
import { createFederation, handleActor, handleCollection, handleCustomCollection, handleInbox, handleObject, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-DozhKfB6.js";
|
|
12
12
|
import "../client-CoCIaTNO.js";
|
|
13
13
|
import "../router-D9eI0s4b.js";
|
|
14
14
|
import "../types-CPz01LGH.js";
|
|
15
|
-
import "../key-
|
|
16
|
-
import { signRequest } from "../http-
|
|
17
|
-
import "../ld-
|
|
18
|
-
import "../owner-
|
|
19
|
-
import "../proof-
|
|
20
|
-
import "../docloader-
|
|
15
|
+
import "../key-D7Y_J9kt.js";
|
|
16
|
+
import { signRequest } from "../http-Br3-1dRf.js";
|
|
17
|
+
import "../ld-Bjq9Z4St.js";
|
|
18
|
+
import "../owner-CImU2dKz.js";
|
|
19
|
+
import "../proof-DLL0MLmV.js";
|
|
20
|
+
import "../docloader-CBHh0rC5.js";
|
|
21
21
|
import "../kv-cache-El7We5sy.js";
|
|
22
|
-
import { InboxListenerSet } from "../inbox-
|
|
23
|
-
import "../builder-
|
|
22
|
+
import { InboxListenerSet } from "../inbox-3bZUqDLE.js";
|
|
23
|
+
import "../builder-B5cKln9v.js";
|
|
24
24
|
import "../collection-CcnIw1qY.js";
|
|
25
|
-
import "../keycache-
|
|
25
|
+
import "../keycache-BASM0rrX.js";
|
|
26
26
|
import "../negotiation-5NPJL6zp.js";
|
|
27
27
|
import "../retry-D4GJ670a.js";
|
|
28
|
-
import "../send-
|
|
28
|
+
import "../send-DbW03azY.js";
|
|
29
29
|
import "../std__assert-DWivtrGR.js";
|
|
30
30
|
import "../assert_rejects-Ce45JcFg.js";
|
|
31
31
|
import "../assert_throws-BNXdRGWP.js";
|
|
@@ -7,25 +7,25 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
7
7
|
import "../assert-MZs1qjMx.js";
|
|
8
8
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
9
9
|
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
10
|
-
import "../deno-
|
|
11
|
-
import { createFederation } from "../middleware-
|
|
10
|
+
import "../deno-4w047OFk.js";
|
|
11
|
+
import { createFederation } from "../middleware-DozhKfB6.js";
|
|
12
12
|
import "../client-CoCIaTNO.js";
|
|
13
13
|
import "../router-D9eI0s4b.js";
|
|
14
14
|
import "../types-CPz01LGH.js";
|
|
15
|
-
import "../key-
|
|
16
|
-
import "../http-
|
|
17
|
-
import "../ld-
|
|
18
|
-
import "../owner-
|
|
19
|
-
import { signObject } from "../proof-
|
|
20
|
-
import "../docloader-
|
|
15
|
+
import "../key-D7Y_J9kt.js";
|
|
16
|
+
import "../http-Br3-1dRf.js";
|
|
17
|
+
import "../ld-Bjq9Z4St.js";
|
|
18
|
+
import "../owner-CImU2dKz.js";
|
|
19
|
+
import { signObject } from "../proof-DLL0MLmV.js";
|
|
20
|
+
import "../docloader-CBHh0rC5.js";
|
|
21
21
|
import "../kv-cache-El7We5sy.js";
|
|
22
|
-
import "../inbox-
|
|
23
|
-
import "../builder-
|
|
22
|
+
import "../inbox-3bZUqDLE.js";
|
|
23
|
+
import "../builder-B5cKln9v.js";
|
|
24
24
|
import "../collection-CcnIw1qY.js";
|
|
25
|
-
import "../keycache-
|
|
25
|
+
import "../keycache-BASM0rrX.js";
|
|
26
26
|
import "../negotiation-5NPJL6zp.js";
|
|
27
27
|
import "../retry-D4GJ670a.js";
|
|
28
|
-
import "../send-
|
|
28
|
+
import "../send-DbW03azY.js";
|
|
29
29
|
import "../std__assert-DWivtrGR.js";
|
|
30
30
|
import "../assert_rejects-Ce45JcFg.js";
|
|
31
31
|
import "../assert_throws-BNXdRGWP.js";
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
6
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
7
|
-
import "../deno-
|
|
8
|
-
import { InboxListenerSet } from "../inbox-
|
|
7
|
+
import "../deno-4w047OFk.js";
|
|
8
|
+
import { InboxListenerSet } from "../inbox-3bZUqDLE.js";
|
|
9
9
|
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
|
10
10
|
import { test } from "@fedify/fixture";
|
|
11
11
|
import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
|
|
@@ -7,7 +7,7 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
7
7
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
8
8
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
9
9
|
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
10
|
-
import { KvKeyCache } from "../keycache-
|
|
10
|
+
import { KvKeyCache } from "../keycache-BASM0rrX.js";
|
|
11
11
|
import { test } from "@fedify/fixture";
|
|
12
12
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
13
13
|
|
|
@@ -29,6 +29,7 @@ test("KvKeyCache.set()", async () => {
|
|
|
29
29
|
});
|
|
30
30
|
await cache.set(new URL("https://example.com/null"), null);
|
|
31
31
|
assert(cache.nullKeys.has("https://example.com/null"));
|
|
32
|
+
assertEquals(await kv.get(["pk", "https://example.com/null"]), { _fedify: "key-unavailable" });
|
|
32
33
|
});
|
|
33
34
|
test("KvKeyCache.get()", async () => {
|
|
34
35
|
const kv = new MemoryKvStore();
|
|
@@ -51,6 +52,9 @@ test("KvKeyCache.get()", async () => {
|
|
|
51
52
|
assertEquals(multikey?.id?.href, "https://example.com/key2");
|
|
52
53
|
cache.nullKeys.add("https://example.com/null");
|
|
53
54
|
assertEquals(await cache.get(new URL("https://example.com/null")), null);
|
|
55
|
+
await kv.set(["pk", "https://example.com/null2"], { _fedify: "key-unavailable" });
|
|
56
|
+
const cache2 = new KvKeyCache(kv, ["pk"]);
|
|
57
|
+
assertEquals(await cache2.get(new URL("https://example.com/null2")), null);
|
|
54
58
|
});
|
|
55
59
|
|
|
56
60
|
//#endregion
|
|
@@ -8,25 +8,25 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
10
|
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
11
|
-
import "../deno-
|
|
12
|
-
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "../middleware-
|
|
11
|
+
import "../deno-4w047OFk.js";
|
|
12
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "../middleware-DozhKfB6.js";
|
|
13
13
|
import "../client-CoCIaTNO.js";
|
|
14
14
|
import { RouterError } from "../router-D9eI0s4b.js";
|
|
15
15
|
import "../types-CPz01LGH.js";
|
|
16
|
-
import "../key-
|
|
17
|
-
import { signRequest, verifyRequest } from "../http-
|
|
18
|
-
import { detachSignature, signJsonLd, verifyJsonLd } from "../ld-
|
|
19
|
-
import { doesActorOwnKey } from "../owner-
|
|
20
|
-
import { signObject, verifyObject } from "../proof-
|
|
21
|
-
import { getAuthenticatedDocumentLoader } from "../docloader-
|
|
16
|
+
import "../key-D7Y_J9kt.js";
|
|
17
|
+
import { signRequest, verifyRequest } from "../http-Br3-1dRf.js";
|
|
18
|
+
import { detachSignature, signJsonLd, verifyJsonLd } from "../ld-Bjq9Z4St.js";
|
|
19
|
+
import { doesActorOwnKey } from "../owner-CImU2dKz.js";
|
|
20
|
+
import { signObject, verifyObject } from "../proof-DLL0MLmV.js";
|
|
21
|
+
import { getAuthenticatedDocumentLoader } from "../docloader-CBHh0rC5.js";
|
|
22
22
|
import "../kv-cache-El7We5sy.js";
|
|
23
|
-
import "../inbox-
|
|
24
|
-
import "../builder-
|
|
23
|
+
import "../inbox-3bZUqDLE.js";
|
|
24
|
+
import "../builder-B5cKln9v.js";
|
|
25
25
|
import "../collection-CcnIw1qY.js";
|
|
26
|
-
import "../keycache-
|
|
26
|
+
import "../keycache-BASM0rrX.js";
|
|
27
27
|
import "../negotiation-5NPJL6zp.js";
|
|
28
28
|
import "../retry-D4GJ670a.js";
|
|
29
|
-
import "../send-
|
|
29
|
+
import "../send-DbW03azY.js";
|
|
30
30
|
import { assertStrictEquals } from "../std__assert-DWivtrGR.js";
|
|
31
31
|
import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
32
32
|
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
package/dist/federation/mod.cjs
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
5
|
require('../transformers-3g8GZwkZ.cjs');
|
|
6
|
-
require('../http-
|
|
7
|
-
const require_middleware = require('../middleware-
|
|
8
|
-
require('../proof-
|
|
6
|
+
require('../http-DGs_78tx.cjs');
|
|
7
|
+
const require_middleware = require('../middleware-CQeA5yF7.cjs');
|
|
8
|
+
require('../proof-UhA5do8k.cjs');
|
|
9
9
|
const require_federation = require('../federation-Bp3HI26G.cjs');
|
|
10
10
|
require('../types-Cd_hszr_.cjs');
|
|
11
|
-
require('../kv-cache-
|
|
11
|
+
require('../kv-cache-9PANi4tA.cjs');
|
|
12
12
|
|
|
13
13
|
exports.InProcessMessageQueue = require_federation.InProcessMessageQueue;
|
|
14
14
|
exports.MemoryKvStore = require_federation.MemoryKvStore;
|
package/dist/federation/mod.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
5
|
import "../transformers-C3FLHUd6.js";
|
|
6
|
-
import "../http-
|
|
7
|
-
import { Router, RouterError, SendActivityError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-
|
|
8
|
-
import "../proof-
|
|
6
|
+
import "../http-C_RwU_oN.js";
|
|
7
|
+
import { Router, RouterError, SendActivityError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-Bj30TZll.js";
|
|
8
|
+
import "../proof-BygvN4r5.js";
|
|
9
9
|
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "../federation-DaMfqRm4.js";
|
|
10
10
|
import "../types-C93Ob9cU.js";
|
|
11
|
-
import "../kv-cache-
|
|
11
|
+
import "../kv-cache-CMM5VJsc.js";
|
|
12
12
|
|
|
13
13
|
export { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError, SendActivityError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
|
@@ -7,11 +7,11 @@ import { esm_default } from "../esm-nLm00z9V.js";
|
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../deno-
|
|
11
|
-
import "../key-
|
|
12
|
-
import { verifyRequest } from "../http-
|
|
13
|
-
import { doesActorOwnKey } from "../owner-
|
|
14
|
-
import { SendActivityError, extractInboxes, sendActivity } from "../send-
|
|
10
|
+
import "../deno-4w047OFk.js";
|
|
11
|
+
import "../key-D7Y_J9kt.js";
|
|
12
|
+
import { verifyRequest } from "../http-Br3-1dRf.js";
|
|
13
|
+
import { doesActorOwnKey } from "../owner-CImU2dKz.js";
|
|
14
|
+
import { SendActivityError, extractInboxes, sendActivity } from "../send-DbW03azY.js";
|
|
15
15
|
import "../std__assert-DWivtrGR.js";
|
|
16
16
|
import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
17
17
|
import "../assert_throws-BNXdRGWP.js";
|
|
@@ -7,25 +7,25 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
7
7
|
import "../assert-MZs1qjMx.js";
|
|
8
8
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
9
9
|
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
10
|
-
import "../deno-
|
|
11
|
-
import { createFederation, handleWebFinger } from "../middleware-
|
|
10
|
+
import "../deno-4w047OFk.js";
|
|
11
|
+
import { createFederation, handleWebFinger } from "../middleware-DozhKfB6.js";
|
|
12
12
|
import "../client-CoCIaTNO.js";
|
|
13
13
|
import "../router-D9eI0s4b.js";
|
|
14
14
|
import "../types-CPz01LGH.js";
|
|
15
|
-
import "../key-
|
|
16
|
-
import "../http-
|
|
17
|
-
import "../ld-
|
|
18
|
-
import "../owner-
|
|
19
|
-
import "../proof-
|
|
20
|
-
import "../docloader-
|
|
15
|
+
import "../key-D7Y_J9kt.js";
|
|
16
|
+
import "../http-Br3-1dRf.js";
|
|
17
|
+
import "../ld-Bjq9Z4St.js";
|
|
18
|
+
import "../owner-CImU2dKz.js";
|
|
19
|
+
import "../proof-DLL0MLmV.js";
|
|
20
|
+
import "../docloader-CBHh0rC5.js";
|
|
21
21
|
import "../kv-cache-El7We5sy.js";
|
|
22
|
-
import "../inbox-
|
|
23
|
-
import "../builder-
|
|
22
|
+
import "../inbox-3bZUqDLE.js";
|
|
23
|
+
import "../builder-B5cKln9v.js";
|
|
24
24
|
import "../collection-CcnIw1qY.js";
|
|
25
|
-
import "../keycache-
|
|
25
|
+
import "../keycache-BASM0rrX.js";
|
|
26
26
|
import "../negotiation-5NPJL6zp.js";
|
|
27
27
|
import "../retry-D4GJ670a.js";
|
|
28
|
-
import "../send-
|
|
28
|
+
import "../send-DbW03azY.js";
|
|
29
29
|
import "../std__assert-DWivtrGR.js";
|
|
30
30
|
import "../assert_rejects-Ce45JcFg.js";
|
|
31
31
|
import "../assert_throws-BNXdRGWP.js";
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./deno-
|
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
|
6
|
+
import { deno_default } from "./deno-4w047OFk.js";
|
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-D7Y_J9kt.js";
|
|
8
8
|
import { CryptographicKey } from "@fedify/vocab";
|
|
9
|
+
import { FetchError } from "@fedify/vocab-runtime";
|
|
9
10
|
import { getLogger } from "@logtape/logtape";
|
|
10
11
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
11
12
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
|
@@ -14,6 +15,7 @@ import { encodeHex } from "byte-encodings/hex";
|
|
|
14
15
|
import { Item, decodeDict, encodeItem } from "structured-field-values";
|
|
15
16
|
|
|
16
17
|
//#region src/sig/http.ts
|
|
18
|
+
const DEFAULT_MAX_REDIRECTION = 20;
|
|
17
19
|
/**
|
|
18
20
|
* Signs a request using the given private key.
|
|
19
21
|
* @param request The request to sign.
|
|
@@ -725,7 +727,11 @@ function createRedirectRequest(request, location, body) {
|
|
|
725
727
|
* @since 1.6.0
|
|
726
728
|
*/
|
|
727
729
|
async function doubleKnock(request, identity, options = {}) {
|
|
730
|
+
return await doubleKnockInternal(request, identity, options);
|
|
731
|
+
}
|
|
732
|
+
async function doubleKnockInternal(request, identity, options, redirected = 0, visited = /* @__PURE__ */ new Set()) {
|
|
728
733
|
const { specDeterminer, log, tracerProvider, signal } = options;
|
|
734
|
+
visited.add(request.url);
|
|
729
735
|
const origin = new URL(request.url).origin;
|
|
730
736
|
const firstTrySpec = specDeterminer == null ? "rfc9421" : await specDeterminer.determineSpec(origin);
|
|
731
737
|
const body = options.body !== void 0 ? options.body : request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : null;
|
|
@@ -740,11 +746,14 @@ async function doubleKnock(request, identity, options = {}) {
|
|
|
740
746
|
signal
|
|
741
747
|
});
|
|
742
748
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
749
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
743
750
|
const location = response.headers.get("Location");
|
|
744
|
-
|
|
751
|
+
const redirectRequest = createRedirectRequest(request, location, body);
|
|
752
|
+
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
753
|
+
return doubleKnockInternal(redirectRequest, identity, {
|
|
745
754
|
...options,
|
|
746
755
|
body
|
|
747
|
-
});
|
|
756
|
+
}, redirected + 1, visited);
|
|
748
757
|
} else if (response.status === 400 || response.status === 401 || response.status > 401) {
|
|
749
758
|
const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
|
|
750
759
|
getLogger([
|
|
@@ -768,11 +777,14 @@ async function doubleKnock(request, identity, options = {}) {
|
|
|
768
777
|
signal
|
|
769
778
|
});
|
|
770
779
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
780
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
771
781
|
const location = response.headers.get("Location");
|
|
772
|
-
|
|
782
|
+
const redirectRequest = createRedirectRequest(request, location, body);
|
|
783
|
+
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
784
|
+
return doubleKnockInternal(redirectRequest, identity, {
|
|
773
785
|
...options,
|
|
774
786
|
body
|
|
775
|
-
});
|
|
787
|
+
}, redirected + 1, visited);
|
|
776
788
|
} else if (response.status !== 400 && response.status !== 401) await specDeterminer?.rememberSpec(origin, spec);
|
|
777
789
|
} else await specDeterminer?.rememberSpec(origin, firstTrySpec);
|
|
778
790
|
return response;
|
|
@@ -6,14 +6,14 @@ import { getLogger } from "@logtape/logtape";
|
|
|
6
6
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
7
7
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
import { encodeHex } from "byte-encodings/hex";
|
|
9
|
+
import { FetchError, getDocumentLoader } from "@fedify/vocab-runtime";
|
|
9
10
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
|
10
11
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
11
12
|
import { Item, decodeDict, encodeItem } from "structured-field-values";
|
|
12
|
-
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
13
13
|
|
|
14
14
|
//#region deno.json
|
|
15
15
|
var name = "@fedify/fedify";
|
|
16
|
-
var version = "2.0.
|
|
16
|
+
var version = "2.0.8";
|
|
17
17
|
var license = "MIT";
|
|
18
18
|
var exports = {
|
|
19
19
|
".": "./src/mod.ts",
|
|
@@ -377,6 +377,7 @@ async function fetchKeyInternal(keyId, cls, { documentLoader, contextLoader, key
|
|
|
377
377
|
|
|
378
378
|
//#endregion
|
|
379
379
|
//#region src/sig/http.ts
|
|
380
|
+
const DEFAULT_MAX_REDIRECTION = 20;
|
|
380
381
|
/**
|
|
381
382
|
* Signs a request using the given private key.
|
|
382
383
|
* @param request The request to sign.
|
|
@@ -1088,7 +1089,11 @@ function createRedirectRequest(request, location, body) {
|
|
|
1088
1089
|
* @since 1.6.0
|
|
1089
1090
|
*/
|
|
1090
1091
|
async function doubleKnock(request, identity, options = {}) {
|
|
1092
|
+
return await doubleKnockInternal(request, identity, options);
|
|
1093
|
+
}
|
|
1094
|
+
async function doubleKnockInternal(request, identity, options, redirected = 0, visited = /* @__PURE__ */ new Set()) {
|
|
1091
1095
|
const { specDeterminer, log, tracerProvider, signal } = options;
|
|
1096
|
+
visited.add(request.url);
|
|
1092
1097
|
const origin = new URL(request.url).origin;
|
|
1093
1098
|
const firstTrySpec = specDeterminer == null ? "rfc9421" : await specDeterminer.determineSpec(origin);
|
|
1094
1099
|
const body = options.body !== void 0 ? options.body : request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : null;
|
|
@@ -1103,11 +1108,14 @@ async function doubleKnock(request, identity, options = {}) {
|
|
|
1103
1108
|
signal
|
|
1104
1109
|
});
|
|
1105
1110
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
1111
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
1106
1112
|
const location = response.headers.get("Location");
|
|
1107
|
-
|
|
1113
|
+
const redirectRequest = createRedirectRequest(request, location, body);
|
|
1114
|
+
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
1115
|
+
return doubleKnockInternal(redirectRequest, identity, {
|
|
1108
1116
|
...options,
|
|
1109
1117
|
body
|
|
1110
|
-
});
|
|
1118
|
+
}, redirected + 1, visited);
|
|
1111
1119
|
} else if (response.status === 400 || response.status === 401 || response.status > 401) {
|
|
1112
1120
|
const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
|
|
1113
1121
|
getLogger([
|
|
@@ -1131,11 +1139,14 @@ async function doubleKnock(request, identity, options = {}) {
|
|
|
1131
1139
|
signal
|
|
1132
1140
|
});
|
|
1133
1141
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
1142
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
1134
1143
|
const location = response.headers.get("Location");
|
|
1135
|
-
|
|
1144
|
+
const redirectRequest = createRedirectRequest(request, location, body);
|
|
1145
|
+
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
1146
|
+
return doubleKnockInternal(redirectRequest, identity, {
|
|
1136
1147
|
...options,
|
|
1137
1148
|
body
|
|
1138
|
-
});
|
|
1149
|
+
}, redirected + 1, visited);
|
|
1139
1150
|
} else if (response.status !== 400 && response.status !== 401) await specDeterminer?.rememberSpec(origin, spec);
|
|
1140
1151
|
} else await specDeterminer?.rememberSpec(origin, firstTrySpec);
|
|
1141
1152
|
return response;
|
|
@@ -7,14 +7,14 @@ const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
|
7
7
|
const __fedify_vocab = require_chunk.__toESM(require("@fedify/vocab"));
|
|
8
8
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
|
9
9
|
const byte_encodings_hex = require_chunk.__toESM(require("byte-encodings/hex"));
|
|
10
|
+
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
|
10
11
|
const __opentelemetry_semantic_conventions = require_chunk.__toESM(require("@opentelemetry/semantic-conventions"));
|
|
11
12
|
const byte_encodings_base64 = require_chunk.__toESM(require("byte-encodings/base64"));
|
|
12
13
|
const structured_field_values = require_chunk.__toESM(require("structured-field-values"));
|
|
13
|
-
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
|
14
14
|
|
|
15
15
|
//#region deno.json
|
|
16
16
|
var name = "@fedify/fedify";
|
|
17
|
-
var version = "2.0.
|
|
17
|
+
var version = "2.0.8";
|
|
18
18
|
var license = "MIT";
|
|
19
19
|
var exports$1 = {
|
|
20
20
|
".": "./src/mod.ts",
|
|
@@ -378,6 +378,7 @@ async function fetchKeyInternal(keyId, cls, { documentLoader, contextLoader, key
|
|
|
378
378
|
|
|
379
379
|
//#endregion
|
|
380
380
|
//#region src/sig/http.ts
|
|
381
|
+
const DEFAULT_MAX_REDIRECTION = 20;
|
|
381
382
|
/**
|
|
382
383
|
* Signs a request using the given private key.
|
|
383
384
|
* @param request The request to sign.
|
|
@@ -1089,7 +1090,11 @@ function createRedirectRequest(request, location, body) {
|
|
|
1089
1090
|
* @since 1.6.0
|
|
1090
1091
|
*/
|
|
1091
1092
|
async function doubleKnock(request, identity, options = {}) {
|
|
1093
|
+
return await doubleKnockInternal(request, identity, options);
|
|
1094
|
+
}
|
|
1095
|
+
async function doubleKnockInternal(request, identity, options, redirected = 0, visited = /* @__PURE__ */ new Set()) {
|
|
1092
1096
|
const { specDeterminer, log, tracerProvider, signal } = options;
|
|
1097
|
+
visited.add(request.url);
|
|
1093
1098
|
const origin = new URL(request.url).origin;
|
|
1094
1099
|
const firstTrySpec = specDeterminer == null ? "rfc9421" : await specDeterminer.determineSpec(origin);
|
|
1095
1100
|
const body = options.body !== void 0 ? options.body : request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : null;
|
|
@@ -1104,11 +1109,14 @@ async function doubleKnock(request, identity, options = {}) {
|
|
|
1104
1109
|
signal
|
|
1105
1110
|
});
|
|
1106
1111
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
1112
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new __fedify_vocab_runtime.FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
1107
1113
|
const location = response.headers.get("Location");
|
|
1108
|
-
|
|
1114
|
+
const redirectRequest = createRedirectRequest(request, location, body);
|
|
1115
|
+
if (visited.has(redirectRequest.url)) throw new __fedify_vocab_runtime.FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
1116
|
+
return doubleKnockInternal(redirectRequest, identity, {
|
|
1109
1117
|
...options,
|
|
1110
1118
|
body
|
|
1111
|
-
});
|
|
1119
|
+
}, redirected + 1, visited);
|
|
1112
1120
|
} else if (response.status === 400 || response.status === 401 || response.status > 401) {
|
|
1113
1121
|
const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
|
|
1114
1122
|
(0, __logtape_logtape.getLogger)([
|
|
@@ -1132,11 +1140,14 @@ async function doubleKnock(request, identity, options = {}) {
|
|
|
1132
1140
|
signal
|
|
1133
1141
|
});
|
|
1134
1142
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
1143
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new __fedify_vocab_runtime.FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
1135
1144
|
const location = response.headers.get("Location");
|
|
1136
|
-
|
|
1145
|
+
const redirectRequest = createRedirectRequest(request, location, body);
|
|
1146
|
+
if (visited.has(redirectRequest.url)) throw new __fedify_vocab_runtime.FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
1147
|
+
return doubleKnockInternal(redirectRequest, identity, {
|
|
1137
1148
|
...options,
|
|
1138
1149
|
body
|
|
1139
|
-
});
|
|
1150
|
+
}, redirected + 1, visited);
|
|
1140
1151
|
} else if (response.status !== 400 && response.status !== 401) await specDeterminer?.rememberSpec(origin, spec);
|
|
1141
1152
|
} else await specDeterminer?.rememberSpec(origin, firstTrySpec);
|
|
1142
1153
|
return response;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./deno-
|
|
6
|
+
import { deno_default } from "./deno-4w047OFk.js";
|
|
7
7
|
import { Activity, getTypeId } from "@fedify/vocab";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./deno-
|
|
6
|
+
import { deno_default } from "./deno-4w047OFk.js";
|
|
7
7
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
8
8
|
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
7
7
|
|
|
8
8
|
//#region src/federation/keycache.ts
|
|
9
|
+
const NULL_KEY_CACHE_VALUE = { _fedify: "key-unavailable" };
|
|
10
|
+
const NULL_KEY_CACHE_TTL = Temporal.Duration.from({ minutes: 5 });
|
|
11
|
+
function isNullKeyCacheValue(value) {
|
|
12
|
+
return typeof value === "object" && value != null && "_fedify" in value && value._fedify === NULL_KEY_CACHE_VALUE._fedify;
|
|
13
|
+
}
|
|
9
14
|
var KvKeyCache = class {
|
|
10
15
|
kv;
|
|
11
16
|
prefix;
|
|
@@ -21,6 +26,10 @@ var KvKeyCache = class {
|
|
|
21
26
|
if (this.nullKeys.has(keyId.href)) return null;
|
|
22
27
|
const serialized = await this.kv.get([...this.prefix, keyId.href]);
|
|
23
28
|
if (serialized == null) return void 0;
|
|
29
|
+
if (isNullKeyCacheValue(serialized)) {
|
|
30
|
+
this.nullKeys.add(keyId.href);
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
24
33
|
try {
|
|
25
34
|
return await CryptographicKey.fromJsonLd(serialized, this.options);
|
|
26
35
|
} catch {
|
|
@@ -35,7 +44,7 @@ var KvKeyCache = class {
|
|
|
35
44
|
async set(keyId, key) {
|
|
36
45
|
if (key == null) {
|
|
37
46
|
this.nullKeys.add(keyId.href);
|
|
38
|
-
await this.kv.
|
|
47
|
+
await this.kv.set([...this.prefix, keyId.href], NULL_KEY_CACHE_VALUE, { ttl: NULL_KEY_CACHE_TTL });
|
|
39
48
|
return;
|
|
40
49
|
}
|
|
41
50
|
this.nullKeys.delete(keyId.href);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
5
|
const require_chunk = require('./chunk-CGaQZ11T.cjs');
|
|
6
|
-
const require_http = require('./http-
|
|
6
|
+
const require_http = require('./http-DGs_78tx.cjs');
|
|
7
7
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
8
8
|
const es_toolkit = require_chunk.__toESM(require("es-toolkit"));
|
|
9
9
|
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { doubleKnock, validateCryptoKey } from "./http-
|
|
5
|
+
import { doubleKnock, validateCryptoKey } from "./http-C_RwU_oN.js";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { curry } from "es-toolkit";
|
|
8
8
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
|