@fedify/fedify 2.4.0-dev.2164 → 2.4.0-dev.2190
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-BqRmnx7p.mjs → builder-CFF0YNTp.mjs} +3 -3
- package/dist/{circuit-breaker-C5NqoLBJ.mjs → circuit-breaker-XJ53md4S.mjs} +16 -11
- 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-CxDBdtNz.mjs → compound-proof-F2jjkrt0.mjs} +3 -3
- package/dist/{context-BykNUf04.d.ts → context-9T--NSo4.d.ts} +55 -1
- package/dist/{context-L0Fnib9j.d.cts → context-CDcAgm4l.d.cts} +55 -1
- package/dist/{deno-CizGaYeG.mjs → deno-EopndaNb.mjs} +1 -1
- package/dist/{docloader-BBFAItNB.mjs → docloader-u6zzOExF.mjs} +25 -17
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/circuit-breaker.test.mjs +50 -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/keycache.test.mjs +1 -1
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +137 -13
- 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/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 +6 -6
- package/dist/federation/portable-inbox.test.mjs +35 -5
- package/dist/federation/portable-parse-uri.test.mjs +1 -1
- package/dist/federation/portable-route-activity.test.d.mts +2 -0
- package/dist/federation/portable-route-activity.test.mjs +259 -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-DFCnp94y.cjs → federation-BSS2dUO7.cjs} +38 -21
- package/dist/{http-Baovr6xq.js → http-BqN5kyUf.js} +426 -141
- package/dist/{http-DC1cqAQ2.d.cts → http-BrwKINQn.d.cts} +28 -0
- package/dist/{http-R4g1McwE.cjs → http-CCr2_ipG.cjs} +443 -140
- package/dist/{http-Cok5-vIC.d.ts → http-DGx0KOws.d.ts} +28 -0
- package/dist/{http-DRH0n8TD.mjs → http-Y1ObT1A8.mjs} +180 -92
- package/dist/{key-D5awqp7u.mjs → key-DyXf88bq.mjs} +4 -4
- package/dist/{key-owner-evidence-Bo3yaeL5.mjs → key-owner-evidence-APB6NpSk.mjs} +1 -1
- package/dist/{keycache-PiOM9pM0.mjs → keycache-Da8A8mZa.mjs} +1 -1
- package/dist/{kv-cache-CZiBDLPi.js → kv-cache-C02XitwK.js} +24 -16
- package/dist/{kv-cache-C7RWL7hz.mjs → kv-cache-C8YjNAi_.mjs} +1 -1
- package/dist/{kv-cache-Ct-KWRta.cjs → kv-cache-DUXluAc0.cjs} +23 -15
- package/dist/{ld-CyliEU48.mjs → ld-oQj6j_hP.mjs} +3 -3
- package/dist/{metrics-CFBEehTc.mjs → metrics-zMe834ID.mjs} +1 -1
- package/dist/{middleware-B99JjvFn.mjs → middleware-Bdu2-OPD.mjs} +37 -25
- package/dist/{middleware-CdpTFsa2.js → middleware-CaR2MRWY.js} +39 -22
- package/dist/{middleware-BmqEWsWP.mjs → middleware-Ck9yghxs.mjs} +1 -1
- package/dist/{mod-DK0y9fd-.d.ts → mod-B3OBLj5g.d.ts} +1 -1
- package/dist/{mod-B5z_q9TH.d.ts → mod-C5Mwx5ty.d.ts} +5 -1
- package/dist/{mod--jv6vyrP.d.ts → mod-Ck9_lSJB.d.ts} +1 -1
- package/dist/{mod-BLOXGs6m.d.cts → mod-D58KCqUg.d.cts} +1 -1
- package/dist/{mod-CPPqkyV_.d.cts → mod-DHTuu3l8.d.cts} +1 -1
- package/dist/{mod-BA_F2x53.d.cts → mod-Dp3Ij7sw.d.cts} +5 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +5 -5
- package/dist/mod.d.ts +5 -5
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/{owner-DKdtsrEq.mjs → owner-Dem4fbwc.mjs} +5 -5
- package/dist/{portable-collection-uv4CuQXm.js → portable-collection-BEqLrMW3.js} +1 -1
- package/dist/{portable-collection-Cb5cdPIU.mjs → portable-collection-BL6aZlQ0.mjs} +2 -2
- package/dist/{portable-collection-UajqDrSL.cjs → portable-collection-DJe_bk50.cjs} +1 -1
- package/dist/{portable-key-Bv1RdQ0n.mjs → portable-key-Duue9Y2Y.mjs} +209 -56
- package/dist/{portable-key-id-Bg259c4Z.mjs → portable-key-id-Ca30-hOa.mjs} +45 -1
- package/dist/{proof-CRTPWbVh.mjs → proof-C9115DX_.mjs} +5 -5
- package/dist/{send-2dULlZc8.mjs → send-D0hxFFRB.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 +495 -23
- package/dist/sig/key-owner-evidence.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.d.cts +2 -2
- package/dist/sig/mod.d.ts +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/portable-collection.test.mjs +1 -1
- package/dist/sig/portable-key-id.test.d.mts +2 -0
- package/dist/sig/portable-key-id.test.mjs +67 -0
- package/dist/sig/portable-key.test.mjs +253 -7
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/{temporal-Dhsk6aUT.mjs → temporal-DKchpKyp.mjs} +1 -1
- package/dist/testing/kv.test.mjs +1 -1
- package/dist/testing/mod.d.mts +52 -0
- package/dist/utils/docloader.test.mjs +93 -2
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +6 -6
package/dist/mod.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-D-XP_Ccb.js";
|
|
3
|
-
import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-
|
|
3
|
+
import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-DGx0KOws.js";
|
|
4
4
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-BSzr5-I8.js";
|
|
5
|
-
import { $ as respondWithObjectIfAcceptable, $t as ActivityTransformer, 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-
|
|
5
|
+
import { $ as respondWithObjectIfAcceptable, $t as ActivityTransformer, 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-9T--NSo4.js";
|
|
6
6
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-BhNbN8Ed.js";
|
|
7
7
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
|
|
8
|
-
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-
|
|
9
|
-
import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "./mod
|
|
10
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-
|
|
8
|
+
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-B3OBLj5g.js";
|
|
9
|
+
import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "./mod-Ck9_lSJB.js";
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-C5Mwx5ty.js";
|
|
11
11
|
export * from "@fedify/vocab-runtime";
|
|
12
12
|
|
|
13
13
|
//#region src/mod.d.ts
|
package/dist/mod.js
CHANGED
|
@@ -3,11 +3,11 @@ import { URLPattern } from "urlpattern-polyfill";
|
|
|
3
3
|
import "./rolldown-runtime-BC-Eo5Mj.js";
|
|
4
4
|
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-DAtXl_Kc.js";
|
|
5
5
|
import "./compat/mod.js";
|
|
6
|
-
import {
|
|
7
|
-
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-
|
|
6
|
+
import { D as createSignature, H as fetchKeyDetailed, I as verifyJsonLd, L as verifySignature, O as detachSignature, P as signJsonLd, T as attachSignature, U as generateCryptoKeyPair, V as fetchKey, W as importJwk, _ as verifyObject, _t as validateAcceptSignature, a as signRequest, c as verifyRequestDetailed, gt as parseAcceptSignature, h as signObject, ht as fulfillAcceptSignature, j as hasSignatureLike, m as hasProofLike, mt as formatAcceptSignature, p as createProof, s as verifyRequest, v as verifyPortableObjectProof, x as verifyProof, z as exportJwk } from "./http-BqN5kyUf.js";
|
|
7
|
+
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-CaR2MRWY.js";
|
|
8
8
|
import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-_S2_MeLF.js";
|
|
9
|
-
import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-
|
|
10
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-
|
|
9
|
+
import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-BEqLrMW3.js";
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-C02XitwK.js";
|
|
11
11
|
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError } from "./federation/mod.js";
|
|
12
12
|
import "./nodeinfo/mod.js";
|
|
13
13
|
import "./runtime/mod.js";
|
|
@@ -5,7 +5,7 @@ import { r as createRequestContext } from "../context-B2rlkkyJ.mjs";
|
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
7
|
import "../std__assert-DvMDRPes.mjs";
|
|
8
|
-
import { C as handleNodeInfo, o as createFederation, w as handleNodeInfoJrd } from "../middleware-
|
|
8
|
+
import { C as handleNodeInfo, o as createFederation, w as handleNodeInfoJrd } from "../middleware-Bdu2-OPD.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
//#region src/nodeinfo/handler.test.ts
|
|
11
11
|
test("handleNodeInfo()", async () => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import {
|
|
6
|
-
import { i as parseKeyOwnerEvidence, r as getVerifiedKeyOwnerEvidence } from "./key-owner-evidence-
|
|
7
|
-
import { l as verifyKeyOwnership, n as exportJwk, r as fetchActorDocument } from "./key-
|
|
8
|
-
import { n as resolvePortableActorKey, t as fetchPortableGatewayKey } from "./portable-key-
|
|
4
|
+
import { n as version, t as name } from "./deno-EopndaNb.mjs";
|
|
5
|
+
import { d as isPortableUri, l as isPortableId, n as getCanonicalPortableId, p as isSamePublicKey$1, s as isCompatibleKeyId } from "./portable-key-id-Ca30-hOa.mjs";
|
|
6
|
+
import { i as parseKeyOwnerEvidence, r as getVerifiedKeyOwnerEvidence } from "./key-owner-evidence-APB6NpSk.mjs";
|
|
7
|
+
import { l as verifyKeyOwnership, n as exportJwk, r as fetchActorDocument } from "./key-DyXf88bq.mjs";
|
|
8
|
+
import { n as resolvePortableActorKey, t as fetchPortableGatewayKey } from "./portable-key-Duue9Y2Y.mjs";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
10
10
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
11
11
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import {
|
|
3
|
+
import { At as name, B as fetchActorDocument, Dt as isPortableUri, J as getVerifiedKeyOwnerEvidence, K as verifyKeyOwnership, Tt as isPortableId, Y as parseKeyOwnerEvidence, b as verifyPortableObjectProofWithRoot, jt as version, kt as isSamePublicKey$1, l as fetchPortableGatewayKey, u as resolvePortableActorKey, v as verifyPortableObjectProof, wt as isCompatibleKeyId, yt as getCanonicalPortableId, z as exportJwk } from "./http-BqN5kyUf.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { CollectionPage, CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
6
6
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { c as verifyPortableObjectProof, u as verifyPortableObjectProofWithRoot } from "./proof-
|
|
4
|
+
import { n as version, t as name } from "./deno-EopndaNb.mjs";
|
|
5
|
+
import { c as verifyPortableObjectProof, u as verifyPortableObjectProofWithRoot } from "./proof-C9115DX_.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { CollectionPage, Object as Object$1, isActor } from "@fedify/vocab";
|
|
8
8
|
import { trace } from "@opentelemetry/api";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
|
-
const require_http = require("./http-
|
|
2
|
+
const require_http = require("./http-CCr2_ipG.cjs");
|
|
3
3
|
let _logtape_logtape = require("@logtape/logtape");
|
|
4
4
|
let _fedify_vocab = require("@fedify/vocab");
|
|
5
5
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import {
|
|
5
|
-
import { u as verifyPortableObjectProofWithRoot } from "./proof-
|
|
4
|
+
import { a as getRawCanonicalPortableId, c as isPortableActorDocument, d as isPortableUri, n as getCanonicalPortableId, p as isSamePublicKey } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
|
+
import { u as verifyPortableObjectProofWithRoot } from "./proof-C9115DX_.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { CryptographicKey, Multikey, Object as Object$1 } from "@fedify/vocab";
|
|
8
8
|
import { FetchError, formatIri, getDocumentLoader, isGatewayUrl, parseIri, toCompatibleEf61Id } from "@fedify/vocab-runtime";
|
|
@@ -222,6 +222,21 @@ async function fetchPortableGatewayKey(keyId, options = {}) {
|
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
/**
|
|
225
|
+
* The maximum number of `@gateway` location hints followed for one `ap:` or
|
|
226
|
+
* `ap+ef61:` key ID. Whoever made a signature chooses the hints of its key
|
|
227
|
+
* ID, so fewer of them are followed than when dereferencing objects, which
|
|
228
|
+
* bounds the gateways one signature can make Fedify ask. Further hints are
|
|
229
|
+
* ignored.
|
|
230
|
+
*/
|
|
231
|
+
const MAX_KEY_ID_GATEWAY_HINTS = 3;
|
|
232
|
+
/**
|
|
233
|
+
* The default of {@link PortableActorKeyOptions.lookupTimeout}, in
|
|
234
|
+
* milliseconds.
|
|
235
|
+
*/
|
|
236
|
+
const DEFAULT_KEY_ID_LOOKUP_TIMEOUT = 1e4;
|
|
237
|
+
/** The longest delay that `setTimeout()` supports, in milliseconds. */
|
|
238
|
+
const MAX_TIMEOUT = 2 ** 31 - 1;
|
|
239
|
+
/**
|
|
225
240
|
* Resolves a key of a portable actor at an `ap:` or `ap+ef61:` key ID, e.g.,
|
|
226
241
|
* `ap://did:key:z6Mk…/actor#main-key`. Such a key ID names no gateway, so
|
|
227
242
|
* the actor's document, i.e., the key ID without its fragment, is fetched
|
|
@@ -249,12 +264,25 @@ async function fetchPortableGatewayKey(keyId, options = {}) {
|
|
|
249
264
|
* unreachable gateway would have served, so the result is an `unavailable`
|
|
250
265
|
* that is not cacheable.
|
|
251
266
|
*
|
|
267
|
+
* Only the first {@link MAX_KEY_ID_GATEWAY_HINTS} location hints are
|
|
268
|
+
* followed, and all the gateways share one timeout, see
|
|
269
|
+
* {@link PortableActorKeyOptions.lookupTimeout}. A gateway that does not
|
|
270
|
+
* serve the document in time failed to serve it, like an unreachable one,
|
|
271
|
+
* with an error that has no HTTP status. A gateway whose document could not
|
|
272
|
+
* be processed in time, and the gateways left untried, make the result an
|
|
273
|
+
* `unavailable` that is not cacheable. A result that arrives after
|
|
274
|
+
* the timeout is ignored, even if it vouches for the key.
|
|
275
|
+
*
|
|
252
276
|
* @param keyId The key ID, which must be an `ap:` or `ap+ef61:` URI.
|
|
253
|
-
* @param options Loaders and
|
|
277
|
+
* @param options Loaders, telemetry providers, and the timeout.
|
|
254
278
|
* @returns The resolution, which is never `legacy`.
|
|
279
|
+
* @throws {RangeError} If the timeout is not a non-negative number of
|
|
280
|
+
* milliseconds that `setTimeout()` supports.
|
|
255
281
|
* @internal
|
|
256
282
|
*/
|
|
257
283
|
async function resolvePortableActorKey(keyId, options = {}) {
|
|
284
|
+
const lookupTimeout = options.lookupTimeout ?? DEFAULT_KEY_ID_LOOKUP_TIMEOUT;
|
|
285
|
+
if (!Number.isFinite(lookupTimeout) || lookupTimeout < 0 || lookupTimeout > MAX_TIMEOUT) throw new RangeError(`The lookup timeout must be between 0 and ${MAX_TIMEOUT} ms: ${lookupTimeout}`);
|
|
258
286
|
const documentLoader = options.documentLoader ?? getDocumentLoader();
|
|
259
287
|
const contextLoader = options.contextLoader ?? getDocumentLoader();
|
|
260
288
|
let formattedKeyId = keyId.href;
|
|
@@ -273,75 +301,67 @@ async function resolvePortableActorKey(keyId, options = {}) {
|
|
|
273
301
|
if (keyId.hash === "" || keyId.hash === "#") return reject("The key ID has no fragment; only keys embedded in actor documents are supported.");
|
|
274
302
|
const actorUrl = new URL(keyId.href);
|
|
275
303
|
actorUrl.hash = "";
|
|
304
|
+
const gateways = getPortableGatewayCandidates(actorUrl);
|
|
305
|
+
if (gateways.length > MAX_KEY_ID_GATEWAY_HINTS) logger.debug("Following only the first {max} location hints of key {keyId}.", {
|
|
306
|
+
keyId: formattedKeyId,
|
|
307
|
+
max: MAX_KEY_ID_GATEWAY_HINTS
|
|
308
|
+
});
|
|
276
309
|
const requestUrls = [];
|
|
277
|
-
for (const gateway of
|
|
310
|
+
for (const gateway of gateways.slice(0, MAX_KEY_ID_GATEWAY_HINTS)) try {
|
|
278
311
|
requestUrls.push(toCompatibleEf61Id(actorUrl, gateway).href);
|
|
279
312
|
} catch (error) {
|
|
280
313
|
if (!(error instanceof TypeError)) throw error;
|
|
281
314
|
return reject(`The key ID cannot be fetched from gateways: ${error}`);
|
|
282
315
|
}
|
|
283
316
|
if (requestUrls.length < 1) requestUrls.push(formatIri(actorUrl));
|
|
317
|
+
const controller = new AbortController();
|
|
318
|
+
const timeoutError = new DOMException(`Timed out looking up the actor of key ${formattedKeyId} after ${lookupTimeout} ms.`, "TimeoutError");
|
|
319
|
+
let timer;
|
|
320
|
+
if (lookupTimeout > 0) timer = setTimeout(() => controller.abort(timeoutError), lookupTimeout);
|
|
321
|
+
else controller.abort(timeoutError);
|
|
322
|
+
const { signal } = controller;
|
|
323
|
+
const attemptOptions = {
|
|
324
|
+
...options,
|
|
325
|
+
documentLoader: withDeadline(documentLoader, signal),
|
|
326
|
+
contextLoader: withDeadline(contextLoader, signal),
|
|
327
|
+
signal,
|
|
328
|
+
formattedKeyId
|
|
329
|
+
};
|
|
284
330
|
const attempts = [];
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
} catch (error) {
|
|
290
|
-
logger.debug("Failed to fetch the actor of key {keyId} from {url}: {error}", {
|
|
291
|
-
keyId: formattedKeyId,
|
|
292
|
-
url,
|
|
293
|
-
error
|
|
294
|
-
});
|
|
295
|
-
attempts.push({
|
|
296
|
-
type: "retrievalFailed",
|
|
297
|
-
error
|
|
298
|
-
});
|
|
299
|
-
continue;
|
|
300
|
-
}
|
|
301
|
-
let resolution;
|
|
302
|
-
try {
|
|
303
|
-
const object = await Object$1.fromJsonLd(remoteDocument.document, {
|
|
304
|
-
documentLoader,
|
|
305
|
-
contextLoader,
|
|
306
|
-
tracerProvider: options.tracerProvider
|
|
307
|
-
});
|
|
308
|
-
resolution = isPortableActorDocument(object) ? await verifyPortableKeyDocument(remoteDocument.document, object, keyId, false, {
|
|
309
|
-
...options,
|
|
310
|
-
documentLoader,
|
|
311
|
-
contextLoader
|
|
312
|
-
}) : {
|
|
313
|
-
type: "rejected",
|
|
314
|
-
reason: "The document is not a portable actor."
|
|
315
|
-
};
|
|
316
|
-
} catch (error) {
|
|
317
|
-
if (error instanceof TypeError) resolution = {
|
|
318
|
-
type: "rejected",
|
|
319
|
-
reason: `The document is malformed: ${error.message}`
|
|
320
|
-
};
|
|
321
|
-
else {
|
|
322
|
-
logger.debug("Failed to process the actor of key {keyId} served from {url}: {error}", {
|
|
331
|
+
try {
|
|
332
|
+
for (const url of requestUrls) {
|
|
333
|
+
if (signal.aborted) {
|
|
334
|
+
logger.debug("Ran out of time looking up the actor of key {keyId}; gateways from {url} on were not tried.", {
|
|
323
335
|
keyId: formattedKeyId,
|
|
324
|
-
url
|
|
325
|
-
error
|
|
336
|
+
url
|
|
326
337
|
});
|
|
327
338
|
attempts.push({
|
|
328
339
|
type: "indeterminate",
|
|
329
|
-
error
|
|
340
|
+
error: signal.reason
|
|
341
|
+
});
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
const state = { processing: false };
|
|
345
|
+
let attempt;
|
|
346
|
+
try {
|
|
347
|
+
attempt = await raceAbort(attemptGateway(url, keyId, attemptOptions, state), signal);
|
|
348
|
+
} catch (error) {
|
|
349
|
+
if (!signal.aborted) throw error;
|
|
350
|
+
logger.debug("Ran out of time looking up the actor of key {keyId} at {url}.", {
|
|
351
|
+
keyId: formattedKeyId,
|
|
352
|
+
url
|
|
353
|
+
});
|
|
354
|
+
attempts.push({
|
|
355
|
+
type: state.processing ? "indeterminate" : "retrievalFailed",
|
|
356
|
+
error: signal.reason
|
|
330
357
|
});
|
|
331
358
|
continue;
|
|
332
359
|
}
|
|
360
|
+
if (attempt.type === "verified") return attempt;
|
|
361
|
+
attempts.push(attempt);
|
|
333
362
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
logger.debug("The actor document served from {url} does not vouch for key {keyId}: {reason}", {
|
|
337
|
-
keyId: formattedKeyId,
|
|
338
|
-
url,
|
|
339
|
-
reason
|
|
340
|
-
});
|
|
341
|
-
attempts.push({
|
|
342
|
-
type: "rejected",
|
|
343
|
-
reason
|
|
344
|
-
});
|
|
363
|
+
} finally {
|
|
364
|
+
clearTimeout(timer);
|
|
345
365
|
}
|
|
346
366
|
const rejections = attempts.flatMap((a) => a.type === "rejected" ? [a.reason] : []);
|
|
347
367
|
if (rejections.length === attempts.length) return reject(rejections.join(" "));
|
|
@@ -362,6 +382,139 @@ async function resolvePortableActorKey(keyId, options = {}) {
|
|
|
362
382
|
};
|
|
363
383
|
}
|
|
364
384
|
/**
|
|
385
|
+
* Fetches the actor's document of a key at an `ap:` or `ap+ef61:` key ID from
|
|
386
|
+
* one gateway, and tells whether it vouches for the key. It never rejects;
|
|
387
|
+
* the caller races it against the lookup's timeout, and ignores what it
|
|
388
|
+
* resolves to after the timeout.
|
|
389
|
+
*/
|
|
390
|
+
async function attemptGateway(url, keyId, options, state) {
|
|
391
|
+
const { documentLoader, contextLoader, signal, formattedKeyId } = options;
|
|
392
|
+
let remoteDocument;
|
|
393
|
+
try {
|
|
394
|
+
remoteDocument = await documentLoader(url);
|
|
395
|
+
} catch (error) {
|
|
396
|
+
logger.debug("Failed to fetch the actor of key {keyId} from {url}: {error}", {
|
|
397
|
+
keyId: formattedKeyId,
|
|
398
|
+
url,
|
|
399
|
+
error
|
|
400
|
+
});
|
|
401
|
+
return {
|
|
402
|
+
type: "retrievalFailed",
|
|
403
|
+
error
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
if (signal.aborted) return {
|
|
407
|
+
type: "indeterminate",
|
|
408
|
+
error: signal.reason
|
|
409
|
+
};
|
|
410
|
+
state.processing = true;
|
|
411
|
+
let resolution;
|
|
412
|
+
try {
|
|
413
|
+
const object = await Object$1.fromJsonLd(remoteDocument.document, {
|
|
414
|
+
documentLoader,
|
|
415
|
+
contextLoader,
|
|
416
|
+
tracerProvider: options.tracerProvider
|
|
417
|
+
});
|
|
418
|
+
signal.throwIfAborted();
|
|
419
|
+
resolution = isPortableActorDocument(object) ? await verifyPortableKeyDocument(remoteDocument.document, object, keyId, false, options) : {
|
|
420
|
+
type: "rejected",
|
|
421
|
+
reason: "The document is not a portable actor."
|
|
422
|
+
};
|
|
423
|
+
} catch (error) {
|
|
424
|
+
if (error instanceof TypeError && !signal.aborted) resolution = {
|
|
425
|
+
type: "rejected",
|
|
426
|
+
reason: `The document is malformed: ${error.message}`
|
|
427
|
+
};
|
|
428
|
+
else {
|
|
429
|
+
logger.debug("Failed to process the actor of key {keyId} served from {url}: {error}", {
|
|
430
|
+
keyId: formattedKeyId,
|
|
431
|
+
url,
|
|
432
|
+
error
|
|
433
|
+
});
|
|
434
|
+
return {
|
|
435
|
+
type: "indeterminate",
|
|
436
|
+
error
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
if (resolution.type === "verified") return resolution;
|
|
441
|
+
const reason = resolution.type === "rejected" ? resolution.reason : "The document is not a portable actor.";
|
|
442
|
+
logger.debug("The actor document served from {url} does not vouch for key {keyId}: {reason}", {
|
|
443
|
+
keyId: formattedKeyId,
|
|
444
|
+
url,
|
|
445
|
+
reason
|
|
446
|
+
});
|
|
447
|
+
return {
|
|
448
|
+
type: "rejected",
|
|
449
|
+
reason
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Wraps a document loader so that it gives up when the given signal aborts,
|
|
454
|
+
* as well as when the signal in its own options does. The wrapped loader is
|
|
455
|
+
* passed a signal that aborts in either case, but in case it ignores that
|
|
456
|
+
* signal, what it resolves to after the abort is ignored, and the wrapper
|
|
457
|
+
* rejects with the reason of the abort at once. After the abort, the wrapped
|
|
458
|
+
* loader is not called at all.
|
|
459
|
+
*/
|
|
460
|
+
function withDeadline(loader, signal) {
|
|
461
|
+
return (url, options) => {
|
|
462
|
+
const combined = combineSignals(signal, options?.signal);
|
|
463
|
+
return raceAbort(combined.signal.aborted ? Promise.reject(combined.signal.reason) : new Promise((resolve) => resolve(loader(url, {
|
|
464
|
+
...options,
|
|
465
|
+
signal: combined.signal
|
|
466
|
+
}))), combined.signal).finally(combined.dispose);
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Makes a signal that aborts when either of the given signals does, with
|
|
471
|
+
* the reason of the one that aborted first. `AbortSignal.any()` is not
|
|
472
|
+
* available on every supported runtime, e.g., Bun before 1.1.4.
|
|
473
|
+
* @returns The signal, and a function that stops listening to the given
|
|
474
|
+
* signals.
|
|
475
|
+
*/
|
|
476
|
+
function combineSignals(signal, other) {
|
|
477
|
+
if (other == null || other === signal) return {
|
|
478
|
+
signal,
|
|
479
|
+
dispose() {}
|
|
480
|
+
};
|
|
481
|
+
const controller = new AbortController();
|
|
482
|
+
const sources = [signal, other];
|
|
483
|
+
const dispose = () => {
|
|
484
|
+
for (const source of sources) source.removeEventListener("abort", onAbort);
|
|
485
|
+
};
|
|
486
|
+
function onAbort() {
|
|
487
|
+
dispose();
|
|
488
|
+
controller.abort(this.reason);
|
|
489
|
+
}
|
|
490
|
+
const aborted = sources.find((source) => source.aborted);
|
|
491
|
+
if (aborted == null) for (const source of sources) source.addEventListener("abort", onAbort);
|
|
492
|
+
else controller.abort(aborted.reason);
|
|
493
|
+
return {
|
|
494
|
+
signal: controller.signal,
|
|
495
|
+
dispose
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Waits for the given promise unless the given signal aborts first, in which
|
|
500
|
+
* case it rejects with the reason of the abort. If the signal has aborted by
|
|
501
|
+
* the time the promise settles, the abort wins as well, so that nothing that
|
|
502
|
+
* settles after it counts.
|
|
503
|
+
*/
|
|
504
|
+
function raceAbort(promise, signal) {
|
|
505
|
+
return new Promise((resolve, reject) => {
|
|
506
|
+
const onAbort = () => reject(signal.reason);
|
|
507
|
+
const settle = (settled) => {
|
|
508
|
+
signal.removeEventListener("abort", onAbort);
|
|
509
|
+
if (signal.aborted) onAbort();
|
|
510
|
+
else settled();
|
|
511
|
+
};
|
|
512
|
+
promise.then((value) => settle(() => resolve(value)), (error) => settle(() => reject(error)));
|
|
513
|
+
if (signal.aborted) onAbort();
|
|
514
|
+
else signal.addEventListener("abort", onAbort, { once: true });
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
365
518
|
* Finds the nodes that stand for the key with the given canonical portable
|
|
366
519
|
* ID. A node whose ID is an `ap:` or `ap+ef61:` URI stands for the key
|
|
367
520
|
* itself, e.g., Mitra lists the keys of portable actors that way while
|
|
@@ -103,6 +103,50 @@ function getCanonicalPortableId(id) {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
|
+
* Gets the [FEP-fe34] origin of an ID for same-origin checks. The origin of
|
|
107
|
+
* an `ap:` or `ap+ef61:` URI, or of a compatible identifier on any gateway,
|
|
108
|
+
* is the DID of its canonical portable ID, as FEP-ef61 treats a compatible
|
|
109
|
+
* identifier as the portable ID it stands for; unlike `getFe34Origin()`,
|
|
110
|
+
* which gives a compatible identifier the web origin of its gateway. The
|
|
111
|
+
* origin of any other HTTP(S) URL is its web origin, and that of a DID URL
|
|
112
|
+
* is its DID.
|
|
113
|
+
*
|
|
114
|
+
* Only the parsed `URL` is validated, so dot segments that URL parsing has
|
|
115
|
+
* already resolved cannot be detected here.
|
|
116
|
+
*
|
|
117
|
+
* [FEP-fe34]: https://w3id.org/fep/fe34
|
|
118
|
+
* @returns The origin, or `null` if the ID has none that is supported, or is
|
|
119
|
+
* a malformed portable ID or compatible identifier.
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
function getAuthenticationOrigin(id) {
|
|
123
|
+
try {
|
|
124
|
+
if (isPortableId(id)) {
|
|
125
|
+
const canonical = getCanonicalPortableId(id);
|
|
126
|
+
return canonical == null ? null : getFe34Origin(canonical);
|
|
127
|
+
}
|
|
128
|
+
return getFe34Origin(id);
|
|
129
|
+
} catch (error) {
|
|
130
|
+
if (error instanceof TypeError) return null;
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Checks whether two IDs identify the same object. Two portable IDs, i.e.,
|
|
136
|
+
* `ap:` or `ap+ef61:` URIs or compatible identifiers, are compared by their
|
|
137
|
+
* canonical portable IDs, so that the same object on different gateways and
|
|
138
|
+
* with different location hints matches. Other IDs have to be equal as
|
|
139
|
+
* they are.
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
function isSameObjectId(a, b) {
|
|
143
|
+
const aPortable = isPortableId(a);
|
|
144
|
+
if (aPortable !== isPortableId(b)) return false;
|
|
145
|
+
if (!aPortable) return a.href === b.href;
|
|
146
|
+
const canonical = getCanonicalPortableId(a);
|
|
147
|
+
return canonical != null && canonical === getCanonicalPortableId(b);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
106
150
|
* Gets the canonical portable ID of an `ap:` or `ap+ef61:` URI or
|
|
107
151
|
* a compatible identifier as it is written, before any URL parsing.
|
|
108
152
|
* Parsing an ID into a `URL` resolves dot segments in its path, which would
|
|
@@ -201,4 +245,4 @@ async function isSamePublicKey(a, b) {
|
|
|
201
245
|
return x.kty === y.kty && x.crv === y.crv && x.n === y.n && x.e === y.e && x.x === y.x && x.y === y.y;
|
|
202
246
|
}
|
|
203
247
|
//#endregion
|
|
204
|
-
export {
|
|
248
|
+
export { getRawCanonicalPortableId as a, isPortableActorDocument as c, isPortableUri as d, isSameObjectId as f, getPortableDid as i, isPortableId as l, parseKeyIdString as m, getCanonicalPortableId as n, hasPortableActor as o, isSamePublicKey as p, getGatewayKeyBase as r, isCompatibleKeyId as s, getAuthenticationOrigin as t, isPortableKeyId as u };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Temporal } from "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 {
|
|
7
|
-
import { c as validateCryptoKey, i as fetchKey, t as bypassKeyCacheReads } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-EopndaNb.mjs";
|
|
5
|
+
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-zMe834ID.mjs";
|
|
6
|
+
import { i as getPortableDid, l as isPortableId } from "./portable-key-id-Ca30-hOa.mjs";
|
|
7
|
+
import { c as validateCryptoKey, i as fetchKey, t as bypassKeyCacheReads } from "./key-DyXf88bq.mjs";
|
|
8
8
|
import { n as preloadedOnlyDocumentLoader } from "./public-audience--klBIOk1.mjs";
|
|
9
9
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
|
|
10
|
-
import { c as getNormalizationContextLoader } from "./ld-
|
|
10
|
+
import { c as getNormalizationContextLoader } from "./ld-oQj6j_hP.mjs";
|
|
11
11
|
import { getLogger } from "@logtape/logtape";
|
|
12
12
|
import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
|
|
13
13
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "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 } from "./metrics-
|
|
6
|
-
import { n as doubleKnock } from "./http-
|
|
4
|
+
import { n as version, t as name } from "./deno-EopndaNb.mjs";
|
|
5
|
+
import { n as getDurationMs, r as getFederationMetrics } from "./metrics-zMe834ID.mjs";
|
|
6
|
+
import { n as doubleKnock } from "./http-Y1ObT1A8.mjs";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
8
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
9
9
|
import { FetchError, UrlError, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
|
-
import { i as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-
|
|
6
|
+
import { i as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-F2jjkrt0.mjs";
|
|
7
7
|
import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/sig/compound-proof-discovery.test.ts
|
|
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
|
-
import { i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-
|
|
6
|
+
import { i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-F2jjkrt0.mjs";
|
|
7
7
|
import { test } from "@fedify/fixture";
|
|
8
8
|
//#region src/sig/compound-proof-producer.test.ts
|
|
9
9
|
const portableId = "ap+ef61://did:key:z6MkAlice/objects/1";
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
6
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
7
|
-
import { l as verifyPortableObjectProofPolicy, o as verifyMapLocalProof } from "../proof-
|
|
7
|
+
import { l as verifyPortableObjectProofPolicy, o as verifyMapLocalProof } from "../proof-C9115DX_.mjs";
|
|
8
8
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
9
|
-
import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, o as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-
|
|
9
|
+
import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, o as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-F2jjkrt0.mjs";
|
|
10
10
|
import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
|
|
11
11
|
import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
|
|
12
12
|
import { CryptographicKey, Multikey, Person } from "@fedify/vocab";
|
|
@@ -6,9 +6,9 @@ import "../std__assert-DvMDRPes.mjs";
|
|
|
6
6
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
7
7
|
import { n as preloadedOnlyDocumentLoader } from "../public-audience--klBIOk1.mjs";
|
|
8
8
|
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
|
|
9
|
-
import { a as signObject, d as verifyProof } from "../proof-
|
|
9
|
+
import { a as signObject, d as verifyProof } from "../proof-C9115DX_.mjs";
|
|
10
10
|
import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
11
|
-
import { o as verifyCompoundProofDocuments } from "../compound-proof-
|
|
11
|
+
import { o as verifyCompoundProofDocuments } from "../compound-proof-F2jjkrt0.mjs";
|
|
12
12
|
import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
|
|
13
13
|
import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
|
|
14
14
|
import { Create, DataIntegrityProof, Note, Question } from "@fedify/vocab";
|