@fedify/fedify 1.7.5-pr.293.995 → 1.8.0-dev.1003
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/LICENSE +20 -0
- package/README.md +33 -0
- package/dist/{actor-CPpvuBKU.d.ts → actor-B4TBtqRP.d.ts} +2 -2
- package/dist/{actor-DpOCWBU2.js → actor-CESvGo9c.js} +179 -179
- package/dist/{actor-DCfCQoKy.js → actor-CqSuisvH.js} +3 -3
- package/dist/{assert-0DSnLFa8.js → assert-DwEa6glZ.js} +2 -2
- package/dist/{assert_equals-XhPMqqO2.js → assert_equals-C5gKCm6A.js} +10 -22
- package/dist/{assert_instance_of-v5adm_-K.js → assert_instance_of-C9QtN-X9.js} +2 -2
- package/dist/{assert_is_error-Drwb_yQp.js → assert_is_error-DQdKoRgb.js} +2 -2
- package/dist/{assert_not_equals-BRPdeJ9D.js → assert_not_equals-7pyUM3Ib.js} +2 -2
- package/dist/{assert_rejects-D_nYI1gs.js → assert_rejects-DceVjUlD.js} +4 -4
- package/dist/{assert_throws-DNuPhPNp.js → assert_throws-DTDC_gwN.js} +3 -3
- package/dist/{authdocloader-C8ocs8WK.js → authdocloader-QSRLyapW.js} +3 -3
- package/dist/{authdocloader-u7iRvJI6.js → authdocloader-rYXZAJDf.js} +3 -3
- package/dist/{builder-CoMaHOSj.js → builder-rGWE83Jn.js} +4 -4
- package/dist/{client-ve1fySOk.js → client-B3xo9NFO.js} +1 -1
- package/dist/{client-DvtwXO7t.d.ts → client-BQ4AQGKo.d.ts} +1 -1
- package/dist/compat/mod.d.ts +11 -11
- package/dist/compat/transformers.test.js +22 -22
- package/dist/{context-DPggmpB4.d.ts → context-CrSyJrIa.d.ts} +9 -9
- package/dist/{context-DJ0lZffc.js → context-T6ATmy_o.js} +3 -3
- package/dist/{denokv-CvROlGYX.js → denokv-QWKsIqML.js} +2 -0
- package/dist/{docloader-Q42SMRIB.d.ts → docloader-BeCtcTOJ.d.ts} +1 -1
- package/dist/{docloader-CWnRyKZz.js → docloader-Coh6BBtD.js} +5 -13
- package/dist/{docloader-0f763awu.js → docloader-DP2c5RKR.js} +5 -13
- package/dist/{esm-CASHO3OR.js → esm-d-9EVGaP.js} +14 -14
- package/dist/federation/builder.test.js +14 -14
- package/dist/federation/collection.test.js +8 -8
- package/dist/federation/handler.test.js +29 -29
- package/dist/federation/inbox.test.js +6 -6
- package/dist/federation/keycache.test.js +7 -7
- package/dist/federation/kv.test.js +21 -9
- package/dist/federation/middleware.test.js +644 -630
- package/dist/federation/mod.d.ts +10 -10
- package/dist/federation/mod.js +11 -11
- package/dist/federation/mq.test.js +11 -11
- package/dist/federation/retry.test.js +2 -2
- package/dist/federation/router.test.js +9 -9
- package/dist/federation/send.test.js +18 -18
- package/dist/{federation-BRIQn-GV.js → federation-C44ekWNP.js} +28 -6
- package/dist/{http-B8EiSgi2.d.ts → http-CP2ZUALI.d.ts} +2 -2
- package/dist/{http-C2jYH3Wj.js → http-CkfVl7ql.js} +29 -21
- package/dist/{http-Ctrc1mTY.js → http-lmPPO2Eo.js} +29 -21
- package/dist/{inbox-C0lZZQrn.js → inbox-CF21yedu.js} +2 -2
- package/dist/{key-w62j0nN_.js → key-BLqpPTN_.js} +3 -3
- package/dist/{key-Du7Mtz6c.js → key-BjUOfK1Q.js} +2 -2
- package/dist/{key-DdzidiHt.js → key-CSLD2uRf.js} +4 -4
- package/dist/{key-DaROeJaM.js → key-NY6yQihW.js} +5 -5
- package/dist/{keycache-HV9rL4Zg.js → keycache-yqwT_M3m.js} +1 -1
- package/dist/{keys-CLKmoYUK.js → keys-D9Gc5bvV.js} +1 -1
- package/dist/{kv-BMY6Qf_A.js → kv-D7Yt6pnB.js} +22 -0
- package/dist/{kv-DRaeSXco.d.ts → kv-DDdb1hMa.d.ts} +14 -0
- package/dist/{ld-d8SMvc77.js → ld-zsHn8nfn.js} +3 -3
- package/dist/{lookup-C0QZwcNp.js → lookup-BYgWjDk7.js} +4 -3
- package/dist/{lookup-vqz66SuH.js → lookup-BlRxqykX.js} +62 -10
- package/dist/{lookup-BhjMJsQq.js → lookup-DU2MRGYe.js} +4 -3
- package/dist/{lookup-Bf-K85bV.d.ts → lookup-J_m4YZg0.d.ts} +7 -1
- package/dist/{middleware-CaLPAUX8.js → middleware-BmxgK7wV.js} +11 -11
- package/dist/middleware-CILojq-d.js +17 -0
- package/dist/{middleware-z6PAl2ao.js → middleware-CkV-ui-y.js} +16 -16
- package/dist/middleware-NVGAT7X_.js +33 -0
- package/dist/{mod-CDzlVCUF.d.ts → mod-BFwgZ7_K.d.ts} +77 -3
- package/dist/{mod-C2drFqH8.d.ts → mod-CytXBx8A.d.ts} +2 -2
- package/dist/{mod-sEI6_uZ2.d.ts → mod-D2uPZuP-.d.ts} +3 -3
- package/dist/{mod-CbjCOiVh.d.ts → mod-DpE8T10I.d.ts} +2 -2
- package/dist/mod.d.ts +14 -14
- package/dist/mod.js +12 -12
- package/dist/nodeinfo/client.test.js +11 -11
- package/dist/nodeinfo/handler.test.js +28 -28
- package/dist/nodeinfo/mod.d.ts +3 -3
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/semver.test.js +8 -8
- package/dist/nodeinfo/types.test.js +8 -8
- package/dist/{owner-D0cOz8R5.d.ts → owner-CEv_PfyK.d.ts} +3 -3
- package/dist/{owner-B681rcfZ.js → owner-yriwUrxg.js} +3 -3
- package/dist/{proof-Ckfj_lUB.js → proof-B0keqm8m.js} +3 -3
- package/dist/{proof-R1Gw5CZB.js → proof-CTzg7mvj.js} +3 -3
- package/dist/{router-D_aVZZUc.js → router-D3UybECj.js} +1 -1
- package/dist/runtime/authdocloader.test.js +17 -17
- package/dist/runtime/docloader.test.js +11 -11
- package/dist/runtime/key.test.js +13 -13
- package/dist/runtime/langstr.test.js +8 -8
- package/dist/runtime/mod.d.ts +5 -5
- package/dist/runtime/mod.js +6 -6
- package/dist/runtime/multibase/multibase.test.js +8 -8
- package/dist/runtime/url.test.js +4 -4
- package/dist/{send-C3nUuiVP.js → send-CdU_Vjiy.js} +2 -2
- package/dist/sig/http.test.js +41 -16
- package/dist/sig/key.test.js +14 -14
- package/dist/sig/ld.test.js +12 -12
- package/dist/sig/mod.d.ts +7 -7
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +16 -16
- package/dist/sig/proof.test.js +15 -15
- package/dist/{std__assert-CmyZxqPw.js → std__assert-B3iAixc-.js} +6 -6
- package/dist/testing/docloader.test.js +8 -8
- package/dist/{types-NuyNm5jf.js → types-D9EP9eEB.js} +1 -1
- package/dist/vocab/actor.test.js +197 -190
- package/dist/vocab/lookup.test.js +13 -13
- package/dist/vocab/mod.d.ts +6 -6
- package/dist/vocab/mod.js +5 -5
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +128 -110
- package/dist/{vocab-BIEZj4Uc.js → vocab-BFfwVBw7.js} +84 -11
- package/dist/{vocab-CzEfWQk2.d.ts → vocab-By6mpzr-.d.ts} +1 -1
- package/dist/{vocab-CJVgR_C2.js → vocab-Df91ohvp.js} +178 -178
- package/dist/webfinger/handler.test.js +28 -28
- package/dist/webfinger/lookup.test.js +30 -12
- package/dist/webfinger/mod.d.ts +3 -3
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/cfworkers.d.ts +6 -1
- package/dist/x/cfworkers.js +5 -0
- package/dist/x/cfworkers.test.js +14 -9
- package/dist/x/hono.d.ts +10 -10
- package/dist/x/sveltekit.d.ts +10 -10
- package/package.json +7 -6
- package/dist/middleware-0Gslab3l.js +0 -33
- package/dist/middleware-DTBS4kbm.js +0 -17
package/dist/federation/mod.d.ts
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import { KvKey, KvStore, KvStoreSetOptions, MemoryKvStore } from "../kv-
|
4
|
-
import "../docloader-
|
5
|
-
import "../client-
|
6
|
-
import "../vocab-
|
7
|
-
import "../actor-
|
8
|
-
import "../http-
|
9
|
-
import "../owner-
|
10
|
-
import "../mod-
|
11
|
-
import "../lookup-
|
12
|
-
import { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../context-
|
3
|
+
import { KvKey, KvStore, KvStoreSetOptions, MemoryKvStore } from "../kv-DDdb1hMa.js";
|
4
|
+
import "../docloader-BeCtcTOJ.js";
|
5
|
+
import "../client-BQ4AQGKo.js";
|
6
|
+
import "../vocab-By6mpzr-.js";
|
7
|
+
import "../actor-B4TBtqRP.js";
|
8
|
+
import "../http-CP2ZUALI.js";
|
9
|
+
import "../owner-CEv_PfyK.js";
|
10
|
+
import "../mod-BFwgZ7_K.js";
|
11
|
+
import "../lookup-J_m4YZg0.js";
|
12
|
+
import { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../context-CrSyJrIa.js";
|
13
13
|
import { InProcessMessageQueue, InProcessMessageQueueOptions, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, ParallelMessageQueue } from "../mq-DYKDDJmp.js";
|
14
14
|
import "../mod-g0xFzAP9.js";
|
15
15
|
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.js
CHANGED
@@ -3,16 +3,16 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
5
|
import "../transformers-ghwJuzGY.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-
|
13
|
-
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "../federation-
|
14
|
-
import "../types-
|
15
|
-
import "../authdocloader-
|
16
|
-
import "../vocab-
|
6
|
+
import "../docloader-DP2c5RKR.js";
|
7
|
+
import "../actor-CESvGo9c.js";
|
8
|
+
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-BmxgK7wV.js";
|
9
|
+
import "../lookup-BYgWjDk7.js";
|
10
|
+
import "../key-BjUOfK1Q.js";
|
11
|
+
import "../http-lmPPO2Eo.js";
|
12
|
+
import "../proof-B0keqm8m.js";
|
13
|
+
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "../federation-C44ekWNP.js";
|
14
|
+
import "../types-D9EP9eEB.js";
|
15
|
+
import "../authdocloader-QSRLyapW.js";
|
16
|
+
import "../vocab-BFfwVBw7.js";
|
17
17
|
|
18
18
|
export { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
|
@@ -3,16 +3,16 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
7
|
-
import { assert } from "../assert-
|
8
|
-
import "../assert_instance_of-
|
6
|
+
import { assertEquals } from "../assert_equals-C5gKCm6A.js";
|
7
|
+
import { assert } from "../assert-DwEa6glZ.js";
|
8
|
+
import "../assert_instance_of-C9QtN-X9.js";
|
9
9
|
import { test } from "../testing-BZ0dJ4qn.js";
|
10
|
-
import { assertGreater, assertGreaterOrEqual } from "../std__assert-
|
11
|
-
import { assertFalse } from "../assert_rejects-
|
12
|
-
import "../assert_is_error-
|
13
|
-
import "../assert_not_equals-
|
14
|
-
import "../assert_throws-
|
15
|
-
import { delay } from "
|
10
|
+
import { assertGreater, assertGreaterOrEqual } from "../std__assert-B3iAixc-.js";
|
11
|
+
import { assertFalse } from "../assert_rejects-DceVjUlD.js";
|
12
|
+
import "../assert_is_error-DQdKoRgb.js";
|
13
|
+
import "../assert_not_equals-7pyUM3Ib.js";
|
14
|
+
import "../assert_throws-DTDC_gwN.js";
|
15
|
+
import { delay } from "es-toolkit";
|
16
16
|
|
17
17
|
//#region federation/mq.ts
|
18
18
|
/**
|
@@ -225,7 +225,7 @@ test("InProcessMessageQueue", async (t) => {
|
|
225
225
|
});
|
226
226
|
test("MessageQueue.nativeRetrial", async (t) => {
|
227
227
|
if ("Deno" in globalThis && "openKv" in globalThis.Deno && typeof globalThis.Deno.openKv === "function") await t.step("DenoKvMessageQueue", async () => {
|
228
|
-
const { DenoKvMessageQueue } = await import("../denokv-
|
228
|
+
const { DenoKvMessageQueue } = await import("../denokv-QWKsIqML.js");
|
229
229
|
const mq = new DenoKvMessageQueue(await globalThis.Deno.openKv(":memory:"));
|
230
230
|
assert(mq.nativeRetrial);
|
231
231
|
if (Symbol.dispose in mq) {
|
@@ -264,7 +264,7 @@ test("MessageQueue.nativeRetrial", async (t) => {
|
|
264
264
|
});
|
265
265
|
const queues = { InProcessMessageQueue: () => Promise.resolve(new InProcessMessageQueue()) };
|
266
266
|
if ("Deno" in globalThis && "openKv" in globalThis.Deno && typeof globalThis.Deno.openKv === "function") {
|
267
|
-
const { DenoKvMessageQueue } = await import("../denokv-
|
267
|
+
const { DenoKvMessageQueue } = await import("../denokv-QWKsIqML.js");
|
268
268
|
queues.DenoKvMessageQueue = async () => new DenoKvMessageQueue(await globalThis.Deno.openKv(":memory:"));
|
269
269
|
}
|
270
270
|
for (const mqName in queues) test({
|
@@ -3,10 +3,10 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { AssertionError, assertEquals } from "../assert_equals-
|
6
|
+
import { AssertionError, assertEquals } from "../assert_equals-C5gKCm6A.js";
|
7
7
|
import { createExponentialBackoffPolicy } from "../retry-BiIhZWgD.js";
|
8
8
|
import { test } from "../testing-BZ0dJ4qn.js";
|
9
|
-
import { assertNotEquals } from "../assert_not_equals-
|
9
|
+
import { assertNotEquals } from "../assert_not_equals-7pyUM3Ib.js";
|
10
10
|
|
11
11
|
//#region federation/retry.test.ts
|
12
12
|
test("createExponentialBackoffPolicy()", () => {
|
@@ -3,16 +3,16 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
7
|
-
import { assert } from "../assert-
|
8
|
-
import "../assert_instance_of-
|
9
|
-
import { Router, RouterError } from "../router-
|
6
|
+
import { assertEquals } from "../assert_equals-C5gKCm6A.js";
|
7
|
+
import { assert } from "../assert-DwEa6glZ.js";
|
8
|
+
import "../assert_instance_of-C9QtN-X9.js";
|
9
|
+
import { Router, RouterError } from "../router-D3UybECj.js";
|
10
10
|
import { test } from "../testing-BZ0dJ4qn.js";
|
11
|
-
import "../std__assert-
|
12
|
-
import { assertFalse } from "../assert_rejects-
|
13
|
-
import "../assert_is_error-
|
14
|
-
import "../assert_not_equals-
|
15
|
-
import { assertThrows } from "../assert_throws-
|
11
|
+
import "../std__assert-B3iAixc-.js";
|
12
|
+
import { assertFalse } from "../assert_rejects-DceVjUlD.js";
|
13
|
+
import "../assert_is_error-DQdKoRgb.js";
|
14
|
+
import "../assert_not_equals-7pyUM3Ib.js";
|
15
|
+
import { assertThrows } from "../assert_throws-DTDC_gwN.js";
|
16
16
|
|
17
17
|
//#region federation/router.test.ts
|
18
18
|
function setUp(options = {}) {
|
@@ -3,30 +3,30 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
7
|
-
import { assert } from "../assert-
|
8
|
-
import "../assert_instance_of-
|
9
|
-
import "../docloader-
|
6
|
+
import { assertEquals } from "../assert_equals-C5gKCm6A.js";
|
7
|
+
import { assert } from "../assert-DwEa6glZ.js";
|
8
|
+
import "../assert_instance_of-C9QtN-X9.js";
|
9
|
+
import "../docloader-Coh6BBtD.js";
|
10
10
|
import "../url-kTAI6_KP.js";
|
11
11
|
import "../multibase-DeCHcK8L.js";
|
12
|
-
import { Activity, Application, Endpoints, Group, Person, Service } from "../vocab-
|
12
|
+
import { Activity, Application, Endpoints, Group, Person, Service } from "../vocab-Df91ohvp.js";
|
13
13
|
import "../langstr-DbWheeIS.js";
|
14
|
-
import "../lookup-
|
14
|
+
import "../lookup-DU2MRGYe.js";
|
15
15
|
import "../type-D2s5lmbZ.js";
|
16
|
-
import "../actor-
|
17
|
-
import "../key-
|
18
|
-
import { verifyRequest } from "../http-
|
19
|
-
import { doesActorOwnKey } from "../owner-
|
20
|
-
import { extractInboxes, sendActivity } from "../send-
|
16
|
+
import "../actor-CqSuisvH.js";
|
17
|
+
import "../key-BLqpPTN_.js";
|
18
|
+
import { verifyRequest } from "../http-CkfVl7ql.js";
|
19
|
+
import { doesActorOwnKey } from "../owner-yriwUrxg.js";
|
20
|
+
import { extractInboxes, sendActivity } from "../send-CdU_Vjiy.js";
|
21
21
|
import { test } from "../testing-BZ0dJ4qn.js";
|
22
|
-
import "../std__assert-
|
23
|
-
import { assertFalse, assertRejects } from "../assert_rejects-
|
24
|
-
import "../assert_is_error-
|
25
|
-
import { assertNotEquals } from "../assert_not_equals-
|
26
|
-
import "../assert_throws-
|
22
|
+
import "../std__assert-B3iAixc-.js";
|
23
|
+
import { assertFalse, assertRejects } from "../assert_rejects-DceVjUlD.js";
|
24
|
+
import "../assert_is_error-DQdKoRgb.js";
|
25
|
+
import { assertNotEquals } from "../assert_not_equals-7pyUM3Ib.js";
|
26
|
+
import "../assert_throws-DTDC_gwN.js";
|
27
27
|
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
28
|
-
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-
|
29
|
-
import { esm_default } from "../esm-
|
28
|
+
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-D9Gc5bvV.js";
|
29
|
+
import { esm_default } from "../esm-d-9EVGaP.js";
|
30
30
|
|
31
31
|
//#region federation/send.test.ts
|
32
32
|
test("extractInboxes()", () => {
|
@@ -2,6 +2,8 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
+
import { isEqual } from "es-toolkit";
|
6
|
+
|
5
7
|
//#region federation/kv.ts
|
6
8
|
/**
|
7
9
|
* A key–value store that stores values in memory.
|
@@ -45,6 +47,26 @@ var MemoryKvStore = class {
|
|
45
47
|
delete this.#values[encodedKey];
|
46
48
|
return Promise.resolve();
|
47
49
|
}
|
50
|
+
/**
|
51
|
+
* {@inheritDoc KvStore.cas}
|
52
|
+
*/
|
53
|
+
cas(key, expectedValue, newValue, options) {
|
54
|
+
const encodedKey = this.#encodeKey(key);
|
55
|
+
const entry = this.#values[encodedKey];
|
56
|
+
let currentValue;
|
57
|
+
if (entry == null) currentValue = void 0;
|
58
|
+
else {
|
59
|
+
const [value, expiration$1] = entry;
|
60
|
+
if (expiration$1 != null && Temporal.Now.instant().until(expiration$1).sign < 0) {
|
61
|
+
delete this.#values[encodedKey];
|
62
|
+
currentValue = void 0;
|
63
|
+
} else currentValue = value;
|
64
|
+
}
|
65
|
+
if (!isEqual(currentValue, expectedValue)) return Promise.resolve(false);
|
66
|
+
const expiration = options?.ttl == null ? null : Temporal.Now.instant().add(options.ttl.round({ largestUnit: "hour" }));
|
67
|
+
this.#values[encodedKey] = [newValue, expiration];
|
68
|
+
return Promise.resolve(true);
|
69
|
+
}
|
48
70
|
};
|
49
71
|
|
50
72
|
//#endregion
|
@@ -75,12 +97,12 @@ var InProcessMessageQueue = class {
|
|
75
97
|
this.#pollIntervalMs = Temporal.Duration.from(options.pollInterval ?? { seconds: 5 }).total("millisecond");
|
76
98
|
}
|
77
99
|
enqueue(message, options) {
|
78
|
-
const delay = options?.delay == null ? 0 : Math.max(options.delay.total("millisecond"), 0);
|
79
|
-
if (delay > 0) {
|
100
|
+
const delay$1 = options?.delay == null ? 0 : Math.max(options.delay.total("millisecond"), 0);
|
101
|
+
if (delay$1 > 0) {
|
80
102
|
setTimeout(() => this.enqueue(message, {
|
81
103
|
...options,
|
82
104
|
delay: void 0
|
83
|
-
}), delay);
|
105
|
+
}), delay$1);
|
84
106
|
return Promise.resolve();
|
85
107
|
}
|
86
108
|
this.#messages.push(message);
|
@@ -89,12 +111,12 @@ var InProcessMessageQueue = class {
|
|
89
111
|
}
|
90
112
|
enqueueMany(messages, options) {
|
91
113
|
if (messages.length === 0) return Promise.resolve();
|
92
|
-
const delay = options?.delay == null ? 0 : Math.max(options.delay.total("millisecond"), 0);
|
93
|
-
if (delay > 0) {
|
114
|
+
const delay$1 = options?.delay == null ? 0 : Math.max(options.delay.total("millisecond"), 0);
|
115
|
+
if (delay$1 > 0) {
|
94
116
|
setTimeout(() => this.enqueueMany(messages, {
|
95
117
|
...options,
|
96
118
|
delay: void 0
|
97
|
-
}), delay);
|
119
|
+
}), delay$1);
|
98
120
|
return Promise.resolve();
|
99
121
|
}
|
100
122
|
this.#messages.push(...messages);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import { DocumentLoader } from "./docloader-
|
4
|
-
import { CryptographicKey, Multikey } from "./vocab-
|
3
|
+
import { DocumentLoader } from "./docloader-BeCtcTOJ.js";
|
4
|
+
import { CryptographicKey, Multikey } from "./vocab-By6mpzr-.js";
|
5
5
|
import { TracerProvider } from "@opentelemetry/api";
|
6
6
|
|
7
7
|
//#region sig/key.d.ts
|
@@ -3,9 +3,9 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { deno_default } from "./docloader-
|
7
|
-
import { CryptographicKey } from "./vocab-
|
8
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
6
|
+
import { deno_default } from "./docloader-Coh6BBtD.js";
|
7
|
+
import { CryptographicKey } from "./vocab-Df91ohvp.js";
|
8
|
+
import { fetchKey, validateCryptoKey } from "./key-BLqpPTN_.js";
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
10
10
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
11
11
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
@@ -645,6 +645,29 @@ async function verifyRequestRfc9421(request, span, { documentLoader, contextLoad
|
|
645
645
|
return validKey;
|
646
646
|
}
|
647
647
|
/**
|
648
|
+
* Helper function to create a new Request for redirect handling.
|
649
|
+
* @param request The original request.
|
650
|
+
* @param location The redirect location.
|
651
|
+
* @param body The request body as ArrayBuffer or undefined.
|
652
|
+
* @returns A new Request object for the redirect.
|
653
|
+
*/
|
654
|
+
function createRedirectRequest(request, location, body) {
|
655
|
+
return new Request(location, {
|
656
|
+
method: request.method,
|
657
|
+
headers: request.headers,
|
658
|
+
body,
|
659
|
+
redirect: "manual",
|
660
|
+
signal: request.signal,
|
661
|
+
mode: request.mode,
|
662
|
+
credentials: request.credentials,
|
663
|
+
referrer: request.referrer,
|
664
|
+
referrerPolicy: request.referrerPolicy,
|
665
|
+
integrity: request.integrity,
|
666
|
+
keepalive: request.keepalive,
|
667
|
+
cache: request.cache
|
668
|
+
});
|
669
|
+
}
|
670
|
+
/**
|
648
671
|
* Performs a double-knock request to the given URL. For the details of
|
649
672
|
* double-knocking, see
|
650
673
|
* <https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions>.
|
@@ -667,19 +690,7 @@ async function doubleKnock(request, identity, options = {}) {
|
|
667
690
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
668
691
|
const location = response.headers.get("Location");
|
669
692
|
const body = request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : void 0;
|
670
|
-
return doubleKnock(
|
671
|
-
method: request.method,
|
672
|
-
headers: request.headers,
|
673
|
-
body,
|
674
|
-
redirect: "manual",
|
675
|
-
signal: request.signal,
|
676
|
-
mode: request.mode,
|
677
|
-
credentials: request.credentials,
|
678
|
-
referrer: request.referrer,
|
679
|
-
referrerPolicy: request.referrerPolicy,
|
680
|
-
integrity: request.integrity,
|
681
|
-
keepalive: request.keepalive
|
682
|
-
}), identity, options);
|
693
|
+
return doubleKnock(createRedirectRequest(request, location, body), identity, options);
|
683
694
|
} else if (response.status === 400 || response.status === 401 || response.status > 401) {
|
684
695
|
const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
|
685
696
|
getLogger([
|
@@ -700,11 +711,8 @@ async function doubleKnock(request, identity, options = {}) {
|
|
700
711
|
response = await fetch(signedRequest, { redirect: "manual" });
|
701
712
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
702
713
|
const location = response.headers.get("Location");
|
703
|
-
const body = request.method !== "GET" && request.method !== "HEAD" ? request.clone().
|
704
|
-
return doubleKnock(
|
705
|
-
...request,
|
706
|
-
body
|
707
|
-
}), identity, options);
|
714
|
+
const body = request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : void 0;
|
715
|
+
return doubleKnock(createRedirectRequest(request, location, body), identity, options);
|
708
716
|
} else if (response.status !== 400 && response.status !== 401) await specDeterminer?.rememberSpec(origin, spec);
|
709
717
|
} else await specDeterminer?.rememberSpec(origin, firstTrySpec);
|
710
718
|
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 { deno_default } from "./docloader-DP2c5RKR.js";
|
6
|
+
import { CryptographicKey } from "./actor-CESvGo9c.js";
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-BjUOfK1Q.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";
|
@@ -644,6 +644,29 @@ async function verifyRequestRfc9421(request, span, { documentLoader, contextLoad
|
|
644
644
|
return validKey;
|
645
645
|
}
|
646
646
|
/**
|
647
|
+
* Helper function to create a new Request for redirect handling.
|
648
|
+
* @param request The original request.
|
649
|
+
* @param location The redirect location.
|
650
|
+
* @param body The request body as ArrayBuffer or undefined.
|
651
|
+
* @returns A new Request object for the redirect.
|
652
|
+
*/
|
653
|
+
function createRedirectRequest(request, location, body) {
|
654
|
+
return new Request(location, {
|
655
|
+
method: request.method,
|
656
|
+
headers: request.headers,
|
657
|
+
body,
|
658
|
+
redirect: "manual",
|
659
|
+
signal: request.signal,
|
660
|
+
mode: request.mode,
|
661
|
+
credentials: request.credentials,
|
662
|
+
referrer: request.referrer,
|
663
|
+
referrerPolicy: request.referrerPolicy,
|
664
|
+
integrity: request.integrity,
|
665
|
+
keepalive: request.keepalive,
|
666
|
+
cache: request.cache
|
667
|
+
});
|
668
|
+
}
|
669
|
+
/**
|
647
670
|
* Performs a double-knock request to the given URL. For the details of
|
648
671
|
* double-knocking, see
|
649
672
|
* <https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions>.
|
@@ -666,19 +689,7 @@ async function doubleKnock(request, identity, options = {}) {
|
|
666
689
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
667
690
|
const location = response.headers.get("Location");
|
668
691
|
const body = request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : void 0;
|
669
|
-
return doubleKnock(
|
670
|
-
method: request.method,
|
671
|
-
headers: request.headers,
|
672
|
-
body,
|
673
|
-
redirect: "manual",
|
674
|
-
signal: request.signal,
|
675
|
-
mode: request.mode,
|
676
|
-
credentials: request.credentials,
|
677
|
-
referrer: request.referrer,
|
678
|
-
referrerPolicy: request.referrerPolicy,
|
679
|
-
integrity: request.integrity,
|
680
|
-
keepalive: request.keepalive
|
681
|
-
}), identity, options);
|
692
|
+
return doubleKnock(createRedirectRequest(request, location, body), identity, options);
|
682
693
|
} else if (response.status === 400 || response.status === 401 || response.status > 401) {
|
683
694
|
const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
|
684
695
|
getLogger([
|
@@ -699,11 +710,8 @@ async function doubleKnock(request, identity, options = {}) {
|
|
699
710
|
response = await fetch(signedRequest, { redirect: "manual" });
|
700
711
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
701
712
|
const location = response.headers.get("Location");
|
702
|
-
const body = request.method !== "GET" && request.method !== "HEAD" ? request.clone().
|
703
|
-
return doubleKnock(
|
704
|
-
...request,
|
705
|
-
body
|
706
|
-
}), identity, options);
|
713
|
+
const body = request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : void 0;
|
714
|
+
return doubleKnock(createRedirectRequest(request, location, body), identity, options);
|
707
715
|
} else if (response.status !== 400 && response.status !== 401) await specDeterminer?.rememberSpec(origin, spec);
|
708
716
|
} else await specDeterminer?.rememberSpec(origin, firstTrySpec);
|
709
717
|
return response;
|
@@ -3,8 +3,8 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { deno_default } from "./docloader-
|
7
|
-
import { Activity } from "./vocab-
|
6
|
+
import { deno_default } from "./docloader-Coh6BBtD.js";
|
7
|
+
import { Activity } from "./vocab-Df91ohvp.js";
|
8
8
|
import { getTypeId } from "./type-D2s5lmbZ.js";
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
10
10
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
@@ -3,9 +3,9 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { deno_default, getDocumentLoader } from "./docloader-
|
7
|
-
import { CryptographicKey, Object as Object$1 } from "./vocab-
|
8
|
-
import { isActor } from "./actor-
|
6
|
+
import { deno_default, getDocumentLoader } from "./docloader-Coh6BBtD.js";
|
7
|
+
import { CryptographicKey, Object as Object$1 } from "./vocab-Df91ohvp.js";
|
8
|
+
import { isActor } from "./actor-CqSuisvH.js";
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
10
10
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
11
11
|
|
@@ -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-DP2c5RKR.js";
|
6
|
+
import { CryptographicKey, Object as Object$1, isActor } from "./actor-CESvGo9c.js";
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
8
8
|
import { SpanKind, SpanStatusCode, 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-DP2c5RKR.js";
|
6
|
+
import "./actor-CESvGo9c.js";
|
7
|
+
import "./lookup-BYgWjDk7.js";
|
8
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "./key-BjUOfK1Q.js";
|
9
9
|
|
10
10
|
export { validateCryptoKey };
|
@@ -3,14 +3,14 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import "./docloader-
|
6
|
+
import "./docloader-Coh6BBtD.js";
|
7
7
|
import "./url-kTAI6_KP.js";
|
8
8
|
import "./multibase-DeCHcK8L.js";
|
9
|
-
import "./vocab-
|
9
|
+
import "./vocab-Df91ohvp.js";
|
10
10
|
import "./langstr-DbWheeIS.js";
|
11
|
-
import "./lookup-
|
11
|
+
import "./lookup-DU2MRGYe.js";
|
12
12
|
import "./type-D2s5lmbZ.js";
|
13
|
-
import "./actor-
|
14
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "./key-
|
13
|
+
import "./actor-CqSuisvH.js";
|
14
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "./key-BLqpPTN_.js";
|
15
15
|
|
16
16
|
export { validateCryptoKey };
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { CryptographicKey, Multikey } from "./vocab-
|
6
|
+
import { CryptographicKey, Multikey } from "./vocab-Df91ohvp.js";
|
7
7
|
|
8
8
|
//#region federation/keycache.ts
|
9
9
|
var KvKeyCache = class {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { CryptographicKey, Multikey, importSpki } from "./vocab-
|
6
|
+
import { CryptographicKey, Multikey, importSpki } from "./vocab-Df91ohvp.js";
|
7
7
|
|
8
8
|
//#region testing/keys.ts
|
9
9
|
const rsaPublicKey1 = new CryptographicKey({
|
@@ -3,6 +3,8 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
+
import { isEqual } from "es-toolkit";
|
7
|
+
|
6
8
|
//#region federation/kv.ts
|
7
9
|
/**
|
8
10
|
* A key–value store that stores values in memory.
|
@@ -46,6 +48,26 @@ var MemoryKvStore = class {
|
|
46
48
|
delete this.#values[encodedKey];
|
47
49
|
return Promise.resolve();
|
48
50
|
}
|
51
|
+
/**
|
52
|
+
* {@inheritDoc KvStore.cas}
|
53
|
+
*/
|
54
|
+
cas(key, expectedValue, newValue, options) {
|
55
|
+
const encodedKey = this.#encodeKey(key);
|
56
|
+
const entry = this.#values[encodedKey];
|
57
|
+
let currentValue;
|
58
|
+
if (entry == null) currentValue = void 0;
|
59
|
+
else {
|
60
|
+
const [value, expiration$1] = entry;
|
61
|
+
if (expiration$1 != null && Temporal.Now.instant().until(expiration$1).sign < 0) {
|
62
|
+
delete this.#values[encodedKey];
|
63
|
+
currentValue = void 0;
|
64
|
+
} else currentValue = value;
|
65
|
+
}
|
66
|
+
if (!isEqual(currentValue, expectedValue)) return Promise.resolve(false);
|
67
|
+
const expiration = options?.ttl == null ? null : Temporal.Now.instant().add(options.ttl.round({ largestUnit: "hour" }));
|
68
|
+
this.#values[encodedKey] = [newValue, expiration];
|
69
|
+
return Promise.resolve(true);
|
70
|
+
}
|
49
71
|
};
|
50
72
|
|
51
73
|
//#endregion
|
@@ -44,6 +44,16 @@ interface KvStore {
|
|
44
44
|
* @param key The key to delete.
|
45
45
|
*/
|
46
46
|
delete(key: KvKey): Promise<void>;
|
47
|
+
/**
|
48
|
+
* Compare-and-swap (CAS) operation for the key–value store.
|
49
|
+
* @param key The key to perform the CAS operation on.
|
50
|
+
* @param expectedValue The expected value for the key.
|
51
|
+
* @param newValue The new value to set if the expected value matches.
|
52
|
+
* @param options Additional options for setting the value.
|
53
|
+
* @return `true` if the CAS operation was successful, `false` otherwise.
|
54
|
+
* @since 1.8.0
|
55
|
+
*/
|
56
|
+
cas?: (key: KvKey, expectedValue: unknown, newValue: unknown, options?: KvStoreSetOptions) => Promise<boolean>;
|
47
57
|
}
|
48
58
|
/**
|
49
59
|
* A key–value store that stores values in memory.
|
@@ -65,6 +75,10 @@ declare class MemoryKvStore implements KvStore {
|
|
65
75
|
* {@inheritDoc KvStore.delete}
|
66
76
|
*/
|
67
77
|
delete(key: KvKey): Promise<void>;
|
78
|
+
/**
|
79
|
+
* {@inheritDoc KvStore.cas}
|
80
|
+
*/
|
81
|
+
cas(key: KvKey, expectedValue: unknown, newValue: unknown, options?: KvStoreSetOptions): Promise<boolean>;
|
68
82
|
}
|
69
83
|
//#endregion
|
70
84
|
export { KvKey, KvStore, KvStoreSetOptions, MemoryKvStore };
|
@@ -3,10 +3,10 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { deno_default, getDocumentLoader } from "./docloader-
|
7
|
-
import { Activity, CryptographicKey, Object as Object$1 } from "./vocab-
|
6
|
+
import { deno_default, getDocumentLoader } from "./docloader-Coh6BBtD.js";
|
7
|
+
import { Activity, CryptographicKey, Object as Object$1 } from "./vocab-Df91ohvp.js";
|
8
8
|
import { getTypeId } from "./type-D2s5lmbZ.js";
|
9
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
9
|
+
import { fetchKey, validateCryptoKey } from "./key-BLqpPTN_.js";
|
10
10
|
import { getLogger } from "@logtape/logtape";
|
11
11
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
12
12
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
@@ -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-DP2c5RKR.js";
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
7
7
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
8
8
|
|
@@ -12,7 +12,7 @@ const logger = getLogger([
|
|
12
12
|
"webfinger",
|
13
13
|
"lookup"
|
14
14
|
]);
|
15
|
-
const
|
15
|
+
const DEFAULT_MAX_REDIRECTION = 5;
|
16
16
|
/**
|
17
17
|
* Looks up a WebFinger resource.
|
18
18
|
* @param resource The resource URL to look up.
|
@@ -90,7 +90,8 @@ async function lookupWebFingerInternal(resource, options = {}) {
|
|
90
90
|
}
|
91
91
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
92
92
|
redirected++;
|
93
|
-
|
93
|
+
const maxRedirection = options.maxRedirection ?? DEFAULT_MAX_REDIRECTION;
|
94
|
+
if (redirected >= maxRedirection) {
|
94
95
|
logger.error("Too many redirections ({redirections}) while fetching WebFinger resource descriptor.", { redirections: redirected });
|
95
96
|
return null;
|
96
97
|
}
|