@fedify/fedify 2.3.4 → 2.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{builder-B6H0Cu-s.mjs → builder-DXekGevh.mjs} +2 -2
- package/dist/{circuit-breaker-DLS_n1x5.mjs → circuit-breaker-D1fxthDI.mjs} +25 -5
- package/dist/{circuit-breaker-test-utils-BVnv3T76.mjs → circuit-breaker-test-utils-CAdwjgMi.mjs} +1 -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-Bjswu3eC.d.cts → context-BpmLyiPx.d.cts} +3 -2
- package/dist/{context-COxc_O-c.d.ts → context-BxVVO5Ro.d.ts} +3 -2
- package/dist/{deno-BWT0m-C0.mjs → deno-BaUlOnHe.mjs} +1 -1
- package/dist/{docloader-BCb3sV46.mjs → docloader-BYH2ymPh.mjs} +13 -9
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/circuit-breaker.test.mjs +184 -21
- package/dist/federation/handler.test.mjs +3 -3
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +10 -9
- 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 +3 -3
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{http-j8P8VWVy.js → http-CD5pDhPT.js} +8 -6
- package/dist/{http-Jf2NuGZH.mjs → http-Cm7Y71lD.mjs} +9 -7
- package/dist/{http-Ddlr1RXX.cjs → http-ifHta2Pj.cjs} +8 -6
- package/dist/{key-BLT79Df7.mjs → key-BSbJc-6T.mjs} +3 -3
- package/dist/{kv-cache-DMlgR8dT.cjs → kv-cache-CQHLWIXt.cjs} +12 -8
- package/dist/{kv-cache-DcrpYM0p.js → kv-cache-DMI3h8vn.js} +12 -8
- package/dist/{kv-cache-CfbraOmf.mjs → kv-cache-NmAX6AF2.mjs} +1 -1
- package/dist/{ld-C5AeN8Mb.mjs → ld-DMY2-bQC.mjs} +3 -3
- package/dist/{metrics-B25b8KGp.mjs → metrics-B9nzbvNe.mjs} +1 -1
- package/dist/{middleware-aQn45-2Y.mjs → middleware-BogX5PzT.mjs} +13 -13
- package/dist/{middleware-BB_zS4N_.mjs → middleware-C3LRXUcT.mjs} +1 -1
- package/dist/{middleware-D88YteNC.js → middleware-bK-NpoPV.js} +28 -8
- package/dist/{middleware-SXjy2D6F.cjs → middleware-rf7LIZPi.cjs} +28 -8
- package/dist/{mod-0bIqGrKQ.d.cts → mod-CjERT09F.d.cts} +1 -1
- package/dist/{mod-3H9Gym5G.d.ts → mod-Rpy4Uwkk.d.ts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +2 -2
- package/dist/mod.d.ts +2 -2
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/{owner-BjvP6UU-.mjs → owner-Ci8O4Q03.mjs} +2 -2
- package/dist/{proof-D0gyqmlm.mjs → proof-BSlz1EIk.mjs} +3 -3
- package/dist/{proof-DppHZMD1.cjs → proof-Ba3iHVt9.cjs} +1 -1
- package/dist/{proof-BVH3Q49N.js → proof-CIOa9FCc.js} +1 -1
- package/dist/{send-Ww8VDONO.mjs → send--ocjLzu4.mjs} +3 -3
- package/dist/sig/http.test.mjs +65 -3
- package/dist/sig/key.test.mjs +46 -1
- package/dist/sig/ld.test.mjs +2 -2
- package/dist/sig/mod.cjs +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-BJVH1-UV.mjs → temporal-C9rNBS3M.mjs} +1 -1
- package/dist/utils/docloader.test.mjs +35 -2
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { $ as CustomCollectionCursor, A as Rfc6570Expression, At as parseCircuitBreakerKvState, B as createFederationBuilder, C as FederationStartQueueOptions, Ct as CircuitBreakerFailurePolicy, D as InboxListenerSetters, Dt as CircuitBreakerStateChange, E as InboxChallengePolicy, Et as CircuitBreakerState, F as CreateExponentialBackoffPolicyOptions, G as ActorDispatcher, H as respondWithObject, I as RetryContext, J as AuthorizePredicate, K as ActorHandleMapper, L as RetryPolicy, M as FederationOrigin, N as FederationQueueOptions, O as ObjectCallbackSetters, Ot as NormalizedCircuitBreakerOptions, P as createFederation, Q as CustomCollectionCounter, R as createExponentialBackoffPolicy, S as FederationOptions, St as CircuitBreakerCreateOptions, T as IdempotencyStrategy, Tt as CircuitBreakerOptions, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as Federatable, _t as buildCollectionSynchronizationHeader, a as GetSignedKeyOptions, at as ObjectDispatcher, b as FederationBuilder, bt as CircuitBreakerActivityDrop, c as ParseUriResult, ct as OutboxListenerErrorHandler, d as SendActivityOptions, dt as UnverifiedActivityHandler, et as CustomCollectionDispatcher, f as SendActivityOptionsForCollection, ft as UnverifiedActivityReason, g as CustomCollectionCallbackSetters, gt as PageItems, h as ConstructorWithTypeId, ht as SenderKeyPair, i as GetActorOptions, it as ObjectAuthorizePredicate, j as FederationKvPrefixes, k as OutboxListenerSetters, kt as normalizeCircuitBreakerOptions, l as RequestContext, lt as OutboxPermanentFailureHandler, m as CollectionCallbackSetters, mt as SendActivityError, n as Context, nt as InboxListener, o as InboxContext, ot as OutboxErrorHandler, p as ActorCallbackSetters, pt as WebFingerLinksDispatcher, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as OutboxContext, st as OutboxListener, t as ActorKeyPair, tt as InboxErrorHandler, u as RouteActivityOptions, ut as SharedInboxKeyDispatcher, v as Federation, vt as digest, w as IdempotencyKeyCallback, wt as CircuitBreakerKvState, x as FederationFetchOptions, xt as CircuitBreakerBeforeSendDecision, y as FederationBenchmarkOptions, yt as CircuitBreaker, z as Message } from "../context-
|
|
2
|
+
import { $ as CustomCollectionCursor, A as Rfc6570Expression, At as parseCircuitBreakerKvState, B as createFederationBuilder, C as FederationStartQueueOptions, Ct as CircuitBreakerFailurePolicy, D as InboxListenerSetters, Dt as CircuitBreakerStateChange, E as InboxChallengePolicy, Et as CircuitBreakerState, F as CreateExponentialBackoffPolicyOptions, G as ActorDispatcher, H as respondWithObject, I as RetryContext, J as AuthorizePredicate, K as ActorHandleMapper, L as RetryPolicy, M as FederationOrigin, N as FederationQueueOptions, O as ObjectCallbackSetters, Ot as NormalizedCircuitBreakerOptions, P as createFederation, Q as CustomCollectionCounter, R as createExponentialBackoffPolicy, S as FederationOptions, St as CircuitBreakerCreateOptions, T as IdempotencyStrategy, Tt as CircuitBreakerOptions, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as Federatable, _t as buildCollectionSynchronizationHeader, a as GetSignedKeyOptions, at as ObjectDispatcher, b as FederationBuilder, bt as CircuitBreakerActivityDrop, c as ParseUriResult, ct as OutboxListenerErrorHandler, d as SendActivityOptions, dt as UnverifiedActivityHandler, et as CustomCollectionDispatcher, f as SendActivityOptionsForCollection, ft as UnverifiedActivityReason, g as CustomCollectionCallbackSetters, gt as PageItems, h as ConstructorWithTypeId, ht as SenderKeyPair, i as GetActorOptions, it as ObjectAuthorizePredicate, j as FederationKvPrefixes, k as OutboxListenerSetters, kt as normalizeCircuitBreakerOptions, l as RequestContext, lt as OutboxPermanentFailureHandler, m as CollectionCallbackSetters, mt as SendActivityError, n as Context, nt as InboxListener, o as InboxContext, ot as OutboxErrorHandler, p as ActorCallbackSetters, pt as WebFingerLinksDispatcher, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as OutboxContext, st as OutboxListener, t as ActorKeyPair, tt as InboxErrorHandler, u as RouteActivityOptions, ut as SharedInboxKeyDispatcher, v as Federation, vt as digest, w as IdempotencyKeyCallback, wt as CircuitBreakerKvState, x as FederationFetchOptions, xt as CircuitBreakerBeforeSendDecision, y as FederationBenchmarkOptions, yt as CircuitBreaker, z as Message } from "../context-BpmLyiPx.cjs";
|
|
3
3
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-gJ8LYbxX.cjs";
|
|
4
4
|
import { a as MessageQueueEnqueueOptions, i as MessageQueueDepth, n as InProcessMessageQueueOptions, o as MessageQueueListenOptions, r as MessageQueue, s as ParallelMessageQueue, t as InProcessMessageQueue } from "../mq-D8uSFzxe.cjs";
|
|
5
|
-
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "../mod-
|
|
5
|
+
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "../mod-CjERT09F.cjs";
|
|
6
6
|
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CircuitBreaker, CircuitBreakerActivityDrop, CircuitBreakerBeforeSendDecision, CircuitBreakerCreateOptions, CircuitBreakerFailurePolicy, CircuitBreakerKvState, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStateChange, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBenchmarkOptions, 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, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, 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, normalizeCircuitBreakerOptions, parseCircuitBreakerKvState, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { $ as CustomCollectionCursor, A as Rfc6570Expression, At as parseCircuitBreakerKvState, B as createFederationBuilder, C as FederationStartQueueOptions, Ct as CircuitBreakerFailurePolicy, D as InboxListenerSetters, Dt as CircuitBreakerStateChange, E as InboxChallengePolicy, Et as CircuitBreakerState, F as CreateExponentialBackoffPolicyOptions, G as ActorDispatcher, H as respondWithObject, I as RetryContext, J as AuthorizePredicate, K as ActorHandleMapper, L as RetryPolicy, M as FederationOrigin, N as FederationQueueOptions, O as ObjectCallbackSetters, Ot as NormalizedCircuitBreakerOptions, P as createFederation, Q as CustomCollectionCounter, R as createExponentialBackoffPolicy, S as FederationOptions, St as CircuitBreakerCreateOptions, T as IdempotencyStrategy, Tt as CircuitBreakerOptions, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as Federatable, _t as buildCollectionSynchronizationHeader, a as GetSignedKeyOptions, at as ObjectDispatcher, b as FederationBuilder, bt as CircuitBreakerActivityDrop, c as ParseUriResult, ct as OutboxListenerErrorHandler, d as SendActivityOptions, dt as UnverifiedActivityHandler, et as CustomCollectionDispatcher, f as SendActivityOptionsForCollection, ft as UnverifiedActivityReason, g as CustomCollectionCallbackSetters, gt as PageItems, h as ConstructorWithTypeId, ht as SenderKeyPair, i as GetActorOptions, it as ObjectAuthorizePredicate, j as FederationKvPrefixes, k as OutboxListenerSetters, kt as normalizeCircuitBreakerOptions, l as RequestContext, lt as OutboxPermanentFailureHandler, m as CollectionCallbackSetters, mt as SendActivityError, n as Context, nt as InboxListener, o as InboxContext, ot as OutboxErrorHandler, p as ActorCallbackSetters, pt as WebFingerLinksDispatcher, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as OutboxContext, st as OutboxListener, t as ActorKeyPair, tt as InboxErrorHandler, u as RouteActivityOptions, ut as SharedInboxKeyDispatcher, v as Federation, vt as digest, w as IdempotencyKeyCallback, wt as CircuitBreakerKvState, x as FederationFetchOptions, xt as CircuitBreakerBeforeSendDecision, y as FederationBenchmarkOptions, yt as CircuitBreaker, z as Message } from "../context-
|
|
2
|
+
import { $ as CustomCollectionCursor, A as Rfc6570Expression, At as parseCircuitBreakerKvState, B as createFederationBuilder, C as FederationStartQueueOptions, Ct as CircuitBreakerFailurePolicy, D as InboxListenerSetters, Dt as CircuitBreakerStateChange, E as InboxChallengePolicy, Et as CircuitBreakerState, F as CreateExponentialBackoffPolicyOptions, G as ActorDispatcher, H as respondWithObject, I as RetryContext, J as AuthorizePredicate, K as ActorHandleMapper, L as RetryPolicy, M as FederationOrigin, N as FederationQueueOptions, O as ObjectCallbackSetters, Ot as NormalizedCircuitBreakerOptions, P as createFederation, Q as CustomCollectionCounter, R as createExponentialBackoffPolicy, S as FederationOptions, St as CircuitBreakerCreateOptions, T as IdempotencyStrategy, Tt as CircuitBreakerOptions, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as Federatable, _t as buildCollectionSynchronizationHeader, a as GetSignedKeyOptions, at as ObjectDispatcher, b as FederationBuilder, bt as CircuitBreakerActivityDrop, c as ParseUriResult, ct as OutboxListenerErrorHandler, d as SendActivityOptions, dt as UnverifiedActivityHandler, et as CustomCollectionDispatcher, f as SendActivityOptionsForCollection, ft as UnverifiedActivityReason, g as CustomCollectionCallbackSetters, gt as PageItems, h as ConstructorWithTypeId, ht as SenderKeyPair, i as GetActorOptions, it as ObjectAuthorizePredicate, j as FederationKvPrefixes, k as OutboxListenerSetters, kt as normalizeCircuitBreakerOptions, l as RequestContext, lt as OutboxPermanentFailureHandler, m as CollectionCallbackSetters, mt as SendActivityError, n as Context, nt as InboxListener, o as InboxContext, ot as OutboxErrorHandler, p as ActorCallbackSetters, pt as WebFingerLinksDispatcher, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as OutboxContext, st as OutboxListener, t as ActorKeyPair, tt as InboxErrorHandler, u as RouteActivityOptions, ut as SharedInboxKeyDispatcher, v as Federation, vt as digest, w as IdempotencyKeyCallback, wt as CircuitBreakerKvState, x as FederationFetchOptions, xt as CircuitBreakerBeforeSendDecision, y as FederationBenchmarkOptions, yt as CircuitBreaker, z as Message } from "../context-BxVVO5Ro.js";
|
|
3
3
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-D6hNiMTK.js";
|
|
4
4
|
import { a as MessageQueueEnqueueOptions, i as MessageQueueDepth, n as InProcessMessageQueueOptions, o as MessageQueueListenOptions, r as MessageQueue, s as ParallelMessageQueue, t as InProcessMessageQueue } from "../mq-D-nlpY04.js";
|
|
5
|
-
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "../mod-
|
|
5
|
+
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "../mod-Rpy4Uwkk.js";
|
|
6
6
|
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CircuitBreaker, CircuitBreakerActivityDrop, CircuitBreakerBeforeSendDecision, CircuitBreakerCreateOptions, CircuitBreakerFailurePolicy, CircuitBreakerKvState, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStateChange, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBenchmarkOptions, 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, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, 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, normalizeCircuitBreakerOptions, parseCircuitBreakerKvState, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { a as SendActivityError, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as createExponentialBackoffPolicy, l as digest, o as respondWithObject, p as createFederationBuilder, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as CircuitBreaker } from "../middleware-
|
|
3
|
+
import { a as SendActivityError, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as createExponentialBackoffPolicy, l as digest, o as respondWithObject, p as createFederationBuilder, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as CircuitBreaker } from "../middleware-bK-NpoPV.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { Router as Router$1, RouterError as RouterError$1, assertPath, isPath } from "@fedify/uri-template";
|
|
6
6
|
import { isEqual } from "es-toolkit";
|
|
@@ -8,10 +8,10 @@ import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from
|
|
|
8
8
|
import { t as assertInstanceOf } from "../assert_instance_of-DBC5X09g.mjs";
|
|
9
9
|
import { t as assertNotEquals } from "../assert_not_equals-DkVK8oqV.mjs";
|
|
10
10
|
import { t as assert } from "../assert-OguE97r2.mjs";
|
|
11
|
-
import { l as verifyRequest } from "../http-
|
|
11
|
+
import { l as verifyRequest } from "../http-Cm7Y71lD.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-Ci8O4Q03.mjs";
|
|
14
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send--ocjLzu4.mjs";
|
|
15
15
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
16
16
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
17
17
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import "../std__assert-BBjXFNOb.mjs";
|
|
5
5
|
import { r as assertFalse } from "../assert_rejects-DN60FHPX.mjs";
|
|
6
6
|
import { t as assert } from "../assert-OguE97r2.mjs";
|
|
7
|
-
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-
|
|
7
|
+
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-C9rNBS3M.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-BBjXFNOb.mjs";
|
|
7
7
|
import { t as assertNotEquals } from "../assert_not_equals-DkVK8oqV.mjs";
|
|
8
8
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
9
|
-
import { o as createFederation, s as handleWebFinger } from "../middleware-
|
|
9
|
+
import { o as createFederation, s as handleWebFinger } from "../middleware-BogX5PzT.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.5";
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/sig/accept.ts
|
|
16
16
|
/**
|
|
@@ -1195,7 +1195,7 @@ async function resolveFetchedKey(document, cacheKey, keyId, cls, { documentLoade
|
|
|
1195
1195
|
}
|
|
1196
1196
|
}
|
|
1197
1197
|
let key = null;
|
|
1198
|
-
if (object instanceof cls) key = object;
|
|
1198
|
+
if (object instanceof cls && (object.id == null || object.id.href === keyId)) key = object;
|
|
1199
1199
|
else if (isActor(object)) {
|
|
1200
1200
|
const keys = cls === CryptographicKey ? object.getPublicKeys({
|
|
1201
1201
|
documentLoader,
|
|
@@ -2198,10 +2198,12 @@ async function verifyRequestRfc9421(request, span, metricsContext, { documentLoa
|
|
|
2198
2198
|
* @param request The original request.
|
|
2199
2199
|
* @param location The redirect location.
|
|
2200
2200
|
* @param body The request body as ArrayBuffer or null.
|
|
2201
|
+
* @param validateRedirect The function to validate the redirect URL.
|
|
2201
2202
|
* @returns A new Request object for the redirect.
|
|
2202
2203
|
*/
|
|
2203
|
-
function createRedirectRequest(request, location, body) {
|
|
2204
|
+
async function createRedirectRequest(request, location, body, validateRedirect) {
|
|
2204
2205
|
const url = new URL(location, request.url);
|
|
2206
|
+
await validateRedirect?.(url.href);
|
|
2205
2207
|
return new Request(url, {
|
|
2206
2208
|
method: request.method,
|
|
2207
2209
|
headers: request.headers,
|
|
@@ -2299,7 +2301,7 @@ async function doubleKnockInternal(request, identity, options, redirected = 0, v
|
|
|
2299
2301
|
let response = await fetchDoubleKnockRequest(request, signedRequest, signal);
|
|
2300
2302
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
2301
2303
|
if (redirected >= maximumRedirection) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
2302
|
-
const redirectRequest = createRedirectRequest(request, response.headers.get("Location"), body);
|
|
2304
|
+
const redirectRequest = await createRedirectRequest(request, response.headers.get("Location"), body, options.validateRedirect);
|
|
2303
2305
|
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
2304
2306
|
return doubleKnockInternal(redirectRequest, identity, {
|
|
2305
2307
|
...options,
|
|
@@ -2347,7 +2349,7 @@ async function doubleKnockInternal(request, identity, options, redirected = 0, v
|
|
|
2347
2349
|
redirect: "manual",
|
|
2348
2350
|
signal
|
|
2349
2351
|
});
|
|
2350
|
-
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) return doubleKnock(createRedirectRequest(request, response.headers.get("Location"), body), identity, {
|
|
2352
|
+
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) return doubleKnock(await createRedirectRequest(request, response.headers.get("Location"), body, options.validateRedirect), identity, {
|
|
2351
2353
|
...options,
|
|
2352
2354
|
body
|
|
2353
2355
|
});
|
|
@@ -2374,7 +2376,7 @@ async function doubleKnockInternal(request, identity, options, redirected = 0, v
|
|
|
2374
2376
|
response = await fetchDoubleKnockRequest(request, signedRequest, signal);
|
|
2375
2377
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
2376
2378
|
if (redirected >= maximumRedirection) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
2377
|
-
const redirectRequest = createRedirectRequest(request, response.headers.get("Location"), body);
|
|
2379
|
+
const redirectRequest = await createRedirectRequest(request, response.headers.get("Location"), body, options.validateRedirect);
|
|
2378
2380
|
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
2379
2381
|
return doubleKnockInternal(redirectRequest, identity, {
|
|
2380
2382
|
...options,
|
|
@@ -1,10 +1,10 @@
|
|
|
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-
|
|
5
|
-
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-
|
|
4
|
+
import { n as version, t as name } from "./deno-BaUlOnHe.mjs";
|
|
5
|
+
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-B9nzbvNe.mjs";
|
|
6
6
|
import { i as validateAcceptSignature, n as fulfillAcceptSignature, r as parseAcceptSignature } from "./accept-CPkZzmGN.mjs";
|
|
7
|
-
import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-
|
|
7
|
+
import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-BSbJc-6T.mjs";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { CryptographicKey } from "@fedify/vocab";
|
|
10
10
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -875,10 +875,12 @@ async function verifyRequestRfc9421(request, span, metricsContext, { documentLoa
|
|
|
875
875
|
* @param request The original request.
|
|
876
876
|
* @param location The redirect location.
|
|
877
877
|
* @param body The request body as ArrayBuffer or null.
|
|
878
|
+
* @param validateRedirect The function to validate the redirect URL.
|
|
878
879
|
* @returns A new Request object for the redirect.
|
|
879
880
|
*/
|
|
880
|
-
function createRedirectRequest(request, location, body) {
|
|
881
|
+
async function createRedirectRequest(request, location, body, validateRedirect) {
|
|
881
882
|
const url = new URL(location, request.url);
|
|
883
|
+
await validateRedirect?.(url.href);
|
|
882
884
|
return new Request(url, {
|
|
883
885
|
method: request.method,
|
|
884
886
|
headers: request.headers,
|
|
@@ -976,7 +978,7 @@ async function doubleKnockInternal(request, identity, options, redirected = 0, v
|
|
|
976
978
|
let response = await fetchDoubleKnockRequest(request, signedRequest, signal);
|
|
977
979
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
978
980
|
if (redirected >= maximumRedirection) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
979
|
-
const redirectRequest = createRedirectRequest(request, response.headers.get("Location"), body);
|
|
981
|
+
const redirectRequest = await createRedirectRequest(request, response.headers.get("Location"), body, options.validateRedirect);
|
|
980
982
|
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
981
983
|
return doubleKnockInternal(redirectRequest, identity, {
|
|
982
984
|
...options,
|
|
@@ -1024,7 +1026,7 @@ async function doubleKnockInternal(request, identity, options, redirected = 0, v
|
|
|
1024
1026
|
redirect: "manual",
|
|
1025
1027
|
signal
|
|
1026
1028
|
});
|
|
1027
|
-
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) return doubleKnock(createRedirectRequest(request, response.headers.get("Location"), body), identity, {
|
|
1029
|
+
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) return doubleKnock(await createRedirectRequest(request, response.headers.get("Location"), body, options.validateRedirect), identity, {
|
|
1028
1030
|
...options,
|
|
1029
1031
|
body
|
|
1030
1032
|
});
|
|
@@ -1051,7 +1053,7 @@ async function doubleKnockInternal(request, identity, options, redirected = 0, v
|
|
|
1051
1053
|
response = await fetchDoubleKnockRequest(request, signedRequest, signal);
|
|
1052
1054
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
1053
1055
|
if (redirected >= maximumRedirection) throw new FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
1054
|
-
const redirectRequest = createRedirectRequest(request, response.headers.get("Location"), body);
|
|
1056
|
+
const redirectRequest = await createRedirectRequest(request, response.headers.get("Location"), body, options.validateRedirect);
|
|
1055
1057
|
if (visited.has(redirectRequest.url)) throw new FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
1056
1058
|
return doubleKnockInternal(redirectRequest, identity, {
|
|
1057
1059
|
...options,
|
|
@@ -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.3.
|
|
14
|
+
var version = "2.3.5";
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/sig/accept.ts
|
|
17
17
|
/**
|
|
@@ -1196,7 +1196,7 @@ async function resolveFetchedKey(document, cacheKey, keyId, cls, { documentLoade
|
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
1198
1198
|
let key = null;
|
|
1199
|
-
if (object instanceof cls) key = object;
|
|
1199
|
+
if (object instanceof cls && (object.id == null || object.id.href === keyId)) key = object;
|
|
1200
1200
|
else if ((0, _fedify_vocab.isActor)(object)) {
|
|
1201
1201
|
const keys = cls === _fedify_vocab.CryptographicKey ? object.getPublicKeys({
|
|
1202
1202
|
documentLoader,
|
|
@@ -2199,10 +2199,12 @@ async function verifyRequestRfc9421(request, span, metricsContext, { documentLoa
|
|
|
2199
2199
|
* @param request The original request.
|
|
2200
2200
|
* @param location The redirect location.
|
|
2201
2201
|
* @param body The request body as ArrayBuffer or null.
|
|
2202
|
+
* @param validateRedirect The function to validate the redirect URL.
|
|
2202
2203
|
* @returns A new Request object for the redirect.
|
|
2203
2204
|
*/
|
|
2204
|
-
function createRedirectRequest(request, location, body) {
|
|
2205
|
+
async function createRedirectRequest(request, location, body, validateRedirect) {
|
|
2205
2206
|
const url = new URL(location, request.url);
|
|
2207
|
+
await validateRedirect?.(url.href);
|
|
2206
2208
|
return new Request(url, {
|
|
2207
2209
|
method: request.method,
|
|
2208
2210
|
headers: request.headers,
|
|
@@ -2300,7 +2302,7 @@ async function doubleKnockInternal(request, identity, options, redirected = 0, v
|
|
|
2300
2302
|
let response = await fetchDoubleKnockRequest(request, signedRequest, signal);
|
|
2301
2303
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
2302
2304
|
if (redirected >= maximumRedirection) throw new _fedify_vocab_runtime.FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
2303
|
-
const redirectRequest = createRedirectRequest(request, response.headers.get("Location"), body);
|
|
2305
|
+
const redirectRequest = await createRedirectRequest(request, response.headers.get("Location"), body, options.validateRedirect);
|
|
2304
2306
|
if (visited.has(redirectRequest.url)) throw new _fedify_vocab_runtime.FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
2305
2307
|
return doubleKnockInternal(redirectRequest, identity, {
|
|
2306
2308
|
...options,
|
|
@@ -2348,7 +2350,7 @@ async function doubleKnockInternal(request, identity, options, redirected = 0, v
|
|
|
2348
2350
|
redirect: "manual",
|
|
2349
2351
|
signal
|
|
2350
2352
|
});
|
|
2351
|
-
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) return doubleKnock(createRedirectRequest(request, response.headers.get("Location"), body), identity, {
|
|
2353
|
+
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) return doubleKnock(await createRedirectRequest(request, response.headers.get("Location"), body, options.validateRedirect), identity, {
|
|
2352
2354
|
...options,
|
|
2353
2355
|
body
|
|
2354
2356
|
});
|
|
@@ -2375,7 +2377,7 @@ async function doubleKnockInternal(request, identity, options, redirected = 0, v
|
|
|
2375
2377
|
response = await fetchDoubleKnockRequest(request, signedRequest, signal);
|
|
2376
2378
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
2377
2379
|
if (redirected >= maximumRedirection) throw new _fedify_vocab_runtime.FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
2378
|
-
const redirectRequest = createRedirectRequest(request, response.headers.get("Location"), body);
|
|
2380
|
+
const redirectRequest = await createRedirectRequest(request, response.headers.get("Location"), body, options.validateRedirect);
|
|
2379
2381
|
if (visited.has(redirectRequest.url)) throw new _fedify_vocab_runtime.FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
2380
2382
|
return doubleKnockInternal(redirectRequest, identity, {
|
|
2381
2383
|
...options,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { _ as recordKeyLookup, n as getDurationMs, t as classifyFetchError } from "./metrics-
|
|
4
|
+
import { n as version, t as name } from "./deno-BaUlOnHe.mjs";
|
|
5
|
+
import { _ as recordKeyLookup, n as getDurationMs, t as classifyFetchError } from "./metrics-B9nzbvNe.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
8
8
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -243,7 +243,7 @@ async function resolveFetchedKey(document, cacheKey, keyId, cls, { documentLoade
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
let key = null;
|
|
246
|
-
if (object instanceof cls) key = object;
|
|
246
|
+
if (object instanceof cls && (object.id == null || object.id.href === keyId)) key = object;
|
|
247
247
|
else if (isActor(object)) {
|
|
248
248
|
const keys = cls === CryptographicKey ? object.getPublicKeys({
|
|
249
249
|
documentLoader,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
require("./chunk-DDcVe30Y.cjs");
|
|
4
|
-
const require_http = require("./http-
|
|
4
|
+
const require_http = require("./http-ifHta2Pj.cjs");
|
|
5
5
|
let _logtape_logtape = require("@logtape/logtape");
|
|
6
6
|
let es_toolkit = require("es-toolkit");
|
|
7
7
|
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
@@ -25,6 +25,17 @@ const logger$1 = (0, _logtape_logtape.getLogger)([
|
|
|
25
25
|
function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, maxRedirection, userAgent, specDeterminer, tracerProvider } = {}) {
|
|
26
26
|
require_http.validateCryptoKey(identity.privateKey);
|
|
27
27
|
async function load(url, options) {
|
|
28
|
+
await validateUrl(url);
|
|
29
|
+
return (0, _fedify_vocab_runtime.getRemoteDocument)(url, await require_http.doubleKnock((0, _fedify_vocab_runtime.createActivityPubRequest)(url, { userAgent }), identity, {
|
|
30
|
+
maxRedirection,
|
|
31
|
+
specDeterminer,
|
|
32
|
+
log: (0, es_toolkit.curry)(_fedify_vocab_runtime.logRequest)(logger$1),
|
|
33
|
+
tracerProvider,
|
|
34
|
+
signal: options?.signal,
|
|
35
|
+
validateRedirect: validateUrl
|
|
36
|
+
}), load);
|
|
37
|
+
}
|
|
38
|
+
async function validateUrl(url) {
|
|
28
39
|
if (!allowPrivateAddress) try {
|
|
29
40
|
await (0, _fedify_vocab_runtime.validatePublicUrl)(url);
|
|
30
41
|
} catch (error) {
|
|
@@ -34,13 +45,6 @@ function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, maxRedi
|
|
|
34
45
|
});
|
|
35
46
|
throw error;
|
|
36
47
|
}
|
|
37
|
-
return (0, _fedify_vocab_runtime.getRemoteDocument)(url, await require_http.doubleKnock((0, _fedify_vocab_runtime.createActivityPubRequest)(url, { userAgent }), identity, {
|
|
38
|
-
maxRedirection,
|
|
39
|
-
specDeterminer,
|
|
40
|
-
log: (0, es_toolkit.curry)(_fedify_vocab_runtime.logRequest)(logger$1),
|
|
41
|
-
tracerProvider,
|
|
42
|
-
signal: options?.signal
|
|
43
|
-
}), load);
|
|
44
48
|
}
|
|
45
49
|
return load;
|
|
46
50
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { C as recordDocumentCache, d as validateCryptoKey, t as doubleKnock } from "./http-
|
|
3
|
+
import { C as recordDocumentCache, d as validateCryptoKey, t as doubleKnock } from "./http-CD5pDhPT.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { curry } from "es-toolkit";
|
|
6
6
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
@@ -24,6 +24,17 @@ const logger$1 = getLogger([
|
|
|
24
24
|
function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, maxRedirection, userAgent, specDeterminer, tracerProvider } = {}) {
|
|
25
25
|
validateCryptoKey(identity.privateKey);
|
|
26
26
|
async function load(url, options) {
|
|
27
|
+
await validateUrl(url);
|
|
28
|
+
return getRemoteDocument(url, await doubleKnock(createActivityPubRequest(url, { userAgent }), identity, {
|
|
29
|
+
maxRedirection,
|
|
30
|
+
specDeterminer,
|
|
31
|
+
log: curry(logRequest)(logger$1),
|
|
32
|
+
tracerProvider,
|
|
33
|
+
signal: options?.signal,
|
|
34
|
+
validateRedirect: validateUrl
|
|
35
|
+
}), load);
|
|
36
|
+
}
|
|
37
|
+
async function validateUrl(url) {
|
|
27
38
|
if (!allowPrivateAddress) try {
|
|
28
39
|
await validatePublicUrl(url);
|
|
29
40
|
} catch (error) {
|
|
@@ -33,13 +44,6 @@ function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, maxRedi
|
|
|
33
44
|
});
|
|
34
45
|
throw error;
|
|
35
46
|
}
|
|
36
|
-
return getRemoteDocument(url, await doubleKnock(createActivityPubRequest(url, { userAgent }), identity, {
|
|
37
|
-
maxRedirection,
|
|
38
|
-
specDeterminer,
|
|
39
|
-
log: curry(logRequest)(logger$1),
|
|
40
|
-
tracerProvider,
|
|
41
|
-
signal: options?.signal
|
|
42
|
-
}), load);
|
|
43
47
|
}
|
|
44
48
|
return load;
|
|
45
49
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { p as recordDocumentCache } from "./metrics-
|
|
4
|
+
import { p as recordDocumentCache } from "./metrics-B9nzbvNe.mjs";
|
|
5
5
|
import { getLogger } from "@logtape/logtape";
|
|
6
6
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
7
7
|
//#region src/utils/kv-cache.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-
|
|
6
|
-
import { n as fetchKey, o as validateCryptoKey } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-BaUlOnHe.mjs";
|
|
5
|
+
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-B9nzbvNe.mjs";
|
|
6
|
+
import { n as fetchKey, o as validateCryptoKey } from "./key-BSbJc-6T.mjs";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
8
|
import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@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-BaUlOnHe.mjs";
|
|
5
5
|
import { metrics } from "@opentelemetry/api";
|
|
6
6
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
7
7
|
//#region src/federation/metrics.ts
|
|
@@ -1,26 +1,26 @@
|
|
|
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-
|
|
5
|
-
import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-
|
|
4
|
+
import { n as version, t as name } from "./deno-BaUlOnHe.mjs";
|
|
5
|
+
import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-B9nzbvNe.mjs";
|
|
6
6
|
import { t as formatAcceptSignature } from "./accept-CPkZzmGN.mjs";
|
|
7
|
-
import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-
|
|
8
|
-
import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-
|
|
9
|
-
import { t as getAuthenticatedDocumentLoader } from "./docloader-
|
|
10
|
-
import { n as kvCache } from "./kv-cache-
|
|
11
|
-
import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-
|
|
12
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-
|
|
7
|
+
import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-BSbJc-6T.mjs";
|
|
8
|
+
import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-Cm7Y71lD.mjs";
|
|
9
|
+
import { t as getAuthenticatedDocumentLoader } from "./docloader-BYH2ymPh.mjs";
|
|
10
|
+
import { n as kvCache } from "./kv-cache-NmAX6AF2.mjs";
|
|
11
|
+
import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-DMY2-bQC.mjs";
|
|
12
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-Ci8O4Q03.mjs";
|
|
13
13
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-L_DbOaFe.mjs";
|
|
14
|
-
import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-
|
|
14
|
+
import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-BSlz1EIk.mjs";
|
|
15
15
|
import { t as getNodeInfo } from "./client-D1KuWxjH.mjs";
|
|
16
16
|
import { t as nodeInfoToJson } from "./types-J53Kw7so.mjs";
|
|
17
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send
|
|
18
|
-
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-
|
|
19
|
-
import { t as CircuitBreaker } from "./circuit-breaker-
|
|
17
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send--ocjLzu4.mjs";
|
|
18
|
+
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-DXekGevh.mjs";
|
|
19
|
+
import { t as CircuitBreaker } from "./circuit-breaker-D1fxthDI.mjs";
|
|
20
20
|
import { t as buildCollectionSynchronizationHeader } from "./collection-Cc3DVAhE.mjs";
|
|
21
21
|
import { t as KvKeyCache } from "./keycache-BeU0LCII.mjs";
|
|
22
22
|
import { t as acceptsJsonLd } from "./negotiation-DDstyBvc.mjs";
|
|
23
|
-
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-
|
|
23
|
+
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-C9rNBS3M.mjs";
|
|
24
24
|
import { t as createExponentialBackoffPolicy } from "./retry-CXg_MBI-.mjs";
|
|
25
25
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
26
26
|
import { RouterError } from "@fedify/uri-template";
|
|
@@ -2,10 +2,10 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
import { t as __exportAll } from "./chunk-CRNNMoPX.js";
|
|
4
4
|
import { r as getDefaultActivityTransformers } from "./transformers-BGMIq1cs.js";
|
|
5
|
-
import { A as formatAcceptSignature, D as recordOutboxEnqueue, E as recordOutboxActivity, F as version, O as recordWebFingerHandle, P as name, S as recordCollectionTotalItems, T as recordInboxActivity, a as verifyRequestDetailed, b as recordCollectionPageItems, d as validateCryptoKey, f as getDurationMs, g as isAbortError, h as instrumentDocumentLoader, i as verifyRequest, k as registerQueueDepthGauge, m as getRemoteHost, n as parseRfc9421SignatureInput, o as exportJwk, p as getFederationMetrics, t as doubleKnock, u as importJwk, v as recordCircuitBreakerStateChange, w as recordFanoutRecipients, x as recordCollectionRequest, y as recordCollectionDispatchDuration } from "./http-
|
|
6
|
-
import { _ as hasSignatureLike, b as signJsonLd, c as getKeyOwner, f as compactJsonLd, g as hasSignature, h as getNormalizationContextLoader, i as verifyObject, l as InvalidContextReferenceError, m as detachSignature, n as hasProofLike, o as normalizeOutgoingActivityJsonLd, r as signObject, s as doesActorOwnKey, u as assertSafeJsonLd, v as isClearlyMalformedContextReference, w as wrapContextLoaderForJsonLd, x as verifyCompactJsonLd, y as isInvalidUrlTypeError } from "./proof-
|
|
5
|
+
import { A as formatAcceptSignature, D as recordOutboxEnqueue, E as recordOutboxActivity, F as version, O as recordWebFingerHandle, P as name, S as recordCollectionTotalItems, T as recordInboxActivity, a as verifyRequestDetailed, b as recordCollectionPageItems, d as validateCryptoKey, f as getDurationMs, g as isAbortError, h as instrumentDocumentLoader, i as verifyRequest, k as registerQueueDepthGauge, m as getRemoteHost, n as parseRfc9421SignatureInput, o as exportJwk, p as getFederationMetrics, t as doubleKnock, u as importJwk, v as recordCircuitBreakerStateChange, w as recordFanoutRecipients, x as recordCollectionRequest, y as recordCollectionDispatchDuration } from "./http-CD5pDhPT.js";
|
|
6
|
+
import { _ as hasSignatureLike, b as signJsonLd, c as getKeyOwner, f as compactJsonLd, g as hasSignature, h as getNormalizationContextLoader, i as verifyObject, l as InvalidContextReferenceError, m as detachSignature, n as hasProofLike, o as normalizeOutgoingActivityJsonLd, r as signObject, s as doesActorOwnKey, u as assertSafeJsonLd, v as isClearlyMalformedContextReference, w as wrapContextLoaderForJsonLd, x as verifyCompactJsonLd, y as isInvalidUrlTypeError } from "./proof-CIOa9FCc.js";
|
|
7
7
|
import { n as getNodeInfo, t as nodeInfoToJson } from "./types-DTONwNqL.js";
|
|
8
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-
|
|
8
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-DMI3h8vn.js";
|
|
9
9
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
10
10
|
import { Router, RouterError, assertPath } from "@fedify/uri-template";
|
|
11
11
|
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
@@ -682,10 +682,11 @@ function createFederationBuilder() {
|
|
|
682
682
|
//#endregion
|
|
683
683
|
//#region src/federation/circuit-breaker.ts
|
|
684
684
|
const MAX_CUSTOM_FAILURE_HISTORY = 100;
|
|
685
|
-
const LEGACY_SWEEP_MARKER = ["__fedify_meta", "
|
|
685
|
+
const LEGACY_SWEEP_MARKER = ["__fedify_meta", "circuit_breaker_state_ttl_sweep_v2"];
|
|
686
686
|
const LEGACY_SWEEP_DELETING_MARKER = { __fedifyDeletingCircuitBreakerLegacyState: true };
|
|
687
687
|
const CIRCUIT_BREAKER_STATE_VERSION = 1;
|
|
688
688
|
const LEGACY_SWEEP_LOCK_TTL = Temporal.Duration.from({ minutes: 5 });
|
|
689
|
+
const LEGACY_SWEEP_RENEW_INTERVAL = Temporal.Duration.from({ minutes: 1 });
|
|
689
690
|
const LEGACY_SWEEP_RETRY_WINDOW = Temporal.Duration.from({ hours: 168 });
|
|
690
691
|
const LEGACY_SWEEP_WAIT_INTERVAL = 10;
|
|
691
692
|
const LEGACY_SWEEP_CAS_ATTEMPTS = 3;
|
|
@@ -900,12 +901,20 @@ var CircuitBreaker = class {
|
|
|
900
901
|
}
|
|
901
902
|
async #sweepLegacyStatesImpl() {
|
|
902
903
|
const markerKey = this.#legacySweepMarkerKey();
|
|
903
|
-
const
|
|
904
|
-
if (
|
|
904
|
+
const acquired = await this.#acquireLegacySweep(markerKey);
|
|
905
|
+
if (acquired === "done") return;
|
|
906
|
+
let marker = acquired;
|
|
907
|
+
let leaseRenewedAt = this.#now();
|
|
905
908
|
try {
|
|
906
909
|
for await (const { key, value } of this.#kv.list(this.#prefix)) {
|
|
907
910
|
if (key.length !== this.#prefix.length + 1) continue;
|
|
908
911
|
await this.#migrateLegacyState(key, value);
|
|
912
|
+
if (Temporal.Instant.compare(this.#now(), leaseRenewedAt.add(LEGACY_SWEEP_RENEW_INTERVAL)) >= 0) {
|
|
913
|
+
const renewed = await this.#renewLegacySweep(markerKey, marker);
|
|
914
|
+
if (renewed == null) return;
|
|
915
|
+
marker = renewed;
|
|
916
|
+
leaseRenewedAt = this.#now();
|
|
917
|
+
}
|
|
909
918
|
}
|
|
910
919
|
} catch (error) {
|
|
911
920
|
await this.#deleteIfUnchanged(markerKey, marker);
|
|
@@ -914,6 +923,14 @@ var CircuitBreaker = class {
|
|
|
914
923
|
const finishedMarker = this.#finishLegacySweepMarker(marker);
|
|
915
924
|
if (await this.#kv.cas(markerKey, marker, finishedMarker)) this.#rememberLegacySweepMarker(finishedMarker);
|
|
916
925
|
}
|
|
926
|
+
async #renewLegacySweep(markerKey, marker) {
|
|
927
|
+
const renewed = {
|
|
928
|
+
state: "sweeping",
|
|
929
|
+
started: this.#now().toString(),
|
|
930
|
+
retryUntil: getLegacySweepRetryUntil(marker) ?? this.#now().add(LEGACY_SWEEP_RETRY_WINDOW).toString()
|
|
931
|
+
};
|
|
932
|
+
if (await this.#kv.cas(markerKey, marker, renewed, { ttl: LEGACY_SWEEP_LOCK_TTL })) return renewed;
|
|
933
|
+
}
|
|
917
934
|
#finishLegacySweepMarker(marker) {
|
|
918
935
|
const retryUntil = getLegacySweepRetryUntil(marker);
|
|
919
936
|
if (retryUntil != null && Temporal.Instant.compare(this.#now(), Temporal.Instant.from(retryUntil)) < 0) return {
|
|
@@ -923,7 +940,10 @@ var CircuitBreaker = class {
|
|
|
923
940
|
return { state: "final" };
|
|
924
941
|
}
|
|
925
942
|
async #migrateLegacyState(key, value) {
|
|
926
|
-
if (isCurrentCircuitBreakerState(value))
|
|
943
|
+
if (isCurrentCircuitBreakerState(value)) {
|
|
944
|
+
await this.#kv.cas(key, value, value, this.#setOptions());
|
|
945
|
+
return;
|
|
946
|
+
}
|
|
927
947
|
const state = parseCircuitBreakerKvState(value);
|
|
928
948
|
if (state != null) {
|
|
929
949
|
await this.#kv.cas(key, value, markCircuitBreakerState(state), this.#setOptions());
|
|
@@ -1060,7 +1080,7 @@ function normalizeCircuitBreakerOptions(options) {
|
|
|
1060
1080
|
} else {
|
|
1061
1081
|
failure = options.failure;
|
|
1062
1082
|
pruneFailures = (timestamps) => timestamps.slice(-MAX_CUSTOM_FAILURE_HISTORY);
|
|
1063
|
-
stateTtl = configuredStateTtl;
|
|
1083
|
+
stateTtl = configuredStateTtl ?? recoveryDelay.add(heldActivityTtl);
|
|
1064
1084
|
}
|
|
1065
1085
|
return {
|
|
1066
1086
|
failure,
|