@fedify/fedify 2.3.9-dev.2048 → 2.3.10
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-BfY2wZ4V.mjs → builder-Bal9bfuM.mjs} +10 -2
- package/dist/{client-DYDoDpMa.mjs → client-Ccbsek6u.mjs} +7 -3
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{context-CAKnQy1x.d.ts → context-BWbdE_MZ.d.ts} +1 -1
- package/dist/{context-BepjCFHN.mjs → context-CxbCIptr.mjs} +2 -1
- package/dist/{context-CSIggG9_.d.cts → context-MOrCC7yl.d.cts} +1 -1
- package/dist/{deno-ayal9buz.mjs → deno-DUgFsCmM.mjs} +1 -1
- package/dist/docloader-w72ipM49.mjs +79 -0
- package/dist/federation/builder.test.mjs +38 -2
- package/dist/federation/circuit-breaker.test.mjs +1 -1
- package/dist/federation/collection.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +7 -7
- package/dist/federation/idempotency.test.mjs +3 -3
- package/dist/federation/kv.test.mjs +1 -1
- package/dist/federation/metrics.test.mjs +2 -2
- package/dist/federation/middleware.test.mjs +302 -8
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +1 -1
- package/dist/federation/mq.test.mjs +98 -43
- package/dist/federation/negotiation.test.mjs +1 -1
- package/dist/federation/router.test.mjs +1 -1
- package/dist/federation/send.test.mjs +85 -4
- package/dist/federation/temporal.test.mjs +2 -2
- package/dist/federation/webfinger.test.mjs +3 -3
- package/dist/{http-B2u6PvNX.mjs → http-BNDHRNJP.mjs} +8 -4
- package/dist/{http-BPPCh0xN.js → http-BY8PpQzP.js} +6 -2
- package/dist/{http-BGP2QCbe.cjs → http-CTYio50W.cjs} +6 -2
- package/dist/{key-C9DkrWwb.mjs → key-BbuFo4CW.mjs} +2 -2
- package/dist/{kv-D6hNiMTK.d.ts → kv-CZKl1IUS.d.cts} +3 -2
- package/dist/{kv-gJ8LYbxX.d.cts → kv-CxaI4eGo.d.ts} +3 -2
- package/dist/{kv-cache-qJSjfLGm.mjs → kv-cache-CNZOaZYq.mjs} +1 -1
- package/dist/{kv-cache-C1TC_e9y.cjs → kv-cache-CrcqGkT-.cjs} +34 -8
- package/dist/{kv-cache-Cl1q1aA9.js → kv-cache-DNnjnc9t.js} +35 -9
- package/dist/{ld-DNl7KwLY.mjs → ld-BYV2Luge.mjs} +4 -4
- package/dist/{metrics-Ce55disp.mjs → metrics-QrVsKSG9.mjs} +1 -1
- package/dist/{middleware-C96wm_7x.mjs → middleware-54KSGAQA.mjs} +1 -1
- package/dist/{middleware-C_utyVa_.js → middleware-B4FNnN3W.js} +36 -11
- package/dist/{middleware-BCG2BX1n.mjs → middleware-Bj9s3J_0.mjs} +22 -19
- package/dist/{middleware-BZojifnF.cjs → middleware-Dv-L7Plm.cjs} +36 -11
- package/dist/{mod-PVR75MeU.d.cts → mod-B6PwkUMU.d.cts} +1 -1
- package/dist/{mod-DHgc4ygG.d.ts → mod-Br8yJNcE.d.ts} +3 -1
- package/dist/{mod-1TuoXkGs.d.cts → mod-Co1M3Ux0.d.cts} +3 -1
- package/dist/{mod-CFuyfw3c.d.ts → mod-LmD03uRA.d.ts} +1 -1
- package/dist/mod.cjs +5 -5
- package/dist/mod.d.cts +4 -4
- package/dist/mod.d.ts +4 -4
- package/dist/mod.js +5 -5
- package/dist/nodeinfo/client.test.mjs +50 -2
- package/dist/nodeinfo/handler.test.mjs +3 -3
- package/dist/nodeinfo/mod.cjs +1 -1
- package/dist/nodeinfo/mod.js +1 -1
- package/dist/nodeinfo/types.test.mjs +1 -1
- package/dist/otel/exporter.test.mjs +1 -1
- package/dist/otel/mod.d.cts +1 -1
- package/dist/otel/mod.d.ts +1 -1
- package/dist/{owner-DqqDBw-l.mjs → owner-BsBzJADO.mjs} +2 -2
- package/dist/{proof-Dz9ObvUq.js → proof-BxS2Xa8B.js} +2 -2
- package/dist/{proof-I6YcKRRq.cjs → proof-CGKQFT2M.cjs} +2 -2
- package/dist/{proof-D5vP7VIN.mjs → proof-cXVkPBIU.mjs} +3 -3
- package/dist/{send-CBtR8DQK.mjs → send-omt23uTA.mjs} +18 -4
- package/dist/sig/http.test.mjs +43 -3
- package/dist/sig/key.test.mjs +2 -2
- package/dist/sig/ld.test.mjs +5 -2
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +2 -2
- package/dist/sig/proof.test.mjs +2 -2
- package/dist/{std__assert-BBjXFNOb.mjs → std__assert-BvGuO4xO.mjs} +2 -27
- package/dist/{temporal-B9t2tY9A.mjs → temporal-ZUAQe754.mjs} +1 -1
- package/dist/testing/mod.mjs +1 -1
- package/dist/{types-DWs-qZaY.cjs → types-DRPjmHVV.cjs} +7 -3
- package/dist/{types-sXITXcWa.js → types-miAYfiGO.js} +7 -3
- package/dist/utils/docloader.test.mjs +299 -3
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +1 -1
- package/dist/vocab/cjs.test.mjs +1 -1
- package/package.json +7 -7
- package/dist/docloader-C-JrNL14.mjs +0 -53
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-
|
|
4
|
+
import { n as version, t as name } from "./deno-DUgFsCmM.mjs";
|
|
5
|
+
import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-QrVsKSG9.mjs";
|
|
6
6
|
import { t as formatAcceptSignature } from "./accept-Dd__NiUL.mjs";
|
|
7
|
-
import { o as importJwk, s as validateCryptoKey, t as exportJwk } from "./key-
|
|
8
|
-
import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-
|
|
9
|
-
import { t as getAuthenticatedDocumentLoader } from "./docloader-
|
|
10
|
-
import { n as kvCache } from "./kv-cache-
|
|
11
|
-
import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-
|
|
12
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-
|
|
7
|
+
import { o as importJwk, s as validateCryptoKey, t as exportJwk } from "./key-BbuFo4CW.mjs";
|
|
8
|
+
import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-BNDHRNJP.mjs";
|
|
9
|
+
import { t as getAuthenticatedDocumentLoader } from "./docloader-w72ipM49.mjs";
|
|
10
|
+
import { n as kvCache } from "./kv-cache-CNZOaZYq.mjs";
|
|
11
|
+
import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-BYV2Luge.mjs";
|
|
12
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-BsBzJADO.mjs";
|
|
13
13
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-HOAywiid.mjs";
|
|
14
|
-
import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-
|
|
15
|
-
import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-
|
|
14
|
+
import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-cXVkPBIU.mjs";
|
|
15
|
+
import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-Ccbsek6u.mjs";
|
|
16
16
|
import { t as nodeInfoToJson } from "./types-s4mCTGkT.mjs";
|
|
17
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-
|
|
18
|
-
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-
|
|
17
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-omt23uTA.mjs";
|
|
18
|
+
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-Bal9bfuM.mjs";
|
|
19
19
|
import { t as CircuitBreaker } from "./circuit-breaker-CDABzqVf.mjs";
|
|
20
20
|
import { t as buildCollectionSynchronizationHeader } from "./collection-CA3V5zyK.mjs";
|
|
21
21
|
import { t as KvKeyCache } from "./keycache-B3qRQNLj.mjs";
|
|
22
22
|
import { t as acceptsJsonLd } from "./negotiation-CDW-_gUU.mjs";
|
|
23
|
-
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-
|
|
23
|
+
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-ZUAQe754.mjs";
|
|
24
24
|
import { t as createExponentialBackoffPolicy } from "./retry-_VvV0h9f.mjs";
|
|
25
25
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
26
26
|
import { RouterError } from "@fedify/uri-template";
|
|
@@ -3870,10 +3870,10 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
3870
3870
|
onNotFound
|
|
3871
3871
|
});
|
|
3872
3872
|
case "collection": {
|
|
3873
|
-
const name = route.name
|
|
3873
|
+
const name = this.getCollectionName(route.name);
|
|
3874
3874
|
const callbacks = this.collectionCallbacks[name];
|
|
3875
3875
|
return await handleCustomCollection(request, {
|
|
3876
|
-
name,
|
|
3876
|
+
name: String(name),
|
|
3877
3877
|
context,
|
|
3878
3878
|
values: route.values,
|
|
3879
3879
|
collectionCallbacks: callbacks,
|
|
@@ -3884,10 +3884,10 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
3884
3884
|
});
|
|
3885
3885
|
}
|
|
3886
3886
|
case "orderedCollection": {
|
|
3887
|
-
const name = route.name
|
|
3887
|
+
const name = this.getCollectionName(route.name);
|
|
3888
3888
|
const callbacks = this.collectionCallbacks[name];
|
|
3889
3889
|
return await handleOrderedCollection(request, {
|
|
3890
|
-
name,
|
|
3890
|
+
name: String(name),
|
|
3891
3891
|
context,
|
|
3892
3892
|
values: route.values,
|
|
3893
3893
|
collectionCallbacks: callbacks,
|
|
@@ -4130,8 +4130,10 @@ var ContextImpl = class ContextImpl {
|
|
|
4130
4130
|
const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
|
|
4131
4131
|
const match = route.name.match(collectionRegex);
|
|
4132
4132
|
if (match !== null) {
|
|
4133
|
-
const [, type
|
|
4133
|
+
const [, type] = match;
|
|
4134
|
+
const name = this.federation.getCollectionName(route.name);
|
|
4134
4135
|
const cls = this.federation.collectionTypeIds[name];
|
|
4136
|
+
if (cls == null) return null;
|
|
4135
4137
|
return {
|
|
4136
4138
|
type,
|
|
4137
4139
|
name,
|
|
@@ -4501,7 +4503,7 @@ var ContextImpl = class ContextImpl {
|
|
|
4501
4503
|
"inbox"
|
|
4502
4504
|
]);
|
|
4503
4505
|
const contextLoader = options.contextLoader ?? this.contextLoader;
|
|
4504
|
-
|
|
4506
|
+
let json = await activity.toJsonLd({ contextLoader });
|
|
4505
4507
|
const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, this);
|
|
4506
4508
|
if (await verifyObject(Activity, json, {
|
|
4507
4509
|
contextLoader,
|
|
@@ -4558,6 +4560,7 @@ var ContextImpl = class ContextImpl {
|
|
|
4558
4560
|
}
|
|
4559
4561
|
logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
|
|
4560
4562
|
activity = fetched;
|
|
4563
|
+
json = await fetched.toJsonLd({ contextLoader });
|
|
4561
4564
|
} else logger.debug("Object Integrity Proofs are verified.", {
|
|
4562
4565
|
recipient,
|
|
4563
4566
|
activity: json
|
|
@@ -2,10 +2,10 @@ const { Temporal } = require("@js-temporal/polyfill");
|
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
const require_chunk = require("./chunk-DDcVe30Y.cjs");
|
|
4
4
|
const require_transformers = require("./transformers-NeAONrAq.cjs");
|
|
5
|
-
const require_http = require("./http-
|
|
6
|
-
const require_types = require("./types-
|
|
7
|
-
const require_proof = require("./proof-
|
|
8
|
-
const require_kv_cache = require("./kv-cache-
|
|
5
|
+
const require_http = require("./http-CTYio50W.cjs");
|
|
6
|
+
const require_types = require("./types-DRPjmHVV.cjs");
|
|
7
|
+
const require_proof = require("./proof-CGKQFT2M.cjs");
|
|
8
|
+
const require_kv_cache = require("./kv-cache-CrcqGkT-.cjs");
|
|
9
9
|
let _logtape_logtape = require("@logtape/logtape");
|
|
10
10
|
let _fedify_uri_template = require("@fedify/uri-template");
|
|
11
11
|
let _fedify_vocab = require("@fedify/vocab");
|
|
@@ -112,6 +112,7 @@ var FederationBuilderImpl = class {
|
|
|
112
112
|
* Symbol registry for unique identification of unnamed symbols.
|
|
113
113
|
*/
|
|
114
114
|
#symbolRegistry = /* @__PURE__ */ new Map();
|
|
115
|
+
#collectionNames = /* @__PURE__ */ new Map();
|
|
115
116
|
constructor() {
|
|
116
117
|
this.router = new _fedify_uri_template.Router();
|
|
117
118
|
this.objectCallbacks = {};
|
|
@@ -140,6 +141,8 @@ var FederationBuilderImpl = class {
|
|
|
140
141
|
f.objectTypeIds = { ...this.objectTypeIds };
|
|
141
142
|
f.collectionCallbacks = { ...this.collectionCallbacks };
|
|
142
143
|
f.collectionTypeIds = { ...this.collectionTypeIds };
|
|
144
|
+
f.#symbolRegistry = new Map(this.#symbolRegistry);
|
|
145
|
+
f.#collectionNames = new Map(this.#collectionNames);
|
|
143
146
|
f.inboxPath = this.inboxPath;
|
|
144
147
|
f.outboxPath = this.outboxPath;
|
|
145
148
|
f.inboxCallbacks = this.inboxCallbacks == null ? void 0 : { ...this.inboxCallbacks };
|
|
@@ -619,6 +622,7 @@ var FederationBuilderImpl = class {
|
|
|
619
622
|
if (this.collectionCallbacks[name] != null) throw new _fedify_uri_template.RouterError(`Collection dispatcher for ${strName} already set.`);
|
|
620
623
|
(0, _fedify_uri_template.assertPath)(path);
|
|
621
624
|
if (_fedify_uri_template.Router.variables(path).size < 1) throw new _fedify_uri_template.RouterError("Path for collection dispatcher must have at least one variable.");
|
|
625
|
+
this.#collectionNames.set(routeName, name);
|
|
622
626
|
this.router.add(path, routeName);
|
|
623
627
|
const callbacks = { dispatcher };
|
|
624
628
|
this.collectionCallbacks[name] = callbacks;
|
|
@@ -656,6 +660,10 @@ var FederationBuilderImpl = class {
|
|
|
656
660
|
const routeName = this.#uniqueCollectionId(name);
|
|
657
661
|
return this.router.build(`collection:${routeName}`, values) ?? this.router.build(`orderedCollection:${routeName}`, values);
|
|
658
662
|
}
|
|
663
|
+
/** Resolves a custom collection route to its original name. */
|
|
664
|
+
getCollectionName(routeName) {
|
|
665
|
+
return this.#collectionNames.get(routeName) ?? routeName.replace(/^(collection|orderedCollection):/, "");
|
|
666
|
+
}
|
|
659
667
|
setOutboxPermanentFailureHandler(handler) {
|
|
660
668
|
this.outboxPermanentFailureHandler = handler;
|
|
661
669
|
}
|
|
@@ -3438,6 +3446,15 @@ async function sendActivityInternal({ activity, activityId, activityType, keys,
|
|
|
3438
3446
|
if (!allowPrivateAddress) try {
|
|
3439
3447
|
await (0, _fedify_vocab_runtime.validatePublicUrl)(url);
|
|
3440
3448
|
} catch (error) {
|
|
3449
|
+
if (error instanceof _fedify_vocab_runtime.UrlError && error.reason === "dns") {
|
|
3450
|
+
logger.error("DNS resolution failed for URL: {url}", {
|
|
3451
|
+
url,
|
|
3452
|
+
error
|
|
3453
|
+
});
|
|
3454
|
+
const failure = new _fedify_vocab_runtime.FetchError(url, error.message);
|
|
3455
|
+
failure.cause = error;
|
|
3456
|
+
throw failure;
|
|
3457
|
+
}
|
|
3441
3458
|
if (error instanceof _fedify_vocab_runtime.UrlError) logger.error("Disallowed private URL: {url}", {
|
|
3442
3459
|
url,
|
|
3443
3460
|
error
|
|
@@ -3445,7 +3462,12 @@ async function sendActivityInternal({ activity, activityId, activityType, keys,
|
|
|
3445
3462
|
throw error;
|
|
3446
3463
|
}
|
|
3447
3464
|
}
|
|
3448
|
-
|
|
3465
|
+
try {
|
|
3466
|
+
await validateUrl(inbox.href);
|
|
3467
|
+
} catch (error) {
|
|
3468
|
+
if (error instanceof _fedify_vocab_runtime.FetchError) federationMetrics.recordDelivery(inbox, require_http.getDurationMs(started), false, activityType);
|
|
3469
|
+
throw error;
|
|
3470
|
+
}
|
|
3449
3471
|
headers = new Headers(headers);
|
|
3450
3472
|
headers.set("Content-Type", "application/activity+json");
|
|
3451
3473
|
const request = new Request(inbox, {
|
|
@@ -5608,10 +5630,10 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
5608
5630
|
onNotFound
|
|
5609
5631
|
});
|
|
5610
5632
|
case "collection": {
|
|
5611
|
-
const name = route.name
|
|
5633
|
+
const name = this.getCollectionName(route.name);
|
|
5612
5634
|
const callbacks = this.collectionCallbacks[name];
|
|
5613
5635
|
return await handleCustomCollection(request, {
|
|
5614
|
-
name,
|
|
5636
|
+
name: String(name),
|
|
5615
5637
|
context,
|
|
5616
5638
|
values: route.values,
|
|
5617
5639
|
collectionCallbacks: callbacks,
|
|
@@ -5622,10 +5644,10 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
5622
5644
|
});
|
|
5623
5645
|
}
|
|
5624
5646
|
case "orderedCollection": {
|
|
5625
|
-
const name = route.name
|
|
5647
|
+
const name = this.getCollectionName(route.name);
|
|
5626
5648
|
const callbacks = this.collectionCallbacks[name];
|
|
5627
5649
|
return await handleOrderedCollection(request, {
|
|
5628
|
-
name,
|
|
5650
|
+
name: String(name),
|
|
5629
5651
|
context,
|
|
5630
5652
|
values: route.values,
|
|
5631
5653
|
collectionCallbacks: callbacks,
|
|
@@ -5868,8 +5890,10 @@ var ContextImpl = class ContextImpl {
|
|
|
5868
5890
|
const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
|
|
5869
5891
|
const match = route.name.match(collectionRegex);
|
|
5870
5892
|
if (match !== null) {
|
|
5871
|
-
const [, type
|
|
5893
|
+
const [, type] = match;
|
|
5894
|
+
const name = this.federation.getCollectionName(route.name);
|
|
5872
5895
|
const cls = this.federation.collectionTypeIds[name];
|
|
5896
|
+
if (cls == null) return null;
|
|
5873
5897
|
return {
|
|
5874
5898
|
type,
|
|
5875
5899
|
name,
|
|
@@ -6239,7 +6263,7 @@ var ContextImpl = class ContextImpl {
|
|
|
6239
6263
|
"inbox"
|
|
6240
6264
|
]);
|
|
6241
6265
|
const contextLoader = options.contextLoader ?? this.contextLoader;
|
|
6242
|
-
|
|
6266
|
+
let json = await activity.toJsonLd({ contextLoader });
|
|
6243
6267
|
const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, this);
|
|
6244
6268
|
if (await require_proof.verifyObject(_fedify_vocab.Activity, json, {
|
|
6245
6269
|
contextLoader,
|
|
@@ -6296,6 +6320,7 @@ var ContextImpl = class ContextImpl {
|
|
|
6296
6320
|
}
|
|
6297
6321
|
logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
|
|
6298
6322
|
activity = fetched;
|
|
6323
|
+
json = await fetched.toJsonLd({ contextLoader });
|
|
6299
6324
|
} else logger.debug("Object Integrity Proofs are verified.", {
|
|
6300
6325
|
recipient,
|
|
6301
6326
|
activity: json
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { G as ActorDispatcher, K as ActorHandleMapper, W as ActorAliasMapper, l as RequestContext, pt as WebFingerLinksDispatcher } from "./context-
|
|
2
|
+
import { G as ActorDispatcher, K as ActorHandleMapper, W as ActorAliasMapper, l as RequestContext, pt as WebFingerLinksDispatcher } from "./context-MOrCC7yl.cjs";
|
|
3
3
|
import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
|
|
4
4
|
import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { n as HttpMessageSignaturesSpecDeterminer } from "./http-DQmNpfym.js";
|
|
3
|
-
import { n as KvStore, t as KvKey } from "./kv-
|
|
3
|
+
import { n as KvStore, t as KvKey } from "./kv-CxaI4eGo.js";
|
|
4
4
|
import { MeterProvider, TracerProvider } from "@opentelemetry/api";
|
|
5
5
|
import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
|
|
6
6
|
|
|
@@ -30,6 +30,8 @@ interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOpt
|
|
|
30
30
|
* Gets an authenticated {@link DocumentLoader} for the given identity.
|
|
31
31
|
* Note that an authenticated document loader intentionally does not cache
|
|
32
32
|
* the fetched documents.
|
|
33
|
+
* At most 20 HTTP redirects and alternate document links are followed in total
|
|
34
|
+
* per call. Revisiting a URL within that chain throws a {@link FetchError}.
|
|
33
35
|
* @param identity The identity to get the document loader for.
|
|
34
36
|
* The actor's key pair.
|
|
35
37
|
* @param options The options for the document loader.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { n as HttpMessageSignaturesSpecDeterminer } from "./http-DiWQB8Mr.cjs";
|
|
3
|
-
import { n as KvStore, t as KvKey } from "./kv-
|
|
3
|
+
import { n as KvStore, t as KvKey } from "./kv-CZKl1IUS.cjs";
|
|
4
4
|
import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
|
|
5
5
|
import { MeterProvider, TracerProvider } from "@opentelemetry/api";
|
|
6
6
|
|
|
@@ -30,6 +30,8 @@ interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOpt
|
|
|
30
30
|
* Gets an authenticated {@link DocumentLoader} for the given identity.
|
|
31
31
|
* Note that an authenticated document loader intentionally does not cache
|
|
32
32
|
* the fetched documents.
|
|
33
|
+
* At most 20 HTTP redirects and alternate document links are followed in total
|
|
34
|
+
* per call. Revisiting a URL within that chain throws a {@link FetchError}.
|
|
33
35
|
* @param identity The identity to get the document loader for.
|
|
34
36
|
* The actor's key pair.
|
|
35
37
|
* @param options The options for the document loader.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { G as ActorDispatcher, K as ActorHandleMapper, W as ActorAliasMapper, l as RequestContext, pt as WebFingerLinksDispatcher } from "./context-
|
|
2
|
+
import { G as ActorDispatcher, K as ActorHandleMapper, W as ActorAliasMapper, l as RequestContext, pt as WebFingerLinksDispatcher } from "./context-BWbdE_MZ.js";
|
|
3
3
|
import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
|
|
4
4
|
import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
|
|
5
5
|
|
package/dist/mod.cjs
CHANGED
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
require("./chunk-DDcVe30Y.cjs");
|
|
5
5
|
const require_transformers = require("./transformers-NeAONrAq.cjs");
|
|
6
6
|
require("./compat/mod.cjs");
|
|
7
|
-
const require_http = require("./http-
|
|
8
|
-
const require_middleware = require("./middleware-
|
|
9
|
-
const require_types = require("./types-
|
|
10
|
-
const require_proof = require("./proof-
|
|
11
|
-
const require_kv_cache = require("./kv-cache-
|
|
7
|
+
const require_http = require("./http-CTYio50W.cjs");
|
|
8
|
+
const require_middleware = require("./middleware-Dv-L7Plm.cjs");
|
|
9
|
+
const require_types = require("./types-DRPjmHVV.cjs");
|
|
10
|
+
const require_proof = require("./proof-CGKQFT2M.cjs");
|
|
11
|
+
const require_kv_cache = require("./kv-cache-CrcqGkT-.cjs");
|
|
12
12
|
const require_federation_mod = require("./federation/mod.cjs");
|
|
13
13
|
require("./nodeinfo/mod.cjs");
|
|
14
14
|
require("./runtime/mod.cjs");
|
package/dist/mod.d.cts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-CAM_bQXx.cjs";
|
|
3
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-DiWQB8Mr.cjs";
|
|
4
4
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-B3hNQCG8.cjs";
|
|
5
|
-
import { $ as CustomCollectionCursor, A as Rfc6570Expression, At as parseCircuitBreakerKvState, B as createFederationBuilder, C as FederationStartQueueOptions, Ct as CircuitBreakerFailurePolicy, D as InboxListenerSetters, Dt as CircuitBreakerStateChange, E as InboxChallengePolicy, Et as CircuitBreakerState, F as CreateExponentialBackoffPolicyOptions, G as ActorDispatcher, H as respondWithObject, I as RetryContext, J as AuthorizePredicate, K as ActorHandleMapper, L as RetryPolicy, M as FederationOrigin, N as FederationQueueOptions, O as ObjectCallbackSetters, Ot as NormalizedCircuitBreakerOptions, P as createFederation, Q as CustomCollectionCounter, R as createExponentialBackoffPolicy, S as FederationOptions, St as CircuitBreakerCreateOptions, T as IdempotencyStrategy, Tt as CircuitBreakerOptions, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as Federatable, _t as buildCollectionSynchronizationHeader, a as GetSignedKeyOptions, at as ObjectDispatcher, b as FederationBuilder, bt as CircuitBreakerActivityDrop, c as ParseUriResult, ct as OutboxListenerErrorHandler, d as SendActivityOptions, dt as UnverifiedActivityHandler, et as CustomCollectionDispatcher, f as SendActivityOptionsForCollection, ft as UnverifiedActivityReason, g as CustomCollectionCallbackSetters, gt as PageItems, h as ConstructorWithTypeId, ht as SenderKeyPair, i as GetActorOptions, it as ObjectAuthorizePredicate, j as FederationKvPrefixes, jt as ActivityTransformer, k as OutboxListenerSetters, kt as normalizeCircuitBreakerOptions, l as RequestContext, lt as OutboxPermanentFailureHandler, m as CollectionCallbackSetters, mt as SendActivityError, n as Context, nt as InboxListener, o as InboxContext, ot as OutboxErrorHandler, p as ActorCallbackSetters, pt as WebFingerLinksDispatcher, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as OutboxContext, st as OutboxListener, t as ActorKeyPair, tt as InboxErrorHandler, u as RouteActivityOptions, ut as SharedInboxKeyDispatcher, v as Federation, vt as digest, w as IdempotencyKeyCallback, wt as CircuitBreakerKvState, x as FederationFetchOptions, xt as CircuitBreakerBeforeSendDecision, y as FederationBenchmarkOptions, yt as CircuitBreaker, z as Message } from "./context-
|
|
6
|
-
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-
|
|
5
|
+
import { $ as CustomCollectionCursor, A as Rfc6570Expression, At as parseCircuitBreakerKvState, B as createFederationBuilder, C as FederationStartQueueOptions, Ct as CircuitBreakerFailurePolicy, D as InboxListenerSetters, Dt as CircuitBreakerStateChange, E as InboxChallengePolicy, Et as CircuitBreakerState, F as CreateExponentialBackoffPolicyOptions, G as ActorDispatcher, H as respondWithObject, I as RetryContext, J as AuthorizePredicate, K as ActorHandleMapper, L as RetryPolicy, M as FederationOrigin, N as FederationQueueOptions, O as ObjectCallbackSetters, Ot as NormalizedCircuitBreakerOptions, P as createFederation, Q as CustomCollectionCounter, R as createExponentialBackoffPolicy, S as FederationOptions, St as CircuitBreakerCreateOptions, T as IdempotencyStrategy, Tt as CircuitBreakerOptions, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as Federatable, _t as buildCollectionSynchronizationHeader, a as GetSignedKeyOptions, at as ObjectDispatcher, b as FederationBuilder, bt as CircuitBreakerActivityDrop, c as ParseUriResult, ct as OutboxListenerErrorHandler, d as SendActivityOptions, dt as UnverifiedActivityHandler, et as CustomCollectionDispatcher, f as SendActivityOptionsForCollection, ft as UnverifiedActivityReason, g as CustomCollectionCallbackSetters, gt as PageItems, h as ConstructorWithTypeId, ht as SenderKeyPair, i as GetActorOptions, it as ObjectAuthorizePredicate, j as FederationKvPrefixes, jt as ActivityTransformer, k as OutboxListenerSetters, kt as normalizeCircuitBreakerOptions, l as RequestContext, lt as OutboxPermanentFailureHandler, m as CollectionCallbackSetters, mt as SendActivityError, n as Context, nt as InboxListener, o as InboxContext, ot as OutboxErrorHandler, p as ActorCallbackSetters, pt as WebFingerLinksDispatcher, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as OutboxContext, st as OutboxListener, t as ActorKeyPair, tt as InboxErrorHandler, u as RouteActivityOptions, ut as SharedInboxKeyDispatcher, v as Federation, vt as digest, w as IdempotencyKeyCallback, wt as CircuitBreakerKvState, x as FederationFetchOptions, xt as CircuitBreakerBeforeSendDecision, y as FederationBenchmarkOptions, yt as CircuitBreaker, z as Message } from "./context-MOrCC7yl.cjs";
|
|
6
|
+
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-CZKl1IUS.cjs";
|
|
7
7
|
import { a as MessageQueueEnqueueOptions, i as MessageQueueDepth, n as InProcessMessageQueueOptions, o as MessageQueueListenOptions, r as MessageQueue, s as ParallelMessageQueue, t as InProcessMessageQueue } from "./mq-D8uSFzxe.cjs";
|
|
8
8
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
|
|
9
|
-
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-
|
|
9
|
+
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-B6PwkUMU.cjs";
|
|
10
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-Bid79LFU.cjs";
|
|
11
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-
|
|
11
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-Co1M3Ux0.cjs";
|
|
12
12
|
export * from "@fedify/vocab-runtime";
|
|
13
13
|
|
|
14
14
|
//#region src/mod.d.ts
|
package/dist/mod.d.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-CSddvgWN.js";
|
|
3
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-DQmNpfym.js";
|
|
4
4
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CiBPcC6F.js";
|
|
5
|
-
import { $ as CustomCollectionCursor, A as Rfc6570Expression, At as parseCircuitBreakerKvState, B as createFederationBuilder, C as FederationStartQueueOptions, Ct as CircuitBreakerFailurePolicy, D as InboxListenerSetters, Dt as CircuitBreakerStateChange, E as InboxChallengePolicy, Et as CircuitBreakerState, F as CreateExponentialBackoffPolicyOptions, G as ActorDispatcher, H as respondWithObject, I as RetryContext, J as AuthorizePredicate, K as ActorHandleMapper, L as RetryPolicy, M as FederationOrigin, N as FederationQueueOptions, O as ObjectCallbackSetters, Ot as NormalizedCircuitBreakerOptions, P as createFederation, Q as CustomCollectionCounter, R as createExponentialBackoffPolicy, S as FederationOptions, St as CircuitBreakerCreateOptions, T as IdempotencyStrategy, Tt as CircuitBreakerOptions, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as Federatable, _t as buildCollectionSynchronizationHeader, a as GetSignedKeyOptions, at as ObjectDispatcher, b as FederationBuilder, bt as CircuitBreakerActivityDrop, c as ParseUriResult, ct as OutboxListenerErrorHandler, d as SendActivityOptions, dt as UnverifiedActivityHandler, et as CustomCollectionDispatcher, f as SendActivityOptionsForCollection, ft as UnverifiedActivityReason, g as CustomCollectionCallbackSetters, gt as PageItems, h as ConstructorWithTypeId, ht as SenderKeyPair, i as GetActorOptions, it as ObjectAuthorizePredicate, j as FederationKvPrefixes, jt as ActivityTransformer, k as OutboxListenerSetters, kt as normalizeCircuitBreakerOptions, l as RequestContext, lt as OutboxPermanentFailureHandler, m as CollectionCallbackSetters, mt as SendActivityError, n as Context, nt as InboxListener, o as InboxContext, ot as OutboxErrorHandler, p as ActorCallbackSetters, pt as WebFingerLinksDispatcher, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as OutboxContext, st as OutboxListener, t as ActorKeyPair, tt as InboxErrorHandler, u as RouteActivityOptions, ut as SharedInboxKeyDispatcher, v as Federation, vt as digest, w as IdempotencyKeyCallback, wt as CircuitBreakerKvState, x as FederationFetchOptions, xt as CircuitBreakerBeforeSendDecision, y as FederationBenchmarkOptions, yt as CircuitBreaker, z as Message } from "./context-
|
|
6
|
-
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-
|
|
5
|
+
import { $ as CustomCollectionCursor, A as Rfc6570Expression, At as parseCircuitBreakerKvState, B as createFederationBuilder, C as FederationStartQueueOptions, Ct as CircuitBreakerFailurePolicy, D as InboxListenerSetters, Dt as CircuitBreakerStateChange, E as InboxChallengePolicy, Et as CircuitBreakerState, F as CreateExponentialBackoffPolicyOptions, G as ActorDispatcher, H as respondWithObject, I as RetryContext, J as AuthorizePredicate, K as ActorHandleMapper, L as RetryPolicy, M as FederationOrigin, N as FederationQueueOptions, O as ObjectCallbackSetters, Ot as NormalizedCircuitBreakerOptions, P as createFederation, Q as CustomCollectionCounter, R as createExponentialBackoffPolicy, S as FederationOptions, St as CircuitBreakerCreateOptions, T as IdempotencyStrategy, Tt as CircuitBreakerOptions, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as Federatable, _t as buildCollectionSynchronizationHeader, a as GetSignedKeyOptions, at as ObjectDispatcher, b as FederationBuilder, bt as CircuitBreakerActivityDrop, c as ParseUriResult, ct as OutboxListenerErrorHandler, d as SendActivityOptions, dt as UnverifiedActivityHandler, et as CustomCollectionDispatcher, f as SendActivityOptionsForCollection, ft as UnverifiedActivityReason, g as CustomCollectionCallbackSetters, gt as PageItems, h as ConstructorWithTypeId, ht as SenderKeyPair, i as GetActorOptions, it as ObjectAuthorizePredicate, j as FederationKvPrefixes, jt as ActivityTransformer, k as OutboxListenerSetters, kt as normalizeCircuitBreakerOptions, l as RequestContext, lt as OutboxPermanentFailureHandler, m as CollectionCallbackSetters, mt as SendActivityError, n as Context, nt as InboxListener, o as InboxContext, ot as OutboxErrorHandler, p as ActorCallbackSetters, pt as WebFingerLinksDispatcher, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as OutboxContext, st as OutboxListener, t as ActorKeyPair, tt as InboxErrorHandler, u as RouteActivityOptions, ut as SharedInboxKeyDispatcher, v as Federation, vt as digest, w as IdempotencyKeyCallback, wt as CircuitBreakerKvState, x as FederationFetchOptions, xt as CircuitBreakerBeforeSendDecision, y as FederationBenchmarkOptions, yt as CircuitBreaker, z as Message } from "./context-BWbdE_MZ.js";
|
|
6
|
+
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-CxaI4eGo.js";
|
|
7
7
|
import { a as MessageQueueEnqueueOptions, i as MessageQueueDepth, n as InProcessMessageQueueOptions, o as MessageQueueListenOptions, r as MessageQueue, s as ParallelMessageQueue, t as InProcessMessageQueue } from "./mq-D-nlpY04.js";
|
|
8
8
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
|
|
9
|
-
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-
|
|
9
|
+
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-LmD03uRA.js";
|
|
10
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-TLEvgT1i.js";
|
|
11
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-
|
|
11
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-Br8yJNcE.js";
|
|
12
12
|
export * from "@fedify/vocab-runtime";
|
|
13
13
|
|
|
14
14
|
//#region src/mod.d.ts
|
package/dist/mod.js
CHANGED
|
@@ -3,11 +3,11 @@ import { URLPattern } from "urlpattern-polyfill";
|
|
|
3
3
|
import "./chunk-CRNNMoPX.js";
|
|
4
4
|
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-BGMIq1cs.js";
|
|
5
5
|
import "./compat/mod.js";
|
|
6
|
-
import { F as validateAcceptSignature, M as formatAcceptSignature, N as fulfillAcceptSignature, P as parseAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, i as verifyRequest, l as fetchKeyDetailed, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "./http-
|
|
7
|
-
import { a as SendActivityError, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as createExponentialBackoffPolicy, l as digest, o as respondWithObject, p as createFederationBuilder, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as CircuitBreaker } from "./middleware-
|
|
8
|
-
import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-
|
|
9
|
-
import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-
|
|
10
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-
|
|
6
|
+
import { F as validateAcceptSignature, M as formatAcceptSignature, N as fulfillAcceptSignature, P as parseAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, i as verifyRequest, l as fetchKeyDetailed, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "./http-BY8PpQzP.js";
|
|
7
|
+
import { a as SendActivityError, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as createExponentialBackoffPolicy, l as digest, o as respondWithObject, p as createFederationBuilder, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as CircuitBreaker } from "./middleware-B4FNnN3W.js";
|
|
8
|
+
import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-miAYfiGO.js";
|
|
9
|
+
import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-BxS2Xa8B.js";
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-DNnjnc9t.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";
|
|
@@ -3,9 +3,13 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as esm_default } from "../esm-vrlUxr60.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
6
|
-
import "../std__assert-
|
|
7
|
-
import {
|
|
6
|
+
import "../std__assert-BvGuO4xO.mjs";
|
|
7
|
+
import { n as assertInstanceOf } from "../assert-jSdZMYam.mjs";
|
|
8
|
+
import { a as parseProtocol, c as parseUsage, i as parseOutboundService, n as parseInboundService, o as parseServices, r as parseNodeInfo, s as parseSoftware, t as getNodeInfo } from "../client-Ccbsek6u.mjs";
|
|
9
|
+
import { configure, reset } from "@logtape/logtape";
|
|
8
10
|
import { test } from "@fedify/fixture";
|
|
11
|
+
import { UrlError } from "@fedify/vocab-runtime";
|
|
12
|
+
import dns from "node:dns/promises";
|
|
9
13
|
//#region src/nodeinfo/client.test.ts
|
|
10
14
|
test("getNodeInfo()", async (t) => {
|
|
11
15
|
esm_default.spyGlobal();
|
|
@@ -994,5 +998,49 @@ test("getNodeInfo() bounds both discovery and document responses", async () => {
|
|
|
994
998
|
esm_default.hardReset();
|
|
995
999
|
}
|
|
996
1000
|
});
|
|
1001
|
+
test("getNodeInfo() logs DNS failures as such", { ignore: "Deno" in globalThis && (await Deno.permissions.query({ name: "net" })).state !== "granted" }, async (t) => {
|
|
1002
|
+
for (const result of [
|
|
1003
|
+
"throws",
|
|
1004
|
+
"empty",
|
|
1005
|
+
"private"
|
|
1006
|
+
]) await t.step(result, async () => {
|
|
1007
|
+
const originalLookup = dns.lookup;
|
|
1008
|
+
dns.lookup = (() => result === "throws" ? Promise.reject(/* @__PURE__ */ new Error("Resolver unavailable")) : Promise.resolve(result === "empty" ? [] : [{
|
|
1009
|
+
address: "127.0.0.1",
|
|
1010
|
+
family: 4
|
|
1011
|
+
}]));
|
|
1012
|
+
const records = [];
|
|
1013
|
+
await configure({
|
|
1014
|
+
sinks: { buffer: (record) => records.push(record) },
|
|
1015
|
+
loggers: [{
|
|
1016
|
+
category: "fedify",
|
|
1017
|
+
sinks: ["buffer"],
|
|
1018
|
+
lowestLevel: "debug"
|
|
1019
|
+
}, {
|
|
1020
|
+
category: ["logtape", "meta"],
|
|
1021
|
+
sinks: []
|
|
1022
|
+
}],
|
|
1023
|
+
reset: true
|
|
1024
|
+
});
|
|
1025
|
+
try {
|
|
1026
|
+
assertEquals(await getNodeInfo("https://dns-failure.invalid/"), void 0);
|
|
1027
|
+
assertEquals(records.map((r) => [
|
|
1028
|
+
r.level,
|
|
1029
|
+
r.rawMessage,
|
|
1030
|
+
r.properties.url
|
|
1031
|
+
]), [[
|
|
1032
|
+
"error",
|
|
1033
|
+
result === "private" ? "Refused to fetch a private or invalid URL {url}: {error}" : "DNS lookup failed for {url}: {error}",
|
|
1034
|
+
"https://dns-failure.invalid/.well-known/nodeinfo"
|
|
1035
|
+
]]);
|
|
1036
|
+
const { error } = records[0].properties;
|
|
1037
|
+
assertInstanceOf(error, UrlError);
|
|
1038
|
+
assertEquals(error.reason, result === "private" ? "disallowed" : "dns");
|
|
1039
|
+
} finally {
|
|
1040
|
+
await reset();
|
|
1041
|
+
dns.lookup = originalLookup;
|
|
1042
|
+
}
|
|
1043
|
+
});
|
|
1044
|
+
});
|
|
997
1045
|
//#endregion
|
|
998
1046
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { r as createRequestContext } from "../context-
|
|
4
|
+
import { r as createRequestContext } from "../context-CxbCIptr.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
6
|
-
import "../std__assert-
|
|
6
|
+
import "../std__assert-BvGuO4xO.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
|
|
8
|
-
import { _ as handleNodeInfo, o as createFederation, v as handleNodeInfoJrd } from "../middleware-
|
|
8
|
+
import { _ as handleNodeInfo, o as createFederation, v as handleNodeInfoJrd } from "../middleware-Bj9s3J_0.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.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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_types = require("../types-
|
|
4
|
+
const require_types = require("../types-DRPjmHVV.cjs");
|
|
5
5
|
exports.getNodeInfo = require_types.getNodeInfo;
|
|
6
6
|
exports.nodeInfoToJson = require_types.nodeInfoToJson;
|
|
7
7
|
exports.parseNodeInfo = require_types.parseNodeInfo;
|
package/dist/nodeinfo/mod.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "../types-
|
|
3
|
+
import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "../types-miAYfiGO.js";
|
|
4
4
|
export { getNodeInfo, nodeInfoToJson, parseNodeInfo };
|
|
@@ -2,7 +2,7 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
5
|
-
import "../std__assert-
|
|
5
|
+
import "../std__assert-BvGuO4xO.mjs";
|
|
6
6
|
import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
|
|
7
7
|
import { t as nodeInfoToJson } from "../types-s4mCTGkT.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
@@ -2,7 +2,7 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
5
|
-
import "../std__assert-
|
|
5
|
+
import "../std__assert-BvGuO4xO.mjs";
|
|
6
6
|
import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
8
|
import { ExportResultCode } from "@opentelemetry/core";
|
package/dist/otel/mod.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { n as KvStore, t as KvKey } from "../kv-
|
|
2
|
+
import { n as KvStore, t as KvKey } from "../kv-CZKl1IUS.cjs";
|
|
3
3
|
import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
|
|
4
4
|
import { ExportResultCode } from "@opentelemetry/core";
|
|
5
5
|
|
package/dist/otel/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { n as KvStore, t as KvKey } from "../kv-
|
|
2
|
+
import { n as KvStore, t as KvKey } from "../kv-CxaI4eGo.js";
|
|
3
3
|
import { ExportResultCode } from "@opentelemetry/core";
|
|
4
4
|
import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
|
|
5
5
|
|
|
@@ -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 { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-DUgFsCmM.mjs";
|
|
5
|
+
import { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-BbuFo4CW.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
8
8
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { I as name, L as version, c as fetchKey, f as validateCryptoKey, h as getFederationMetrics, m as getDurationMs, o as exportJwk, p as verifyKeyOwnership, s as fetchActorDocument, y as measureSignatureKeyFetch } from "./http-
|
|
3
|
+
import { I as name, L as version, c as fetchKey, f as validateCryptoKey, h as getFederationMetrics, m as getDurationMs, o as exportJwk, p as verifyKeyOwnership, s as fetchActorDocument, y as measureSignatureKeyFetch } from "./http-BY8PpQzP.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";
|
|
@@ -204,7 +204,7 @@ function normalizeContextReference(reference, baseUrl) {
|
|
|
204
204
|
/** @internal */
|
|
205
205
|
function isInvalidUrlTypeError(error) {
|
|
206
206
|
const code = error.code;
|
|
207
|
-
return error instanceof TypeError && (code === "ERR_INVALID_URL" || /^Invalid URL(?::|$)/.test(error.message) || / cannot be parsed as a URL\.?$/.test(error.message));
|
|
207
|
+
return error instanceof TypeError && (code === "ERR_INVALID_URL" || error.message === "Invalid URL string." || /^Invalid URL(?::|$)/.test(error.message) || / cannot be parsed as a URL\.?$/.test(error.message));
|
|
208
208
|
}
|
|
209
209
|
async function applyGraphAliasContext(state, context, documentLoader, remoteContextCache, baseUrl = null, processingContexts = /* @__PURE__ */ new Set()) {
|
|
210
210
|
if (context === null) return createGraphAliasContextState();
|
|
@@ -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-CTYio50W.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");
|
|
@@ -207,7 +207,7 @@ function normalizeContextReference(reference, baseUrl) {
|
|
|
207
207
|
/** @internal */
|
|
208
208
|
function isInvalidUrlTypeError(error) {
|
|
209
209
|
const code = error.code;
|
|
210
|
-
return error instanceof TypeError && (code === "ERR_INVALID_URL" || /^Invalid URL(?::|$)/.test(error.message) || / cannot be parsed as a URL\.?$/.test(error.message));
|
|
210
|
+
return error instanceof TypeError && (code === "ERR_INVALID_URL" || error.message === "Invalid URL string." || /^Invalid URL(?::|$)/.test(error.message) || / cannot be parsed as a URL\.?$/.test(error.message));
|
|
211
211
|
}
|
|
212
212
|
async function applyGraphAliasContext(state, context, documentLoader, remoteContextCache, baseUrl = null, processingContexts = /* @__PURE__ */ new Set()) {
|
|
213
213
|
if (context === null) return createGraphAliasContextState();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-
|
|
6
|
-
import { r as fetchKey, s as validateCryptoKey } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-DUgFsCmM.mjs";
|
|
5
|
+
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-QrVsKSG9.mjs";
|
|
6
|
+
import { r as fetchKey, s as validateCryptoKey } from "./key-BbuFo4CW.mjs";
|
|
7
7
|
import { n as preloadedOnlyDocumentLoader } from "./public-audience-jwoSIGUw.mjs";
|
|
8
8
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-HOAywiid.mjs";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|