@fedify/fedify 2.2.1 → 2.2.2
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-DYb3SudV.mjs → builder-Bw2K7xaq.mjs} +2 -2
- package/dist/{chunk-nlSIicah.js → chunk-CRNNMoPX.js} +2 -2
- package/dist/{client-z-8dc-e1.d.cts → client-CAM_bQXx.d.cts} +1 -0
- package/dist/{client-AtlibPOU.d.ts → client-CSddvgWN.d.ts} +1 -2
- package/dist/compat/mod.d.cts +2 -1
- package/dist/compat/mod.d.ts +2 -3
- package/dist/compat/mod.js +3 -3
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{context-DJGagtNd.d.cts → context-BPMgyX7m.d.ts} +6 -5
- package/dist/{context-BzH2-ajs.d.ts → context-DwkhwUX9.d.cts} +6 -7
- package/dist/{deno-mvUeVczh.mjs → deno-DCXSCeB3.mjs} +1 -1
- package/dist/{docloader-BLsi-2mD.mjs → docloader-BqX3RfO-.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/middleware.test.mjs +6 -6
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +4 -3
- package/dist/federation/mod.d.ts +4 -5
- package/dist/federation/mod.js +2 -2
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{http-CrGuipxe.d.cts → http-BDZeS5om.d.ts} +2 -1
- package/dist/{http-Vlmbn5B8.mjs → http-Bslazr8_.mjs} +58 -10
- package/dist/{http-aQzN9Ayi.d.ts → http-C87EWkO0.d.cts} +2 -3
- package/dist/{http-D83HjGP5.cjs → http-DhcDuRya.cjs} +57 -9
- package/dist/{http-B2myqcJR.js → http-FZD1s7yO.js} +58 -10
- package/dist/{key-DTvO2ssE.mjs → key-Dk8-s0bs.mjs} +1 -1
- package/dist/{kv-CbLNp3zQ.d.cts → kv-D6hNiMTK.d.ts} +1 -0
- package/dist/{kv-cache-BbJq5kGB.js → kv-cache-BYBaA6NP.js} +2 -2
- package/dist/{kv-cache-Dj8fSsWU.cjs → kv-cache-Csre9hbs.cjs} +2 -2
- package/dist/{kv-cache-U__xU4qR.mjs → kv-cache-DYsF2MhP.mjs} +1 -1
- package/dist/{kv-GFYnFoOl.d.ts → kv-gJ8LYbxX.d.cts} +1 -3
- package/dist/{ld-BtpjIzvs.mjs → ld-BPA4jaBc.mjs} +2 -2
- package/dist/{middleware-7uXlGejW.mjs → middleware-AO-0hf_I.mjs} +10 -10
- package/dist/{middleware-huKeo4t5.js → middleware-BEw9z4kK.js} +7 -7
- package/dist/{middleware-DSsfLI3G.mjs → middleware-CDwTn0jH.mjs} +1 -1
- package/dist/{middleware-vq7fxMf5.cjs → middleware-D5H3hLTL.cjs} +1 -1
- package/dist/{middleware-BSuNDzz1.cjs → middleware-DBU9HFil.cjs} +4 -4
- package/dist/{mod-CLgIXe9w.d.ts → mod-B0rWmfW5.d.cts} +4 -5
- package/dist/{mod-CMEbIaNh.d.cts → mod-BhU_H1I_.d.ts} +4 -3
- package/dist/{mod-2d12ffz3.d.ts → mod-Bi6WOdti.d.cts} +2 -3
- package/dist/{mod-D35TRn09.d.cts → mod-CNAHY39V.d.ts} +2 -1
- package/dist/{mod-Cr3f-ACa.d.cts → mod-DHO9lk3D.d.ts} +3 -2
- package/dist/{mod-CR8soWa9.d.ts → mod-DXY9JF28.d.cts} +3 -4
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +9 -8
- package/dist/mod.d.ts +9 -10
- package/dist/mod.js +9 -9
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/nodeinfo/mod.d.cts +2 -1
- package/dist/nodeinfo/mod.d.ts +2 -3
- package/dist/nodeinfo/mod.js +3 -3
- package/dist/otel/mod.d.cts +2 -1
- package/dist/otel/mod.d.ts +2 -3
- package/dist/otel/mod.js +2 -2
- package/dist/{owner-CptqhsOy.d.cts → owner-CnngXDNJ.d.ts} +2 -1
- package/dist/{owner-74ARJ5TL.d.ts → owner-DEvZuyOE.d.cts} +2 -3
- package/dist/{owner-DSisAQmf.mjs → owner-SWOTNh3d.mjs} +2 -2
- package/dist/{proof-C2ej_fUH.mjs → proof-BMoWLd-F.mjs} +2 -2
- package/dist/{proof-Du7xQdqD.js → proof-BT_TJd2j.js} +2 -2
- package/dist/{proof-BcQuuoiD.cjs → proof-e42uuEG9.cjs} +1 -1
- package/dist/runtime/mod.d.cts +1 -0
- package/dist/runtime/mod.d.ts +1 -2
- package/dist/runtime/mod.js +3 -3
- package/dist/{send-Cuqmi6dk.mjs → send-ir10TETC.mjs} +2 -2
- package/dist/sig/http.test.mjs +120 -2
- package/dist/sig/key.test.mjs +1 -1
- package/dist/sig/ld.test.mjs +2 -2
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.d.cts +4 -3
- package/dist/sig/mod.d.ts +4 -5
- package/dist/sig/mod.js +4 -4
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/proof.test.mjs +1 -1
- package/dist/{transformers-ve6e2xcg.js → transformers-BGMIq1cs.js} +2 -2
- package/dist/{types-hvL8ElAs.js → types-CAY3OdLq.js} +2 -2
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.d.cts +2 -1
- package/dist/utils/mod.d.ts +2 -3
- package/dist/utils/mod.js +3 -3
- package/dist/vocab/mod.d.cts +1 -0
- package/dist/vocab/mod.d.ts +1 -2
- package/dist/vocab/mod.js +2 -2
- package/package.json +6 -6
|
@@ -2,7 +2,7 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { n as RouterError, t as Router } from "./router-CrMLXoOr.mjs";
|
|
5
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
+
import { n as version, t as name } from "./deno-DCXSCeB3.mjs";
|
|
6
6
|
import { t as ActivityListenerSet } from "./activity-listener-ell7W1s9.mjs";
|
|
7
7
|
import { Tombstone, getTypeId } from "@fedify/vocab";
|
|
8
8
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -58,7 +58,7 @@ var FederationBuilderImpl = class {
|
|
|
58
58
|
this.collectionTypeIds = {};
|
|
59
59
|
}
|
|
60
60
|
async build(options) {
|
|
61
|
-
const { FederationImpl } = await import("./middleware-
|
|
61
|
+
const { FederationImpl } = await import("./middleware-CDwTn0jH.mjs");
|
|
62
62
|
const f = new FederationImpl(options);
|
|
63
63
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
64
64
|
f.router = this.router.clone();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "@js-temporal/polyfill";
|
|
2
|
-
import "urlpattern-polyfill";
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
//#region \0rolldown/runtime.js
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/compat/mod.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
2
|
+
import { Ot as ActivityTransformer, n as Context } from "../context-DwkhwUX9.cjs";
|
|
2
3
|
import { Activity } from "@fedify/vocab";
|
|
3
4
|
|
|
4
5
|
//#region src/compat/transformers.d.ts
|
package/dist/compat/mod.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { Ot as ActivityTransformer, n as Context } from "../context-BzH2-ajs.js";
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
2
|
+
import { Ot as ActivityTransformer, n as Context } from "../context-BPMgyX7m.js";
|
|
4
3
|
import { Activity } from "@fedify/vocab";
|
|
5
4
|
|
|
6
5
|
//#region src/compat/transformers.d.ts
|
package/dist/compat/mod.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "@js-temporal/polyfill";
|
|
2
|
-
import "urlpattern-polyfill";
|
|
3
|
-
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "../transformers-
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
+
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "../transformers-BGMIq1cs.js";
|
|
4
4
|
export { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
|
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
5
5
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
6
6
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
8
|
-
import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-
|
|
8
|
+
import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-AO-0hf_I.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
import { Follow, Person } from "@fedify/vocab";
|
|
11
11
|
//#region src/compat/transformers.test.ts
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import { o as
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
2
|
+
import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client-CSddvgWN.js";
|
|
3
|
+
import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-BDZeS5om.js";
|
|
4
|
+
import { n as GetKeyOwnerOptions } from "./owner-CnngXDNJ.js";
|
|
5
|
+
import { n as KvStore, t as KvKey } from "./kv-D6hNiMTK.js";
|
|
5
6
|
import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, Tombstone, TraverseCollectionOptions } from "@fedify/vocab";
|
|
7
|
+
import { Span, Tracer, TracerProvider } from "@opentelemetry/api";
|
|
6
8
|
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
7
9
|
import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
|
|
8
|
-
import { Span, Tracer, TracerProvider } from "@opentelemetry/api";
|
|
9
10
|
|
|
10
11
|
//#region src/compat/types.d.ts
|
|
11
12
|
/**
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { o as
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import { n as KvStore, t as KvKey } from "./kv-GFYnFoOl.js";
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
2
|
+
import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client-CAM_bQXx.cjs";
|
|
3
|
+
import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-C87EWkO0.cjs";
|
|
4
|
+
import { n as GetKeyOwnerOptions } from "./owner-DEvZuyOE.cjs";
|
|
5
|
+
import { n as KvStore, t as KvKey } from "./kv-gJ8LYbxX.cjs";
|
|
7
6
|
import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, Tombstone, TraverseCollectionOptions } from "@fedify/vocab";
|
|
8
|
-
import { Span, Tracer, TracerProvider } from "@opentelemetry/api";
|
|
9
7
|
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
10
8
|
import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
|
|
9
|
+
import { Span, Tracer, TracerProvider } from "@opentelemetry/api";
|
|
11
10
|
|
|
12
11
|
//#region src/compat/types.d.ts
|
|
13
12
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { o as validateCryptoKey } from "./key-
|
|
5
|
-
import { n as doubleKnock } from "./http-
|
|
4
|
+
import { o as validateCryptoKey } from "./key-Dk8-s0bs.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-Bslazr8_.mjs";
|
|
6
6
|
import { curry } from "es-toolkit";
|
|
7
7
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
@@ -6,7 +6,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
6
6
|
import { i as assertExists } from "../std__assert-CRDpx_HF.mjs";
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
8
8
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
9
|
-
import { n as createFederationBuilder } from "../builder-
|
|
9
|
+
import { n as createFederationBuilder } from "../builder-Bw2K7xaq.mjs";
|
|
10
10
|
import { test } from "@fedify/fixture";
|
|
11
11
|
import { Activity, Note, Person } from "@fedify/vocab";
|
|
12
12
|
//#region src/federation/builder.test.ts
|
|
@@ -7,10 +7,10 @@ import "../std__assert-CRDpx_HF.mjs";
|
|
|
7
7
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
8
8
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
9
9
|
import { r as parseAcceptSignature } from "../accept-CPkZzmGN.mjs";
|
|
10
|
-
import { s as signRequest } from "../http-
|
|
10
|
+
import { s as signRequest } from "../http-Bslazr8_.mjs";
|
|
11
11
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-DGu1NFwu.mjs";
|
|
12
12
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
13
|
-
import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-
|
|
13
|
+
import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-AO-0hf_I.mjs";
|
|
14
14
|
import { t as ActivityListenerSet } from "../activity-listener-ell7W1s9.mjs";
|
|
15
15
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { Activity, Create, Note, Person, Tombstone } from "@fedify/vocab";
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import "../std__assert-CRDpx_HF.mjs";
|
|
6
6
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
|
|
7
|
-
import { r as signObject } from "../proof-
|
|
7
|
+
import { r as signObject } from "../proof-BMoWLd-F.mjs";
|
|
8
8
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
9
|
-
import { o as createFederation } from "../middleware-
|
|
9
|
+
import { o as createFederation } from "../middleware-AO-0hf_I.mjs";
|
|
10
10
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
11
11
|
import { Create, Follow, Person } from "@fedify/vocab";
|
|
12
12
|
//#region src/federation/idempotency.test.ts
|
|
@@ -11,14 +11,14 @@ import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
|
11
11
|
import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
|
|
12
12
|
import { t as assertStrictEquals } from "../assert_strict_equals-Dmjbg-bA.mjs";
|
|
13
13
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
14
|
-
import { l as verifyRequest, s as signRequest } from "../http-
|
|
14
|
+
import { l as verifyRequest, s as signRequest } from "../http-Bslazr8_.mjs";
|
|
15
15
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
|
|
16
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
17
|
-
import { a as signJsonLd, o as verifyJsonLd, r as detachSignature } from "../ld-
|
|
18
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
19
|
-
import { i as verifyObject, r as signObject } from "../proof-
|
|
16
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-BqX3RfO-.mjs";
|
|
17
|
+
import { a as signJsonLd, o as verifyJsonLd, r as detachSignature } from "../ld-BPA4jaBc.mjs";
|
|
18
|
+
import { t as doesActorOwnKey } from "../owner-SWOTNh3d.mjs";
|
|
19
|
+
import { i as verifyObject, r as signObject } from "../proof-BMoWLd-F.mjs";
|
|
20
20
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
21
|
-
import { i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-
|
|
21
|
+
import { i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-AO-0hf_I.mjs";
|
|
22
22
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
23
23
|
import * as vocab from "@fedify/vocab";
|
|
24
24
|
import { getTypeId, lookupObject } from "@fedify/vocab";
|
package/dist/federation/mod.cjs
CHANGED
|
@@ -2,7 +2,7 @@ const { Temporal } = require("@js-temporal/polyfill");
|
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
require("../chunk-DDcVe30Y.cjs");
|
|
5
|
-
const require_middleware = require("../middleware-
|
|
5
|
+
const require_middleware = require("../middleware-DBU9HFil.cjs");
|
|
6
6
|
let es_toolkit = require("es-toolkit");
|
|
7
7
|
//#region src/federation/kv.ts
|
|
8
8
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { a as
|
|
3
|
-
import { n as
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
2
|
+
import { $ as ActorAliasMapper, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as SendActivityError, D as ObjectCallbackSetters, Dt as digest, E as InboxListenerSetters, Et as buildCollectionSynchronizationHeader, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, P as CreateExponentialBackoffPolicyOptions, Q as ParallelMessageQueue, R as Message, S as FederationStartQueueOptions, St as WebFingerLinksDispatcher, T as InboxChallengePolicy, Tt as PageItems, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueEnqueueOptions, Y as MessageQueue, Z as MessageQueueListenOptions, _ as Federatable, _t as OutboxListenerErrorHandler, a as GetSignedKeyOptions, at as CollectionCursor, b as FederationFetchOptions, bt as UnverifiedActivityHandler, c as ParseUriResult, ct as CustomCollectionCursor, d as SendActivityOptions, dt as InboxListener, et as ActorDispatcher, f as SendActivityOptionsForCollection, ft as NodeInfoDispatcher, g as CustomCollectionCallbackSetters, gt as OutboxListener, h as ConstructorWithTypeId, ht as OutboxErrorHandler, i as GetActorOptions, it as CollectionCounter, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionDispatcher, m as CollectionCallbackSetters, mt as ObjectDispatcher, n as Context, nt as ActorKeyPairsDispatcher, o as InboxContext, ot as CollectionDispatcher, p as ActorCallbackSetters, pt as ObjectAuthorizePredicate, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as AuthorizePredicate, s as OutboxContext, st as CustomCollectionCounter, t as ActorKeyPair, tt as ActorHandleMapper, u as RouteActivityOptions, ut as InboxErrorHandler, v as Federation, vt as OutboxPermanentFailureHandler, w as IdempotencyStrategy, wt as SenderKeyPair, x as FederationOptions, xt as UnverifiedActivityReason, y as FederationBuilder, yt as SharedInboxKeyDispatcher, z as createFederationBuilder } from "../context-DwkhwUX9.cjs";
|
|
3
|
+
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-gJ8LYbxX.cjs";
|
|
4
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-Bi6WOdti.cjs";
|
|
4
5
|
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-2d12ffz3.js";
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
2
|
+
import { $ as ActorAliasMapper, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as SendActivityError, D as ObjectCallbackSetters, Dt as digest, E as InboxListenerSetters, Et as buildCollectionSynchronizationHeader, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, P as CreateExponentialBackoffPolicyOptions, Q as ParallelMessageQueue, R as Message, S as FederationStartQueueOptions, St as WebFingerLinksDispatcher, T as InboxChallengePolicy, Tt as PageItems, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueEnqueueOptions, Y as MessageQueue, Z as MessageQueueListenOptions, _ as Federatable, _t as OutboxListenerErrorHandler, a as GetSignedKeyOptions, at as CollectionCursor, b as FederationFetchOptions, bt as UnverifiedActivityHandler, c as ParseUriResult, ct as CustomCollectionCursor, d as SendActivityOptions, dt as InboxListener, et as ActorDispatcher, f as SendActivityOptionsForCollection, ft as NodeInfoDispatcher, g as CustomCollectionCallbackSetters, gt as OutboxListener, h as ConstructorWithTypeId, ht as OutboxErrorHandler, i as GetActorOptions, it as CollectionCounter, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionDispatcher, m as CollectionCallbackSetters, mt as ObjectDispatcher, n as Context, nt as ActorKeyPairsDispatcher, o as InboxContext, ot as CollectionDispatcher, p as ActorCallbackSetters, pt as ObjectAuthorizePredicate, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as AuthorizePredicate, s as OutboxContext, st as CustomCollectionCounter, t as ActorKeyPair, tt as ActorHandleMapper, u as RouteActivityOptions, ut as InboxErrorHandler, v as Federation, vt as OutboxPermanentFailureHandler, w as IdempotencyStrategy, wt as SenderKeyPair, x as FederationOptions, xt as UnverifiedActivityReason, y as FederationBuilder, yt as SharedInboxKeyDispatcher, z as createFederationBuilder } from "../context-BPMgyX7m.js";
|
|
3
|
+
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-D6hNiMTK.js";
|
|
4
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-CNAHY39V.js";
|
|
6
5
|
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
-
import "urlpattern-polyfill";
|
|
3
|
-
import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "../middleware-
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
+
import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "../middleware-BEw9z4kK.js";
|
|
4
4
|
import { isEqual } from "es-toolkit";
|
|
5
5
|
//#region src/federation/kv.ts
|
|
6
6
|
/**
|
|
@@ -8,10 +8,10 @@ import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z
|
|
|
8
8
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
9
9
|
import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
|
|
10
10
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
11
|
-
import { l as verifyRequest } from "../http-
|
|
11
|
+
import { l as verifyRequest } from "../http-Bslazr8_.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
|
|
13
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
14
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-
|
|
13
|
+
import { t as doesActorOwnKey } from "../owner-SWOTNh3d.mjs";
|
|
14
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-ir10TETC.mjs";
|
|
15
15
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
17
17
|
//#region src/federation/send.test.ts
|
|
@@ -5,7 +5,7 @@ import { r as createRequestContext } from "../context-Dk_tacqz.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-CRDpx_HF.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
8
|
-
import { o as createFederation, s as handleWebFinger } from "../middleware-
|
|
8
|
+
import { o as createFederation, s as handleWebFinger } from "../middleware-AO-0hf_I.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
import { Image, Link, Person, Tombstone } from "@fedify/vocab";
|
|
11
11
|
//#region src/federation/webfinger.test.ts
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
1
2
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
2
|
-
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
3
3
|
import { TracerProvider } from "@opentelemetry/api";
|
|
4
|
+
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
4
5
|
|
|
5
6
|
//#region src/sig/key.d.ts
|
|
6
7
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
4
|
+
import { n as version, t as name } from "./deno-DCXSCeB3.mjs";
|
|
5
5
|
import { i as validateAcceptSignature, n as fulfillAcceptSignature, r as parseAcceptSignature } from "./accept-CPkZzmGN.mjs";
|
|
6
|
-
import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-
|
|
6
|
+
import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-Dk8-s0bs.mjs";
|
|
7
7
|
import { CryptographicKey } from "@fedify/vocab";
|
|
8
8
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
9
9
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
@@ -14,6 +14,7 @@ import { encodeHex } from "byte-encodings/hex";
|
|
|
14
14
|
import { Item, decodeDict, encodeItem } from "structured-field-values";
|
|
15
15
|
//#region src/sig/http.ts
|
|
16
16
|
const DEFAULT_MAX_REDIRECTION = 20;
|
|
17
|
+
const DOUBLE_KNOCK_TRANSPORT_RETRY_DELAY_MS = 100;
|
|
17
18
|
/**
|
|
18
19
|
* Signs a request using the given private key.
|
|
19
20
|
* @param request The request to sign.
|
|
@@ -842,6 +843,59 @@ function createRedirectRequest(request, location, body) {
|
|
|
842
843
|
cache: request.cache
|
|
843
844
|
});
|
|
844
845
|
}
|
|
846
|
+
async function fetchDoubleKnockRequest(request, signedRequest, signal) {
|
|
847
|
+
const maxAttempts = request.method === "GET" || request.method === "HEAD" ? 2 : 1;
|
|
848
|
+
for (let attempt = 1;; attempt++) try {
|
|
849
|
+
return await fetch(signedRequest, {
|
|
850
|
+
redirect: "manual",
|
|
851
|
+
signal
|
|
852
|
+
});
|
|
853
|
+
} catch (error) {
|
|
854
|
+
const abortedSignal = getAbortedSignal(signal, request.signal, signedRequest.signal);
|
|
855
|
+
if (abortedSignal != null) throw getAbortReason(abortedSignal);
|
|
856
|
+
if (isAbortError(error)) throw error;
|
|
857
|
+
if (attempt >= maxAttempts) throw createFetchError(request.url, error);
|
|
858
|
+
await sleep(DOUBLE_KNOCK_TRANSPORT_RETRY_DELAY_MS, signal, request.signal, signedRequest.signal);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
function createFetchError(url, cause) {
|
|
862
|
+
const error = new FetchError(url, cause instanceof Error ? cause.message : String(cause));
|
|
863
|
+
error.cause = cause;
|
|
864
|
+
return error;
|
|
865
|
+
}
|
|
866
|
+
function isAbortError(error) {
|
|
867
|
+
return error instanceof Error && error.name === "AbortError";
|
|
868
|
+
}
|
|
869
|
+
async function sleep(ms, ...signals) {
|
|
870
|
+
const abortSignals = signals.filter((signal) => signal != null);
|
|
871
|
+
const abortedSignal = getAbortedSignal(...abortSignals);
|
|
872
|
+
if (abortedSignal != null) throw getAbortReason(abortedSignal);
|
|
873
|
+
if (abortSignals.length < 1) {
|
|
874
|
+
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
await new Promise((resolve, reject) => {
|
|
878
|
+
const removeAbortListeners = () => {
|
|
879
|
+
for (const signal of abortSignals) signal.removeEventListener("abort", handleAbort);
|
|
880
|
+
};
|
|
881
|
+
const timeout = setTimeout(() => {
|
|
882
|
+
removeAbortListeners();
|
|
883
|
+
resolve();
|
|
884
|
+
}, ms);
|
|
885
|
+
function handleAbort(event) {
|
|
886
|
+
clearTimeout(timeout);
|
|
887
|
+
removeAbortListeners();
|
|
888
|
+
reject(getAbortReason(event.currentTarget));
|
|
889
|
+
}
|
|
890
|
+
for (const signal of abortSignals) signal.addEventListener("abort", handleAbort, { once: true });
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
function getAbortedSignal(...signals) {
|
|
894
|
+
return signals.find((signal) => signal?.aborted);
|
|
895
|
+
}
|
|
896
|
+
function getAbortReason(signal) {
|
|
897
|
+
return signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
898
|
+
}
|
|
845
899
|
/**
|
|
846
900
|
* Performs a double-knock request to the given URL. For the details of
|
|
847
901
|
* double-knocking, see
|
|
@@ -868,10 +922,7 @@ async function doubleKnockInternal(request, identity, options, redirected = 0, v
|
|
|
868
922
|
body
|
|
869
923
|
});
|
|
870
924
|
log?.(signedRequest);
|
|
871
|
-
let response = await
|
|
872
|
-
redirect: "manual",
|
|
873
|
-
signal
|
|
874
|
-
});
|
|
925
|
+
let response = await fetchDoubleKnockRequest(request, signedRequest, signal);
|
|
875
926
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
876
927
|
if (redirected >= maximumRedirection) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
877
928
|
const redirectRequest = createRedirectRequest(request, response.headers.get("Location"), body);
|
|
@@ -946,10 +997,7 @@ async function doubleKnockInternal(request, identity, options, redirected = 0, v
|
|
|
946
997
|
body
|
|
947
998
|
});
|
|
948
999
|
log?.(signedRequest);
|
|
949
|
-
response = await
|
|
950
|
-
redirect: "manual",
|
|
951
|
-
signal
|
|
952
|
-
});
|
|
1000
|
+
response = await fetchDoubleKnockRequest(request, signedRequest, signal);
|
|
953
1001
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
954
1002
|
if (redirected >= maximumRedirection) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
955
1003
|
const redirectRequest = createRedirectRequest(request, response.headers.get("Location"), body);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
3
2
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
4
|
-
import { TracerProvider } from "@opentelemetry/api";
|
|
5
3
|
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
4
|
+
import { TracerProvider } from "@opentelemetry/api";
|
|
6
5
|
|
|
7
6
|
//#region src/sig/key.d.ts
|
|
8
7
|
/**
|
|
@@ -11,7 +11,7 @@ let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conve
|
|
|
11
11
|
let byte_encodings_base64 = require("byte-encodings/base64");
|
|
12
12
|
//#region deno.json
|
|
13
13
|
var name = "@fedify/fedify";
|
|
14
|
-
var version = "2.2.
|
|
14
|
+
var version = "2.2.2";
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/sig/accept.ts
|
|
17
17
|
/**
|
|
@@ -497,6 +497,7 @@ async function fetchKeyInternal(keyId, cls, options = {}) {
|
|
|
497
497
|
//#endregion
|
|
498
498
|
//#region src/sig/http.ts
|
|
499
499
|
const DEFAULT_MAX_REDIRECTION = 20;
|
|
500
|
+
const DOUBLE_KNOCK_TRANSPORT_RETRY_DELAY_MS = 100;
|
|
500
501
|
/**
|
|
501
502
|
* Signs a request using the given private key.
|
|
502
503
|
* @param request The request to sign.
|
|
@@ -1325,6 +1326,59 @@ function createRedirectRequest(request, location, body) {
|
|
|
1325
1326
|
cache: request.cache
|
|
1326
1327
|
});
|
|
1327
1328
|
}
|
|
1329
|
+
async function fetchDoubleKnockRequest(request, signedRequest, signal) {
|
|
1330
|
+
const maxAttempts = request.method === "GET" || request.method === "HEAD" ? 2 : 1;
|
|
1331
|
+
for (let attempt = 1;; attempt++) try {
|
|
1332
|
+
return await fetch(signedRequest, {
|
|
1333
|
+
redirect: "manual",
|
|
1334
|
+
signal
|
|
1335
|
+
});
|
|
1336
|
+
} catch (error) {
|
|
1337
|
+
const abortedSignal = getAbortedSignal(signal, request.signal, signedRequest.signal);
|
|
1338
|
+
if (abortedSignal != null) throw getAbortReason(abortedSignal);
|
|
1339
|
+
if (isAbortError(error)) throw error;
|
|
1340
|
+
if (attempt >= maxAttempts) throw createFetchError(request.url, error);
|
|
1341
|
+
await sleep(DOUBLE_KNOCK_TRANSPORT_RETRY_DELAY_MS, signal, request.signal, signedRequest.signal);
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
function createFetchError(url, cause) {
|
|
1345
|
+
const error = new _fedify_vocab_runtime.FetchError(url, cause instanceof Error ? cause.message : String(cause));
|
|
1346
|
+
error.cause = cause;
|
|
1347
|
+
return error;
|
|
1348
|
+
}
|
|
1349
|
+
function isAbortError(error) {
|
|
1350
|
+
return error instanceof Error && error.name === "AbortError";
|
|
1351
|
+
}
|
|
1352
|
+
async function sleep(ms, ...signals) {
|
|
1353
|
+
const abortSignals = signals.filter((signal) => signal != null);
|
|
1354
|
+
const abortedSignal = getAbortedSignal(...abortSignals);
|
|
1355
|
+
if (abortedSignal != null) throw getAbortReason(abortedSignal);
|
|
1356
|
+
if (abortSignals.length < 1) {
|
|
1357
|
+
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
1358
|
+
return;
|
|
1359
|
+
}
|
|
1360
|
+
await new Promise((resolve, reject) => {
|
|
1361
|
+
const removeAbortListeners = () => {
|
|
1362
|
+
for (const signal of abortSignals) signal.removeEventListener("abort", handleAbort);
|
|
1363
|
+
};
|
|
1364
|
+
const timeout = setTimeout(() => {
|
|
1365
|
+
removeAbortListeners();
|
|
1366
|
+
resolve();
|
|
1367
|
+
}, ms);
|
|
1368
|
+
function handleAbort(event) {
|
|
1369
|
+
clearTimeout(timeout);
|
|
1370
|
+
removeAbortListeners();
|
|
1371
|
+
reject(getAbortReason(event.currentTarget));
|
|
1372
|
+
}
|
|
1373
|
+
for (const signal of abortSignals) signal.addEventListener("abort", handleAbort, { once: true });
|
|
1374
|
+
});
|
|
1375
|
+
}
|
|
1376
|
+
function getAbortedSignal(...signals) {
|
|
1377
|
+
return signals.find((signal) => signal?.aborted);
|
|
1378
|
+
}
|
|
1379
|
+
function getAbortReason(signal) {
|
|
1380
|
+
return signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
1381
|
+
}
|
|
1328
1382
|
/**
|
|
1329
1383
|
* Performs a double-knock request to the given URL. For the details of
|
|
1330
1384
|
* double-knocking, see
|
|
@@ -1351,10 +1405,7 @@ async function doubleKnockInternal(request, identity, options, redirected = 0, v
|
|
|
1351
1405
|
body
|
|
1352
1406
|
});
|
|
1353
1407
|
log?.(signedRequest);
|
|
1354
|
-
let response = await
|
|
1355
|
-
redirect: "manual",
|
|
1356
|
-
signal
|
|
1357
|
-
});
|
|
1408
|
+
let response = await fetchDoubleKnockRequest(request, signedRequest, signal);
|
|
1358
1409
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
1359
1410
|
if (redirected >= maximumRedirection) throw new _fedify_vocab_runtime.FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
1360
1411
|
const redirectRequest = createRedirectRequest(request, response.headers.get("Location"), body);
|
|
@@ -1429,10 +1480,7 @@ async function doubleKnockInternal(request, identity, options, redirected = 0, v
|
|
|
1429
1480
|
body
|
|
1430
1481
|
});
|
|
1431
1482
|
log?.(signedRequest);
|
|
1432
|
-
response = await
|
|
1433
|
-
redirect: "manual",
|
|
1434
|
-
signal
|
|
1435
|
-
});
|
|
1483
|
+
response = await fetchDoubleKnockRequest(request, signedRequest, signal);
|
|
1436
1484
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
1437
1485
|
if (redirected >= maximumRedirection) throw new _fedify_vocab_runtime.FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
1438
1486
|
const redirectRequest = createRedirectRequest(request, response.headers.get("Location"), body);
|