@fedify/fedify 2.3.14 → 2.3.15
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-C6yXExXl.mjs → builder-B6vSXYxn.mjs} +2 -2
- package/dist/{client-CAM_bQXx.d.cts → client-BIBzqEIp.d.cts} +0 -1
- package/dist/{client-1He2YuBF.mjs → client-DpUNYKla.mjs} +113 -64
- package/dist/{client-CSddvgWN.d.ts → client-jE7oGvRh.d.ts} +0 -1
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{context-MOrCC7yl.d.cts → context-CE_Tj_Oc.d.cts} +28 -2
- package/dist/{context-BWbdE_MZ.d.ts → context-H_5tZXg-.d.ts} +28 -2
- package/dist/{deno-y3L4Oa94.mjs → deno-BCuL3mid.mjs} +1 -1
- package/dist/docloader-D2dr1_6B.mjs +125 -0
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +5 -5
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +455 -29
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +2 -2
- package/dist/federation/mod.d.ts +2 -2
- package/dist/federation/mod.js +1 -1
- package/dist/federation/send.test.mjs +498 -88
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{http-DNM9KyIO.js → http-BkjxY3U0.js} +172 -103
- package/dist/{http-BCSf1KIY.mjs → http-CSDcThvz.mjs} +196 -98
- package/dist/{http-DQmNpfym.d.ts → http-CZPYFK3b.d.cts} +1 -2
- package/dist/{http-DiWQB8Mr.d.cts → http-DmP0sr2l.d.ts} +1 -2
- package/dist/{http-D77Wjrcg.cjs → http-gOkAiIe1.cjs} +173 -104
- package/dist/{inbox-NObX26c9.mjs → inbox-BHxez4d5.mjs} +2 -2
- package/dist/{key-APURZ0ky.mjs → key-D8IMQ72M.mjs} +2 -2
- package/dist/{kv-cache-Bg4utAuv.cjs → kv-cache-Alm5UmJa.cjs} +59 -17
- package/dist/{kv-cache-C69dzgQi.mjs → kv-cache-Blr9nDDp.mjs} +1 -1
- package/dist/{kv-cache-LBCwHNLu.js → kv-cache-CkXgU-ak.js} +60 -18
- package/dist/{ld-BoLqbDaL.mjs → ld-CVxxE1Pp.mjs} +3 -3
- package/dist/{metrics-DBSl8wEr.mjs → metrics-SYIZHFf_.mjs} +1 -1
- package/dist/{middleware-BQUQ0pPl.cjs → middleware-4yPyyoF5.cjs} +237 -99
- package/dist/{middleware-CZ8tI1qL.mjs → middleware-CfskJGfV.mjs} +81 -41
- package/dist/{middleware-DAqo2eOY.mjs → middleware-D3JWfiCu.mjs} +1 -1
- package/dist/{middleware-CRd1JmuL.js → middleware-DhN7c65B.js} +238 -100
- package/dist/{mod-LmD03uRA.d.ts → mod-CDFFESfL.d.ts} +1 -1
- package/dist/{mod-Bid79LFU.d.cts → mod-C_gFmeNq.d.cts} +1 -1
- package/dist/{mod-Co1M3Ux0.d.cts → mod-DDVkmZ_h.d.cts} +2 -8
- package/dist/{mod-B6PwkUMU.d.cts → mod-DDjtbkZO.d.cts} +1 -1
- package/dist/{mod-Br8yJNcE.d.ts → mod-DMjhnFbg.d.ts} +2 -8
- package/dist/{mod-TLEvgT1i.d.ts → mod-HQXFvOHs.d.ts} +1 -1
- package/dist/mod.cjs +5 -5
- package/dist/mod.d.cts +6 -6
- package/dist/mod.d.ts +6 -6
- package/dist/mod.js +5 -5
- package/dist/nodeinfo/client.test.mjs +337 -19
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/nodeinfo/mod.cjs +1 -1
- package/dist/nodeinfo/mod.d.cts +1 -1
- package/dist/nodeinfo/mod.d.ts +1 -1
- package/dist/nodeinfo/mod.js +1 -1
- package/dist/otel/exporter.test.mjs +292 -30
- package/dist/otel/mod.cjs +36 -30
- package/dist/otel/mod.d.cts +13 -0
- package/dist/otel/mod.d.ts +13 -0
- package/dist/otel/mod.js +36 -30
- package/dist/{owner-DjKvngeb.mjs → owner-BluLVPf0.mjs} +2 -2
- package/dist/{proof-CWTnYhjS.cjs → proof-CR-HwI0l.cjs} +1 -1
- package/dist/{proof-D2oFOdNA.mjs → proof-Co6nQBVR.mjs} +3 -3
- package/dist/{proof-s9sy44kx.js → proof-Dg0d9QBo.js} +1 -1
- package/dist/{send-xDK5UnL-.mjs → send-D_DnqOFA.mjs} +171 -73
- package/dist/sig/http.test.mjs +528 -2
- package/dist/sig/key.test.mjs +2 -2
- package/dist/sig/ld.test.mjs +2 -2
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.d.cts +2 -2
- package/dist/sig/mod.d.ts +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/proof.test.mjs +1 -1
- package/dist/{temporal-C6icc5n9.mjs → temporal-B8FUNkXB.mjs} +1 -1
- package/dist/testing/mod.d.mts +26 -0
- package/dist/{types-miAYfiGO.js → types-B1_pRFE_.js} +112 -63
- package/dist/{types-DRPjmHVV.cjs → types-DOvyymM4.cjs} +111 -62
- package/dist/utils/docloader.test.mjs +318 -34
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +8 -8
- package/dist/docloader-yuyzZC9a.mjs +0 -83
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import "../std__assert-BjJn2daJ.mjs";
|
|
5
5
|
import { r as assertFalse } from "../assert_throws-BbSMEFKo.mjs";
|
|
6
6
|
import { t as assert } from "../assert-CEO06XCw.mjs";
|
|
7
|
-
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-
|
|
7
|
+
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-B8FUNkXB.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/federation/temporal.test.ts
|
|
10
10
|
test("hasMalformedKnownTemporalLiteral() detects expanded proof timestamps", async () => {
|
|
@@ -6,7 +6,7 @@ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
|
6
6
|
import "../std__assert-BjJn2daJ.mjs";
|
|
7
7
|
import { t as assertNotEquals } from "../assert_not_equals-DkVK8oqV.mjs";
|
|
8
8
|
import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
|
|
9
|
-
import { o as createFederation, s as handleWebFinger } from "../middleware-
|
|
9
|
+
import { o as createFederation, s as handleWebFinger } from "../middleware-CfskJGfV.mjs";
|
|
10
10
|
import { Image, Link, Person, Tombstone } from "@fedify/vocab";
|
|
11
11
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
12
12
|
//#region src/federation/webfinger.test.ts
|
|
@@ -10,7 +10,7 @@ import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } fro
|
|
|
10
10
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
11
11
|
//#region deno.json
|
|
12
12
|
var name = "@fedify/fedify";
|
|
13
|
-
var version = "2.3.
|
|
13
|
+
var version = "2.3.15";
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/sig/accept.ts
|
|
16
16
|
/**
|
|
@@ -2483,10 +2483,10 @@ async function createRedirectRequest(request, location, body, validateRedirect)
|
|
|
2483
2483
|
cache: request.cache
|
|
2484
2484
|
});
|
|
2485
2485
|
}
|
|
2486
|
-
async function fetchDoubleKnockRequest(request, signedRequest, signal) {
|
|
2486
|
+
async function fetchDoubleKnockRequest(session, request, signedRequest, signal) {
|
|
2487
2487
|
const maxAttempts = request.method === "GET" || request.method === "HEAD" ? 2 : 1;
|
|
2488
2488
|
for (let attempt = 1;; attempt++) try {
|
|
2489
|
-
return await fetch(signedRequest, {
|
|
2489
|
+
return await session.fetch(signedRequest, {
|
|
2490
2490
|
redirect: "manual",
|
|
2491
2491
|
signal
|
|
2492
2492
|
});
|
|
@@ -2537,118 +2537,187 @@ function getAbortReason(signal) {
|
|
|
2537
2537
|
return signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
2538
2538
|
}
|
|
2539
2539
|
/**
|
|
2540
|
-
* Performs a double-knock request
|
|
2541
|
-
*
|
|
2542
|
-
*
|
|
2540
|
+
* Performs a double-knock request like {@link doubleKnock}, opening a session
|
|
2541
|
+
* for every hop with the given function, and passes the final response to
|
|
2542
|
+
* the given function. The final session is closed after `consume` settles,
|
|
2543
|
+
* so `consume` must read or cancel the response body before it returns.
|
|
2544
|
+
* This is not exported from any entry point.
|
|
2543
2545
|
* @param request The request to send.
|
|
2544
2546
|
* @param identity The identity to use for signing the request.
|
|
2545
2547
|
* @param options The options for double-knock requests.
|
|
2546
|
-
* @
|
|
2547
|
-
*
|
|
2548
|
+
* @param openHop The function to open a session for each hop. The session of
|
|
2549
|
+
* a hop is closed before the next hop is opened.
|
|
2550
|
+
* @param consume The function to consume the final response.
|
|
2551
|
+
* @returns The value returned by `consume`.
|
|
2548
2552
|
*/
|
|
2549
|
-
async function
|
|
2550
|
-
|
|
2553
|
+
async function doubleKnockScoped(request, identity, options, openHop, consume) {
|
|
2554
|
+
const { response, session } = await doubleKnockCore(request, identity, options, openHop);
|
|
2555
|
+
try {
|
|
2556
|
+
return await consume(response);
|
|
2557
|
+
} catch (error) {
|
|
2558
|
+
getLogger([
|
|
2559
|
+
"fedify",
|
|
2560
|
+
"sig",
|
|
2561
|
+
"http"
|
|
2562
|
+
]).debug("Failed to consume the response from {url}; closing the session: {error}", {
|
|
2563
|
+
url: request.url,
|
|
2564
|
+
error
|
|
2565
|
+
});
|
|
2566
|
+
throw error;
|
|
2567
|
+
} finally {
|
|
2568
|
+
await session.close();
|
|
2569
|
+
}
|
|
2551
2570
|
}
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
let response = await fetchDoubleKnockRequest(request, signedRequest, signal);
|
|
2566
|
-
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
2567
|
-
if (redirected >= maximumRedirection) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
2568
|
-
const redirectRequest = await createRedirectRequest(request, response.headers.get("Location"), body, options.validateRedirect);
|
|
2569
|
-
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
2570
|
-
return doubleKnockInternal(redirectRequest, identity, {
|
|
2571
|
-
...options,
|
|
2572
|
-
body
|
|
2573
|
-
}, redirected + 1, visited);
|
|
2574
|
-
} else if (response.status === 400 || response.status === 401 || response.status > 401) {
|
|
2575
|
-
const logger = getLogger([
|
|
2571
|
+
function isRedirectResponse(response) {
|
|
2572
|
+
return response.status >= 300 && response.status < 400 && response.headers.has("Location");
|
|
2573
|
+
}
|
|
2574
|
+
/**
|
|
2575
|
+
* Starts cancelling the body of a response that is not passed to the caller,
|
|
2576
|
+
* without waiting for it to settle. The cancellation of a branch of a tee
|
|
2577
|
+
* (e.g., a body cloned by a fetch mock) settles only after the other branch
|
|
2578
|
+
* is cancelled too, per the Streams standard, so awaiting it could block
|
|
2579
|
+
* forever. Failures are only logged.
|
|
2580
|
+
*/
|
|
2581
|
+
function cancelResponseBody(response, url) {
|
|
2582
|
+
response.body?.cancel().catch((error) => {
|
|
2583
|
+
getLogger([
|
|
2576
2584
|
"fedify",
|
|
2577
2585
|
"sig",
|
|
2578
2586
|
"http"
|
|
2579
|
-
])
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2587
|
+
]).debug("Failed to cancel the response body from {url}: {error}", {
|
|
2588
|
+
url,
|
|
2589
|
+
error
|
|
2590
|
+
});
|
|
2591
|
+
});
|
|
2592
|
+
}
|
|
2593
|
+
async function doubleKnockCore(request, identity, options, openHop) {
|
|
2594
|
+
const { specDeterminer, log, tracerProvider, signal } = options;
|
|
2595
|
+
const maximumRedirection = options.maxRedirection ?? DEFAULT_MAX_REDIRECTION;
|
|
2596
|
+
const visited = /* @__PURE__ */ new Set();
|
|
2597
|
+
const body = options.body !== void 0 ? options.body : request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : null;
|
|
2598
|
+
let session = await openHop(request.url);
|
|
2599
|
+
try {
|
|
2600
|
+
for (let redirected = 0;; redirected++) {
|
|
2601
|
+
visited.add(request.url);
|
|
2602
|
+
const origin = new URL(request.url).origin;
|
|
2603
|
+
const firstTrySpec = specDeterminer == null ? "rfc9421" : await specDeterminer.determineSpec(origin);
|
|
2604
|
+
let signedRequest = await signRequest(request, identity.privateKey, identity.keyId, {
|
|
2605
|
+
spec: firstTrySpec,
|
|
2606
|
+
tracerProvider,
|
|
2607
|
+
body
|
|
2608
|
+
});
|
|
2609
|
+
log?.(signedRequest);
|
|
2610
|
+
let response = await fetchDoubleKnockRequest(session, request, signedRequest, signal);
|
|
2611
|
+
const firstRedirected = isRedirectResponse(response);
|
|
2612
|
+
if (!firstRedirected && (response.status === 400 || response.status === 401 || response.status > 401)) {
|
|
2613
|
+
const logger = getLogger([
|
|
2614
|
+
"fedify",
|
|
2615
|
+
"sig",
|
|
2616
|
+
"http"
|
|
2617
|
+
]);
|
|
2618
|
+
const acceptSigHeader = response.headers.get("Accept-Signature");
|
|
2619
|
+
if (acceptSigHeader != null) {
|
|
2620
|
+
const entries = validateAcceptSignature(parseAcceptSignature(acceptSigHeader));
|
|
2621
|
+
const localKeyId = identity.keyId.href;
|
|
2622
|
+
const localAlg = "rsa-v1_5-sha256";
|
|
2623
|
+
let fulfilled = false;
|
|
2624
|
+
let challengeRequest;
|
|
2625
|
+
for (const entry of entries) {
|
|
2626
|
+
const rfc9421 = fulfillAcceptSignature(entry, localKeyId, localAlg);
|
|
2627
|
+
if (rfc9421 == null) continue;
|
|
2628
|
+
logger.debug("Received Accept-Signature challenge; accumulating label {label} and components {components}.", {
|
|
2629
|
+
label: rfc9421.label,
|
|
2630
|
+
components: rfc9421.components
|
|
2631
|
+
});
|
|
2632
|
+
try {
|
|
2633
|
+
challengeRequest = await signRequest(challengeRequest ?? request, identity.privateKey, identity.keyId, {
|
|
2634
|
+
spec: "rfc9421",
|
|
2635
|
+
tracerProvider,
|
|
2636
|
+
body,
|
|
2637
|
+
rfc9421
|
|
2638
|
+
});
|
|
2639
|
+
fulfilled = true;
|
|
2640
|
+
} catch (error) {
|
|
2641
|
+
logger.debug("Failed to fulfill Accept-Signature challenge entry {label}: {error}", {
|
|
2642
|
+
label: entry.label,
|
|
2643
|
+
error
|
|
2644
|
+
});
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2647
|
+
if (fulfilled && challengeRequest != null) {
|
|
2648
|
+
cancelResponseBody(response, request.url);
|
|
2649
|
+
signedRequest = challengeRequest;
|
|
2650
|
+
log?.(signedRequest);
|
|
2651
|
+
response = await session.fetch(signedRequest, {
|
|
2652
|
+
redirect: "manual",
|
|
2653
|
+
signal
|
|
2654
|
+
});
|
|
2655
|
+
}
|
|
2656
|
+
if (fulfilled && !isRedirectResponse(response)) {
|
|
2657
|
+
if (response.status < 300) {
|
|
2658
|
+
await specDeterminer?.rememberSpec(origin, "rfc9421");
|
|
2659
|
+
return {
|
|
2660
|
+
response,
|
|
2661
|
+
session
|
|
2662
|
+
};
|
|
2663
|
+
}
|
|
2664
|
+
if (response.status !== 400 && response.status !== 401) return {
|
|
2665
|
+
response,
|
|
2666
|
+
session
|
|
2667
|
+
};
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2670
|
+
if (!isRedirectResponse(response)) {
|
|
2671
|
+
const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
|
|
2672
|
+
getLogger([
|
|
2673
|
+
"fedify",
|
|
2674
|
+
"sig",
|
|
2675
|
+
"http"
|
|
2676
|
+
]).debug("Failed to verify with the spec {spec} ({status} {statusText}); retrying with spec {secondSpec}... (double-knocking)", {
|
|
2677
|
+
spec: firstTrySpec,
|
|
2678
|
+
secondSpec: spec,
|
|
2679
|
+
status: response.status,
|
|
2680
|
+
statusText: response.statusText
|
|
2600
2681
|
});
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2682
|
+
cancelResponseBody(response, request.url);
|
|
2683
|
+
signedRequest = await signRequest(request, identity.privateKey, identity.keyId, {
|
|
2684
|
+
spec,
|
|
2685
|
+
tracerProvider,
|
|
2686
|
+
body
|
|
2606
2687
|
});
|
|
2688
|
+
log?.(signedRequest);
|
|
2689
|
+
response = await fetchDoubleKnockRequest(session, request, signedRequest, signal);
|
|
2690
|
+
if (!isRedirectResponse(response) && response.status !== 400 && response.status !== 401) await specDeterminer?.rememberSpec(origin, spec);
|
|
2607
2691
|
}
|
|
2608
|
-
}
|
|
2609
|
-
if (
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
});
|
|
2616
|
-
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) return doubleKnock(await createRedirectRequest(request, response.headers.get("Location"), body, options.validateRedirect), identity, {
|
|
2617
|
-
...options,
|
|
2618
|
-
body
|
|
2619
|
-
});
|
|
2620
|
-
}
|
|
2621
|
-
if (fulfilled && response.status < 300) {
|
|
2622
|
-
await specDeterminer?.rememberSpec(origin, "rfc9421");
|
|
2623
|
-
return response;
|
|
2624
|
-
}
|
|
2625
|
-
if (fulfilled && response.status !== 400 && response.status !== 401) return response;
|
|
2626
|
-
}
|
|
2627
|
-
const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
|
|
2628
|
-
logger.debug("Failed to verify with the spec {spec} ({status} {statusText}); retrying with spec {secondSpec}... (double-knocking)", {
|
|
2629
|
-
spec: firstTrySpec,
|
|
2630
|
-
secondSpec: spec,
|
|
2631
|
-
status: response.status,
|
|
2632
|
-
statusText: response.statusText
|
|
2633
|
-
});
|
|
2634
|
-
signedRequest = await signRequest(request, identity.privateKey, identity.keyId, {
|
|
2635
|
-
spec,
|
|
2636
|
-
tracerProvider,
|
|
2637
|
-
body
|
|
2638
|
-
});
|
|
2639
|
-
log?.(signedRequest);
|
|
2640
|
-
response = await fetchDoubleKnockRequest(request, signedRequest, signal);
|
|
2641
|
-
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
2692
|
+
} else if (!firstRedirected) await specDeterminer?.rememberSpec(origin, firstTrySpec);
|
|
2693
|
+
if (!isRedirectResponse(response)) return {
|
|
2694
|
+
response,
|
|
2695
|
+
session
|
|
2696
|
+
};
|
|
2697
|
+
cancelResponseBody(response, request.url);
|
|
2698
|
+
await session.close();
|
|
2642
2699
|
if (redirected >= maximumRedirection) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
2643
|
-
const
|
|
2700
|
+
const location = response.headers.get("Location");
|
|
2701
|
+
const redirectRequest = await createRedirectRequest(request, location, body, options.validateRedirect);
|
|
2644
2702
|
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2703
|
+
request = redirectRequest;
|
|
2704
|
+
session = await openHop(request.url);
|
|
2705
|
+
}
|
|
2706
|
+
} catch (error) {
|
|
2707
|
+
try {
|
|
2708
|
+
await session.close();
|
|
2709
|
+
} catch (closeError) {
|
|
2710
|
+
getLogger([
|
|
2711
|
+
"fedify",
|
|
2712
|
+
"sig",
|
|
2713
|
+
"http"
|
|
2714
|
+
]).debug("Failed to close the session for {url}: {error}", {
|
|
2715
|
+
url: request.url,
|
|
2716
|
+
error: closeError
|
|
2717
|
+
});
|
|
2718
|
+
}
|
|
2719
|
+
throw error;
|
|
2720
|
+
}
|
|
2652
2721
|
}
|
|
2653
2722
|
/**
|
|
2654
2723
|
* Performs a timing-safe equality comparison between two `Uint8Array` values.
|
|
@@ -2678,4 +2747,4 @@ function timingSafeEqual(a, b) {
|
|
|
2678
2747
|
return result === 0;
|
|
2679
2748
|
}
|
|
2680
2749
|
//#endregion
|
|
2681
|
-
export { recordWebFingerHandle as A, recordCollectionRequest as C, recordInboxActivity as D, recordFanoutRecipients as E, validateAcceptSignature as F, name as I, version as L, formatAcceptSignature as M, fulfillAcceptSignature as N, recordOutboxActivity as O, parseAcceptSignature as P, recordCollectionPageItems as S, recordDocumentCache as T, instrumentDocumentLoader as _, verifyRequestDetailed as a, recordCircuitBreakerStateChange as b, fetchKey as c, importJwk as d, validateCryptoKey as f, getRemoteHost as g, getFederationMetrics as h, verifyRequest as i, registerQueueDepthGauge as j, recordOutboxEnqueue as k, fetchKeyDetailed as l, getDurationMs as m, parseRfc9421SignatureInput as n, exportJwk as o, verifyKeyOwnership as p, signRequest as r, fetchActorDocument as s,
|
|
2750
|
+
export { recordWebFingerHandle as A, recordCollectionRequest as C, recordInboxActivity as D, recordFanoutRecipients as E, validateAcceptSignature as F, name as I, version as L, formatAcceptSignature as M, fulfillAcceptSignature as N, recordOutboxActivity as O, parseAcceptSignature as P, recordCollectionPageItems as S, recordDocumentCache as T, instrumentDocumentLoader as _, verifyRequestDetailed as a, recordCircuitBreakerStateChange as b, fetchKey as c, importJwk as d, validateCryptoKey as f, getRemoteHost as g, getFederationMetrics as h, verifyRequest as i, registerQueueDepthGauge as j, recordOutboxEnqueue as k, fetchKeyDetailed as l, getDurationMs as m, parseRfc9421SignatureInput as n, exportJwk as o, verifyKeyOwnership as p, signRequest as r, fetchActorDocument as s, doubleKnockScoped as t, generateCryptoKeyPair as u, isAbortError$1 as v, recordCollectionTotalItems as w, recordCollectionDispatchDuration as x, measureSignatureKeyFetch as y };
|