@fedify/fedify 1.10.4 → 1.10.5
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/{actor-BOBYD2WU.js → actor-CQdxP8N-.js} +187 -187
- package/dist/{actor-Snz2FxRV.js → actor-Ch9BTg3N.js} +1 -1
- package/dist/{actor-Bj7QfjMG.cjs → actor-CjkHF7Cj.cjs} +187 -187
- package/dist/{authdocloader-DYsGSwww.js → authdocloader-COFZT9Wh.js} +3 -3
- package/dist/{authdocloader-DAkeYWim.js → authdocloader-fR-Fqcpa.js} +3 -3
- package/dist/{authdocloader-dttG5T5s.cjs → authdocloader-zc5ibOmU.cjs} +3 -3
- package/dist/{builder-DLRO0a1o.js → builder-YD0q32nG.js} +4 -4
- package/dist/{client-B6e8VkGv.js → client-BgCucCG7.js} +1 -1
- package/dist/compat/transformers.test.js +16 -16
- package/dist/{docloader-BH4pzZZC.js → docloader-BETPdM09.js} +30 -13
- package/dist/{docloader-C54TKiQx.cjs → docloader-irBWMSOZ.cjs} +30 -13
- package/dist/{esm-CbGx2KcW.js → esm-iGH0sRsE.js} +1 -1
- package/dist/federation/builder.test.js +5 -5
- package/dist/federation/collection.test.js +3 -3
- package/dist/federation/handler.test.js +17 -17
- package/dist/federation/idempotency.test.js +17 -17
- package/dist/federation/inbox.test.js +4 -4
- package/dist/federation/keycache.test.js +8 -4
- package/dist/federation/kv.test.js +3 -3
- package/dist/federation/middleware.test.js +18 -18
- package/dist/federation/mod.cjs +10 -10
- package/dist/federation/mod.js +10 -10
- package/dist/federation/mq.test.js +3 -3
- package/dist/federation/retry.test.js +3 -3
- package/dist/federation/router.test.js +3 -3
- package/dist/federation/send.test.js +10 -10
- package/dist/{http-DmxJlZvy.cjs → http-CQAqR_vx.cjs} +18 -7
- package/dist/{http-n5BTcxeh.js → http-CxiIW4rD.js} +17 -6
- package/dist/{http-DbXPDTX4.js → http-PgdBoDIj.js} +18 -7
- package/dist/{inbox-CQcSx4I9.js → inbox-DcDIqTbR.js} +1 -1
- package/dist/{key-BLNbwA_2.js → key-Bnod5wJl.js} +4 -4
- package/dist/{key-CPqemOR2.js → key-C6swTX71.js} +3 -3
- package/dist/{key-Bidhpg7V.js → key-Cg0kO4dA.js} +2 -2
- package/dist/{key-DY-1H5d9.js → key-I-ibyaZH.js} +2 -2
- package/dist/key-_Uq8gkmM.cjs +10 -0
- package/dist/{key-CdyBP8cw.cjs → key-dNFkodH5.cjs} +2 -2
- package/dist/{keycache-DtptNYtI.js → keycache-hSs_XFSb.js} +11 -2
- package/dist/{keys-kLtROwLY.js → keys-CElJez9H.js} +1 -1
- package/dist/{ld-8dX3VuDg.js → ld-b16r91YS.js} +2 -2
- package/dist/{lookup-DpuJzIOl.cjs → lookup-Bfq9Jpm0.cjs} +1 -1
- package/dist/{lookup-CBeEjsrU.js → lookup-CiSAeWJl.js} +1 -1
- package/dist/{lookup-DqqwtRxy.js → lookup-CySNcNcC.js} +1 -1
- package/dist/middleware-BWsOtDIF.cjs +17 -0
- package/dist/middleware-Bm4bJzjg.js +26 -0
- package/dist/{middleware-ZywRHmGd.js → middleware-Bs4xDuXR.js} +20 -11
- package/dist/middleware-BvODpE_U.js +17 -0
- package/dist/{middleware-Cnkc9TKm.js → middleware-C5emnCh-.js} +13 -13
- package/dist/{middleware-fQqVkTI_.cjs → middleware-Dxo56yae.cjs} +20 -11
- package/dist/mod.cjs +10 -10
- package/dist/mod.js +10 -10
- package/dist/nodeinfo/client.test.js +5 -5
- package/dist/nodeinfo/handler.test.js +16 -16
- package/dist/nodeinfo/mod.cjs +2 -2
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/semver.test.js +3 -3
- package/dist/nodeinfo/types.test.js +3 -3
- package/dist/otel/exporter.test.js +3 -3
- package/dist/{owner-DUbJSrOH.js → owner-Bs-sPbHX.js} +2 -2
- package/dist/{proof-r5NuE5WJ.cjs → proof-BvQS195q.cjs} +3 -3
- package/dist/{proof-DkGFNm3h.js → proof-SgRikE_Y.js} +2 -2
- package/dist/{proof-BZJajwfx.js → proof-flD2DeA-.js} +3 -3
- package/dist/runtime/authdocloader.test.js +9 -9
- package/dist/runtime/docloader.test.js +51 -4
- package/dist/runtime/key.test.js +5 -5
- package/dist/runtime/langstr.test.js +3 -3
- package/dist/runtime/link.test.js +3 -3
- package/dist/runtime/mod.cjs +6 -6
- package/dist/runtime/mod.js +6 -6
- package/dist/runtime/multibase/multibase.test.js +3 -3
- package/dist/runtime/url.test.js +3 -3
- package/dist/{send-BP6BnZB0.js → send-C0gFHa2i.js} +2 -2
- package/dist/sig/http.test.js +51 -8
- package/dist/sig/key.test.js +6 -6
- package/dist/sig/ld.test.js +7 -7
- package/dist/sig/mod.cjs +6 -6
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +7 -7
- package/dist/sig/proof.test.js +7 -7
- package/dist/testing/docloader.test.js +3 -3
- package/dist/testing/mod.js +3 -3
- package/dist/{testing-BHk-TOca.js → testing-C1GIraJh.js} +2 -2
- package/dist/{type-BJ212aq2.js → type-DUhon7qK.js} +215 -198
- package/dist/{types-jnh1Ge-D.cjs → types-BgUCCngg.cjs} +1 -1
- package/dist/{types-D8QbEexz.js → types-Bu-epI-z.js} +1 -1
- package/dist/vocab/actor.test.js +5 -5
- package/dist/vocab/lookup.test.js +4 -4
- package/dist/vocab/mod.cjs +4 -4
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +4 -4
- package/dist/{vocab-DZmhBJkz.cjs → vocab-5i6DEIi6.cjs} +3 -3
- package/dist/{vocab-CKa0etLd.js → vocab-CBavAdew.js} +3 -3
- package/dist/webfinger/handler.test.js +16 -16
- package/dist/webfinger/lookup.test.js +4 -4
- package/dist/webfinger/mod.cjs +2 -2
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/cfworkers.test.js +3 -3
- package/package.json +1 -1
- package/dist/key-Bam8dJ0F.cjs +0 -10
- package/dist/middleware-Ba3Grmg4.js +0 -26
- package/dist/middleware-COSQWfNA.cjs +0 -17
- package/dist/middleware-Cq8RCRvR.js +0 -17
package/dist/federation/mod.js
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
5
|
import "../transformers-BFT6d7J5.js";
|
|
6
|
-
import "../docloader-
|
|
7
|
-
import "../actor-
|
|
8
|
-
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-
|
|
9
|
-
import "../lookup-
|
|
10
|
-
import "../key-
|
|
11
|
-
import "../http-
|
|
12
|
-
import "../proof-
|
|
6
|
+
import "../docloader-BETPdM09.js";
|
|
7
|
+
import "../actor-CQdxP8N-.js";
|
|
8
|
+
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-Bs4xDuXR.js";
|
|
9
|
+
import "../lookup-CiSAeWJl.js";
|
|
10
|
+
import "../key-I-ibyaZH.js";
|
|
11
|
+
import "../http-PgdBoDIj.js";
|
|
12
|
+
import "../proof-flD2DeA-.js";
|
|
13
13
|
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "../federation-K-xsO03l.js";
|
|
14
|
-
import "../types-
|
|
15
|
-
import "../authdocloader-
|
|
16
|
-
import "../vocab-
|
|
14
|
+
import "../types-Bu-epI-z.js";
|
|
15
|
+
import "../authdocloader-fR-Fqcpa.js";
|
|
16
|
+
import "../vocab-CBavAdew.js";
|
|
17
17
|
|
|
18
18
|
export { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../type-
|
|
6
|
+
import "../type-DUhon7qK.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../lookup-
|
|
11
|
-
import { test } from "../testing-
|
|
10
|
+
import "../lookup-CySNcNcC.js";
|
|
11
|
+
import { test } from "../testing-C1GIraJh.js";
|
|
12
12
|
import { assertGreater, assertGreaterOrEqual } from "../std__assert-X-_kMxKM.js";
|
|
13
13
|
import { assertFalse } from "../assert_rejects-DiIiJbZn.js";
|
|
14
14
|
import "../assert_is_error-BPGph1Jx.js";
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../type-
|
|
6
|
+
import "../type-DUhon7qK.js";
|
|
7
7
|
import { AssertionError, assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
|
-
import "../lookup-
|
|
8
|
+
import "../lookup-CySNcNcC.js";
|
|
9
9
|
import { createExponentialBackoffPolicy } from "../retry-D4GJ670a.js";
|
|
10
|
-
import { test } from "../testing-
|
|
10
|
+
import { test } from "../testing-C1GIraJh.js";
|
|
11
11
|
import { assertNotEquals } from "../assert_not_equals-f3m3epl3.js";
|
|
12
12
|
|
|
13
13
|
//#region src/federation/retry.test.ts
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../type-
|
|
6
|
+
import "../type-DUhon7qK.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import { Router, RouterError } from "../lookup-
|
|
11
|
-
import { test } from "../testing-
|
|
10
|
+
import { Router, RouterError } from "../lookup-CySNcNcC.js";
|
|
11
|
+
import { test } from "../testing-C1GIraJh.js";
|
|
12
12
|
import "../std__assert-X-_kMxKM.js";
|
|
13
13
|
import { assertFalse } from "../assert_rejects-DiIiJbZn.js";
|
|
14
14
|
import "../assert_is_error-BPGph1Jx.js";
|
|
@@ -3,25 +3,25 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Activity, Application, Endpoints, Group, Person, Service } from "../type-
|
|
6
|
+
import { Activity, Application, Endpoints, Group, Person, Service } from "../type-DUhon7qK.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../lookup-
|
|
11
|
-
import "../actor-
|
|
12
|
-
import "../key-
|
|
13
|
-
import { verifyRequest } from "../http-
|
|
14
|
-
import { doesActorOwnKey } from "../owner-
|
|
15
|
-
import { extractInboxes, sendActivity } from "../send-
|
|
16
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import "../lookup-CySNcNcC.js";
|
|
11
|
+
import "../actor-Ch9BTg3N.js";
|
|
12
|
+
import "../key-Cg0kO4dA.js";
|
|
13
|
+
import { verifyRequest } from "../http-CxiIW4rD.js";
|
|
14
|
+
import { doesActorOwnKey } from "../owner-Bs-sPbHX.js";
|
|
15
|
+
import { extractInboxes, sendActivity } from "../send-C0gFHa2i.js";
|
|
16
|
+
import { mockDocumentLoader, test } from "../testing-C1GIraJh.js";
|
|
17
17
|
import "../std__assert-X-_kMxKM.js";
|
|
18
18
|
import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
19
19
|
import "../assert_is_error-BPGph1Jx.js";
|
|
20
20
|
import { assertNotEquals } from "../assert_not_equals-f3m3epl3.js";
|
|
21
21
|
import "../assert_throws-BOO88avQ.js";
|
|
22
|
-
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-
|
|
22
|
+
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-CElJez9H.js";
|
|
23
23
|
import { createTestTracerProvider } from "../otel-Chy5T2Xh.js";
|
|
24
|
-
import { esm_default } from "../esm-
|
|
24
|
+
import { esm_default } from "../esm-iGH0sRsE.js";
|
|
25
25
|
|
|
26
26
|
//#region src/federation/send.test.ts
|
|
27
27
|
test("extractInboxes()", () => {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
|
6
|
-
const require_docloader = require('./docloader-
|
|
7
|
-
const require_actor = require('./actor-
|
|
8
|
-
const require_key = require('./key-
|
|
6
|
+
const require_docloader = require('./docloader-irBWMSOZ.cjs');
|
|
7
|
+
const require_actor = require('./actor-CjkHF7Cj.cjs');
|
|
8
|
+
const require_key = require('./key-dNFkodH5.cjs');
|
|
9
9
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
10
10
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
|
11
11
|
const byte_encodings_base64 = require_chunk.__toESM(require("byte-encodings/base64"));
|
|
@@ -14,6 +14,7 @@ const __opentelemetry_semantic_conventions = require_chunk.__toESM(require("@ope
|
|
|
14
14
|
const structured_field_values = require_chunk.__toESM(require("structured-field-values"));
|
|
15
15
|
|
|
16
16
|
//#region src/sig/http.ts
|
|
17
|
+
const DEFAULT_MAX_REDIRECTION = 20;
|
|
17
18
|
/**
|
|
18
19
|
* Signs a request using the given private key.
|
|
19
20
|
* @param request The request to sign.
|
|
@@ -725,7 +726,11 @@ function createRedirectRequest(request, location, body) {
|
|
|
725
726
|
* @since 1.6.0
|
|
726
727
|
*/
|
|
727
728
|
async function doubleKnock(request, identity, options = {}) {
|
|
729
|
+
return await doubleKnockInternal(request, identity, options);
|
|
730
|
+
}
|
|
731
|
+
async function doubleKnockInternal(request, identity, options, redirected = 0, visited = /* @__PURE__ */ new Set()) {
|
|
728
732
|
const { specDeterminer, log, tracerProvider, signal } = options;
|
|
733
|
+
visited.add(request.url);
|
|
729
734
|
const origin = new URL(request.url).origin;
|
|
730
735
|
const firstTrySpec = specDeterminer == null ? "rfc9421" : await specDeterminer.determineSpec(origin);
|
|
731
736
|
const body = options.body !== void 0 ? options.body : request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : null;
|
|
@@ -740,11 +745,14 @@ async function doubleKnock(request, identity, options = {}) {
|
|
|
740
745
|
signal
|
|
741
746
|
});
|
|
742
747
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
748
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new require_docloader.FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
743
749
|
const location = response.headers.get("Location");
|
|
744
|
-
|
|
750
|
+
const redirectRequest = createRedirectRequest(request, location, body);
|
|
751
|
+
if (visited.has(redirectRequest.url)) throw new require_docloader.FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
752
|
+
return doubleKnockInternal(redirectRequest, identity, {
|
|
745
753
|
...options,
|
|
746
754
|
body
|
|
747
|
-
});
|
|
755
|
+
}, redirected + 1, visited);
|
|
748
756
|
} else if (response.status === 400 || response.status === 401 || response.status > 401) {
|
|
749
757
|
const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
|
|
750
758
|
(0, __logtape_logtape.getLogger)([
|
|
@@ -768,11 +776,14 @@ async function doubleKnock(request, identity, options = {}) {
|
|
|
768
776
|
signal
|
|
769
777
|
});
|
|
770
778
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
779
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new require_docloader.FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
771
780
|
const location = response.headers.get("Location");
|
|
772
|
-
|
|
781
|
+
const redirectRequest = createRedirectRequest(request, location, body);
|
|
782
|
+
if (visited.has(redirectRequest.url)) throw new require_docloader.FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
783
|
+
return doubleKnockInternal(redirectRequest, identity, {
|
|
773
784
|
...options,
|
|
774
785
|
body
|
|
775
|
-
});
|
|
786
|
+
}, redirected + 1, visited);
|
|
776
787
|
} else if (response.status !== 400 && response.status !== 401) await specDeterminer?.rememberSpec(origin, spec);
|
|
777
788
|
} else await specDeterminer?.rememberSpec(origin, firstTrySpec);
|
|
778
789
|
return response;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { CryptographicKey, deno_default } from "./type-
|
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
|
6
|
+
import { CryptographicKey, FetchError, deno_default } from "./type-DUhon7qK.js";
|
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-Cg0kO4dA.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
|
@@ -13,6 +13,7 @@ import { encodeHex } from "byte-encodings/hex";
|
|
|
13
13
|
import { Item, decodeDict, encodeItem } from "structured-field-values";
|
|
14
14
|
|
|
15
15
|
//#region src/sig/http.ts
|
|
16
|
+
const DEFAULT_MAX_REDIRECTION = 20;
|
|
16
17
|
/**
|
|
17
18
|
* Signs a request using the given private key.
|
|
18
19
|
* @param request The request to sign.
|
|
@@ -724,7 +725,11 @@ function createRedirectRequest(request, location, body) {
|
|
|
724
725
|
* @since 1.6.0
|
|
725
726
|
*/
|
|
726
727
|
async function doubleKnock(request, identity, options = {}) {
|
|
728
|
+
return await doubleKnockInternal(request, identity, options);
|
|
729
|
+
}
|
|
730
|
+
async function doubleKnockInternal(request, identity, options, redirected = 0, visited = /* @__PURE__ */ new Set()) {
|
|
727
731
|
const { specDeterminer, log, tracerProvider, signal } = options;
|
|
732
|
+
visited.add(request.url);
|
|
728
733
|
const origin = new URL(request.url).origin;
|
|
729
734
|
const firstTrySpec = specDeterminer == null ? "rfc9421" : await specDeterminer.determineSpec(origin);
|
|
730
735
|
const body = options.body !== void 0 ? options.body : request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : null;
|
|
@@ -739,11 +744,14 @@ async function doubleKnock(request, identity, options = {}) {
|
|
|
739
744
|
signal
|
|
740
745
|
});
|
|
741
746
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
747
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
742
748
|
const location = response.headers.get("Location");
|
|
743
|
-
|
|
749
|
+
const redirectRequest = createRedirectRequest(request, location, body);
|
|
750
|
+
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
751
|
+
return doubleKnockInternal(redirectRequest, identity, {
|
|
744
752
|
...options,
|
|
745
753
|
body
|
|
746
|
-
});
|
|
754
|
+
}, redirected + 1, visited);
|
|
747
755
|
} else if (response.status === 400 || response.status === 401 || response.status > 401) {
|
|
748
756
|
const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
|
|
749
757
|
getLogger([
|
|
@@ -767,11 +775,14 @@ async function doubleKnock(request, identity, options = {}) {
|
|
|
767
775
|
signal
|
|
768
776
|
});
|
|
769
777
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
778
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
770
779
|
const location = response.headers.get("Location");
|
|
771
|
-
|
|
780
|
+
const redirectRequest = createRedirectRequest(request, location, body);
|
|
781
|
+
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
782
|
+
return doubleKnockInternal(redirectRequest, identity, {
|
|
772
783
|
...options,
|
|
773
784
|
body
|
|
774
|
-
});
|
|
785
|
+
}, redirected + 1, visited);
|
|
775
786
|
} else if (response.status !== 400 && response.status !== 401) await specDeterminer?.rememberSpec(origin, spec);
|
|
776
787
|
} else await specDeterminer?.rememberSpec(origin, firstTrySpec);
|
|
777
788
|
return response;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { deno_default } from "./docloader-
|
|
6
|
-
import { CryptographicKey } from "./actor-
|
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
|
5
|
+
import { FetchError, deno_default } from "./docloader-BETPdM09.js";
|
|
6
|
+
import { CryptographicKey } from "./actor-CQdxP8N-.js";
|
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-I-ibyaZH.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
@@ -13,6 +13,7 @@ import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } fro
|
|
|
13
13
|
import { Item, decodeDict, encodeItem } from "structured-field-values";
|
|
14
14
|
|
|
15
15
|
//#region src/sig/http.ts
|
|
16
|
+
const DEFAULT_MAX_REDIRECTION = 20;
|
|
16
17
|
/**
|
|
17
18
|
* Signs a request using the given private key.
|
|
18
19
|
* @param request The request to sign.
|
|
@@ -724,7 +725,11 @@ function createRedirectRequest(request, location, body) {
|
|
|
724
725
|
* @since 1.6.0
|
|
725
726
|
*/
|
|
726
727
|
async function doubleKnock(request, identity, options = {}) {
|
|
728
|
+
return await doubleKnockInternal(request, identity, options);
|
|
729
|
+
}
|
|
730
|
+
async function doubleKnockInternal(request, identity, options, redirected = 0, visited = /* @__PURE__ */ new Set()) {
|
|
727
731
|
const { specDeterminer, log, tracerProvider, signal } = options;
|
|
732
|
+
visited.add(request.url);
|
|
728
733
|
const origin = new URL(request.url).origin;
|
|
729
734
|
const firstTrySpec = specDeterminer == null ? "rfc9421" : await specDeterminer.determineSpec(origin);
|
|
730
735
|
const body = options.body !== void 0 ? options.body : request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : null;
|
|
@@ -739,11 +744,14 @@ async function doubleKnock(request, identity, options = {}) {
|
|
|
739
744
|
signal
|
|
740
745
|
});
|
|
741
746
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
747
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
742
748
|
const location = response.headers.get("Location");
|
|
743
|
-
|
|
749
|
+
const redirectRequest = createRedirectRequest(request, location, body);
|
|
750
|
+
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
751
|
+
return doubleKnockInternal(redirectRequest, identity, {
|
|
744
752
|
...options,
|
|
745
753
|
body
|
|
746
|
-
});
|
|
754
|
+
}, redirected + 1, visited);
|
|
747
755
|
} else if (response.status === 400 || response.status === 401 || response.status > 401) {
|
|
748
756
|
const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
|
|
749
757
|
getLogger([
|
|
@@ -767,11 +775,14 @@ async function doubleKnock(request, identity, options = {}) {
|
|
|
767
775
|
signal
|
|
768
776
|
});
|
|
769
777
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
778
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
770
779
|
const location = response.headers.get("Location");
|
|
771
|
-
|
|
780
|
+
const redirectRequest = createRedirectRequest(request, location, body);
|
|
781
|
+
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
782
|
+
return doubleKnockInternal(redirectRequest, identity, {
|
|
772
783
|
...options,
|
|
773
784
|
body
|
|
774
|
-
});
|
|
785
|
+
}, redirected + 1, visited);
|
|
775
786
|
} else if (response.status !== 400 && response.status !== 401) await specDeterminer?.rememberSpec(origin, spec);
|
|
776
787
|
} else await specDeterminer?.rememberSpec(origin, firstTrySpec);
|
|
777
788
|
return response;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Activity, deno_default, getTypeId } from "./type-
|
|
6
|
+
import { Activity, deno_default, getTypeId } from "./type-DUhon7qK.js";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
8
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
9
9
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import "./docloader-
|
|
6
|
-
import "./actor-
|
|
7
|
-
import "./lookup-
|
|
8
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "./key-
|
|
5
|
+
import "./docloader-BETPdM09.js";
|
|
6
|
+
import "./actor-CQdxP8N-.js";
|
|
7
|
+
import "./lookup-CiSAeWJl.js";
|
|
8
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "./key-I-ibyaZH.js";
|
|
9
9
|
|
|
10
10
|
export { validateCryptoKey };
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "./type-
|
|
7
|
-
import "./actor-
|
|
8
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "./key-
|
|
6
|
+
import "./type-DUhon7qK.js";
|
|
7
|
+
import "./actor-Ch9BTg3N.js";
|
|
8
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "./key-Cg0kO4dA.js";
|
|
9
9
|
|
|
10
10
|
export { validateCryptoKey };
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { CryptographicKey, Object as Object$1, deno_default, getDocumentLoader } from "./type-
|
|
7
|
-
import { isActor } from "./actor-
|
|
6
|
+
import { CryptographicKey, Object as Object$1, deno_default, getDocumentLoader } from "./type-DUhon7qK.js";
|
|
7
|
+
import { isActor } from "./actor-Ch9BTg3N.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { deno_default, getDocumentLoader } from "./docloader-
|
|
6
|
-
import { CryptographicKey, Object as Object$1, isActor } from "./actor-
|
|
5
|
+
import { deno_default, getDocumentLoader } from "./docloader-BETPdM09.js";
|
|
6
|
+
import { CryptographicKey, Object as Object$1, isActor } from "./actor-CQdxP8N-.js";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
8
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
9
9
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
|
+
|
|
5
|
+
require('./docloader-irBWMSOZ.cjs');
|
|
6
|
+
require('./actor-CjkHF7Cj.cjs');
|
|
7
|
+
require('./lookup-Bfq9Jpm0.cjs');
|
|
8
|
+
const require_key = require('./key-dNFkodH5.cjs');
|
|
9
|
+
|
|
10
|
+
exports.validateCryptoKey = require_key.validateCryptoKey;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
|
6
|
-
const require_docloader = require('./docloader-
|
|
7
|
-
const require_actor = require('./actor-
|
|
6
|
+
const require_docloader = require('./docloader-irBWMSOZ.cjs');
|
|
7
|
+
const require_actor = require('./actor-CjkHF7Cj.cjs');
|
|
8
8
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
9
9
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
|
10
10
|
|
|
@@ -3,9 +3,14 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { CryptographicKey, Multikey } from "./type-
|
|
6
|
+
import { CryptographicKey, Multikey } from "./type-DUhon7qK.js";
|
|
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
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { CryptographicKey, Multikey, importSpki } from "./type-
|
|
6
|
+
import { CryptographicKey, Multikey, importSpki } from "./type-DUhon7qK.js";
|
|
7
7
|
|
|
8
8
|
//#region src/testing/keys.ts
|
|
9
9
|
const rsaPublicKey1 = new CryptographicKey({
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Activity, CryptographicKey, Object as Object$1, deno_default, getDocumentLoader, getTypeId } from "./type-
|
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
|
6
|
+
import { Activity, CryptographicKey, Object as Object$1, deno_default, getDocumentLoader, getTypeId } from "./type-DUhon7qK.js";
|
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-Cg0kO4dA.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
|
6
|
-
const require_docloader = require('./docloader-
|
|
6
|
+
const require_docloader = require('./docloader-irBWMSOZ.cjs');
|
|
7
7
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
8
8
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
|
9
9
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { UrlError, deno_default, getUserAgent, validatePublicUrl } from "./docloader-
|
|
5
|
+
import { UrlError, deno_default, getUserAgent, validatePublicUrl } from "./docloader-BETPdM09.js";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Object as Object$1, deno_default, getDocumentLoader, getTypeId, lookupWebFinger } from "./type-
|
|
6
|
+
import { Object as Object$1, deno_default, getDocumentLoader, getTypeId, lookupWebFinger } from "./type-DUhon7qK.js";
|
|
7
7
|
import { cloneDeep, delay } from "es-toolkit";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
|
+
|
|
5
|
+
require('./transformers-CoBS-oFG.cjs');
|
|
6
|
+
require('./docloader-irBWMSOZ.cjs');
|
|
7
|
+
require('./actor-CjkHF7Cj.cjs');
|
|
8
|
+
const require_middleware = require('./middleware-Dxo56yae.cjs');
|
|
9
|
+
require('./lookup-Bfq9Jpm0.cjs');
|
|
10
|
+
require('./key-dNFkodH5.cjs');
|
|
11
|
+
require('./http-CQAqR_vx.cjs');
|
|
12
|
+
require('./proof-BvQS195q.cjs');
|
|
13
|
+
require('./types-BgUCCngg.cjs');
|
|
14
|
+
require('./authdocloader-zc5ibOmU.cjs');
|
|
15
|
+
require('./vocab-5i6DEIi6.cjs');
|
|
16
|
+
|
|
17
|
+
exports.FederationImpl = require_middleware.FederationImpl;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
+
globalThis.addEventListener = () => {};
|
|
5
|
+
|
|
6
|
+
import "./type-DUhon7qK.js";
|
|
7
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-C5emnCh-.js";
|
|
8
|
+
import "./semver-dArNLkR9.js";
|
|
9
|
+
import "./client-BgCucCG7.js";
|
|
10
|
+
import "./lookup-CySNcNcC.js";
|
|
11
|
+
import "./types-BIgY6c-l.js";
|
|
12
|
+
import "./actor-Ch9BTg3N.js";
|
|
13
|
+
import "./key-Cg0kO4dA.js";
|
|
14
|
+
import "./http-CxiIW4rD.js";
|
|
15
|
+
import "./authdocloader-COFZT9Wh.js";
|
|
16
|
+
import "./ld-b16r91YS.js";
|
|
17
|
+
import "./owner-Bs-sPbHX.js";
|
|
18
|
+
import "./proof-SgRikE_Y.js";
|
|
19
|
+
import "./inbox-DcDIqTbR.js";
|
|
20
|
+
import "./builder-YD0q32nG.js";
|
|
21
|
+
import "./collection-CSzG2j1P.js";
|
|
22
|
+
import "./keycache-hSs_XFSb.js";
|
|
23
|
+
import "./retry-D4GJ670a.js";
|
|
24
|
+
import "./send-C0gFHa2i.js";
|
|
25
|
+
|
|
26
|
+
export { FederationImpl };
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
5
|
import { getDefaultActivityTransformers } from "./transformers-BFT6d7J5.js";
|
|
6
|
-
import { deno_default, getDocumentLoader, kvCache } from "./docloader-
|
|
7
|
-
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-
|
|
8
|
-
import { lookupWebFinger } from "./lookup-
|
|
9
|
-
import { exportJwk, importJwk, validateCryptoKey } from "./key-
|
|
10
|
-
import { doubleKnock, verifyRequest } from "./http-
|
|
11
|
-
import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-
|
|
12
|
-
import { getNodeInfo, nodeInfoToJson } from "./types-
|
|
13
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader-
|
|
14
|
-
import { lookupObject, traverseCollection } from "./vocab-
|
|
6
|
+
import { deno_default, getDocumentLoader, kvCache } from "./docloader-BETPdM09.js";
|
|
7
|
+
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-CQdxP8N-.js";
|
|
8
|
+
import { lookupWebFinger } from "./lookup-CiSAeWJl.js";
|
|
9
|
+
import { exportJwk, importJwk, validateCryptoKey } from "./key-I-ibyaZH.js";
|
|
10
|
+
import { doubleKnock, verifyRequest } from "./http-PgdBoDIj.js";
|
|
11
|
+
import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-flD2DeA-.js";
|
|
12
|
+
import { getNodeInfo, nodeInfoToJson } from "./types-Bu-epI-z.js";
|
|
13
|
+
import { getAuthenticatedDocumentLoader } from "./authdocloader-fR-Fqcpa.js";
|
|
14
|
+
import { lookupObject, traverseCollection } from "./vocab-CBavAdew.js";
|
|
15
15
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
16
16
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
17
17
|
import { encodeHex } from "byte-encodings/hex";
|
|
@@ -344,7 +344,7 @@ var FederationBuilderImpl = class {
|
|
|
344
344
|
this.collectionTypeIds = {};
|
|
345
345
|
}
|
|
346
346
|
async build(options) {
|
|
347
|
-
const { FederationImpl: FederationImpl$1 } = await import("./middleware-
|
|
347
|
+
const { FederationImpl: FederationImpl$1 } = await import("./middleware-BvODpE_U.js");
|
|
348
348
|
const f = new FederationImpl$1(options);
|
|
349
349
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
350
350
|
f.router = this.router.clone();
|
|
@@ -912,6 +912,11 @@ async function buildCollectionSynchronizationHeader(collectionId, actorIds) {
|
|
|
912
912
|
|
|
913
913
|
//#endregion
|
|
914
914
|
//#region src/federation/keycache.ts
|
|
915
|
+
const NULL_KEY_CACHE_VALUE = { _fedify: "key-unavailable" };
|
|
916
|
+
const NULL_KEY_CACHE_TTL = Temporal.Duration.from({ minutes: 5 });
|
|
917
|
+
function isNullKeyCacheValue(value) {
|
|
918
|
+
return typeof value === "object" && value != null && "_fedify" in value && value._fedify === NULL_KEY_CACHE_VALUE._fedify;
|
|
919
|
+
}
|
|
915
920
|
var KvKeyCache = class {
|
|
916
921
|
kv;
|
|
917
922
|
prefix;
|
|
@@ -927,6 +932,10 @@ var KvKeyCache = class {
|
|
|
927
932
|
if (this.nullKeys.has(keyId.href)) return null;
|
|
928
933
|
const serialized = await this.kv.get([...this.prefix, keyId.href]);
|
|
929
934
|
if (serialized == null) return void 0;
|
|
935
|
+
if (isNullKeyCacheValue(serialized)) {
|
|
936
|
+
this.nullKeys.add(keyId.href);
|
|
937
|
+
return null;
|
|
938
|
+
}
|
|
930
939
|
try {
|
|
931
940
|
return await CryptographicKey.fromJsonLd(serialized, this.options);
|
|
932
941
|
} catch {
|
|
@@ -941,7 +950,7 @@ var KvKeyCache = class {
|
|
|
941
950
|
async set(keyId, key) {
|
|
942
951
|
if (key == null) {
|
|
943
952
|
this.nullKeys.add(keyId.href);
|
|
944
|
-
await this.kv.
|
|
953
|
+
await this.kv.set([...this.prefix, keyId.href], NULL_KEY_CACHE_VALUE, { ttl: NULL_KEY_CACHE_TTL });
|
|
945
954
|
return;
|
|
946
955
|
}
|
|
947
956
|
this.nullKeys.delete(keyId.href);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
+
|
|
5
|
+
import "./transformers-BFT6d7J5.js";
|
|
6
|
+
import "./docloader-BETPdM09.js";
|
|
7
|
+
import "./actor-CQdxP8N-.js";
|
|
8
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-Bs4xDuXR.js";
|
|
9
|
+
import "./lookup-CiSAeWJl.js";
|
|
10
|
+
import "./key-I-ibyaZH.js";
|
|
11
|
+
import "./http-PgdBoDIj.js";
|
|
12
|
+
import "./proof-flD2DeA-.js";
|
|
13
|
+
import "./types-Bu-epI-z.js";
|
|
14
|
+
import "./authdocloader-fR-Fqcpa.js";
|
|
15
|
+
import "./vocab-CBavAdew.js";
|
|
16
|
+
|
|
17
|
+
export { FederationImpl };
|