@fedify/fedify 2.3.0-dev.1079 → 2.3.0-dev.1099
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-DqT-OPZ8.mjs → builder-BkRRjxzb.mjs} +2 -2
- package/dist/{chunk-nlSIicah.js → chunk-CRNNMoPX.js} +2 -2
- package/dist/{client-z-8dc-e1.d.cts → client-CAM_bQXx.d.cts} +1 -0
- package/dist/{client-AtlibPOU.d.ts → client-CSddvgWN.d.ts} +1 -2
- package/dist/compat/mod.d.cts +2 -1
- package/dist/compat/mod.d.ts +2 -3
- package/dist/compat/mod.js +3 -3
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{context-DrNqYkPw.d.ts → context-C0C_sRha.d.cts} +6 -7
- package/dist/{context-BKLGj9QO.d.cts → context-Dqgt8saU.d.ts} +6 -5
- package/dist/{deno-BxqkYxIf.mjs → deno-DBabeupC.mjs} +1 -1
- package/dist/{docloader-vsZP01ww.mjs → docloader-DA5FzJOR.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +84 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/middleware.test.mjs +383 -16
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +4 -3
- package/dist/federation/mod.d.ts +4 -5
- package/dist/federation/mod.js +2 -2
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{http-DM4ZAFCe.mjs → http-5G18W3NP.mjs} +58 -10
- package/dist/{http-CrGuipxe.d.cts → http-BDZeS5om.d.ts} +2 -1
- package/dist/{http-aQzN9Ayi.d.ts → http-C87EWkO0.d.cts} +2 -3
- package/dist/{http-b__OS_rJ.js → http-Dzy5c472.js} +58 -10
- package/dist/{http-DQ25_ruv.cjs → http-W2u_KBoQ.cjs} +57 -9
- package/dist/{key-BNp_b9oE.mjs → key-D9dUsyow.mjs} +1 -1
- package/dist/{kv-CbLNp3zQ.d.cts → kv-D6hNiMTK.d.ts} +1 -0
- package/dist/{kv-cache-DzctboPD.cjs → kv-cache-BygrlQ1c.cjs} +2 -2
- package/dist/{kv-cache-D5vjOi5y.js → kv-cache-CBSgxEsZ.js} +2 -2
- package/dist/{kv-cache-EaVpV2xQ.mjs → kv-cache-CiiNwT6W.mjs} +1 -1
- package/dist/{kv-GFYnFoOl.d.ts → kv-gJ8LYbxX.d.cts} +1 -3
- package/dist/{ld-L9w529xq.mjs → ld-hbxDLO1k.mjs} +2 -2
- package/dist/{middleware-CTdNwf_s.mjs → middleware-BXnhAGF9.mjs} +188 -114
- package/dist/{middleware-CMF242Rg.cjs → middleware-Caj827xW.cjs} +305 -107
- package/dist/{middleware-CpCSD43m.mjs → middleware-DZQsPMZb.mjs} +1 -1
- package/dist/{middleware-DZNHpEbh.js → middleware-vCF_cKAq.js} +309 -111
- package/dist/{mod-CLgIXe9w.d.ts → mod-B0rWmfW5.d.cts} +4 -5
- package/dist/{mod-CMEbIaNh.d.cts → mod-BhU_H1I_.d.ts} +4 -3
- package/dist/{mod-B8Z8mBLk.d.ts → mod-CLPnQPsv.d.cts} +2 -3
- package/dist/{mod-Cr3f-ACa.d.cts → mod-DHO9lk3D.d.ts} +3 -2
- package/dist/{mod-CR8soWa9.d.ts → mod-DXY9JF28.d.cts} +3 -4
- package/dist/{mod-DClCOv0M.d.cts → mod-Dx3-hqyo.d.ts} +2 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +9 -8
- package/dist/mod.d.ts +9 -10
- package/dist/mod.js +9 -9
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/nodeinfo/mod.d.cts +2 -1
- package/dist/nodeinfo/mod.d.ts +2 -3
- package/dist/nodeinfo/mod.js +3 -3
- package/dist/otel/mod.d.cts +2 -1
- package/dist/otel/mod.d.ts +2 -3
- package/dist/otel/mod.js +2 -2
- package/dist/{owner-CptqhsOy.d.cts → owner-CnngXDNJ.d.ts} +2 -1
- package/dist/{owner-74ARJ5TL.d.ts → owner-DEvZuyOE.d.cts} +2 -3
- package/dist/{owner-C30LGgMz.mjs → owner-DwJe0BH9.mjs} +2 -2
- package/dist/{proof-zrLeLWgt.cjs → proof-CZCaAURh.cjs} +1 -1
- package/dist/{proof-CO1qAbN8.js → proof-DMJJZnKd.js} +2 -2
- package/dist/{proof-BjToRsXF.mjs → proof-erpV_J_n.mjs} +2 -2
- package/dist/runtime/mod.d.cts +1 -0
- package/dist/runtime/mod.d.ts +1 -2
- package/dist/runtime/mod.js +3 -3
- package/dist/{send-DzbMznU6.mjs → send-BOwz4Hw5.mjs} +127 -3
- package/dist/sig/http.test.mjs +120 -2
- package/dist/sig/key.test.mjs +1 -1
- package/dist/sig/ld.test.mjs +2 -2
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.d.cts +4 -3
- package/dist/sig/mod.d.ts +4 -5
- package/dist/sig/mod.js +4 -4
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/proof.test.mjs +1 -1
- package/dist/{transformers-ve6e2xcg.js → transformers-BGMIq1cs.js} +2 -2
- package/dist/{types-hvL8ElAs.js → types-CAY3OdLq.js} +2 -2
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.d.cts +2 -1
- package/dist/utils/mod.d.ts +2 -3
- package/dist/utils/mod.js +3 -3
- package/dist/vocab/mod.d.cts +1 -0
- package/dist/vocab/mod.d.ts +1 -2
- package/dist/vocab/mod.js +2 -2
- package/package.json +6 -6
package/dist/mod.d.cts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { i as
|
|
4
|
-
import {
|
|
5
|
-
import { a as
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
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-CAM_bQXx.cjs";
|
|
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-C87EWkO0.cjs";
|
|
4
|
+
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-DEvZuyOE.cjs";
|
|
5
|
+
import { $ as ParallelMessageQueue, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as WebFingerLinksDispatcher, D as ObjectCallbackSetters, Dt as buildCollectionSynchronizationHeader, E as InboxListenerSetters, Et as PageItems, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as digest, P as CreateExponentialBackoffPolicyOptions, Q as MessageQueueListenOptions, R as Message, S as FederationStartQueueOptions, St as UnverifiedActivityReason, T as InboxChallengePolicy, Tt as SenderKeyPair, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueDepth, Y as MessageQueue, Z as MessageQueueEnqueueOptions, _ as Federatable, _t as OutboxListener, a as GetSignedKeyOptions, at as CollectionCounter, b as FederationFetchOptions, bt as SharedInboxKeyDispatcher, c as ParseUriResult, ct as CustomCollectionCounter, d as SendActivityOptions, dt as InboxErrorHandler, et as ActorAliasMapper, f as SendActivityOptionsForCollection, ft as InboxListener, g as CustomCollectionCallbackSetters, gt as OutboxErrorHandler, h as ConstructorWithTypeId, ht as ObjectDispatcher, i as GetActorOptions, it as AuthorizePredicate, j as FederationOrigin, k as Rfc6570Expression, kt as ActivityTransformer, l as RequestContext, lt as CustomCollectionCursor, m as CollectionCallbackSetters, mt as ObjectAuthorizePredicate, n as Context, nt as ActorHandleMapper, o as InboxContext, ot as CollectionCursor, p as ActorCallbackSetters, pt as NodeInfoDispatcher, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as ActorKeyPairsDispatcher, s as OutboxContext, st as CollectionDispatcher, t as ActorKeyPair, tt as ActorDispatcher, u as RouteActivityOptions, ut as CustomCollectionDispatcher, v as Federation, vt as OutboxListenerErrorHandler, w as IdempotencyStrategy, wt as SendActivityError, x as FederationOptions, xt as UnverifiedActivityHandler, y as FederationBuilder, yt as OutboxPermanentFailureHandler, z as createFederationBuilder } from "./context-C0C_sRha.cjs";
|
|
6
|
+
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-gJ8LYbxX.cjs";
|
|
6
7
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
|
|
7
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-
|
|
8
|
-
import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-
|
|
9
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-
|
|
8
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-CLPnQPsv.cjs";
|
|
9
|
+
import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-DXY9JF28.cjs";
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-B0rWmfW5.cjs";
|
|
10
11
|
export * from "@fedify/vocab-runtime";
|
|
11
12
|
|
|
12
13
|
//#region src/mod.d.ts
|
package/dist/mod.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import { i as
|
|
6
|
-
import {
|
|
7
|
-
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-GFYnFoOl.js";
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
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-CSddvgWN.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-BDZeS5om.js";
|
|
4
|
+
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CnngXDNJ.js";
|
|
5
|
+
import { $ as ParallelMessageQueue, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as WebFingerLinksDispatcher, D as ObjectCallbackSetters, Dt as buildCollectionSynchronizationHeader, E as InboxListenerSetters, Et as PageItems, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as digest, P as CreateExponentialBackoffPolicyOptions, Q as MessageQueueListenOptions, R as Message, S as FederationStartQueueOptions, St as UnverifiedActivityReason, T as InboxChallengePolicy, Tt as SenderKeyPair, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueDepth, Y as MessageQueue, Z as MessageQueueEnqueueOptions, _ as Federatable, _t as OutboxListener, a as GetSignedKeyOptions, at as CollectionCounter, b as FederationFetchOptions, bt as SharedInboxKeyDispatcher, c as ParseUriResult, ct as CustomCollectionCounter, d as SendActivityOptions, dt as InboxErrorHandler, et as ActorAliasMapper, f as SendActivityOptionsForCollection, ft as InboxListener, g as CustomCollectionCallbackSetters, gt as OutboxErrorHandler, h as ConstructorWithTypeId, ht as ObjectDispatcher, i as GetActorOptions, it as AuthorizePredicate, j as FederationOrigin, k as Rfc6570Expression, kt as ActivityTransformer, l as RequestContext, lt as CustomCollectionCursor, m as CollectionCallbackSetters, mt as ObjectAuthorizePredicate, n as Context, nt as ActorHandleMapper, o as InboxContext, ot as CollectionCursor, p as ActorCallbackSetters, pt as NodeInfoDispatcher, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as ActorKeyPairsDispatcher, s as OutboxContext, st as CollectionDispatcher, t as ActorKeyPair, tt as ActorDispatcher, u as RouteActivityOptions, ut as CustomCollectionDispatcher, v as Federation, vt as OutboxListenerErrorHandler, w as IdempotencyStrategy, wt as SendActivityError, x as FederationOptions, xt as UnverifiedActivityHandler, y as FederationBuilder, yt as OutboxPermanentFailureHandler, z as createFederationBuilder } from "./context-Dqgt8saU.js";
|
|
6
|
+
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-D6hNiMTK.js";
|
|
8
7
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
|
|
9
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-
|
|
10
|
-
import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-
|
|
11
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-
|
|
8
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-Dx3-hqyo.js";
|
|
9
|
+
import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-DHO9lk3D.js";
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-BhU_H1I_.js";
|
|
12
11
|
export * from "@fedify/vocab-runtime";
|
|
13
12
|
|
|
14
13
|
//#region src/mod.d.ts
|
package/dist/mod.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "@js-temporal/polyfill";
|
|
2
|
-
import "urlpattern-polyfill";
|
|
3
|
-
import "./chunk-
|
|
4
|
-
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
+
import "./chunk-CRNNMoPX.js";
|
|
4
|
+
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-BGMIq1cs.js";
|
|
5
5
|
import "./compat/mod.js";
|
|
6
|
-
import { a as verifyRequestDetailed, c as fetchKeyDetailed, f as formatAcceptSignature, h as validateAcceptSignature, i as verifyRequest, l as generateCryptoKeyPair, m as parseAcceptSignature, o as exportJwk, p as fulfillAcceptSignature, r as signRequest, s as fetchKey, u as importJwk } from "./http-
|
|
7
|
-
import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "./middleware-
|
|
8
|
-
import { a as verifyProof, c as getKeyOwner, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyObject, l as attachSignature, m as verifyJsonLd, n as hasProofLike, p as signJsonLd, r as signObject, s as doesActorOwnKey, t as createProof, u as createSignature } from "./proof-
|
|
9
|
-
import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-
|
|
10
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-
|
|
6
|
+
import { a as verifyRequestDetailed, c as fetchKeyDetailed, f as formatAcceptSignature, h as validateAcceptSignature, i as verifyRequest, l as generateCryptoKeyPair, m as parseAcceptSignature, o as exportJwk, p as fulfillAcceptSignature, r as signRequest, s as fetchKey, u as importJwk } from "./http-Dzy5c472.js";
|
|
7
|
+
import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "./middleware-vCF_cKAq.js";
|
|
8
|
+
import { a as verifyProof, c as getKeyOwner, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyObject, l as attachSignature, m as verifyJsonLd, n as hasProofLike, p as signJsonLd, r as signObject, s as doesActorOwnKey, t as createProof, u as createSignature } from "./proof-DMJJZnKd.js";
|
|
9
|
+
import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-CAY3OdLq.js";
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CBSgxEsZ.js";
|
|
11
11
|
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } 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-BAE7AKLA.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-CRDpx_HF.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
|
|
8
|
-
import { _ as handleNodeInfoJrd, g as handleNodeInfo, o as createFederation } from "../middleware-
|
|
8
|
+
import { _ as handleNodeInfoJrd, g as handleNodeInfo, o as createFederation } from "../middleware-BXnhAGF9.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
//#region src/nodeinfo/handler.test.ts
|
|
11
11
|
test("handleNodeInfo()", async () => {
|
package/dist/nodeinfo/mod.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
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-CAM_bQXx.cjs";
|
|
2
3
|
export { type GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, type ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo };
|
package/dist/nodeinfo/mod.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
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-AtlibPOU.js";
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
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-CSddvgWN.js";
|
|
4
3
|
export { type GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, type ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo };
|
package/dist/nodeinfo/mod.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "@js-temporal/polyfill";
|
|
2
|
-
import "urlpattern-polyfill";
|
|
3
|
-
import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "../types-
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
+
import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "../types-CAY3OdLq.js";
|
|
4
4
|
export { getNodeInfo, nodeInfoToJson, parseNodeInfo };
|
package/dist/otel/mod.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
2
|
+
import { n as KvStore, t as KvKey } from "../kv-gJ8LYbxX.cjs";
|
|
2
3
|
import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
|
|
3
4
|
import { ExportResultCode } from "@opentelemetry/core";
|
|
4
5
|
|
package/dist/otel/mod.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { n as KvStore, t as KvKey } from "../kv-GFYnFoOl.js";
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
2
|
+
import { n as KvStore, t as KvKey } from "../kv-D6hNiMTK.js";
|
|
4
3
|
import { ExportResultCode } from "@opentelemetry/core";
|
|
5
4
|
import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
|
|
6
5
|
|
package/dist/otel/mod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "@js-temporal/polyfill";
|
|
2
|
-
import "urlpattern-polyfill";
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
import { getLogger } from "@logtape/logtape";
|
|
4
4
|
import { ExportResultCode } from "@opentelemetry/core";
|
|
5
5
|
//#region src/otel/exporter.ts
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
1
2
|
import { Activity, Actor, CryptographicKey } from "@fedify/vocab";
|
|
2
|
-
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
3
3
|
import { TracerProvider } from "@opentelemetry/api";
|
|
4
|
+
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
4
5
|
|
|
5
6
|
//#region src/sig/owner.d.ts
|
|
6
7
|
/**
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
3
2
|
import { Activity, Actor, CryptographicKey } from "@fedify/vocab";
|
|
4
|
-
import { TracerProvider } from "@opentelemetry/api";
|
|
5
3
|
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
4
|
+
import { TracerProvider } from "@opentelemetry/api";
|
|
6
5
|
|
|
7
6
|
//#region src/sig/owner.d.ts
|
|
8
7
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-DBabeupC.mjs";
|
|
5
|
+
import "./key-D9dUsyow.mjs";
|
|
6
6
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
7
7
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
const require_chunk = require("./chunk-DDcVe30Y.cjs");
|
|
4
|
-
const require_http = require("./http-
|
|
4
|
+
const require_http = require("./http-W2u_KBoQ.cjs");
|
|
5
5
|
let _logtape_logtape = require("@logtape/logtape");
|
|
6
6
|
let _fedify_vocab = require("@fedify/vocab");
|
|
7
7
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
-
import "urlpattern-polyfill";
|
|
3
|
-
import { _ as version, d as validateCryptoKey, g as name, s as fetchKey } from "./http-
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
+
import { _ as version, d as validateCryptoKey, g as name, s as fetchKey } from "./http-Dzy5c472.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, PUBLIC_COLLECTION, getTypeId, isActor } from "@fedify/vocab";
|
|
6
6
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { n as fetchKey, o as validateCryptoKey } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-DBabeupC.mjs";
|
|
5
|
+
import { n as fetchKey, o as validateCryptoKey } from "./key-D9dUsyow.mjs";
|
|
6
6
|
import { n as preloadedOnlyDocumentLoader } from "./public-audience-N3pyOx2p.mjs";
|
|
7
7
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-BgFLCJQ_.mjs";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
package/dist/runtime/mod.d.cts
CHANGED
package/dist/runtime/mod.d.ts
CHANGED
package/dist/runtime/mod.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "@js-temporal/polyfill";
|
|
2
|
-
import "urlpattern-polyfill";
|
|
3
|
-
import "../chunk-
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
+
import "../chunk-CRNNMoPX.js";
|
|
4
4
|
export * from "@fedify/vocab-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { n as doubleKnock } from "./http-
|
|
4
|
+
import { n as version, t as name } from "./deno-DBabeupC.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-5G18W3NP.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { SpanKind, SpanStatusCode, metrics, trace } from "@opentelemetry/api";
|
|
8
8
|
//#region src/federation/metrics.ts
|
|
@@ -14,6 +14,12 @@ var FederationMetrics = class {
|
|
|
14
14
|
inboxProcessingDuration;
|
|
15
15
|
httpServerRequestCount;
|
|
16
16
|
httpServerRequestDuration;
|
|
17
|
+
queueTaskEnqueued;
|
|
18
|
+
queueTaskStarted;
|
|
19
|
+
queueTaskCompleted;
|
|
20
|
+
queueTaskFailed;
|
|
21
|
+
queueTaskDuration;
|
|
22
|
+
queueTaskInFlight;
|
|
17
23
|
constructor(meterProvider) {
|
|
18
24
|
const meter = meterProvider.getMeter(name, version);
|
|
19
25
|
this.deliverySent = meter.createCounter("activitypub.delivery.sent", {
|
|
@@ -60,6 +66,46 @@ var FederationMetrics = class {
|
|
|
60
66
|
1e4
|
|
61
67
|
] }
|
|
62
68
|
});
|
|
69
|
+
this.queueTaskEnqueued = meter.createCounter("fedify.queue.task.enqueued", {
|
|
70
|
+
description: "Tasks Fedify enqueued for inbox, outbox, or fanout work.",
|
|
71
|
+
unit: "{task}"
|
|
72
|
+
});
|
|
73
|
+
this.queueTaskStarted = meter.createCounter("fedify.queue.task.started", {
|
|
74
|
+
description: "Tasks Fedify began processing as a queue worker.",
|
|
75
|
+
unit: "{task}"
|
|
76
|
+
});
|
|
77
|
+
this.queueTaskCompleted = meter.createCounter("fedify.queue.task.completed", {
|
|
78
|
+
description: "Queue tasks Fedify finished processing without throwing.",
|
|
79
|
+
unit: "{task}"
|
|
80
|
+
});
|
|
81
|
+
this.queueTaskFailed = meter.createCounter("fedify.queue.task.failed", {
|
|
82
|
+
description: "Queue tasks Fedify abandoned because processing threw.",
|
|
83
|
+
unit: "{task}"
|
|
84
|
+
});
|
|
85
|
+
this.queueTaskDuration = meter.createHistogram("fedify.queue.task.duration", {
|
|
86
|
+
description: "Duration of queue task processing in Fedify workers.",
|
|
87
|
+
unit: "ms",
|
|
88
|
+
advice: { explicitBucketBoundaries: [
|
|
89
|
+
5,
|
|
90
|
+
10,
|
|
91
|
+
25,
|
|
92
|
+
50,
|
|
93
|
+
75,
|
|
94
|
+
100,
|
|
95
|
+
250,
|
|
96
|
+
500,
|
|
97
|
+
750,
|
|
98
|
+
1e3,
|
|
99
|
+
2500,
|
|
100
|
+
5e3,
|
|
101
|
+
7500,
|
|
102
|
+
1e4
|
|
103
|
+
] }
|
|
104
|
+
});
|
|
105
|
+
this.queueTaskInFlight = meter.createUpDownCounter("fedify.queue.task.in_flight", {
|
|
106
|
+
description: "Queue tasks currently being processed in this Fedify process.",
|
|
107
|
+
unit: "{task}"
|
|
108
|
+
});
|
|
63
109
|
}
|
|
64
110
|
recordDelivery(inbox, durationMs, success, activityType) {
|
|
65
111
|
const deliveryAttributes = {
|
|
@@ -94,7 +140,85 @@ var FederationMetrics = class {
|
|
|
94
140
|
this.httpServerRequestCount.add(1, attributes);
|
|
95
141
|
this.httpServerRequestDuration.record(durationMs, attributes);
|
|
96
142
|
}
|
|
143
|
+
recordQueueTaskEnqueued(common, attempt) {
|
|
144
|
+
const attributes = buildQueueTaskAttributes(common);
|
|
145
|
+
attributes["fedify.queue.task.attempt"] = attempt;
|
|
146
|
+
this.queueTaskEnqueued.add(1, attributes);
|
|
147
|
+
}
|
|
148
|
+
recordQueueTaskStarted(common) {
|
|
149
|
+
this.queueTaskStarted.add(1, buildQueueTaskAttributes(common));
|
|
150
|
+
}
|
|
151
|
+
incrementQueueTaskInFlight(common) {
|
|
152
|
+
this.queueTaskInFlight.add(1, buildQueueTaskInFlightAttributes(common));
|
|
153
|
+
}
|
|
154
|
+
decrementQueueTaskInFlight(common) {
|
|
155
|
+
this.queueTaskInFlight.add(-1, buildQueueTaskInFlightAttributes(common));
|
|
156
|
+
}
|
|
157
|
+
recordQueueTaskOutcome(common, result, durationMs) {
|
|
158
|
+
const attributes = buildQueueTaskAttributes(common);
|
|
159
|
+
attributes["fedify.queue.task.result"] = result;
|
|
160
|
+
if (result === "completed") this.queueTaskCompleted.add(1, attributes);
|
|
161
|
+
else if (result === "failed") this.queueTaskFailed.add(1, attributes);
|
|
162
|
+
this.queueTaskDuration.record(durationMs, attributes);
|
|
163
|
+
}
|
|
97
164
|
};
|
|
165
|
+
function buildQueueTaskAttributes(common) {
|
|
166
|
+
const attributes = { "fedify.queue.role": common.role };
|
|
167
|
+
const backend = getQueueBackend(common.queue);
|
|
168
|
+
if (backend != null) attributes["fedify.queue.backend"] = backend;
|
|
169
|
+
const nativeRetrial = common.queue?.nativeRetrial;
|
|
170
|
+
if (typeof nativeRetrial === "boolean") attributes["fedify.queue.native_retrial"] = nativeRetrial;
|
|
171
|
+
if (common.activityType != null) attributes["activitypub.activity.type"] = common.activityType;
|
|
172
|
+
return attributes;
|
|
173
|
+
}
|
|
174
|
+
function buildQueueTaskInFlightAttributes(common) {
|
|
175
|
+
return buildQueueTaskAttributes({
|
|
176
|
+
role: common.role,
|
|
177
|
+
queue: common.queue
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Returns the constructor name of the given message queue, when it is a
|
|
182
|
+
* meaningful identifier. Used as a best-effort `fedify.queue.backend`
|
|
183
|
+
* attribute on queue task metrics; returns `undefined` for plain object
|
|
184
|
+
* literals (whose constructor is `Object`) so the attribute does not appear
|
|
185
|
+
* with a non-informative value.
|
|
186
|
+
* @since 2.3.0
|
|
187
|
+
*/
|
|
188
|
+
function getQueueBackend(queue) {
|
|
189
|
+
const name = queue?.constructor?.name;
|
|
190
|
+
if (name == null || name === "" || name === "Object") return void 0;
|
|
191
|
+
return name;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Records `fedify.queue.task.enqueued` for an outgoing outbox enqueue.
|
|
195
|
+
*
|
|
196
|
+
* Both `Context.sendActivity()` and `OutboxContext.forwardActivity()` enqueue
|
|
197
|
+
* outbox messages with the same metric attributes (role, queue, activity
|
|
198
|
+
* type, attempt), so they share this helper rather than each defining a local
|
|
199
|
+
* closure.
|
|
200
|
+
* @since 2.3.0
|
|
201
|
+
*/
|
|
202
|
+
function recordOutboxEnqueue(meterProvider, outboxQueue, message) {
|
|
203
|
+
getFederationMetrics(meterProvider).recordQueueTaskEnqueued({
|
|
204
|
+
role: "outbox",
|
|
205
|
+
queue: outboxQueue,
|
|
206
|
+
activityType: message.activityType
|
|
207
|
+
}, message.attempt);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Whether the given thrown value is an `AbortError`.
|
|
211
|
+
*
|
|
212
|
+
* `processQueuedTask` distinguishes aborted tasks (recorded as
|
|
213
|
+
* `fedify.queue.task.result=aborted`) from other failures so that backend
|
|
214
|
+
* shutdown signals do not inflate the `fedify.queue.task.failed` counter.
|
|
215
|
+
* @since 2.3.0
|
|
216
|
+
*/
|
|
217
|
+
function isAbortError(error) {
|
|
218
|
+
if (error == null || typeof error !== "object") return false;
|
|
219
|
+
const name = error.name;
|
|
220
|
+
return typeof name === "string" && name === "AbortError";
|
|
221
|
+
}
|
|
98
222
|
const KNOWN_HTTP_METHODS = new Set([
|
|
99
223
|
"CONNECT",
|
|
100
224
|
"DELETE",
|
|
@@ -355,4 +479,4 @@ var SendActivityError = class extends Error {
|
|
|
355
479
|
}
|
|
356
480
|
};
|
|
357
481
|
//#endregion
|
|
358
|
-
export { getFederationMetrics as a, getDurationMs as i, extractInboxes as n, getRemoteHost as o, sendActivity as r, SendActivityError as t };
|
|
482
|
+
export { getFederationMetrics as a, recordOutboxEnqueue as c, getDurationMs as i, extractInboxes as n, getRemoteHost as o, sendActivity as r, isAbortError as s, SendActivityError as t };
|
package/dist/sig/http.test.mjs
CHANGED
|
@@ -7,8 +7,8 @@ import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z
|
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
8
8
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
9
9
|
import { t as esm_default } from "../esm-sdtqOUPu.mjs";
|
|
10
|
-
import { t as exportJwk } from "../key-
|
|
11
|
-
import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-
|
|
10
|
+
import { t as exportJwk } from "../key-D9dUsyow.mjs";
|
|
11
|
+
import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-5G18W3NP.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-C3kae-6B.mjs";
|
|
13
13
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
14
14
|
import { FetchError, exportSpki } from "@fedify/vocab-runtime";
|
|
@@ -975,6 +975,124 @@ test("doubleKnock() detects redirect loops", async () => {
|
|
|
975
975
|
assertEquals(requestCount, 2);
|
|
976
976
|
esm_default.hardReset();
|
|
977
977
|
});
|
|
978
|
+
test("doubleKnock() retries idempotent request transport errors", async () => {
|
|
979
|
+
esm_default.spyGlobal();
|
|
980
|
+
try {
|
|
981
|
+
let requestCount = 0;
|
|
982
|
+
esm_default.get("https://example.com/flaky-document", () => {
|
|
983
|
+
requestCount++;
|
|
984
|
+
if (requestCount === 1) throw new TypeError("temporary DNS failure");
|
|
985
|
+
return new Response("Success", { status: 200 });
|
|
986
|
+
});
|
|
987
|
+
const response = await doubleKnock(new Request("https://example.com/flaky-document"), {
|
|
988
|
+
keyId: rsaPublicKey2.id,
|
|
989
|
+
privateKey: rsaPrivateKey2
|
|
990
|
+
});
|
|
991
|
+
assertEquals(response.status, 200);
|
|
992
|
+
assertEquals(await response.text(), "Success");
|
|
993
|
+
assertEquals(requestCount, 2);
|
|
994
|
+
} finally {
|
|
995
|
+
esm_default.hardReset();
|
|
996
|
+
}
|
|
997
|
+
});
|
|
998
|
+
test("doubleKnock() wraps repeated transport errors", async () => {
|
|
999
|
+
esm_default.spyGlobal();
|
|
1000
|
+
try {
|
|
1001
|
+
let requestCount = 0;
|
|
1002
|
+
const failure = /* @__PURE__ */ new TypeError("DNS lookup failed");
|
|
1003
|
+
esm_default.get("https://example.com/unreachable-document", () => {
|
|
1004
|
+
requestCount++;
|
|
1005
|
+
throw failure;
|
|
1006
|
+
});
|
|
1007
|
+
const request = new Request("https://example.com/unreachable-document");
|
|
1008
|
+
const error = await assertRejects(() => doubleKnock(request, {
|
|
1009
|
+
keyId: rsaPublicKey2.id,
|
|
1010
|
+
privateKey: rsaPrivateKey2
|
|
1011
|
+
}), FetchError, "DNS lookup failed");
|
|
1012
|
+
assertEquals(error.url.href, "https://example.com/unreachable-document");
|
|
1013
|
+
assertEquals(error.cause, failure);
|
|
1014
|
+
assertEquals(requestCount, 2);
|
|
1015
|
+
} finally {
|
|
1016
|
+
esm_default.hardReset();
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
test("doubleKnock() does not retry non-idempotent transport errors", async () => {
|
|
1020
|
+
esm_default.spyGlobal();
|
|
1021
|
+
try {
|
|
1022
|
+
let requestCount = 0;
|
|
1023
|
+
const failure = /* @__PURE__ */ new TypeError("connection reset");
|
|
1024
|
+
esm_default.post("https://example.com/flaky-inbox", () => {
|
|
1025
|
+
requestCount++;
|
|
1026
|
+
throw failure;
|
|
1027
|
+
});
|
|
1028
|
+
const request = new Request("https://example.com/flaky-inbox", {
|
|
1029
|
+
method: "POST",
|
|
1030
|
+
body: "Test activity content",
|
|
1031
|
+
headers: { "Content-Type": "application/activity+json" }
|
|
1032
|
+
});
|
|
1033
|
+
const error = await assertRejects(() => doubleKnock(request, {
|
|
1034
|
+
keyId: rsaPublicKey2.id,
|
|
1035
|
+
privateKey: rsaPrivateKey2
|
|
1036
|
+
}), FetchError, "connection reset");
|
|
1037
|
+
assertEquals(error.url.href, "https://example.com/flaky-inbox");
|
|
1038
|
+
assertEquals(error.cause, failure);
|
|
1039
|
+
assertEquals(requestCount, 1);
|
|
1040
|
+
} finally {
|
|
1041
|
+
esm_default.hardReset();
|
|
1042
|
+
}
|
|
1043
|
+
});
|
|
1044
|
+
test("doubleKnock() preserves Request signal abort reasons", async () => {
|
|
1045
|
+
const controller = new AbortController();
|
|
1046
|
+
const abortReason = "request aborted";
|
|
1047
|
+
controller.abort(abortReason);
|
|
1048
|
+
const request = new Request("https://example.com/request-abort", { signal: controller.signal });
|
|
1049
|
+
assertEquals(await assertRejects(() => doubleKnock(request, {
|
|
1050
|
+
keyId: rsaPublicKey2.id,
|
|
1051
|
+
privateKey: rsaPrivateKey2
|
|
1052
|
+
})), abortReason);
|
|
1053
|
+
});
|
|
1054
|
+
test("doubleKnock() preserves Request signal aborts during retry delay", async () => {
|
|
1055
|
+
esm_default.spyGlobal();
|
|
1056
|
+
try {
|
|
1057
|
+
let requestCount = 0;
|
|
1058
|
+
const controller = new AbortController();
|
|
1059
|
+
const abortReason = "retry aborted";
|
|
1060
|
+
esm_default.get("https://example.com/aborted-retry", () => {
|
|
1061
|
+
requestCount++;
|
|
1062
|
+
setTimeout(() => controller.abort(abortReason));
|
|
1063
|
+
throw new TypeError("temporary DNS failure");
|
|
1064
|
+
});
|
|
1065
|
+
const request = new Request("https://example.com/aborted-retry", { signal: controller.signal });
|
|
1066
|
+
assertEquals(await assertRejects(() => doubleKnock(request, {
|
|
1067
|
+
keyId: rsaPublicKey2.id,
|
|
1068
|
+
privateKey: rsaPrivateKey2
|
|
1069
|
+
})), abortReason);
|
|
1070
|
+
assertEquals(requestCount, 1);
|
|
1071
|
+
} finally {
|
|
1072
|
+
esm_default.hardReset();
|
|
1073
|
+
}
|
|
1074
|
+
});
|
|
1075
|
+
test("doubleKnock() prefers Request aborts over transport errors", async () => {
|
|
1076
|
+
esm_default.spyGlobal();
|
|
1077
|
+
try {
|
|
1078
|
+
let requestCount = 0;
|
|
1079
|
+
const controller = new AbortController();
|
|
1080
|
+
const abortReason = "transport aborted";
|
|
1081
|
+
esm_default.get("https://example.com/abort-with-transport-error", () => {
|
|
1082
|
+
requestCount++;
|
|
1083
|
+
controller.abort(abortReason);
|
|
1084
|
+
throw new TypeError("temporary DNS failure");
|
|
1085
|
+
});
|
|
1086
|
+
const request = new Request("https://example.com/abort-with-transport-error", { signal: controller.signal });
|
|
1087
|
+
assertEquals(await assertRejects(() => doubleKnock(request, {
|
|
1088
|
+
keyId: rsaPublicKey2.id,
|
|
1089
|
+
privateKey: rsaPrivateKey2
|
|
1090
|
+
})), abortReason);
|
|
1091
|
+
assertEquals(requestCount, 1);
|
|
1092
|
+
} finally {
|
|
1093
|
+
esm_default.hardReset();
|
|
1094
|
+
}
|
|
1095
|
+
});
|
|
978
1096
|
test("doubleKnock() async specDeterminer test", async () => {
|
|
979
1097
|
esm_default.spyGlobal();
|
|
980
1098
|
let requestCount = 0;
|
package/dist/sig/key.test.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
5
5
|
import "../std__assert-CRDpx_HF.mjs";
|
|
6
6
|
import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
8
|
-
import { a as importJwk, i as generateCryptoKeyPair, n as fetchKey, o as validateCryptoKey, r as fetchKeyDetailed, t as exportJwk } from "../key-
|
|
8
|
+
import { a as importJwk, i as generateCryptoKeyPair, n as fetchKey, o as validateCryptoKey, r as fetchKeyDetailed, t as exportJwk } from "../key-D9dUsyow.mjs";
|
|
9
9
|
import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-C3kae-6B.mjs";
|
|
10
10
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
11
11
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
package/dist/sig/ld.test.mjs
CHANGED
|
@@ -5,9 +5,9 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
5
5
|
import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
|
|
6
6
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
7
7
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
8
|
-
import { i as generateCryptoKeyPair } from "../key-
|
|
8
|
+
import { i as generateCryptoKeyPair } from "../key-D9dUsyow.mjs";
|
|
9
9
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-C3kae-6B.mjs";
|
|
10
|
-
import { a as signJsonLd, i as hasSignatureLike, n as createSignature, o as verifyJsonLd, r as detachSignature, s as verifySignature, t as attachSignature } from "../ld-
|
|
10
|
+
import { a as signJsonLd, i as hasSignatureLike, n as createSignature, o as verifyJsonLd, r as detachSignature, s as verifySignature, t as attachSignature } from "../ld-hbxDLO1k.mjs";
|
|
11
11
|
import { CryptographicKey } from "@fedify/vocab";
|
|
12
12
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
13
13
|
import { encodeBase64 } from "byte-encodings/base64";
|
package/dist/sig/mod.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const require_http = require("../http-
|
|
5
|
-
const require_proof = require("../proof-
|
|
4
|
+
const require_http = require("../http-W2u_KBoQ.cjs");
|
|
5
|
+
const require_proof = require("../proof-CZCaAURh.cjs");
|
|
6
6
|
exports.attachSignature = require_proof.attachSignature;
|
|
7
7
|
exports.createProof = require_proof.createProof;
|
|
8
8
|
exports.createSignature = require_proof.createSignature;
|
package/dist/sig/mod.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { i as
|
|
3
|
-
import {
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
2
|
+
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-C87EWkO0.cjs";
|
|
3
|
+
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-DEvZuyOE.cjs";
|
|
4
|
+
import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "../mod-DXY9JF28.cjs";
|
|
4
5
|
export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|