@fedify/fedify 2.4.0-dev.2155 → 2.4.0-dev.2157
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-CxHALSwA.mjs → builder-CLaS4-yA.mjs} +2 -2
- package/dist/{client-DpnpgjyX.mjs → client-CEnNz8O7.mjs} +7 -3
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{compound-proof-nhrXTRQO.mjs → compound-proof-D7K94KPz.mjs} +2 -2
- package/dist/{context-OrnjnuMq.mjs → context-B2rlkkyJ.mjs} +1 -1
- package/dist/{deno-YLLbRq06.mjs → deno-D1gcWWqB.mjs} +1 -1
- package/dist/{dist-BQvArojP.mjs → dist-DJQM4u7i.mjs} +2 -1
- package/dist/docloader-BMqr3hji.mjs +79 -0
- 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 +4 -4
- package/dist/federation/handler.test.mjs +6 -6
- package/dist/federation/hashlink-media.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +187 -10
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/mq.test.mjs +98 -69
- package/dist/federation/outgoing-proof.test.mjs +5 -5
- package/dist/federation/portable-actor.test.mjs +3 -3
- package/dist/federation/portable-chain.test.mjs +3 -3
- package/dist/federation/portable-collection.test.mjs +4 -4
- package/dist/federation/portable-gateway-keys.test.mjs +4 -4
- package/dist/federation/portable-inbox.test.mjs +4 -4
- package/dist/federation/portable.test.mjs +3 -3
- package/dist/federation/send.test.mjs +84 -3
- package/dist/federation/tasks/enqueue.test.mjs +3 -3
- package/dist/federation/tasks/tasks.test.mjs +4 -4
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +2 -2
- package/dist/{federation-D9TufmIO.cjs → federation-2e8XrN7q.cjs} +19 -5
- package/dist/{http-eqYXHRkz.cjs → http-BObQoB0j.cjs} +7 -3
- package/dist/{http-CXnNbRe_.mjs → http-CGcLv8rh.mjs} +9 -5
- package/dist/{http-Dk4O3WM0.js → http-Dgtt45-K.js} +7 -3
- package/dist/{key-BZ-Z4uez.mjs → key-CPM4r6tP.mjs} +2 -2
- package/dist/{kv-cache-3uKc0G76.js → kv-cache-BweyIZTb.js} +35 -9
- package/dist/{kv-cache-DzClEalR.cjs → kv-cache-D2fnB8qu.cjs} +34 -8
- package/dist/{kv-cache-DZr8HTel.mjs → kv-cache-bdPqTR1k.mjs} +1 -1
- package/dist/{ld-Djxsq6JR.mjs → ld-lU_ZqzsQ.mjs} +4 -4
- package/dist/{metrics-CBHhbHgG.mjs → metrics-B41pRPfd.mjs} +1 -1
- package/dist/{middleware-BDUR99k3.js → middleware-BYWyYjmX.js} +19 -5
- package/dist/{middleware-BahNnLfD.mjs → middleware-TrCVULgs.mjs} +1 -1
- package/dist/{middleware-DDa8pCUa.mjs → middleware-xdukzV3x.mjs} +15 -15
- package/dist/{mod-CZetqT5h.d.ts → mod-DaiBrWDW.d.ts} +2 -0
- package/dist/{mod-D4g9ffEn.d.cts → mod-Mt4aO3DX.d.cts} +2 -0
- package/dist/mod.cjs +5 -5
- package/dist/mod.d.cts +1 -1
- package/dist/mod.d.ts +1 -1
- package/dist/mod.js +5 -5
- package/dist/nodeinfo/client.test.mjs +49 -1
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/nodeinfo/mod.cjs +1 -1
- package/dist/nodeinfo/mod.js +1 -1
- package/dist/{owner-OdWSE8am.mjs → owner-D63yPo_i.mjs} +3 -3
- package/dist/{portable-collection-wBWbuHOH.cjs → portable-collection-B8ojoQ50.cjs} +1 -1
- package/dist/{portable-collection-BCy06GiS.js → portable-collection-C3xEzYri.js} +1 -1
- package/dist/{portable-collection-DAV7Ho3m.mjs → portable-collection-_lZg-osX.mjs} +2 -2
- package/dist/{portable-key-BL6K88p2.mjs → portable-key-D8uWZF7b.mjs} +1 -1
- package/dist/{proof-vZ04IAjq.mjs → proof-C2YwD8a_.mjs} +4 -4
- package/dist/{send-ylV8KCLx.mjs → send-D9SGhxTB.mjs} +18 -4
- 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 +42 -2
- package/dist/sig/key.test.mjs +1 -1
- 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 +1 -1
- package/dist/sig/portable-collection.test.mjs +2 -2
- package/dist/sig/portable-key.test.mjs +6 -6
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/{tasks-dbCShlCb.mjs → tasks-IG3pHfvZ.mjs} +1 -1
- package/dist/{temporal-BTD4f_mZ.mjs → temporal-q6FSekcN.mjs} +1 -1
- package/dist/testing/context.test.mjs +1 -1
- package/dist/testing/kv.test.mjs +3 -3
- package/dist/testing/mod.mjs +4 -4
- package/dist/{testing-CKaJhcA0.mjs → testing-C1itIjqW.mjs} +3 -3
- package/dist/{types-C_cNlNVK.js → types-_S2_MeLF.js} +7 -3
- package/dist/{types-Be2zbyeG.cjs → types-poIao40f.cjs} +7 -3
- package/dist/utils/docloader.test.mjs +297 -2
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +1 -1
- package/dist/vocab/cjs.test.mjs +1 -1
- package/package.json +7 -7
- package/dist/docloader-vc-pSu9-.mjs +0 -53
|
@@ -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 { _ as recordKeyLookup, n as getDurationMs, t as classifyFetchError } from "./metrics-
|
|
4
|
+
import { n as version, t as name } from "./deno-D1gcWWqB.mjs";
|
|
5
|
+
import { _ as recordKeyLookup, n as getDurationMs, t as classifyFetchError } from "./metrics-B41pRPfd.mjs";
|
|
6
6
|
import { c as isPortableId, f as parseKeyIdString, o as isCompatibleKeyId, s as isPortableActorDocument, u as isPortableUri } from "./portable-key-id-Bg259c4Z.mjs";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
8
|
import { CryptographicKey, Multikey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { W as validateCryptoKey, nt as recordDocumentCache, t as doubleKnock } from "./http-
|
|
3
|
+
import { W as validateCryptoKey, nt as recordDocumentCache, t as doubleKnock } from "./http-Dgtt45-K.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
|
-
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
5
|
+
import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
6
6
|
import { curry } from "es-toolkit";
|
|
7
7
|
//#region src/utils/docloader.ts
|
|
8
8
|
const logger$1 = getLogger([
|
|
@@ -10,10 +10,13 @@ const logger$1 = getLogger([
|
|
|
10
10
|
"utils",
|
|
11
11
|
"docloader"
|
|
12
12
|
]);
|
|
13
|
+
const DEFAULT_MAX_REDIRECTION = 20;
|
|
13
14
|
/**
|
|
14
15
|
* Gets an authenticated {@link DocumentLoader} for the given identity.
|
|
15
16
|
* Note that an authenticated document loader intentionally does not cache
|
|
16
17
|
* the fetched documents.
|
|
18
|
+
* At most 20 HTTP redirects and alternate document links are followed in total
|
|
19
|
+
* per call. Revisiting a URL within that chain throws a {@link FetchError}.
|
|
17
20
|
* @param identity The identity to get the document loader for.
|
|
18
21
|
* The actor's key pair.
|
|
19
22
|
* @param options The options for the document loader.
|
|
@@ -23,29 +26,52 @@ const logger$1 = getLogger([
|
|
|
23
26
|
*/
|
|
24
27
|
function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, maxRedirection, userAgent, specDeterminer, tracerProvider } = {}) {
|
|
25
28
|
validateCryptoKey(identity.privateKey);
|
|
26
|
-
async function load(url, options) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
async function load(url, options, redirected = 0, visited = /* @__PURE__ */ new Set()) {
|
|
30
|
+
options?.signal?.throwIfAborted();
|
|
31
|
+
let currentUrl = new URL(url).href;
|
|
32
|
+
await validateUrl(currentUrl, options);
|
|
33
|
+
visited.add(currentUrl);
|
|
34
|
+
const originalRequest = createActivityPubRequest(currentUrl, { userAgent });
|
|
35
|
+
function follow(nextUrl) {
|
|
36
|
+
options?.signal?.throwIfAborted();
|
|
37
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new FetchError(currentUrl, `Too many redirections (${redirected + 1})`);
|
|
38
|
+
if (visited.has(nextUrl)) throw new FetchError(currentUrl, `Redirect loop detected: ${nextUrl}`);
|
|
39
|
+
redirected++;
|
|
40
|
+
}
|
|
41
|
+
const response = await doubleKnock(originalRequest, identity, {
|
|
29
42
|
maxRedirection,
|
|
30
43
|
specDeterminer,
|
|
31
44
|
log: curry(logRequest)(logger$1),
|
|
32
45
|
tracerProvider,
|
|
33
46
|
signal: options?.signal,
|
|
34
|
-
validateRedirect: (
|
|
35
|
-
|
|
47
|
+
validateRedirect: async (nextUrl) => {
|
|
48
|
+
follow(nextUrl);
|
|
49
|
+
await validateUrl(nextUrl, options);
|
|
50
|
+
visited.add(nextUrl);
|
|
51
|
+
currentUrl = nextUrl;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return getRemoteDocument(currentUrl, response, (alternateUrl) => {
|
|
55
|
+
follow(alternateUrl);
|
|
56
|
+
return load(alternateUrl, options, redirected, visited);
|
|
57
|
+
}, options);
|
|
36
58
|
}
|
|
37
59
|
async function validateUrl(url, options) {
|
|
38
60
|
if (!allowPrivateAddress) try {
|
|
39
61
|
await validatePublicUrl(url);
|
|
40
62
|
} catch (error) {
|
|
41
|
-
if (error instanceof UrlError)
|
|
63
|
+
if (error instanceof UrlError) if (error.reason === "dns") logger$1.debug("DNS lookup failed for {url}", {
|
|
64
|
+
url,
|
|
65
|
+
error
|
|
66
|
+
});
|
|
67
|
+
else logger$1[options?.suppressError ? "warn" : "error"]("Disallowed private URL: {url}", {
|
|
42
68
|
url,
|
|
43
69
|
error
|
|
44
70
|
});
|
|
45
71
|
throw error;
|
|
46
72
|
}
|
|
47
73
|
}
|
|
48
|
-
return load;
|
|
74
|
+
return (url, options) => load(url, options);
|
|
49
75
|
}
|
|
50
76
|
//#endregion
|
|
51
77
|
//#region src/utils/kv-cache.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
|
-
const require_http = require("./http-
|
|
2
|
+
const require_http = require("./http-BObQoB0j.cjs");
|
|
3
3
|
let _logtape_logtape = require("@logtape/logtape");
|
|
4
4
|
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
5
5
|
let es_toolkit = require("es-toolkit");
|
|
@@ -9,10 +9,13 @@ const logger$1 = (0, _logtape_logtape.getLogger)([
|
|
|
9
9
|
"utils",
|
|
10
10
|
"docloader"
|
|
11
11
|
]);
|
|
12
|
+
const DEFAULT_MAX_REDIRECTION = 20;
|
|
12
13
|
/**
|
|
13
14
|
* Gets an authenticated {@link DocumentLoader} for the given identity.
|
|
14
15
|
* Note that an authenticated document loader intentionally does not cache
|
|
15
16
|
* the fetched documents.
|
|
17
|
+
* At most 20 HTTP redirects and alternate document links are followed in total
|
|
18
|
+
* per call. Revisiting a URL within that chain throws a {@link FetchError}.
|
|
16
19
|
* @param identity The identity to get the document loader for.
|
|
17
20
|
* The actor's key pair.
|
|
18
21
|
* @param options The options for the document loader.
|
|
@@ -22,29 +25,52 @@ const logger$1 = (0, _logtape_logtape.getLogger)([
|
|
|
22
25
|
*/
|
|
23
26
|
function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, maxRedirection, userAgent, specDeterminer, tracerProvider } = {}) {
|
|
24
27
|
require_http.validateCryptoKey(identity.privateKey);
|
|
25
|
-
async function load(url, options) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
async function load(url, options, redirected = 0, visited = /* @__PURE__ */ new Set()) {
|
|
29
|
+
options?.signal?.throwIfAborted();
|
|
30
|
+
let currentUrl = new URL(url).href;
|
|
31
|
+
await validateUrl(currentUrl, options);
|
|
32
|
+
visited.add(currentUrl);
|
|
33
|
+
const originalRequest = (0, _fedify_vocab_runtime.createActivityPubRequest)(currentUrl, { userAgent });
|
|
34
|
+
function follow(nextUrl) {
|
|
35
|
+
options?.signal?.throwIfAborted();
|
|
36
|
+
if (redirected >= DEFAULT_MAX_REDIRECTION) throw new _fedify_vocab_runtime.FetchError(currentUrl, `Too many redirections (${redirected + 1})`);
|
|
37
|
+
if (visited.has(nextUrl)) throw new _fedify_vocab_runtime.FetchError(currentUrl, `Redirect loop detected: ${nextUrl}`);
|
|
38
|
+
redirected++;
|
|
39
|
+
}
|
|
40
|
+
const response = await require_http.doubleKnock(originalRequest, identity, {
|
|
28
41
|
maxRedirection,
|
|
29
42
|
specDeterminer,
|
|
30
43
|
log: (0, es_toolkit.curry)(_fedify_vocab_runtime.logRequest)(logger$1),
|
|
31
44
|
tracerProvider,
|
|
32
45
|
signal: options?.signal,
|
|
33
|
-
validateRedirect: (
|
|
34
|
-
|
|
46
|
+
validateRedirect: async (nextUrl) => {
|
|
47
|
+
follow(nextUrl);
|
|
48
|
+
await validateUrl(nextUrl, options);
|
|
49
|
+
visited.add(nextUrl);
|
|
50
|
+
currentUrl = nextUrl;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return (0, _fedify_vocab_runtime.getRemoteDocument)(currentUrl, response, (alternateUrl) => {
|
|
54
|
+
follow(alternateUrl);
|
|
55
|
+
return load(alternateUrl, options, redirected, visited);
|
|
56
|
+
}, options);
|
|
35
57
|
}
|
|
36
58
|
async function validateUrl(url, options) {
|
|
37
59
|
if (!allowPrivateAddress) try {
|
|
38
60
|
await (0, _fedify_vocab_runtime.validatePublicUrl)(url);
|
|
39
61
|
} catch (error) {
|
|
40
|
-
if (error instanceof _fedify_vocab_runtime.UrlError)
|
|
62
|
+
if (error instanceof _fedify_vocab_runtime.UrlError) if (error.reason === "dns") logger$1.debug("DNS lookup failed for {url}", {
|
|
63
|
+
url,
|
|
64
|
+
error
|
|
65
|
+
});
|
|
66
|
+
else logger$1[options?.suppressError ? "warn" : "error"]("Disallowed private URL: {url}", {
|
|
41
67
|
url,
|
|
42
68
|
error
|
|
43
69
|
});
|
|
44
70
|
throw error;
|
|
45
71
|
}
|
|
46
72
|
}
|
|
47
|
-
return load;
|
|
73
|
+
return (url, options) => load(url, options);
|
|
48
74
|
}
|
|
49
75
|
//#endregion
|
|
50
76
|
//#region src/utils/kv-cache.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { p as recordDocumentCache } from "./metrics-
|
|
4
|
+
import { p as recordDocumentCache } from "./metrics-B41pRPfd.mjs";
|
|
5
5
|
import { getLogger } from "@logtape/logtape";
|
|
6
6
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
7
7
|
//#region src/utils/kv-cache.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-
|
|
6
|
-
import { c as validateCryptoKey, i as fetchKey, t as bypassKeyCacheReads } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-D1gcWWqB.mjs";
|
|
5
|
+
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-B41pRPfd.mjs";
|
|
6
|
+
import { c as validateCryptoKey, i as fetchKey, t as bypassKeyCacheReads } from "./key-CPM4r6tP.mjs";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
8
|
import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -206,7 +206,7 @@ function normalizeContextReference(reference, baseUrl) {
|
|
|
206
206
|
/** @internal */
|
|
207
207
|
function isInvalidUrlTypeError(error) {
|
|
208
208
|
const code = error.code;
|
|
209
|
-
return error instanceof TypeError && (code === "ERR_INVALID_URL" || /^Invalid URL(?::|$)/.test(error.message) || / cannot be parsed as a URL\.?$/.test(error.message));
|
|
209
|
+
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));
|
|
210
210
|
}
|
|
211
211
|
async function applyGraphAliasContext(state, context, documentLoader, remoteContextCache, baseUrl = null, processingContexts = /* @__PURE__ */ new Set()) {
|
|
212
212
|
if (context === null) return createGraphAliasContextState();
|
|
@@ -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-D1gcWWqB.mjs";
|
|
5
5
|
import { metrics } from "@opentelemetry/api";
|
|
6
6
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
7
7
|
//#region src/federation/metrics.ts
|
|
@@ -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 recordCollectionPageItems, A as hasSignatureLike, C as assertSafeJsonLd, D as detachSignature, J as getRemoteHost, K as getDurationMs, L as wrapContextLoaderForJsonLd, M as isInvalidUrlTypeError, N as signJsonLd, O as getNormalizationContextLoader, P as verifyCompactJsonLd, Q as recordCollectionDispatchDuration, R as exportJwk, S as InvalidContextReferenceError, St as isPortableUri, T as compactJsonLd, Tt as version, U as importJwk, W as validateCryptoKey, X as isAbortError, Y as instrumentDocumentLoader, Z as recordCircuitBreakerStateChange, _ as verifyPortableObjectProof, _t as getRawCanonicalPortableId, at as recordOutboxActivity, bt as isPortableId, ct as registerQueueDepthGauge, d as classifyFep2277CoreType, et as recordCollectionRequest, g as verifyObject, gt as getPortableDid, h as verifyMapLocalProof, ht as getGatewayKeyBase, i as selectRequestSignature, it as recordInboxActivity, j as isClearlyMalformedContextReference, k as hasSignature, lt as preloadedOnlyDocumentLoader, m as signObject, mt as getCanonicalPortableId, n as listRequestSignatures, o as verifyRequest, ot as recordOutboxEnqueue, p as hasProofLike, q as getFederationMetrics, r as parseRfc9421SignatureInput, rt as recordFanoutRecipients, s as verifyRequestDetailed, st as recordWebFingerHandle, t as doubleKnock, tt as recordCollectionTotalItems, u as InvalidPortableObjectIdError, ut as formatAcceptSignature, v as verifyPortableObjectProofPolicy, vt as hasPortableActor, wt as name, x as normalizeOutgoingActivityJsonLd, xt as isPortableKeyId, y as verifyPortableObjectProofWithRoot, yt as isCompatibleKeyId } from "./http-
|
|
6
|
-
import { a as MAX_BODY_SIZE, i as BodyTooLargeError, n as getNodeInfo, o as readBoundedText, t as nodeInfoToJson } from "./types-
|
|
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-
|
|
5
|
+
import { $ as recordCollectionPageItems, A as hasSignatureLike, C as assertSafeJsonLd, D as detachSignature, J as getRemoteHost, K as getDurationMs, L as wrapContextLoaderForJsonLd, M as isInvalidUrlTypeError, N as signJsonLd, O as getNormalizationContextLoader, P as verifyCompactJsonLd, Q as recordCollectionDispatchDuration, R as exportJwk, S as InvalidContextReferenceError, St as isPortableUri, T as compactJsonLd, Tt as version, U as importJwk, W as validateCryptoKey, X as isAbortError, Y as instrumentDocumentLoader, Z as recordCircuitBreakerStateChange, _ as verifyPortableObjectProof, _t as getRawCanonicalPortableId, at as recordOutboxActivity, bt as isPortableId, ct as registerQueueDepthGauge, d as classifyFep2277CoreType, et as recordCollectionRequest, g as verifyObject, gt as getPortableDid, h as verifyMapLocalProof, ht as getGatewayKeyBase, i as selectRequestSignature, it as recordInboxActivity, j as isClearlyMalformedContextReference, k as hasSignature, lt as preloadedOnlyDocumentLoader, m as signObject, mt as getCanonicalPortableId, n as listRequestSignatures, o as verifyRequest, ot as recordOutboxEnqueue, p as hasProofLike, q as getFederationMetrics, r as parseRfc9421SignatureInput, rt as recordFanoutRecipients, s as verifyRequestDetailed, st as recordWebFingerHandle, t as doubleKnock, tt as recordCollectionTotalItems, u as InvalidPortableObjectIdError, ut as formatAcceptSignature, v as verifyPortableObjectProofPolicy, vt as hasPortableActor, wt as name, x as normalizeOutgoingActivityJsonLd, xt as isPortableKeyId, y as verifyPortableObjectProofWithRoot, yt as isCompatibleKeyId } from "./http-Dgtt45-K.js";
|
|
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-C3xEzYri.js";
|
|
8
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BweyIZTb.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, Tombstone, getTypeId, isActor, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
@@ -3013,6 +3013,15 @@ async function sendActivityInternal({ activity, activityId, activityType, keys,
|
|
|
3013
3013
|
if (!allowPrivateAddress) try {
|
|
3014
3014
|
await validatePublicUrl(url);
|
|
3015
3015
|
} catch (error) {
|
|
3016
|
+
if (error instanceof UrlError && error.reason === "dns") {
|
|
3017
|
+
logger.error("DNS resolution failed for URL: {url}", {
|
|
3018
|
+
url,
|
|
3019
|
+
error
|
|
3020
|
+
});
|
|
3021
|
+
const failure = new FetchError(url, error.message);
|
|
3022
|
+
failure.cause = error;
|
|
3023
|
+
throw failure;
|
|
3024
|
+
}
|
|
3016
3025
|
if (error instanceof UrlError) logger.error("Disallowed private URL: {url}", {
|
|
3017
3026
|
url,
|
|
3018
3027
|
error
|
|
@@ -3020,7 +3029,12 @@ async function sendActivityInternal({ activity, activityId, activityType, keys,
|
|
|
3020
3029
|
throw error;
|
|
3021
3030
|
}
|
|
3022
3031
|
}
|
|
3023
|
-
|
|
3032
|
+
try {
|
|
3033
|
+
await validateUrl(inbox.href);
|
|
3034
|
+
} catch (error) {
|
|
3035
|
+
if (error instanceof FetchError) federationMetrics.recordDelivery(inbox, getDurationMs(started), false, activityType);
|
|
3036
|
+
throw error;
|
|
3037
|
+
}
|
|
3024
3038
|
headers = new Headers(headers);
|
|
3025
3039
|
headers.set("Content-Type", "application/activity+json");
|
|
3026
3040
|
const request = new Request(inbox, {
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { 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-D1gcWWqB.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-B41pRPfd.mjs";
|
|
6
6
|
import { t as formatAcceptSignature } from "./accept-CPVqki78.mjs";
|
|
7
7
|
import { a as hasPortableActor, c as isPortableId, l as isPortableKeyId, n as getGatewayKeyBase, o as isCompatibleKeyId, r as getPortableDid, t as getCanonicalPortableId, u as isPortableUri } from "./portable-key-id-Bg259c4Z.mjs";
|
|
8
|
-
import { c as validateCryptoKey, n as exportJwk, s as importJwk } from "./key-
|
|
8
|
+
import { c as validateCryptoKey, n as exportJwk, s as importJwk } from "./key-CPM4r6tP.mjs";
|
|
9
9
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
|
|
10
|
-
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-
|
|
11
|
-
import { a as signObject, c as verifyPortableObjectProof, i as hasProofLike, s as verifyObject, t as InvalidPortableObjectIdError, u as verifyPortableObjectProofWithRoot } from "./proof-
|
|
12
|
-
import { a as listRequestSignatures, c as selectRequestSignature, d as verifyRequest, f as verifyRequestDetailed, s as parseRfc9421SignatureInput } from "./http-
|
|
13
|
-
import { t as getAuthenticatedDocumentLoader } from "./docloader-
|
|
14
|
-
import { n as kvCache } from "./kv-cache-
|
|
15
|
-
import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-
|
|
10
|
+
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-lU_ZqzsQ.mjs";
|
|
11
|
+
import { a as signObject, c as verifyPortableObjectProof, i as hasProofLike, s as verifyObject, t as InvalidPortableObjectIdError, u as verifyPortableObjectProofWithRoot } from "./proof-C2YwD8a_.mjs";
|
|
12
|
+
import { a as listRequestSignatures, c as selectRequestSignature, d as verifyRequest, f as verifyRequestDetailed, s as parseRfc9421SignatureInput } from "./http-CGcLv8rh.mjs";
|
|
13
|
+
import { t as getAuthenticatedDocumentLoader } from "./docloader-BMqr3hji.mjs";
|
|
14
|
+
import { n as kvCache } from "./kv-cache-bdPqTR1k.mjs";
|
|
15
|
+
import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-CEnNz8O7.mjs";
|
|
16
16
|
import { t as nodeInfoToJson } from "./types-DE_LV1JB.mjs";
|
|
17
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-
|
|
18
|
-
import { t as verifyPortableObject } from "./portable-collection-
|
|
19
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-
|
|
20
|
-
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-
|
|
17
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-D63yPo_i.mjs";
|
|
18
|
+
import { t as verifyPortableObject } from "./portable-collection-_lZg-osX.mjs";
|
|
19
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-D9SGhxTB.mjs";
|
|
20
|
+
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-CLaS4-yA.mjs";
|
|
21
21
|
import { t as CircuitBreaker } from "./circuit-breaker-C5NqoLBJ.mjs";
|
|
22
22
|
import { t as buildCollectionSynchronizationHeader } from "./collection-CnnP1UAv.mjs";
|
|
23
|
-
import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, s as verifyServedPortableObjects, t as containsCompoundPortableObject } from "./compound-proof-
|
|
23
|
+
import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, s as verifyServedPortableObjects, t as containsCompoundPortableObject } from "./compound-proof-D7K94KPz.mjs";
|
|
24
24
|
import { t as KvKeyCache } from "./keycache-BInaECGj.mjs";
|
|
25
25
|
import { t as acceptsJsonLd } from "./negotiation-CCocWT_N.mjs";
|
|
26
|
-
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-
|
|
26
|
+
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-q6FSekcN.mjs";
|
|
27
27
|
import { t as createExponentialBackoffPolicy } from "./retry-zX5xw5e0.mjs";
|
|
28
28
|
import { t as TaskCodec } from "./codec-C6rTrpIp.mjs";
|
|
29
29
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
@@ -31,6 +31,8 @@ interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOpt
|
|
|
31
31
|
* Gets an authenticated {@link DocumentLoader} for the given identity.
|
|
32
32
|
* Note that an authenticated document loader intentionally does not cache
|
|
33
33
|
* the fetched documents.
|
|
34
|
+
* At most 20 HTTP redirects and alternate document links are followed in total
|
|
35
|
+
* per call. Revisiting a URL within that chain throws a {@link FetchError}.
|
|
34
36
|
* @param identity The identity to get the document loader for.
|
|
35
37
|
* The actor's key pair.
|
|
36
38
|
* @param options The options for the document loader.
|
|
@@ -31,6 +31,8 @@ interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOpt
|
|
|
31
31
|
* Gets an authenticated {@link DocumentLoader} for the given identity.
|
|
32
32
|
* Note that an authenticated document loader intentionally does not cache
|
|
33
33
|
* the fetched documents.
|
|
34
|
+
* At most 20 HTTP redirects and alternate document links are followed in total
|
|
35
|
+
* per call. Revisiting a URL within that chain throws a {@link FetchError}.
|
|
34
36
|
* @param identity The identity to get the document loader for.
|
|
35
37
|
* The actor's key pair.
|
|
36
38
|
* @param options The options for the document loader.
|
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-
|
|
8
|
-
const require_types = require("./types-
|
|
9
|
-
const require_portable_collection = require("./portable-collection-
|
|
10
|
-
const require_kv_cache = require("./kv-cache-
|
|
6
|
+
const require_http = require("./http-BObQoB0j.cjs");
|
|
7
|
+
const require_federation = require("./federation-2e8XrN7q.cjs");
|
|
8
|
+
const require_types = require("./types-poIao40f.cjs");
|
|
9
|
+
const require_portable_collection = require("./portable-collection-B8ojoQ50.cjs");
|
|
10
|
+
const require_kv_cache = require("./kv-cache-D2fnB8qu.cjs");
|
|
11
11
|
require("./nodeinfo/mod.cjs");
|
|
12
12
|
require("./runtime/mod.cjs");
|
|
13
13
|
require("./sig/mod.cjs");
|
package/dist/mod.d.cts
CHANGED
|
@@ -7,7 +7,7 @@ import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreL
|
|
|
7
7
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
|
|
8
8
|
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-Decmur1U.cjs";
|
|
9
9
|
import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "./mod-S--JxYjo.cjs";
|
|
10
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-Mt4aO3DX.cjs";
|
|
11
11
|
export * from "@fedify/vocab-runtime";
|
|
12
12
|
|
|
13
13
|
//#region src/mod.d.ts
|
package/dist/mod.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreL
|
|
|
7
7
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
|
|
8
8
|
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-CnGtADvO.js";
|
|
9
9
|
import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "./mod-Bz9tFXI2.js";
|
|
10
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-DaiBrWDW.js";
|
|
11
11
|
export * from "@fedify/vocab-runtime";
|
|
12
12
|
|
|
13
13
|
//#region src/mod.d.ts
|
package/dist/mod.js
CHANGED
|
@@ -3,11 +3,11 @@ import { URLPattern } from "urlpattern-polyfill";
|
|
|
3
3
|
import "./rolldown-runtime-BC-Eo5Mj.js";
|
|
4
4
|
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-DAtXl_Kc.js";
|
|
5
5
|
import "./compat/mod.js";
|
|
6
|
-
import { A as hasSignatureLike, B as fetchKey, D as detachSignature, E as createSignature, F as verifyJsonLd, H as generateCryptoKeyPair, I as verifySignature, N as signJsonLd, R as exportJwk, U as importJwk, V as fetchKeyDetailed, _ as verifyPortableObjectProof, a as signRequest, b as verifyProof, dt as fulfillAcceptSignature, f as createProof, ft as parseAcceptSignature, g as verifyObject, m as signObject, o as verifyRequest, p as hasProofLike, pt as validateAcceptSignature, s as verifyRequestDetailed, ut as formatAcceptSignature, w as attachSignature } 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-
|
|
8
|
-
import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-
|
|
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-
|
|
6
|
+
import { A as hasSignatureLike, B as fetchKey, D as detachSignature, E as createSignature, F as verifyJsonLd, H as generateCryptoKeyPair, I as verifySignature, N as signJsonLd, R as exportJwk, U as importJwk, V as fetchKeyDetailed, _ as verifyPortableObjectProof, a as signRequest, b as verifyProof, dt as fulfillAcceptSignature, f as createProof, ft as parseAcceptSignature, g as verifyObject, m as signObject, o as verifyRequest, p as hasProofLike, pt as validateAcceptSignature, s as verifyRequestDetailed, ut as formatAcceptSignature, w as attachSignature } from "./http-Dgtt45-K.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-BYWyYjmX.js";
|
|
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-C3xEzYri.js";
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BweyIZTb.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-BHXXx4Wx.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
|
+
import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
6
7
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
|
-
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-
|
|
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-CEnNz8O7.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 "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-B2rlkkyJ.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
7
|
import "../std__assert-DvMDRPes.mjs";
|
|
8
|
-
import { C as handleNodeInfo, o as createFederation, w as handleNodeInfoJrd } from "../middleware-
|
|
8
|
+
import { C as handleNodeInfo, o as createFederation, w as handleNodeInfoJrd } from "../middleware-xdukzV3x.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,6 +1,6 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_types = require("../types-
|
|
3
|
+
const require_types = require("../types-poIao40f.cjs");
|
|
4
4
|
exports.getNodeInfo = require_types.getNodeInfo;
|
|
5
5
|
exports.nodeInfoToJson = require_types.nodeInfoToJson;
|
|
6
6
|
exports.parseNodeInfo = require_types.parseNodeInfo;
|
package/dist/nodeinfo/mod.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Temporal } from "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-_S2_MeLF.js";
|
|
4
4
|
export { getNodeInfo, nodeInfoToJson, parseNodeInfo };
|
|
@@ -1,10 +1,10 @@
|
|
|
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-D1gcWWqB.mjs";
|
|
5
5
|
import { c as isPortableId, d as isSamePublicKey$1, o as isCompatibleKeyId, t as getCanonicalPortableId, u as isPortableUri } from "./portable-key-id-Bg259c4Z.mjs";
|
|
6
|
-
import { l as verifyKeyOwnership, n as exportJwk, r as fetchActorDocument } from "./key-
|
|
7
|
-
import { n as resolvePortableActorKey, t as fetchPortableGatewayKey } from "./portable-key-
|
|
6
|
+
import { l as verifyKeyOwnership, n as exportJwk, r as fetchActorDocument } from "./key-CPM4r6tP.mjs";
|
|
7
|
+
import { n as resolvePortableActorKey, t as fetchPortableGatewayKey } from "./portable-key-D8uWZF7b.mjs";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
10
10
|
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-BObQoB0j.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 { Ct as isSamePublicKey$1, G as verifyKeyOwnership, R as exportJwk, St as isPortableUri, Tt as version, _ as verifyPortableObjectProof, bt as isPortableId, c as fetchPortableGatewayKey, l as resolvePortableActorKey, mt as getCanonicalPortableId, wt as name, y as verifyPortableObjectProofWithRoot, yt as isCompatibleKeyId, z as fetchActorDocument } from "./http-
|
|
3
|
+
import { Ct as isSamePublicKey$1, G as verifyKeyOwnership, R as exportJwk, St as isPortableUri, Tt as version, _ as verifyPortableObjectProof, bt as isPortableId, c as fetchPortableGatewayKey, l as resolvePortableActorKey, mt as getCanonicalPortableId, wt as name, y as verifyPortableObjectProofWithRoot, yt as isCompatibleKeyId, z as fetchActorDocument } from "./http-Dgtt45-K.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { CollectionPage, CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
6
6
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { c as verifyPortableObjectProof, u as verifyPortableObjectProofWithRoot } from "./proof-
|
|
4
|
+
import { n as version, t as name } from "./deno-D1gcWWqB.mjs";
|
|
5
|
+
import { c as verifyPortableObjectProof, u as verifyPortableObjectProofWithRoot } from "./proof-C2YwD8a_.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 { d as isSamePublicKey, i as getRawCanonicalPortableId, s as isPortableActorDocument, t as getCanonicalPortableId, u as isPortableUri } from "./portable-key-id-Bg259c4Z.mjs";
|
|
5
|
-
import { u as verifyPortableObjectProofWithRoot } from "./proof-
|
|
5
|
+
import { u as verifyPortableObjectProofWithRoot } from "./proof-C2YwD8a_.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";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-
|
|
4
|
+
import { n as version, t as name } from "./deno-D1gcWWqB.mjs";
|
|
5
|
+
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-B41pRPfd.mjs";
|
|
6
6
|
import { c as isPortableId, r as getPortableDid } from "./portable-key-id-Bg259c4Z.mjs";
|
|
7
|
-
import { c as validateCryptoKey, i as fetchKey, t as bypassKeyCacheReads } from "./key-
|
|
7
|
+
import { c as validateCryptoKey, i as fetchKey, t as bypassKeyCacheReads } from "./key-CPM4r6tP.mjs";
|
|
8
8
|
import { n as preloadedOnlyDocumentLoader } from "./public-audience--klBIOk1.mjs";
|
|
9
9
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
|
|
10
|
-
import { c as getNormalizationContextLoader } from "./ld-
|
|
10
|
+
import { c as getNormalizationContextLoader } from "./ld-lU_ZqzsQ.mjs";
|
|
11
11
|
import { getLogger } from "@logtape/logtape";
|
|
12
12
|
import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
|
|
13
13
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|