@fedify/fedify 2.4.0-dev.2157 → 2.4.0-dev.2159
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-CLaS4-yA.mjs → builder-D89oOfHC.mjs} +2 -2
- 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/{compound-proof-D7K94KPz.mjs → compound-proof-B02Os8h2.mjs} +2 -2
- package/dist/{context-BMggDR-l.d.cts → context-DpsaHkk1.d.cts} +119 -2
- package/dist/{context-exYu7gDU.d.ts → context-JDNkUtnu.d.ts} +119 -2
- package/dist/{deno-D1gcWWqB.mjs → deno-CE_s0yQb.mjs} +1 -1
- package/dist/{docloader-BMqr3hji.mjs → docloader-C5p26tpa.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/compound-fanout.test.mjs +3 -3
- package/dist/federation/handler-compound-proof.test.mjs +3 -3
- package/dist/federation/handler.test.mjs +5 -5
- package/dist/federation/hashlink-media.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +7 -7
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +1 -1
- package/dist/federation/outgoing-proof.test.mjs +5 -5
- package/dist/federation/portable-actor.test.mjs +3 -3
- package/dist/federation/portable-chain.test.mjs +3 -3
- package/dist/federation/portable-collection.test.mjs +4 -4
- package/dist/federation/portable-gateway-keys.test.mjs +3 -3
- package/dist/federation/portable-inbox.test.mjs +4 -4
- package/dist/federation/portable-parse-uri.test.d.mts +2 -0
- package/dist/federation/portable-parse-uri.test.mjs +348 -0
- package/dist/federation/portable.test.mjs +3 -3
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/tasks/enqueue.test.mjs +1 -1
- package/dist/federation/tasks/tasks.test.mjs +2 -2
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{federation-2e8XrN7q.cjs → federation-dBOqmJcA.cjs} +58 -8
- package/dist/{http-CGcLv8rh.mjs → http-DV_yW4dv.mjs} +4 -4
- package/dist/{http-Dgtt45-K.js → http-nTZuTacw.js} +1 -1
- package/dist/{http-BObQoB0j.cjs → http-wdsia0-O.cjs} +1 -1
- package/dist/{key-CPM4r6tP.mjs → key-C6jnekFI.mjs} +2 -2
- package/dist/{kv-cache-D2fnB8qu.cjs → kv-cache-BHNtQi9e.cjs} +1 -1
- package/dist/{kv-cache-bdPqTR1k.mjs → kv-cache-Bxm0a0Ww.mjs} +1 -1
- package/dist/{kv-cache-BweyIZTb.js → kv-cache-DhIl9YlV.js} +1 -1
- package/dist/{ld-lU_ZqzsQ.mjs → ld-ya2C1Xip.mjs} +3 -3
- package/dist/{metrics-B41pRPfd.mjs → metrics-ByOQOHHS.mjs} +1 -1
- package/dist/{middleware-xdukzV3x.mjs → middleware-Bdwd_Gg8.mjs} +69 -19
- package/dist/{middleware-TrCVULgs.mjs → middleware-DoVWq8mE.mjs} +1 -1
- package/dist/{middleware-BYWyYjmX.js → middleware-WiaN4RS3.js} +58 -8
- package/dist/{mod-Decmur1U.d.cts → mod-DSKkTwH2.d.cts} +1 -1
- package/dist/{mod-CnGtADvO.d.ts → mod-_4K05HZF.d.ts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +4 -4
- package/dist/mod.d.ts +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/{owner-D63yPo_i.mjs → owner-C6Nv5yyw.mjs} +3 -3
- package/dist/{portable-collection-C3xEzYri.js → portable-collection-B-mU1F1-.js} +1 -1
- package/dist/{portable-collection-B8ojoQ50.cjs → portable-collection-C65SwL2l.cjs} +1 -1
- package/dist/{portable-collection-_lZg-osX.mjs → portable-collection-uWj3hfzv.mjs} +2 -2
- package/dist/{portable-key-D8uWZF7b.mjs → portable-key-BXsVLSMa.mjs} +1 -1
- package/dist/{proof-C2YwD8a_.mjs → proof-BdO3BbLh.mjs} +4 -4
- package/dist/{send-D9SGhxTB.mjs → send-BwANxryy.mjs} +3 -3
- package/dist/sig/compound-proof-discovery.test.mjs +1 -1
- package/dist/sig/compound-proof-producer.test.mjs +1 -1
- package/dist/sig/compound-proof-verification.test.mjs +2 -2
- package/dist/sig/compound-proof.test.mjs +2 -2
- package/dist/sig/http.test.mjs +2 -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.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/portable-collection.test.mjs +1 -1
- package/dist/sig/portable-key.test.mjs +5 -5
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/{temporal-q6FSekcN.mjs → temporal-CbPfRGZq.mjs} +1 -1
- package/dist/testing/kv.test.mjs +1 -1
- package/dist/testing/mod.d.mts +118 -1
- 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.js +1 -1
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as respondWithObjectIfAcceptable, A as InboxListenerSetters, At as HashlinkMediaDispatcher, B as Message, Bt as OutboxListenerErrorHandler, C as FederationBuilder, Ct as AuthorizePredicate, D as IdempotencyKeyCallback, Dt as CustomCollectionCounter, E as FederationStartQueueOptions, Et as CollectionDispatcher, F as Rfc6570Expression, Ft as NodeInfoDispatcher, G as TaskHandler, Gt as UnverifiedActivityHandler, H as TaskDefinition, Ht as PortableActorIdMapper, I as FederationKvPrefixes, It as ObjectAuthorizePredicate, J as RetryContext, Jt as SendActivityError, K as TaskRegistry, Kt as UnverifiedActivityReason, L as FederationOrigin, Lt as ObjectDispatcher, M as ObjectCallbackSetters, Mt as InboxErrorHandler, N as OutboxListenerSetters, Nt as InboxListener, O as IdempotencyStrategy, Ot as CustomCollectionCursor, P as PortableInboxForwardingOptions, Pt as MediaUploaderCallback, Q as respondWithObject, Qt as digest, R as FederationQueueOptions, Rt as OutboxErrorHandler, S as FederationBenchmarkOptions, St as ActorKeyPairsDispatcher, T as FederationOptions, Tt as CollectionCursor, U as TaskDefinitionOptions, Ut as PortableCollectionOwnerMapper, V as createFederationBuilder, Vt as OutboxPermanentFailureHandler, W as TaskEnqueueOptions, Wt as SharedInboxKeyDispatcher, X as createExponentialBackoffPolicy, Xt as PageItems, Y as RetryPolicy, Yt as SenderKeyPair, Z as RespondWithObjectOptions, Zt as buildCollectionSynchronizationHeader, _ as CollectionCallbackSetters, _t as normalizeCircuitBreakerOptions, a as GetObjectOptions, at as MessageQueueListenOptions, b as Federatable, bt as ActorDispatcher, c as OutboxContext, ct as CircuitBreakerActivityDrop, d as PortableRequest, dt as CircuitBreakerFailurePolicy, et as InProcessMessageQueue, f as RequestContext, ft as CircuitBreakerKvState, g as ActorCallbackSetters, gt as NormalizedCircuitBreakerOptions, h as SendActivityOptionsForCollection, ht as CircuitBreakerStateChange, i as GetActorOptions, it as MessageQueueEnqueueOptions, j as MediaUploaderSetters, jt as HashlinkMediaRequest, k as InboxChallengePolicy, kt as CustomCollectionDispatcher, l as ParseUriOptions, lt as CircuitBreakerBeforeSendDecision, m as SendActivityOptions, mt as CircuitBreakerState, n as Context, nt as MessageQueue, o as GetSignedKeyOptions, ot as ParallelMessageQueue, p as RouteActivityOptions, pt as CircuitBreakerOptions, q as CreateExponentialBackoffPolicyOptions, qt as WebFingerLinksDispatcher, r as ForwardActivityOptions, rt as MessageQueueDepth, s as InboxContext, st as CircuitBreaker, t as ActorKeyPair, tt as InProcessMessageQueueOptions, u as ParseUriResult, ut as CircuitBreakerCreateOptions, v as ConstructorWithTypeId, vt as parseCircuitBreakerKvState, w as FederationFetchOptions, wt as CollectionCounter, x as Federation, xt as ActorHandleMapper, y as CustomCollectionCallbackSetters, yt as ActorAliasMapper, z as createFederation, zt as OutboxListener } from "../context-DpsaHkk1.cjs";
|
|
3
3
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-BhNbN8Ed.cjs";
|
|
4
|
-
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "../mod-
|
|
5
|
-
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, GetObjectOptions, GetSignedKeyOptions, HashlinkMediaDispatcher, HashlinkMediaRequest, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MediaUploaderCallback, MediaUploaderSetters, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, PortableActorIdMapper, PortableCollectionOwnerMapper, PortableInboxForwardingOptions, PortableRequest, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, TaskDefinition, TaskDefinitionOptions, TaskEnqueueOptions, TaskHandler, TaskRegistry, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, normalizeCircuitBreakerOptions, parseCircuitBreakerKvState, respondWithObject, respondWithObjectIfAcceptable };
|
|
4
|
+
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "../mod-DSKkTwH2.cjs";
|
|
5
|
+
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, GetObjectOptions, GetSignedKeyOptions, HashlinkMediaDispatcher, HashlinkMediaRequest, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MediaUploaderCallback, MediaUploaderSetters, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriOptions, ParseUriResult, PortableActorIdMapper, PortableCollectionOwnerMapper, PortableInboxForwardingOptions, PortableRequest, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, TaskDefinition, TaskDefinitionOptions, TaskEnqueueOptions, TaskHandler, TaskRegistry, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, normalizeCircuitBreakerOptions, parseCircuitBreakerKvState, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as respondWithObjectIfAcceptable, A as InboxListenerSetters, At as HashlinkMediaDispatcher, B as Message, Bt as OutboxListenerErrorHandler, C as FederationBuilder, Ct as AuthorizePredicate, D as IdempotencyKeyCallback, Dt as CustomCollectionCounter, E as FederationStartQueueOptions, Et as CollectionDispatcher, F as Rfc6570Expression, Ft as NodeInfoDispatcher, G as TaskHandler, Gt as UnverifiedActivityHandler, H as TaskDefinition, Ht as PortableActorIdMapper, I as FederationKvPrefixes, It as ObjectAuthorizePredicate, J as RetryContext, Jt as SendActivityError, K as TaskRegistry, Kt as UnverifiedActivityReason, L as FederationOrigin, Lt as ObjectDispatcher, M as ObjectCallbackSetters, Mt as InboxErrorHandler, N as OutboxListenerSetters, Nt as InboxListener, O as IdempotencyStrategy, Ot as CustomCollectionCursor, P as PortableInboxForwardingOptions, Pt as MediaUploaderCallback, Q as respondWithObject, Qt as digest, R as FederationQueueOptions, Rt as OutboxErrorHandler, S as FederationBenchmarkOptions, St as ActorKeyPairsDispatcher, T as FederationOptions, Tt as CollectionCursor, U as TaskDefinitionOptions, Ut as PortableCollectionOwnerMapper, V as createFederationBuilder, Vt as OutboxPermanentFailureHandler, W as TaskEnqueueOptions, Wt as SharedInboxKeyDispatcher, X as createExponentialBackoffPolicy, Xt as PageItems, Y as RetryPolicy, Yt as SenderKeyPair, Z as RespondWithObjectOptions, Zt as buildCollectionSynchronizationHeader, _ as CollectionCallbackSetters, _t as normalizeCircuitBreakerOptions, a as GetObjectOptions, at as MessageQueueListenOptions, b as Federatable, bt as ActorDispatcher, c as OutboxContext, ct as CircuitBreakerActivityDrop, d as PortableRequest, dt as CircuitBreakerFailurePolicy, et as InProcessMessageQueue, f as RequestContext, ft as CircuitBreakerKvState, g as ActorCallbackSetters, gt as NormalizedCircuitBreakerOptions, h as SendActivityOptionsForCollection, ht as CircuitBreakerStateChange, i as GetActorOptions, it as MessageQueueEnqueueOptions, j as MediaUploaderSetters, jt as HashlinkMediaRequest, k as InboxChallengePolicy, kt as CustomCollectionDispatcher, l as ParseUriOptions, lt as CircuitBreakerBeforeSendDecision, m as SendActivityOptions, mt as CircuitBreakerState, n as Context, nt as MessageQueue, o as GetSignedKeyOptions, ot as ParallelMessageQueue, p as RouteActivityOptions, pt as CircuitBreakerOptions, q as CreateExponentialBackoffPolicyOptions, qt as WebFingerLinksDispatcher, r as ForwardActivityOptions, rt as MessageQueueDepth, s as InboxContext, st as CircuitBreaker, t as ActorKeyPair, tt as InProcessMessageQueueOptions, u as ParseUriResult, ut as CircuitBreakerCreateOptions, v as ConstructorWithTypeId, vt as parseCircuitBreakerKvState, w as FederationFetchOptions, wt as CollectionCounter, x as Federation, xt as ActorHandleMapper, y as CustomCollectionCallbackSetters, yt as ActorAliasMapper, z as createFederation, zt as OutboxListener } from "../context-JDNkUtnu.js";
|
|
3
3
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-BhNbN8Ed.js";
|
|
4
|
-
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "../mod-
|
|
5
|
-
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, GetObjectOptions, GetSignedKeyOptions, HashlinkMediaDispatcher, HashlinkMediaRequest, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MediaUploaderCallback, MediaUploaderSetters, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, PortableActorIdMapper, PortableCollectionOwnerMapper, PortableInboxForwardingOptions, PortableRequest, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, TaskDefinition, TaskDefinitionOptions, TaskEnqueueOptions, TaskHandler, TaskRegistry, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, normalizeCircuitBreakerOptions, parseCircuitBreakerKvState, respondWithObject, respondWithObjectIfAcceptable };
|
|
4
|
+
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "../mod-_4K05HZF.js";
|
|
5
|
+
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, GetObjectOptions, GetSignedKeyOptions, HashlinkMediaDispatcher, HashlinkMediaRequest, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MediaUploaderCallback, MediaUploaderSetters, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriOptions, ParseUriResult, PortableActorIdMapper, PortableCollectionOwnerMapper, PortableInboxForwardingOptions, PortableRequest, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, TaskDefinition, TaskDefinitionOptions, TaskEnqueueOptions, TaskHandler, TaskRegistry, 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 "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { a as respondWithObjectIfAcceptable, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as respondWithObject, l as CircuitBreaker, n as handleWebFinger, o as SendActivityError, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "../middleware-
|
|
3
|
+
import { a as respondWithObjectIfAcceptable, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as respondWithObject, l as CircuitBreaker, n as handleWebFinger, o as SendActivityError, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "../middleware-WiaN4RS3.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";
|
|
@@ -7,12 +7,12 @@ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
|
7
7
|
import "../std__assert-DvMDRPes.mjs";
|
|
8
8
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
9
9
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
10
|
-
import { n as exportJwk } from "../key-
|
|
11
|
-
import { s as detachSignature } from "../ld-
|
|
12
|
-
import { a as signObject } from "../proof-
|
|
10
|
+
import { n as exportJwk } from "../key-C6jnekFI.mjs";
|
|
11
|
+
import { s as detachSignature } from "../ld-ya2C1Xip.mjs";
|
|
12
|
+
import { a as signObject } from "../proof-BdO3BbLh.mjs";
|
|
13
13
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
14
|
-
import { c as assertPortableActorActivity, n as FederationImpl, o as createFederation } from "../middleware-
|
|
15
|
-
import { a as verifyCompoundPortableObjectProofs } from "../compound-proof-
|
|
14
|
+
import { c as assertPortableActorActivity, n as FederationImpl, o as createFederation } from "../middleware-Bdwd_Gg8.mjs";
|
|
15
|
+
import { a as verifyCompoundPortableObjectProofs } from "../compound-proof-B02Os8h2.mjs";
|
|
16
16
|
import { configure, reset } from "@logtape/logtape";
|
|
17
17
|
import { Create, Note, Person } from "@fedify/vocab";
|
|
18
18
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -8,10 +8,10 @@ import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
|
8
8
|
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
9
9
|
import "../std__assert-DvMDRPes.mjs";
|
|
10
10
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
11
|
-
import { a as signObject, c as verifyPortableObjectProof } from "../proof-
|
|
12
|
-
import { d as verifyRequest, l as signRequest } from "../http-
|
|
11
|
+
import { a as signObject, c as verifyPortableObjectProof } from "../proof-BdO3BbLh.mjs";
|
|
12
|
+
import { d as verifyRequest, l as signRequest } from "../http-DV_yW4dv.mjs";
|
|
13
13
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
14
|
-
import { b as PORTABLE_OBJECT_CONTENT_TYPE, o as createFederation } from "../middleware-
|
|
14
|
+
import { b as PORTABLE_OBJECT_CONTENT_TYPE, o as createFederation } from "../middleware-Bdwd_Gg8.mjs";
|
|
15
15
|
import { n as RouterError } from "../router-u5O5KCQr.mjs";
|
|
16
16
|
import { configure, reset } from "@logtape/logtape";
|
|
17
17
|
import { Note, Person, Tombstone, lookupObject } from "@fedify/vocab";
|
|
@@ -7,10 +7,10 @@ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
|
7
7
|
import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
8
8
|
import "../std__assert-DvMDRPes.mjs";
|
|
9
9
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
10
|
-
import { n as exportJwk } from "../key-
|
|
11
|
-
import { c as verifyPortableObjectProof, s as verifyObject } from "../proof-
|
|
10
|
+
import { n as exportJwk } from "../key-C6jnekFI.mjs";
|
|
11
|
+
import { c as verifyPortableObjectProof, s as verifyObject } from "../proof-BdO3BbLh.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
13
|
-
import { n as FederationImpl } from "../middleware-
|
|
13
|
+
import { n as FederationImpl } from "../middleware-Bdwd_Gg8.mjs";
|
|
14
14
|
import { Create, DataIntegrityProof, Note, OrderedCollection, Person, traverseCollection } from "@fedify/vocab";
|
|
15
15
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { FetchError, encodeMultibase, exportDidKey } from "@fedify/vocab-runtime";
|
|
@@ -7,11 +7,11 @@ import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
8
8
|
import "../std__assert-DvMDRPes.mjs";
|
|
9
9
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
10
|
-
import { a as signObject } from "../proof-
|
|
10
|
+
import { a as signObject } from "../proof-BdO3BbLh.mjs";
|
|
11
11
|
import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
12
|
-
import { b as PORTABLE_OBJECT_CONTENT_TYPE, o as createFederation } from "../middleware-
|
|
13
|
-
import { t as verifyPortableObject } from "../portable-collection-
|
|
14
|
-
import { s as verifyServedPortableObjects } from "../compound-proof-
|
|
12
|
+
import { b as PORTABLE_OBJECT_CONTENT_TYPE, o as createFederation } from "../middleware-Bdwd_Gg8.mjs";
|
|
13
|
+
import { t as verifyPortableObject } from "../portable-collection-uWj3hfzv.mjs";
|
|
14
|
+
import { s as verifyServedPortableObjects } from "../compound-proof-B02Os8h2.mjs";
|
|
15
15
|
import { n as RouterError } from "../router-u5O5KCQr.mjs";
|
|
16
16
|
import { configure, reset } from "@logtape/logtape";
|
|
17
17
|
import { Create, Note, Object as Object$1, OrderedCollection, Person, Tombstone, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
@@ -7,10 +7,10 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
7
7
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
8
8
|
import "../std__assert-DvMDRPes.mjs";
|
|
9
9
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
10
|
-
import { p as signJsonLd } from "../ld-
|
|
11
|
-
import { l as signRequest } from "../http-
|
|
10
|
+
import { p as signJsonLd } from "../ld-ya2C1Xip.mjs";
|
|
11
|
+
import { l as signRequest } from "../http-DV_yW4dv.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
13
|
-
import { f as handleInbox, n as FederationImpl, o as createFederation } from "../middleware-
|
|
13
|
+
import { f as handleInbox, n as FederationImpl, o as createFederation } from "../middleware-Bdwd_Gg8.mjs";
|
|
14
14
|
import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
|
|
15
15
|
import { t as KvKeyCache } from "../keycache-BInaECGj.mjs";
|
|
16
16
|
import { Create, CryptographicKey, Person } from "@fedify/vocab";
|
|
@@ -8,11 +8,11 @@ import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
|
8
8
|
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
9
9
|
import "../std__assert-DvMDRPes.mjs";
|
|
10
10
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
11
|
-
import { p as signJsonLd } from "../ld-
|
|
12
|
-
import { a as signObject } from "../proof-
|
|
13
|
-
import { f as verifyRequestDetailed, l as signRequest } from "../http-
|
|
11
|
+
import { p as signJsonLd } from "../ld-ya2C1Xip.mjs";
|
|
12
|
+
import { a as signObject } from "../proof-BdO3BbLh.mjs";
|
|
13
|
+
import { f as verifyRequestDetailed, l as signRequest } from "../http-DV_yW4dv.mjs";
|
|
14
14
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
15
|
-
import { _ as coversDelivery, o as createFederation, v as forwardPortableInboxActivity, y as resolvePortableInboxForwardingOptions } from "../middleware-
|
|
15
|
+
import { _ as coversDelivery, o as createFederation, v as forwardPortableInboxActivity, y as resolvePortableInboxForwardingOptions } from "../middleware-Bdwd_Gg8.mjs";
|
|
16
16
|
import { Create, CryptographicKey, Follow, Note, Person, Tombstone } from "@fedify/vocab";
|
|
17
17
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
18
18
|
import { exportDidKey, formatIri, parseIri } from "@fedify/vocab-runtime";
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import "temporal-polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
|
+
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
7
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
8
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
9
|
+
import { r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
10
|
+
import { o as createFederation } from "../middleware-Bdwd_Gg8.mjs";
|
|
11
|
+
import { Note, Object as Object$1, Person } from "@fedify/vocab";
|
|
12
|
+
import { test } from "@fedify/fixture";
|
|
13
|
+
import { exportDidKey, parseIri } from "@fedify/vocab-runtime";
|
|
14
|
+
//#region src/federation/portable-parse-uri.test.ts
|
|
15
|
+
const did = await exportDidKey(ed25519PublicKey.publicKey);
|
|
16
|
+
const otherDid = await exportDidKey((await crypto.subtle.generateKey("Ed25519", true, ["sign", "verify"])).publicKey);
|
|
17
|
+
const encodedDid = encodeURIComponent(did);
|
|
18
|
+
const ORIGIN = "https://example.com";
|
|
19
|
+
const NOTE_TYPE_ID = new URL("https://www.w3.org/ns/activitystreams#Note");
|
|
20
|
+
const OBJECT_TYPE_ID = new URL("https://www.w3.org/ns/activitystreams#Object");
|
|
21
|
+
function createTestFederation() {
|
|
22
|
+
const calls = [];
|
|
23
|
+
const federation = createFederation({ kv: new MemoryKvStore() });
|
|
24
|
+
federation.setActorDispatcher("/users/{identifier}", (_ctx, identifier) => {
|
|
25
|
+
calls.push(`actor:${identifier}`);
|
|
26
|
+
return new Person({});
|
|
27
|
+
}).mapActorAlias("/bot", "bot").mapPortableActorId((_ctx, identifier) => {
|
|
28
|
+
calls.push(`portableActorId:${identifier}`);
|
|
29
|
+
return null;
|
|
30
|
+
});
|
|
31
|
+
federation.setObjectDispatcher(Note, "/users/{identifier}/notes/{id}", () => {
|
|
32
|
+
calls.push("object");
|
|
33
|
+
return null;
|
|
34
|
+
});
|
|
35
|
+
federation.setInboxListeners("/users/{identifier}/inbox", "/inbox");
|
|
36
|
+
federation.setOutboxDispatcher("/users/{identifier}/outbox", () => null);
|
|
37
|
+
federation.setFollowingDispatcher("/users/{identifier}/following", () => null);
|
|
38
|
+
federation.setFollowersDispatcher("/users/{identifier}/followers", () => null);
|
|
39
|
+
federation.setLikedDispatcher("/users/{identifier}/liked", () => null);
|
|
40
|
+
federation.setFeaturedDispatcher("/users/{identifier}/featured", () => null);
|
|
41
|
+
federation.setFeaturedTagsDispatcher("/users/{identifier}/tags", () => null);
|
|
42
|
+
federation.setCollectionDispatcher("bookmarks", Object$1, "/users/{identifier}/bookmarks", () => null).mapPortableOwner((_ctx, values) => {
|
|
43
|
+
calls.push(`portableOwner:${values.identifier}`);
|
|
44
|
+
return values.identifier;
|
|
45
|
+
});
|
|
46
|
+
federation.setOrderedCollectionDispatcher("pins", Note, "/users/{identifier}/pins", () => null);
|
|
47
|
+
return {
|
|
48
|
+
federation,
|
|
49
|
+
ctx: federation.createContext(new URL(ORIGIN)),
|
|
50
|
+
calls
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function portableId(path, authority = did) {
|
|
54
|
+
return parseIri(`ap+ef61://${authority}${path}`);
|
|
55
|
+
}
|
|
56
|
+
function compatibleId(path, origin = ORIGIN, authority = did) {
|
|
57
|
+
return new URL(`${origin}/.well-known/apgateway/${authority}${path}`);
|
|
58
|
+
}
|
|
59
|
+
function parsePortable(ctx, uri) {
|
|
60
|
+
return ctx.parseUri(uri, { portable: true });
|
|
61
|
+
}
|
|
62
|
+
test("Context.parseUri() does not recognize portable IDs by default", () => {
|
|
63
|
+
const { ctx } = createTestFederation();
|
|
64
|
+
for (const uri of [
|
|
65
|
+
portableId("/users/alice"),
|
|
66
|
+
parseIri(`ap://${did}/users/alice`),
|
|
67
|
+
compatibleId("/users/alice"),
|
|
68
|
+
compatibleId("/users/alice", "https://gateway.example")
|
|
69
|
+
]) {
|
|
70
|
+
assertEquals(ctx.parseUri(uri), null, uri.href);
|
|
71
|
+
assertEquals(ctx.parseUri(uri, {}), null, uri.href);
|
|
72
|
+
assertEquals(ctx.parseUri(uri, { portable: false }), null, uri.href);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
test("Context.parseUri() keeps the results of ordinary URIs", () => {
|
|
76
|
+
const { ctx } = createTestFederation();
|
|
77
|
+
for (const path of [
|
|
78
|
+
"/users/alice",
|
|
79
|
+
"/bot",
|
|
80
|
+
"/users/alice/notes/123",
|
|
81
|
+
"/inbox",
|
|
82
|
+
"/users/alice/inbox",
|
|
83
|
+
"/users/alice/outbox",
|
|
84
|
+
"/users/alice/following",
|
|
85
|
+
"/users/alice/followers",
|
|
86
|
+
"/users/alice/liked",
|
|
87
|
+
"/users/alice/featured",
|
|
88
|
+
"/users/alice/tags",
|
|
89
|
+
"/users/alice/bookmarks",
|
|
90
|
+
"/users/alice/pins",
|
|
91
|
+
"/nowhere"
|
|
92
|
+
]) {
|
|
93
|
+
const uri = new URL(path, ORIGIN);
|
|
94
|
+
const result = ctx.parseUri(uri);
|
|
95
|
+
assertEquals(parsePortable(ctx, uri), result, path);
|
|
96
|
+
if (result != null) assertFalse("authority" in result, path);
|
|
97
|
+
}
|
|
98
|
+
assertEquals(parsePortable(ctx, new URL("https://other.example/users/alice")), null);
|
|
99
|
+
assertEquals(ctx.parseUri(null, { portable: true }), null);
|
|
100
|
+
});
|
|
101
|
+
test("Context.parseUri() recognizes portable IDs", () => {
|
|
102
|
+
const { ctx, calls } = createTestFederation();
|
|
103
|
+
const identifier = "alice";
|
|
104
|
+
const cases = [
|
|
105
|
+
["/users/alice", {
|
|
106
|
+
type: "actor",
|
|
107
|
+
identifier,
|
|
108
|
+
authority: did
|
|
109
|
+
}],
|
|
110
|
+
["/bot", {
|
|
111
|
+
type: "actor",
|
|
112
|
+
identifier: "bot",
|
|
113
|
+
authority: did
|
|
114
|
+
}],
|
|
115
|
+
["/users/alice/notes/123", {
|
|
116
|
+
type: "object",
|
|
117
|
+
class: Note,
|
|
118
|
+
typeId: NOTE_TYPE_ID,
|
|
119
|
+
values: {
|
|
120
|
+
identifier,
|
|
121
|
+
id: "123"
|
|
122
|
+
},
|
|
123
|
+
authority: did
|
|
124
|
+
}],
|
|
125
|
+
["/users/alice/inbox", {
|
|
126
|
+
type: "inbox",
|
|
127
|
+
identifier,
|
|
128
|
+
authority: did
|
|
129
|
+
}],
|
|
130
|
+
["/users/alice/outbox", {
|
|
131
|
+
type: "outbox",
|
|
132
|
+
identifier,
|
|
133
|
+
authority: did
|
|
134
|
+
}],
|
|
135
|
+
["/users/alice/following", {
|
|
136
|
+
type: "following",
|
|
137
|
+
identifier,
|
|
138
|
+
authority: did
|
|
139
|
+
}],
|
|
140
|
+
["/users/alice/followers", {
|
|
141
|
+
type: "followers",
|
|
142
|
+
identifier,
|
|
143
|
+
authority: did
|
|
144
|
+
}],
|
|
145
|
+
["/users/alice/liked", {
|
|
146
|
+
type: "liked",
|
|
147
|
+
identifier,
|
|
148
|
+
authority: did
|
|
149
|
+
}],
|
|
150
|
+
["/users/alice/featured", {
|
|
151
|
+
type: "featured",
|
|
152
|
+
identifier,
|
|
153
|
+
authority: did
|
|
154
|
+
}],
|
|
155
|
+
["/users/alice/tags", {
|
|
156
|
+
type: "featuredTags",
|
|
157
|
+
identifier,
|
|
158
|
+
authority: did
|
|
159
|
+
}],
|
|
160
|
+
["/users/alice/bookmarks", {
|
|
161
|
+
type: "collection",
|
|
162
|
+
name: "bookmarks",
|
|
163
|
+
class: Object$1,
|
|
164
|
+
typeId: OBJECT_TYPE_ID,
|
|
165
|
+
values: { identifier },
|
|
166
|
+
authority: did
|
|
167
|
+
}],
|
|
168
|
+
["/users/alice/pins", {
|
|
169
|
+
type: "orderedCollection",
|
|
170
|
+
name: "pins",
|
|
171
|
+
class: Note,
|
|
172
|
+
typeId: NOTE_TYPE_ID,
|
|
173
|
+
values: { identifier },
|
|
174
|
+
authority: did
|
|
175
|
+
}]
|
|
176
|
+
];
|
|
177
|
+
for (const [path, expected] of cases) for (const uri of [
|
|
178
|
+
portableId(path),
|
|
179
|
+
parseIri(`ap://${did}${path}`),
|
|
180
|
+
new URL(`ap+ef61://${encodedDid}${path}`),
|
|
181
|
+
new URL(`ap://${encodedDid}${path}`),
|
|
182
|
+
compatibleId(path),
|
|
183
|
+
compatibleId(path, "https://gateway.example"),
|
|
184
|
+
compatibleId(path, "http://localhost:8000")
|
|
185
|
+
]) assertEquals(parsePortable(ctx, uri), expected, uri.href);
|
|
186
|
+
assertEquals(calls, []);
|
|
187
|
+
});
|
|
188
|
+
test("Context.parseUri() round-trips the portable ID helpers", () => {
|
|
189
|
+
const { ctx } = createTestFederation();
|
|
190
|
+
const uris = [
|
|
191
|
+
[ctx.getPortableActorUri("alice", did), "actor"],
|
|
192
|
+
[ctx.getPortableObjectUri(Note, {
|
|
193
|
+
identifier: "alice",
|
|
194
|
+
id: "1"
|
|
195
|
+
}, did), "object"],
|
|
196
|
+
[ctx.getPortableInboxUri("alice", did), "inbox"],
|
|
197
|
+
[ctx.getPortableOutboxUri("alice", did), "outbox"],
|
|
198
|
+
[ctx.getPortableFollowingUri("alice", did), "following"],
|
|
199
|
+
[ctx.getPortableFollowersUri("alice", did), "followers"],
|
|
200
|
+
[ctx.getPortableLikedUri("alice", did), "liked"],
|
|
201
|
+
[ctx.getPortableFeaturedUri("alice", did), "featured"],
|
|
202
|
+
[ctx.getPortableFeaturedTagsUri("alice", did), "featuredTags"],
|
|
203
|
+
[ctx.getPortableCollectionUri("bookmarks", { identifier: "alice" }, did), "collection"],
|
|
204
|
+
[ctx.getPortableCollectionUri("pins", { identifier: "alice" }, did), "orderedCollection"]
|
|
205
|
+
];
|
|
206
|
+
for (const [uri, type] of uris) {
|
|
207
|
+
const result = parsePortable(ctx, uri);
|
|
208
|
+
assertEquals(result?.type, type, uri.href);
|
|
209
|
+
assertEquals(result?.authority, did, uri.href);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
test("Context.parseUri() returns any DID for the caller to check", () => {
|
|
213
|
+
const { ctx } = createTestFederation();
|
|
214
|
+
assertEquals(parsePortable(ctx, portableId("/users/alice", otherDid)), {
|
|
215
|
+
type: "actor",
|
|
216
|
+
identifier: "alice",
|
|
217
|
+
authority: otherDid
|
|
218
|
+
});
|
|
219
|
+
assertEquals(parsePortable(ctx, compatibleId("/users/alice", "https://gateway.example", otherDid)), {
|
|
220
|
+
type: "actor",
|
|
221
|
+
identifier: "alice",
|
|
222
|
+
authority: otherDid
|
|
223
|
+
});
|
|
224
|
+
assertEquals(parsePortable(ctx, portableId("/users/alice", "did:web:example.com")), {
|
|
225
|
+
type: "actor",
|
|
226
|
+
identifier: "alice",
|
|
227
|
+
authority: "did:web:example.com"
|
|
228
|
+
});
|
|
229
|
+
assertEquals(parsePortable(ctx, parseIri(`ap://DID:KEY:${did.slice(8)}/users/alice`)), {
|
|
230
|
+
type: "actor",
|
|
231
|
+
identifier: "alice",
|
|
232
|
+
authority: did
|
|
233
|
+
});
|
|
234
|
+
assertEquals(parsePortable(ctx, new URL(`ap://DID%3Akey%3A${did.slice(8)}/users/alice`)), {
|
|
235
|
+
type: "actor",
|
|
236
|
+
identifier: "alice",
|
|
237
|
+
authority: did
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
test("Context.parseUri() ignores the query and fragment of portable IDs", () => {
|
|
241
|
+
const { ctx } = createTestFederation();
|
|
242
|
+
const expected = {
|
|
243
|
+
type: "actor",
|
|
244
|
+
identifier: "alice",
|
|
245
|
+
authority: did
|
|
246
|
+
};
|
|
247
|
+
const hint = "@gateway=https%3A%2F%2Fgateway.example";
|
|
248
|
+
for (const uri of [
|
|
249
|
+
parseIri(`ap://${did}/users/alice?${hint}`),
|
|
250
|
+
portableId("/users/alice#main-key"),
|
|
251
|
+
new URL(`${compatibleId("/users/alice").href}?${hint}`),
|
|
252
|
+
new URL(`${compatibleId("/users/alice").href}#main-key`)
|
|
253
|
+
]) assertEquals(parsePortable(ctx, uri), expected, uri.href);
|
|
254
|
+
});
|
|
255
|
+
test("Context.parseUri() routes portable paths like ordinary ones", () => {
|
|
256
|
+
const { ctx } = createTestFederation();
|
|
257
|
+
for (const path of [
|
|
258
|
+
"/users/alice/",
|
|
259
|
+
"/users/alice/notes/",
|
|
260
|
+
"/users"
|
|
261
|
+
]) {
|
|
262
|
+
const ordinary = ctx.parseUri(new URL(path, ORIGIN));
|
|
263
|
+
const expected = ordinary == null ? null : {
|
|
264
|
+
...ordinary,
|
|
265
|
+
authority: did
|
|
266
|
+
};
|
|
267
|
+
assertEquals(parsePortable(ctx, portableId(path)), expected, path);
|
|
268
|
+
assertEquals(parsePortable(ctx, compatibleId(path)), expected, path);
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
test("Context.parseUri() does not recognize unroutable portable IDs", () => {
|
|
272
|
+
const { ctx } = createTestFederation();
|
|
273
|
+
for (const uri of [
|
|
274
|
+
portableId("/nowhere"),
|
|
275
|
+
compatibleId("/nowhere"),
|
|
276
|
+
portableId("/inbox"),
|
|
277
|
+
compatibleId("/inbox"),
|
|
278
|
+
compatibleId("/inbox", "https://gateway.example"),
|
|
279
|
+
new URL(`${ORIGIN}/.well-known/apgateway`),
|
|
280
|
+
new URL(`${ORIGIN}/.well-known/apgateway/users/alice`),
|
|
281
|
+
new URL(`${ORIGIN}/.well-known/apgateway/hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n`)
|
|
282
|
+
]) assertEquals(parsePortable(ctx, uri), null, uri.href);
|
|
283
|
+
});
|
|
284
|
+
test("Context.parseUri() does not recognize malformed portable IDs", () => {
|
|
285
|
+
const { ctx } = createTestFederation();
|
|
286
|
+
const base64UrlDid = `did:key:u${did.slice(8).slice(1)}`;
|
|
287
|
+
for (const uri of [
|
|
288
|
+
new URL(`ap+ef61://${encodeURIComponent(base64UrlDid)}/users/alice`),
|
|
289
|
+
compatibleId("/users/alice", ORIGIN, base64UrlDid),
|
|
290
|
+
new URL("ap+ef61://did%3Akey/users/alice"),
|
|
291
|
+
new URL("ap+ef61://example.com/users/alice"),
|
|
292
|
+
compatibleId("/users/alice", ORIGIN, "did:"),
|
|
293
|
+
compatibleId("/users/alice", "https://gateway.example", "did:key"),
|
|
294
|
+
new URL(`ap+ef61://${encodedDid}/users/%ZZ`),
|
|
295
|
+
new URL(`${compatibleId("/users/").href}%ZZ`),
|
|
296
|
+
new URL(`ap+ef61://user:pass@${encodedDid}/users/alice`),
|
|
297
|
+
new URL(`https://user:pass@gateway.example/.well-known/apgateway/${did}/users/alice`)
|
|
298
|
+
]) assertEquals(parsePortable(ctx, uri), null, uri.href);
|
|
299
|
+
});
|
|
300
|
+
test("Context.parseUri() prefers the application's routes", () => {
|
|
301
|
+
const federation = createFederation({ kv: new MemoryKvStore() });
|
|
302
|
+
federation.setActorDispatcher("/users/{identifier}", () => null);
|
|
303
|
+
federation.setObjectDispatcher(Note, "/.well-known/apgateway/{+did}/users/{identifier}/notes/{id}", () => null);
|
|
304
|
+
federation.setNodeInfoDispatcher(`/.well-known/apgateway/${did}/users/alice`, () => ({
|
|
305
|
+
software: {
|
|
306
|
+
name: "test",
|
|
307
|
+
version: "1.0.0"
|
|
308
|
+
},
|
|
309
|
+
protocols: ["activitypub"],
|
|
310
|
+
usage: {
|
|
311
|
+
users: {},
|
|
312
|
+
localPosts: 0,
|
|
313
|
+
localComments: 0
|
|
314
|
+
}
|
|
315
|
+
}));
|
|
316
|
+
const ctx = federation.createContext(new URL(ORIGIN));
|
|
317
|
+
assertEquals(parsePortable(ctx, compatibleId("/users/alice")), null);
|
|
318
|
+
assertEquals(parsePortable(ctx, compatibleId("/users/alice", "https://gateway.example")), {
|
|
319
|
+
type: "actor",
|
|
320
|
+
identifier: "alice",
|
|
321
|
+
authority: did
|
|
322
|
+
});
|
|
323
|
+
const note = parsePortable(ctx, compatibleId("/users/alice/notes/1"));
|
|
324
|
+
assert(note?.type === "object");
|
|
325
|
+
assertEquals(note.values, {
|
|
326
|
+
did,
|
|
327
|
+
identifier: "alice",
|
|
328
|
+
id: "1"
|
|
329
|
+
});
|
|
330
|
+
assertFalse("authority" in note);
|
|
331
|
+
assertEquals(parsePortable(ctx, portableId("/users/alice")), {
|
|
332
|
+
type: "actor",
|
|
333
|
+
identifier: "alice",
|
|
334
|
+
authority: did
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
test("RequestContext.parseUri() recognizes portable IDs", () => {
|
|
338
|
+
const { federation } = createTestFederation();
|
|
339
|
+
const ctx = federation.createContext(new Request(compatibleId("/users/alice")), void 0);
|
|
340
|
+
assertEquals(ctx.parseUri(portableId("/users/alice")), null);
|
|
341
|
+
assertEquals(ctx.parseUri(portableId("/users/alice", otherDid), { portable: true }), {
|
|
342
|
+
type: "actor",
|
|
343
|
+
identifier: "alice",
|
|
344
|
+
authority: otherDid
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
//#endregion
|
|
348
|
+
export {};
|
|
@@ -8,10 +8,10 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
|
8
8
|
import "../std__assert-DvMDRPes.mjs";
|
|
9
9
|
import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
|
|
10
10
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
11
|
-
import { a as signObject, c as verifyPortableObjectProof } from "../proof-
|
|
12
|
-
import { l as signRequest } from "../http-
|
|
11
|
+
import { a as signObject, c as verifyPortableObjectProof } from "../proof-BdO3BbLh.mjs";
|
|
12
|
+
import { l as signRequest } from "../http-DV_yW4dv.mjs";
|
|
13
13
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
14
|
-
import { b as PORTABLE_OBJECT_CONTENT_TYPE, o as createFederation } from "../middleware-
|
|
14
|
+
import { b as PORTABLE_OBJECT_CONTENT_TYPE, o as createFederation } from "../middleware-Bdwd_Gg8.mjs";
|
|
15
15
|
import { configure, reset } from "@logtape/logtape";
|
|
16
16
|
import { Collection, Create, Note, Object as Object$1, Person, Tombstone, lookupObject } from "@fedify/vocab";
|
|
17
17
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -10,10 +10,10 @@ import { t as assertNotEquals } from "../assert_not_equals-CpPK2t89.mjs";
|
|
|
10
10
|
import "../std__assert-DvMDRPes.mjs";
|
|
11
11
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
12
12
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
13
|
-
import { d as verifyRequest } from "../http-
|
|
13
|
+
import { d as verifyRequest } from "../http-DV_yW4dv.mjs";
|
|
14
14
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
15
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
16
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-
|
|
15
|
+
import { t as doesActorOwnKey } from "../owner-C6Nv5yyw.mjs";
|
|
16
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-BwANxryy.mjs";
|
|
17
17
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
18
18
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
19
19
|
import { FetchError, UrlError } from "@fedify/vocab-runtime";
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
|
|
5
5
|
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../tasks-IG3pHfvZ.mjs";
|
|
6
6
|
import "../../testing-C1itIjqW.mjs";
|
|
7
|
-
import { o as createFederation } from "../../middleware-
|
|
7
|
+
import { o as createFederation } from "../../middleware-Bdwd_Gg8.mjs";
|
|
8
8
|
import { n as ParallelMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
|
|
9
9
|
import { configure, reset } from "@logtape/logtape";
|
|
10
10
|
import { delay } from "es-toolkit";
|
|
@@ -4,8 +4,8 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
|
|
5
5
|
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../tasks-IG3pHfvZ.mjs";
|
|
6
6
|
import "../../testing-C1itIjqW.mjs";
|
|
7
|
-
import { o as createFederation } from "../../middleware-
|
|
8
|
-
import { r as createFederationBuilder } from "../../builder-
|
|
7
|
+
import { o as createFederation } from "../../middleware-Bdwd_Gg8.mjs";
|
|
8
|
+
import { r as createFederationBuilder } from "../../builder-D89oOfHC.mjs";
|
|
9
9
|
import { t as TaskCodec } from "../../codec-C6rTrpIp.mjs";
|
|
10
10
|
import { t as InProcessMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
|
|
11
11
|
import { W3CTraceContextPropagator } from "@opentelemetry/core";
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
6
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
7
|
-
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-
|
|
7
|
+
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-CbPfRGZq.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 MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
7
|
import { t as assertNotEquals } from "../assert_not_equals-CpPK2t89.mjs";
|
|
8
8
|
import "../std__assert-DvMDRPes.mjs";
|
|
9
|
-
import { o as createFederation, s as handleWebFinger } from "../middleware-
|
|
9
|
+
import { o as createFederation, s as handleWebFinger } from "../middleware-Bdwd_Gg8.mjs";
|
|
10
10
|
import { Image, Link, Person, Tombstone } from "@fedify/vocab";
|
|
11
11
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
12
12
|
import { parseIri } from "@fedify/vocab-runtime";
|