@fedify/fedify 2.5.0-dev.2370 → 2.5.0-dev.2378
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-DzGfERAV.mjs → builder-J1K0IJj6.mjs} +2 -2
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{compound-proof-hnZ7MNwN.mjs → compound-proof-DtmVrMV7.mjs} +2 -2
- package/dist/{deno-CkkDV5gw.mjs → deno-Ci6tSK9-.mjs} +1 -1
- package/dist/{docloader-D6eQ0vA8.mjs → docloader-DZ9h6KJS.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/compound-fanout.test.mjs +3 -3
- package/dist/federation/handler-compound-proof.test.mjs +3 -3
- package/dist/federation/handler.test.mjs +4 -5
- package/dist/federation/hashlink-media.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox-report.test.mjs +5 -5
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +7 -7
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/outgoing-proof.test.mjs +4 -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-delivery.test.mjs +2 -2
- package/dist/federation/portable-gateway-keys.test.mjs +4 -4
- package/dist/federation/portable-inbox.test.mjs +4 -4
- package/dist/federation/portable-parse-uri.test.mjs +1 -1
- package/dist/federation/portable-route-activity.test.mjs +2 -2
- 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-BkIRrGXG.cjs → federation-lzy7M3hT.cjs} +3 -3
- package/dist/{http-DxljNiCC.mjs → http-CFyizTHa.mjs} +4 -4
- package/dist/{http-C2gfnrKF.js → http-Cmz7x6Iw.js} +110 -12
- package/dist/{http-CjpGhvxc.cjs → http-D1RPHoq3.cjs} +109 -11
- package/dist/{kv-cache-nsVJF31j.js → kv-cache-C0-HuvwP.js} +1 -1
- package/dist/{kv-cache-BVtotkZw.cjs → kv-cache-Jym5nP3J.cjs} +1 -1
- package/dist/{kv-cache-DDwF4zee.mjs → kv-cache-rOQX3I3c.mjs} +1 -1
- package/dist/{key-8sZWp4lR.mjs → ld-DJ--ZUpr.mjs} +760 -16
- package/dist/{metrics-DiQRjv6y.mjs → metrics-Dwgav7s_.mjs} +1 -1
- package/dist/{middleware-ClqRVObS.mjs → middleware-BbBsa5iR.mjs} +13 -14
- package/dist/{middleware-BBnHLNpJ.mjs → middleware-CJWxuUy5.mjs} +1 -1
- package/dist/{middleware-C_EdDn9c.js → middleware-CqgRIsWM.js} +3 -3
- package/dist/mod.cjs +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/{owner-IiJfae6n.mjs → owner-Btd7SwMj.mjs} +3 -3
- package/dist/{portable-collection-BeS_vx1G.cjs → portable-collection-BvWxS1sL.cjs} +1 -1
- package/dist/{portable-collection-BtyE_2Rv.js → portable-collection-DwQT28O2.js} +1 -1
- package/dist/{portable-collection-CUDbGQ5_.mjs → portable-collection-gb9V8XEO.mjs} +2 -2
- package/dist/{portable-key-ENr3Sc97.mjs → portable-key-Cwti99nP.mjs} +1 -1
- package/dist/{proof-CGtiU4Lz.mjs → proof-Bwzv6mXZ.mjs} +3 -4
- package/dist/{send-CRYlnzg6.mjs → send-BrQYUSb4.mjs} +3 -3
- package/dist/sig/compound-proof-discovery.test.mjs +1 -1
- package/dist/sig/compound-proof-producer.test.mjs +1 -1
- package/dist/sig/compound-proof-verification.test.mjs +2 -2
- package/dist/sig/compound-proof.test.mjs +2 -2
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key.test.mjs +208 -3
- package/dist/sig/ld.test.mjs +1 -2
- package/dist/sig/mitra-receive-interop.test.mjs +4 -4
- package/dist/sig/mitra-send-interop.test.mjs +3 -3
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/portable-collection.test.mjs +1 -1
- package/dist/sig/portable-interop.test.mjs +3 -3
- package/dist/sig/portable-key.test.mjs +5 -6
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/sig/tootik-request-interop.test.mjs +4 -4
- package/dist/sig/tootik-send-interop.test.mjs +3 -3
- package/dist/sig/verification.test.mjs +3 -3
- package/dist/{temporal-CDbdX_g_.mjs → temporal-BRaCTxVe.mjs} +1 -1
- package/dist/testing/kv.test.mjs +1 -1
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +7 -7
- package/dist/ld-DXaIENwZ.mjs +0 -658
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
4
|
+
import { n as version, t as name } from "./deno-Ci6tSK9-.mjs";
|
|
5
5
|
import { metrics } from "@opentelemetry/api";
|
|
6
6
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
7
7
|
//#region src/federation/metrics.ts
|
|
@@ -4,28 +4,27 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { d as isPortableUri, f as isSameObjectId, i as getPortableDid, l as isPortableId, n as getCanonicalPortableId, o as hasPortableActor, r as getGatewayKeyBase, s as isCompatibleKeyId, t as getAuthenticationOrigin, u as isPortableKeyId } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
5
|
import { n as isPubliclyAddressedNode, t as isInAudience } from "./audience-CHQ-FlLD.mjs";
|
|
6
6
|
import { a as verificationObservation, r as snapshotKey, t as observeAttempt } from "./verification-Dpfcw8ml.mjs";
|
|
7
|
-
import { n as version, t as name } from "./deno-
|
|
8
|
-
import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-
|
|
7
|
+
import { n as version, t as name } from "./deno-Ci6tSK9-.mjs";
|
|
8
|
+
import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-Dwgav7s_.mjs";
|
|
9
9
|
import { t as formatAcceptSignature } from "./accept-CPVqki78.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { T as validateCryptoKey, _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike, w as importJwk, y as exportJwk } from "./ld-DJ--ZUpr.mjs";
|
|
11
11
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { n as kvCache } from "./kv-cache-DDwF4zee.mjs";
|
|
12
|
+
import { c as verifyObject, d as verifyPortableObjectProofWithRoot, i as hasProofLike, l as verifyPortableObjectProof, o as signObject, t as InvalidPortableObjectIdError } from "./proof-Bwzv6mXZ.mjs";
|
|
13
|
+
import { a as listRequestSignatures, c as selectRequestSignature, d as validateMaxSignatures, f as verifyRequest, p as verifyRequestDetailed, s as parseRfc9421SignatureInput } from "./http-CFyizTHa.mjs";
|
|
14
|
+
import { t as getAuthenticatedDocumentLoader } from "./docloader-DZ9h6KJS.mjs";
|
|
15
|
+
import { n as kvCache } from "./kv-cache-rOQX3I3c.mjs";
|
|
17
16
|
import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-CEnNz8O7.mjs";
|
|
18
17
|
import { t as nodeInfoToJson } from "./types-DE_LV1JB.mjs";
|
|
19
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-
|
|
20
|
-
import { t as verifyPortableObject } from "./portable-collection-
|
|
21
|
-
import { a as getOrderingDestination, i as sendActivityThroughGateways, n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-
|
|
22
|
-
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-
|
|
18
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-Btd7SwMj.mjs";
|
|
19
|
+
import { t as verifyPortableObject } from "./portable-collection-gb9V8XEO.mjs";
|
|
20
|
+
import { a as getOrderingDestination, i as sendActivityThroughGateways, n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-BrQYUSb4.mjs";
|
|
21
|
+
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-J1K0IJj6.mjs";
|
|
23
22
|
import { t as CircuitBreaker } from "./circuit-breaker-XJ53md4S.mjs";
|
|
24
23
|
import { t as buildCollectionSynchronizationHeader } from "./collection-CnnP1UAv.mjs";
|
|
25
|
-
import { a as inspectCompoundPortableObjectApplicability, c as verifyServedPortableObjects, i as findUnsupportedCompoundProofShape, o as verifyCompoundPortableObjectProofs, r as findEmbeddedProofWithoutContext, t as containsCompoundPortableObject } from "./compound-proof-
|
|
24
|
+
import { a as inspectCompoundPortableObjectApplicability, c as verifyServedPortableObjects, i as findUnsupportedCompoundProofShape, o as verifyCompoundPortableObjectProofs, r as findEmbeddedProofWithoutContext, t as containsCompoundPortableObject } from "./compound-proof-DtmVrMV7.mjs";
|
|
26
25
|
import { t as KvKeyCache } from "./keycache-D-MNltOk.mjs";
|
|
27
26
|
import { t as acceptsJsonLd } from "./negotiation-CCocWT_N.mjs";
|
|
28
|
-
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-
|
|
27
|
+
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-BRaCTxVe.mjs";
|
|
29
28
|
import { t as createExponentialBackoffPolicy } from "./retry-zX5xw5e0.mjs";
|
|
30
29
|
import { t as TaskCodec } from "./codec-C6rTrpIp.mjs";
|
|
31
30
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
@@ -2,10 +2,10 @@ import { Temporal } from "temporal-polyfill";
|
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
import { t as __exportAll } from "./rolldown-runtime-BC-Eo5Mj.js";
|
|
4
4
|
import { r as getDefaultActivityTransformers } from "./transformers-DAtXl_Kc.js";
|
|
5
|
-
import { $ as getFederationMetrics, A as detachSignature, At as isPortableId, B as wrapContextLoaderForJsonLd, Ct as getAuthenticationOrigin, Dt as getRawCanonicalPortableId, E as assertSafeJsonLd, Et as getPortableDid, F as isInvalidUrlTypeError, Ft as name, I as signJsonLd, It as version, K as importJwk, L as verifyCompactJsonLd, M as hasSignature, Mt as isPortableUri, N as hasSignatureLike, Nt as isSameObjectId, O as compactJsonLd, Ot as hasPortableActor, P as isClearlyMalformedContextReference, Q as getDurationMs, S as verifyPreparedPortableObjectProofPolicy, St as verificationObservation, T as InvalidContextReferenceError, Tt as getGatewayKeyBase, V as exportJwk, Y as MAX_PORTABLE_KEY_TTL, _ as verifyMapLocalProof, at as recordCollectionPageItems, b as verifyPortableObjectProofPolicy, bt as observeAttempt, c as verifyRequestDetailed, d as InvalidPortableObjectIdError, dt as recordOutboxActivity, et as getRemoteHost, f as classifyFep2277CoreType, ft as recordOutboxEnqueue, g as signObject, gt as formatAcceptSignature, h as preparePortableObjectProofPolicy, ht as preloadedOnlyDocumentLoader, i as selectRequestSignature, it as recordCollectionDispatchDuration, j as getNormalizationContextLoader, jt as isPortableKeyId, kt as isCompatibleKeyId, lt as recordFanoutRecipients, m as hasProofLike, mt as registerQueueDepthGauge, n as listRequestSignatures, nt as isAbortError, o as validateMaxSignatures, ot as recordCollectionRequest, pt as recordWebFingerHandle, q as validateCryptoKey, r as parseRfc9421SignatureInput, rt as recordCircuitBreakerStateChange, s as verifyRequest, st as recordCollectionTotalItems, t as doubleKnock, tt as instrumentDocumentLoader, ut as recordInboxActivity, v as verifyObject, w as normalizeOutgoingActivityJsonLd, wt as getCanonicalPortableId, x as verifyPortableObjectProofWithRoot, xt as snapshotKey, y as verifyPortableObjectProof } from "./http-
|
|
5
|
+
import { $ as getFederationMetrics, A as detachSignature, At as isPortableId, B as wrapContextLoaderForJsonLd, Ct as getAuthenticationOrigin, Dt as getRawCanonicalPortableId, E as assertSafeJsonLd, Et as getPortableDid, F as isInvalidUrlTypeError, Ft as name, I as signJsonLd, It as version, K as importJwk, L as verifyCompactJsonLd, M as hasSignature, Mt as isPortableUri, N as hasSignatureLike, Nt as isSameObjectId, O as compactJsonLd, Ot as hasPortableActor, P as isClearlyMalformedContextReference, Q as getDurationMs, S as verifyPreparedPortableObjectProofPolicy, St as verificationObservation, T as InvalidContextReferenceError, Tt as getGatewayKeyBase, V as exportJwk, Y as MAX_PORTABLE_KEY_TTL, _ as verifyMapLocalProof, at as recordCollectionPageItems, b as verifyPortableObjectProofPolicy, bt as observeAttempt, c as verifyRequestDetailed, d as InvalidPortableObjectIdError, dt as recordOutboxActivity, et as getRemoteHost, f as classifyFep2277CoreType, ft as recordOutboxEnqueue, g as signObject, gt as formatAcceptSignature, h as preparePortableObjectProofPolicy, ht as preloadedOnlyDocumentLoader, i as selectRequestSignature, it as recordCollectionDispatchDuration, j as getNormalizationContextLoader, jt as isPortableKeyId, kt as isCompatibleKeyId, lt as recordFanoutRecipients, m as hasProofLike, mt as registerQueueDepthGauge, n as listRequestSignatures, nt as isAbortError, o as validateMaxSignatures, ot as recordCollectionRequest, pt as recordWebFingerHandle, q as validateCryptoKey, r as parseRfc9421SignatureInput, rt as recordCircuitBreakerStateChange, s as verifyRequest, st as recordCollectionTotalItems, t as doubleKnock, tt as instrumentDocumentLoader, ut as recordInboxActivity, v as verifyObject, w as normalizeOutgoingActivityJsonLd, wt as getCanonicalPortableId, x as verifyPortableObjectProofWithRoot, xt as snapshotKey, y as verifyPortableObjectProof } from "./http-Cmz7x6Iw.js";
|
|
6
6
|
import { a as MAX_BODY_SIZE, i as BodyTooLargeError, n as getNodeInfo, o as readBoundedText, t as nodeInfoToJson } from "./types-_S2_MeLF.js";
|
|
7
|
-
import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-
|
|
8
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-
|
|
7
|
+
import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-DwQT28O2.js";
|
|
8
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-C0-HuvwP.js";
|
|
9
9
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
10
10
|
import { Router, RouterError, assertPath } from "@fedify/uri-template";
|
|
11
11
|
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, PUBLIC_COLLECTION, Tombstone, getTypeId, isActor, lookupObject, traverseCollection } from "@fedify/vocab";
|
package/dist/mod.cjs
CHANGED
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
require("./rolldown-runtime-Dmm3t92W.cjs");
|
|
4
4
|
const require_transformers = require("./transformers-BalCrSsr.cjs");
|
|
5
5
|
require("./compat/mod.cjs");
|
|
6
|
-
const require_http = require("./http-
|
|
7
|
-
const require_federation = require("./federation-
|
|
6
|
+
const require_http = require("./http-D1RPHoq3.cjs");
|
|
7
|
+
const require_federation = require("./federation-lzy7M3hT.cjs");
|
|
8
8
|
const require_types = require("./types-poIao40f.cjs");
|
|
9
|
-
const require_portable_collection = require("./portable-collection-
|
|
10
|
-
const require_kv_cache = require("./kv-cache-
|
|
9
|
+
const require_portable_collection = require("./portable-collection-BvWxS1sL.cjs");
|
|
10
|
+
const require_kv_cache = require("./kv-cache-Jym5nP3J.cjs");
|
|
11
11
|
require("./nodeinfo/mod.cjs");
|
|
12
12
|
require("./runtime/mod.cjs");
|
|
13
13
|
require("./sig/mod.cjs");
|
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 { A as detachSignature, C as verifyProof, D as attachSignature, G as generateCryptoKeyPair, I as signJsonLd, K as importJwk, N as hasSignatureLike, R as verifyJsonLd, U as fetchKey, V as exportJwk, W as fetchKeyDetailed, _t as fulfillAcceptSignature, a as signRequest, c as verifyRequestDetailed, g as signObject, gt as formatAcceptSignature, k as createSignature, m as hasProofLike, p as createProof, s as verifyRequest, v as verifyObject, vt as parseAcceptSignature, y as verifyPortableObjectProof, yt as validateAcceptSignature, z as verifySignature } from "./http-
|
|
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 { A as detachSignature, C as verifyProof, D as attachSignature, G as generateCryptoKeyPair, I as signJsonLd, K as importJwk, N as hasSignatureLike, R as verifyJsonLd, U as fetchKey, V as exportJwk, W as fetchKeyDetailed, _t as fulfillAcceptSignature, a as signRequest, c as verifyRequestDetailed, g as signObject, gt as formatAcceptSignature, k as createSignature, m as hasProofLike, p as createProof, s as verifyRequest, v as verifyObject, vt as parseAcceptSignature, y as verifyPortableObjectProof, yt as validateAcceptSignature, z as verifySignature } from "./http-Cmz7x6Iw.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-CqgRIsWM.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-DwQT28O2.js";
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-C0-HuvwP.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-8Tu9kea0.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 { D as handleNodeInfoJrd, E as handleNodeInfo, o as createFederation } from "../middleware-
|
|
8
|
+
import { D as handleNodeInfoJrd, E as handleNodeInfo, o as createFederation } from "../middleware-BbBsa5iR.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
//#region src/nodeinfo/handler.test.ts
|
|
11
11
|
test("handleNodeInfo()", async () => {
|
|
@@ -2,10 +2,10 @@ import "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { d as isPortableUri, l as isPortableId, n as getCanonicalPortableId, p as isSamePublicKey$1, s as isCompatibleKeyId } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
+
import { n as version, t as name } from "./deno-Ci6tSK9-.mjs";
|
|
6
6
|
import { i as parseKeyOwnerEvidence, r as getVerifiedKeyOwnerEvidence } from "./key-owner-evidence-APB6NpSk.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { n as resolvePortableActorKey, t as fetchPortableGatewayKey } from "./portable-key-
|
|
7
|
+
import { E as verifyKeyOwnership, b as fetchActorDocument, y as exportJwk } from "./ld-DJ--ZUpr.mjs";
|
|
8
|
+
import { n as resolvePortableActorKey, t as fetchPortableGatewayKey } from "./portable-key-Cwti99nP.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,5 +1,5 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
|
-
const require_http = require("./http-
|
|
2
|
+
const require_http = require("./http-D1RPHoq3.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,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { At as isPortableId, Ft as name, H as fetchActorDocument, It as version, J as verifyKeyOwnership, Mt as isPortableUri, Pt as isSamePublicKey$1, V as exportJwk, X as getVerifiedKeyOwnerEvidence, Z as parseKeyOwnerEvidence, kt as isCompatibleKeyId, l as fetchPortableGatewayKey, u as resolvePortableActorKey, wt as getCanonicalPortableId, x as verifyPortableObjectProofWithRoot, y as verifyPortableObjectProof } from "./http-
|
|
3
|
+
import { At as isPortableId, Ft as name, H as fetchActorDocument, It as version, J as verifyKeyOwnership, Mt as isPortableUri, Pt as isSamePublicKey$1, V as exportJwk, X as getVerifiedKeyOwnerEvidence, Z as parseKeyOwnerEvidence, kt as isCompatibleKeyId, l as fetchPortableGatewayKey, u as resolvePortableActorKey, wt as getCanonicalPortableId, x as verifyPortableObjectProofWithRoot, y as verifyPortableObjectProof } from "./http-Cmz7x6Iw.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 { d as verifyPortableObjectProofWithRoot, l as verifyPortableObjectProof } from "./proof-
|
|
4
|
+
import { n as version, t as name } from "./deno-Ci6tSK9-.mjs";
|
|
5
|
+
import { d as verifyPortableObjectProofWithRoot, l as verifyPortableObjectProof } from "./proof-Bwzv6mXZ.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";
|
|
@@ -2,7 +2,7 @@ import "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
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 { d as verifyPortableObjectProofWithRoot } from "./proof-
|
|
5
|
+
import { d as verifyPortableObjectProofWithRoot } from "./proof-Bwzv6mXZ.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";
|
|
@@ -3,12 +3,11 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { i as getPortableDid, l as isPortableId } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
5
|
import { a as verificationObservation, i as triedKey, n as observeCheck, t as observeAttempt } from "./verification-Dpfcw8ml.mjs";
|
|
6
|
-
import { n as version, t as name } from "./deno-
|
|
7
|
-
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-
|
|
8
|
-
import {
|
|
6
|
+
import { n as version, t as name } from "./deno-Ci6tSK9-.mjs";
|
|
7
|
+
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-Dwgav7s_.mjs";
|
|
8
|
+
import { T as validateCryptoKey, c as getNormalizationContextLoader, v as bypassKeyCacheReads, x as fetchKey } from "./ld-DJ--ZUpr.mjs";
|
|
9
9
|
import { n as preloadedOnlyDocumentLoader } from "./public-audience--klBIOk1.mjs";
|
|
10
10
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
|
|
11
|
-
import { c as getNormalizationContextLoader } from "./ld-DXaIENwZ.mjs";
|
|
12
11
|
import { getLogger } from "@logtape/logtape";
|
|
13
12
|
import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
|
|
14
13
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -2,9 +2,9 @@ import "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { d as isPortableUri } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
|
-
import { n as version, t as name } from "./deno-
|
|
6
|
-
import { n as getDurationMs, r as getFederationMetrics } from "./metrics-
|
|
7
|
-
import { n as doubleKnock } from "./http-
|
|
5
|
+
import { n as version, t as name } from "./deno-Ci6tSK9-.mjs";
|
|
6
|
+
import { n as getDurationMs, r as getFederationMetrics } from "./metrics-Dwgav7s_.mjs";
|
|
7
|
+
import { n as doubleKnock } from "./http-CFyizTHa.mjs";
|
|
8
8
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
9
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import { FetchError, UrlError, canonicalizePortableUri, getFe34Origin, isGatewayUrl, toCompatibleEf61Id, 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 { a as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-
|
|
6
|
+
import { a as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-DtmVrMV7.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 { a as inspectCompoundPortableObjectApplicability, i as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-
|
|
6
|
+
import { a as inspectCompoundPortableObjectApplicability, i as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-DtmVrMV7.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 { s as verifyMapLocalProof, u as verifyPortableObjectProofPolicy } from "../proof-
|
|
7
|
+
import { s as verifyMapLocalProof, u as verifyPortableObjectProofPolicy } from "../proof-Bwzv6mXZ.mjs";
|
|
8
8
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
9
|
-
import { a as inspectCompoundPortableObjectApplicability, o as verifyCompoundPortableObjectProofs, s as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-
|
|
9
|
+
import { a as inspectCompoundPortableObjectApplicability, o as verifyCompoundPortableObjectProofs, s as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-DtmVrMV7.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 { o as signObject, p as verifyProof } from "../proof-
|
|
9
|
+
import { o as signObject, p as verifyProof } from "../proof-Bwzv6mXZ.mjs";
|
|
10
10
|
import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
11
|
-
import { s as verifyCompoundProofDocuments } from "../compound-proof-
|
|
11
|
+
import { s as verifyCompoundProofDocuments } from "../compound-proof-DtmVrMV7.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";
|
package/dist/sig/http.test.mjs
CHANGED
|
@@ -12,8 +12,8 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
|
12
12
|
import "../std__assert-DvMDRPes.mjs";
|
|
13
13
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
14
14
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
15
|
-
import {
|
|
16
|
-
import { a as listRequestSignatures, c as selectRequestSignature, f as verifyRequest, i as formatRfc9421SignatureParameters, l as signRequest, n as doubleKnock, o as parseRfc9421Signature, p as verifyRequestDetailed, r as formatRfc9421Signature, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as timingSafeEqual } from "../http-
|
|
15
|
+
import { y as exportJwk } from "../ld-DJ--ZUpr.mjs";
|
|
16
|
+
import { a as listRequestSignatures, c as selectRequestSignature, f as verifyRequest, i as formatRfc9421SignatureParameters, l as signRequest, n as doubleKnock, o as parseRfc9421Signature, p as verifyRequestDetailed, r as formatRfc9421Signature, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as timingSafeEqual } from "../http-CFyizTHa.mjs";
|
|
17
17
|
import { a as rsaPrivateKey3, i as rsaPrivateKey2, l as rsaPublicKey5, n as ed25519PrivateKey, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
18
18
|
import { t as KvKeyCache } from "../keycache-D-MNltOk.mjs";
|
|
19
19
|
import { FetchError, UrlError, exportSpki, getDocumentLoader } from "@fedify/vocab-runtime";
|
package/dist/sig/key.test.mjs
CHANGED
|
@@ -5,11 +5,12 @@ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
|
5
5
|
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
6
6
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
7
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
8
|
+
import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
|
|
8
9
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
9
|
-
import {
|
|
10
|
+
import { C as generateCryptoKeyPair, S as fetchKeyDetailed, T as validateCryptoKey, _ as wrapContextLoaderForJsonLd, w as importJwk, x as fetchKey, y as exportJwk } from "../ld-DJ--ZUpr.mjs";
|
|
10
11
|
import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
11
|
-
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
12
|
-
import { FetchError, exportDidKey } from "@fedify/vocab-runtime";
|
|
12
|
+
import { CryptographicKey, Multikey, Person } from "@fedify/vocab";
|
|
13
|
+
import { FetchError, UrlError, exportDidKey, getDocumentLoader } from "@fedify/vocab-runtime";
|
|
13
14
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
14
15
|
//#region src/sig/key.test.ts
|
|
15
16
|
test("validateCryptoKey()", async () => {
|
|
@@ -680,6 +681,210 @@ test("fetchKey() returns null for a malformed actor publicKey", async () => {
|
|
|
680
681
|
cached: true
|
|
681
682
|
});
|
|
682
683
|
});
|
|
684
|
+
for (const cls of [CryptographicKey, Multikey]) for (const location of [
|
|
685
|
+
"actor",
|
|
686
|
+
"key",
|
|
687
|
+
"owner"
|
|
688
|
+
]) test(`fetchKey() handles JSON-LD context failures in ${cls.name} ${location} documents`, async (t) => {
|
|
689
|
+
const actorId = new URL("https://example.com/context-actor");
|
|
690
|
+
const keyId = new URL(`${actorId.href}#key`);
|
|
691
|
+
const key = cls === CryptographicKey ? rsaPublicKey1.clone({
|
|
692
|
+
id: keyId,
|
|
693
|
+
owner: actorId
|
|
694
|
+
}) : ed25519Multikey.clone({
|
|
695
|
+
id: keyId,
|
|
696
|
+
controller: actorId
|
|
697
|
+
});
|
|
698
|
+
const actorDocument = await new Person({
|
|
699
|
+
id: actorId,
|
|
700
|
+
...key instanceof CryptographicKey ? { publicKeys: [key] } : { assertionMethods: [key] }
|
|
701
|
+
}).toJsonLd({ contextLoader: mockDocumentLoader });
|
|
702
|
+
const keyDocument = await key.toJsonLd({ contextLoader: mockDocumentLoader });
|
|
703
|
+
const contextUrl = `https://example.com/context/${cls.name}/${location}`;
|
|
704
|
+
const transportErrors = [
|
|
705
|
+
/* @__PURE__ */ new TypeError("fetch failed"),
|
|
706
|
+
/* @__PURE__ */ new TypeError("error reading a body from connection"),
|
|
707
|
+
globalThis.Object.assign(/* @__PURE__ */ new TypeError("The socket connection was closed unexpectedly."), { code: "ECONNRESET" }),
|
|
708
|
+
globalThis.Object.assign(/* @__PURE__ */ new TypeError("Network request failed"), { code: "ECONNRESET" }),
|
|
709
|
+
new TypeError("Network request failed", { cause: globalThis.Object.assign(/* @__PURE__ */ new Error("connection refused"), { code: "ECONNREFUSED" }) }),
|
|
710
|
+
new FetchError(contextUrl, "HTTP 503"),
|
|
711
|
+
new FetchError(contextUrl, "HTTP 503", new Response("unavailable", { status: 503 })),
|
|
712
|
+
new UrlError("DNS lookup failed", { reason: "dns" }),
|
|
713
|
+
globalThis.Object.assign(/* @__PURE__ */ new Error("request aborted"), { name: "AbortError" })
|
|
714
|
+
];
|
|
715
|
+
const programmingErrors = [
|
|
716
|
+
/* @__PURE__ */ new Error("loader bug"),
|
|
717
|
+
/* @__PURE__ */ new ReferenceError("loader bug"),
|
|
718
|
+
/* @__PURE__ */ new TypeError("loader bug"),
|
|
719
|
+
"loader bug",
|
|
720
|
+
null,
|
|
721
|
+
void 0
|
|
722
|
+
];
|
|
723
|
+
const cases = [
|
|
724
|
+
{ kind: "inline" },
|
|
725
|
+
{
|
|
726
|
+
kind: "url",
|
|
727
|
+
wrapped: false
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
kind: "url",
|
|
731
|
+
wrapped: true
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
kind: "wrapped",
|
|
735
|
+
error: /* @__PURE__ */ new TypeError("Invalid URL string.")
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
kind: "remote",
|
|
739
|
+
document: 123
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
kind: "remote",
|
|
743
|
+
document: "not JSON"
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
kind: "remote",
|
|
747
|
+
document: { "@context": contextUrl }
|
|
748
|
+
},
|
|
749
|
+
...transportErrors.map((error) => ({
|
|
750
|
+
kind: "transport",
|
|
751
|
+
error
|
|
752
|
+
})),
|
|
753
|
+
...programmingErrors.map((error) => ({
|
|
754
|
+
kind: "programming",
|
|
755
|
+
error
|
|
756
|
+
})),
|
|
757
|
+
...location === "key" ? [{
|
|
758
|
+
kind: "transport",
|
|
759
|
+
error: /* @__PURE__ */ new TypeError("fetch failed"),
|
|
760
|
+
fallback: true
|
|
761
|
+
}, {
|
|
762
|
+
kind: "programming",
|
|
763
|
+
error: /* @__PURE__ */ new ReferenceError("fallback bug"),
|
|
764
|
+
fallback: true
|
|
765
|
+
}] : []
|
|
766
|
+
];
|
|
767
|
+
for (const scenario of cases) {
|
|
768
|
+
const description = "error" in scenario ? scenario.error instanceof Error ? `${scenario.error.name}: ${scenario.error.message}` : String(scenario.error) : "document" in scenario ? JSON.stringify(scenario.document) : "invalid type mapping";
|
|
769
|
+
await t.step(`${scenario.kind}: ${description}${"fallback" in scenario ? " (fallback)" : ""}`, async () => {
|
|
770
|
+
const cache = {};
|
|
771
|
+
let fetchError = { error: /* @__PURE__ */ new Error("stale fetch error") };
|
|
772
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
773
|
+
let recovered = false;
|
|
774
|
+
let contextLoads = 0;
|
|
775
|
+
const options = {
|
|
776
|
+
meterProvider,
|
|
777
|
+
documentLoader(resource) {
|
|
778
|
+
const document = structuredClone(resource === keyId.href && location !== "actor" ? keyDocument : actorDocument);
|
|
779
|
+
if (location === "actor" || location === "key" && resource === keyId.href || location === "owner" && resource === actorId.href) {
|
|
780
|
+
const context = scenario.kind === "inline" ? { broken: {
|
|
781
|
+
"@id": "https://example.com/ns#broken",
|
|
782
|
+
"@type": "not-an-absolute-iri"
|
|
783
|
+
} } : scenario.kind === "url" ? "http://[" : contextUrl;
|
|
784
|
+
document["@context"] = [document["@context"], context].flat();
|
|
785
|
+
}
|
|
786
|
+
return Promise.resolve({
|
|
787
|
+
contextUrl: null,
|
|
788
|
+
documentUrl: resource,
|
|
789
|
+
document
|
|
790
|
+
});
|
|
791
|
+
},
|
|
792
|
+
async contextLoader(resource) {
|
|
793
|
+
if (scenario.kind === "url" && resource === "http://[") {
|
|
794
|
+
const loader = getDocumentLoader();
|
|
795
|
+
return await (scenario.wrapped ? wrapContextLoaderForJsonLd(loader) : loader)(resource);
|
|
796
|
+
}
|
|
797
|
+
if (scenario.kind === "wrapped" && resource === contextUrl) return await wrapContextLoaderForJsonLd(() => Promise.reject(scenario.error))(resource);
|
|
798
|
+
if (resource !== contextUrl) return await mockDocumentLoader(resource);
|
|
799
|
+
contextLoads++;
|
|
800
|
+
if (!recovered && "error" in scenario && (!("fallback" in scenario) || contextLoads > 1)) throw scenario.error;
|
|
801
|
+
return {
|
|
802
|
+
contextUrl: null,
|
|
803
|
+
documentUrl: resource,
|
|
804
|
+
document: !recovered && "document" in scenario ? scenario.document : { "@context": {} }
|
|
805
|
+
};
|
|
806
|
+
},
|
|
807
|
+
keyCache: {
|
|
808
|
+
get: (id) => Promise.resolve(cache[id.href]),
|
|
809
|
+
set(id, value) {
|
|
810
|
+
cache[id.href] = value;
|
|
811
|
+
return Promise.resolve();
|
|
812
|
+
},
|
|
813
|
+
getFetchError: () => Promise.resolve(fetchError),
|
|
814
|
+
setFetchError(_id, error) {
|
|
815
|
+
fetchError = error ?? void 0;
|
|
816
|
+
return Promise.resolve();
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
};
|
|
820
|
+
const lookup = () => fetchKey(keyId, cls, options);
|
|
821
|
+
if (scenario.kind === "programming" && "error" in scenario) {
|
|
822
|
+
assertStrictEquals(await assertRejects(lookup), scenario.error);
|
|
823
|
+
assertEquals(cache, {});
|
|
824
|
+
assertStrictEquals(await assertRejects(() => fetchKeyDetailed(keyId, cls, options)), scenario.error);
|
|
825
|
+
assertEquals(cache, {});
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
assertEquals(await lookup(), {
|
|
829
|
+
key: null,
|
|
830
|
+
cached: false
|
|
831
|
+
});
|
|
832
|
+
if (scenario.kind === "transport") {
|
|
833
|
+
const counter = recorder.getMeasurement("activitypub.key.lookup");
|
|
834
|
+
const duration = recorder.getMeasurement("activitypub.key.lookup.duration");
|
|
835
|
+
const status = scenario.error instanceof FetchError ? scenario.error.response?.status : void 0;
|
|
836
|
+
const expected = status != null ? "error" : scenario.error instanceof TypeError || scenario.error instanceof FetchError || scenario.error instanceof Error && scenario.error.name === "AbortError" ? "network_error" : "error";
|
|
837
|
+
assertEquals(counter?.attributes["activitypub.lookup.result"], expected);
|
|
838
|
+
assertEquals(duration?.attributes["activitypub.lookup.result"], expected);
|
|
839
|
+
assertEquals(counter?.attributes["http.response.status_code"], status);
|
|
840
|
+
}
|
|
841
|
+
assertEquals(cache, { [keyId.href]: null });
|
|
842
|
+
const detailed = await fetchKeyDetailed(keyId, cls, options);
|
|
843
|
+
assertEquals(detailed.cached, true);
|
|
844
|
+
if (scenario.kind === "transport" || scenario.kind === "wrapped") {
|
|
845
|
+
assert(detailed.fetchError != null);
|
|
846
|
+
if (scenario.error instanceof FetchError && scenario.error.response != null) {
|
|
847
|
+
assert("status" in detailed.fetchError);
|
|
848
|
+
assertEquals(detailed.fetchError.status, 503);
|
|
849
|
+
assertEquals(await detailed.fetchError.response.text(), "unavailable");
|
|
850
|
+
} else {
|
|
851
|
+
assert("error" in detailed.fetchError);
|
|
852
|
+
assertStrictEquals(detailed.fetchError.error, scenario.error);
|
|
853
|
+
}
|
|
854
|
+
} else assertEquals(detailed.fetchError, void 0);
|
|
855
|
+
const previousLoads = contextLoads;
|
|
856
|
+
assertEquals(await lookup(), {
|
|
857
|
+
key: null,
|
|
858
|
+
cached: true
|
|
859
|
+
});
|
|
860
|
+
assertEquals(contextLoads, previousLoads);
|
|
861
|
+
delete cache[keyId.href];
|
|
862
|
+
fetchError = void 0;
|
|
863
|
+
const fresh = await fetchKeyDetailed(keyId, cls, options);
|
|
864
|
+
assertEquals(fresh.cached, false);
|
|
865
|
+
assertEquals(fresh.key, null);
|
|
866
|
+
if (scenario.kind === "transport" || scenario.kind === "wrapped") {
|
|
867
|
+
assert(fresh.fetchError != null);
|
|
868
|
+
if (scenario.error instanceof FetchError && scenario.error.response != null) {
|
|
869
|
+
assert("status" in fresh.fetchError);
|
|
870
|
+
assertEquals(fresh.fetchError.status, 503);
|
|
871
|
+
assertEquals(await fresh.fetchError.response.text(), "unavailable");
|
|
872
|
+
} else {
|
|
873
|
+
assert("error" in fresh.fetchError);
|
|
874
|
+
assertStrictEquals(fresh.fetchError.error, scenario.error);
|
|
875
|
+
}
|
|
876
|
+
} else assertEquals(fresh.fetchError, void 0);
|
|
877
|
+
if (scenario.kind === "transport") {
|
|
878
|
+
delete cache[keyId.href];
|
|
879
|
+
recovered = true;
|
|
880
|
+
const result = await lookup();
|
|
881
|
+
assertEquals(result.cached, false);
|
|
882
|
+
assertEquals(result.key?.id, keyId);
|
|
883
|
+
assert(result.key?.publicKey != null);
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
});
|
|
683
888
|
test("fetchKey() rejects a key whose owner does not link back", async () => {
|
|
684
889
|
const keyId = "https://attacker.example/key";
|
|
685
890
|
const keyDocument = await rsaPublicKey1.toJsonLd({ contextLoader: mockDocumentLoader });
|
package/dist/sig/ld.test.mjs
CHANGED
|
@@ -8,8 +8,7 @@ import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
|
8
8
|
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
9
9
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
10
10
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
11
|
-
import {
|
|
12
|
-
import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-DXaIENwZ.mjs";
|
|
11
|
+
import { C as generateCryptoKeyPair, a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-DJ--ZUpr.mjs";
|
|
13
12
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
14
13
|
import { CryptographicKey } from "@fedify/vocab";
|
|
15
14
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -5,10 +5,10 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
6
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
7
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
8
|
-
import { l as verifyPortableObjectProof } from "../proof-
|
|
9
|
-
import { p as verifyRequestDetailed } from "../http-
|
|
10
|
-
import { o as createFederation } from "../middleware-
|
|
11
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
8
|
+
import { l as verifyPortableObjectProof } from "../proof-Bwzv6mXZ.mjs";
|
|
9
|
+
import { p as verifyRequestDetailed } from "../http-CFyizTHa.mjs";
|
|
10
|
+
import { o as createFederation } from "../middleware-BbBsa5iR.mjs";
|
|
11
|
+
import { t as doesActorOwnKey } from "../owner-Btd7SwMj.mjs";
|
|
12
12
|
import { Create, Person } from "@fedify/vocab";
|
|
13
13
|
import { canonicalizePortableUri, decodeMultibase, importDidKey } from "@fedify/vocab-runtime";
|
|
14
14
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -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 verifyPortableObjectProof } from "../proof-
|
|
8
|
-
import { p as verifyRequestDetailed } from "../http-
|
|
9
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
7
|
+
import { l as verifyPortableObjectProof } from "../proof-Bwzv6mXZ.mjs";
|
|
8
|
+
import { p as verifyRequestDetailed } from "../http-CFyizTHa.mjs";
|
|
9
|
+
import { t as doesActorOwnKey } from "../owner-Btd7SwMj.mjs";
|
|
10
10
|
import { Create } from "@fedify/vocab";
|
|
11
11
|
import { canonicalizePortableUri, decodeMultibase, fromCompatibleEf61Id, importDidKey } from "@fedify/vocab-runtime";
|
|
12
12
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
package/dist/sig/mod.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_http = require("../http-
|
|
4
|
-
const require_portable_collection = require("../portable-collection-
|
|
3
|
+
const require_http = require("../http-D1RPHoq3.cjs");
|
|
4
|
+
const require_portable_collection = require("../portable-collection-BvWxS1sL.cjs");
|
|
5
5
|
exports.attachSignature = require_http.attachSignature;
|
|
6
6
|
exports.createProof = require_http.createProof;
|
|
7
7
|
exports.createSignature = require_http.createSignature;
|
package/dist/sig/mod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { A as detachSignature, C as verifyProof, D as attachSignature, G as generateCryptoKeyPair, I as signJsonLd, K as importJwk, N as hasSignatureLike, R as verifyJsonLd, U as fetchKey, V as exportJwk, W as fetchKeyDetailed, _t as fulfillAcceptSignature, a as signRequest, c as verifyRequestDetailed, g as signObject, gt as formatAcceptSignature, k as createSignature, m as hasProofLike, p as createProof, s as verifyRequest, v as verifyObject, vt as parseAcceptSignature, y as verifyPortableObjectProof, yt as validateAcceptSignature, z as verifySignature } from "../http-
|
|
4
|
-
import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-
|
|
3
|
+
import { A as detachSignature, C as verifyProof, D as attachSignature, G as generateCryptoKeyPair, I as signJsonLd, K as importJwk, N as hasSignatureLike, R as verifyJsonLd, U as fetchKey, V as exportJwk, W as fetchKeyDetailed, _t as fulfillAcceptSignature, a as signRequest, c as verifyRequestDetailed, g as signObject, gt as formatAcceptSignature, k as createSignature, m as hasProofLike, p as createProof, s as verifyRequest, v as verifyObject, vt as parseAcceptSignature, y as verifyPortableObjectProof, yt as validateAcceptSignature, z as verifySignature } from "../http-Cmz7x6Iw.js";
|
|
4
|
+
import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-DwQT28O2.js";
|
|
5
5
|
export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
package/dist/sig/owner.test.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
|
6
6
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
7
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
8
8
|
import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
9
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-
|
|
9
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-Btd7SwMj.mjs";
|
|
10
10
|
import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
|
|
11
11
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
//#region src/sig/owner.test.ts
|
|
@@ -2,7 +2,7 @@ import "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
5
|
-
import { t as verifyPortableObject } from "../portable-collection-
|
|
5
|
+
import { t as verifyPortableObject } from "../portable-collection-gb9V8XEO.mjs";
|
|
6
6
|
import { Collection, CollectionPage, Note, OrderedCollection, Person, traverseCollection } from "@fedify/vocab";
|
|
7
7
|
import { FetchError, encodeMultibase, exportDidKey, preloadedContexts } from "@fedify/vocab-runtime";
|
|
8
8
|
import { test } from "@fedify/fixture";
|