@fedify/fedify 1.6.1-dev.881 → 1.6.1-dev.883
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/{actor-BidJp8n0.js → actor-CwAL6Q82.js} +179 -179
- package/dist/{actor-BRIxlOTx.js → actor-DezwbbQX.js} +3 -3
- package/dist/{authdocloader-CG3GTtW2.js → authdocloader-C-_Lr-KH.js} +3 -3
- package/dist/{authdocloader-BRs7flug.js → authdocloader-Df1y1MKv.js} +3 -3
- package/dist/{builder-DtoRVfyu.js → builder-C8tsk_Xe.js} +3 -3
- package/dist/{client-CQ24CTCb.js → client-CwjvB-Dh.js} +1 -1
- package/dist/compat/transformers.test.js +17 -17
- package/dist/{context-Dub61h2m.js → context-DfToVZY6.js} +2 -2
- package/dist/{docloader-CjMOaZ0w.js → docloader-BFRgyDAa.js} +1 -2
- package/dist/{docloader-BzbamfL0.js → docloader-BXc5egq6.js} +1 -2
- package/dist/federation/builder.test.js +4 -4
- package/dist/federation/handler.test.js +19 -19
- package/dist/federation/inbox.test.js +3 -3
- package/dist/federation/keycache.test.js +3 -3
- package/dist/federation/middleware.test.js +18 -18
- package/dist/federation/mod.js +10 -10
- package/dist/federation/mq.test.js +1 -1
- package/dist/federation/send.test.js +9 -9
- package/dist/{http-B3Xedrzu.js → http-3CJyDlPz.js} +3 -3
- package/dist/{http-CV67UidJ.js → http-DC3mY9EG.js} +3 -3
- package/dist/{inbox-BoldQCGa.js → inbox-CCbuuUqY.js} +2 -2
- package/dist/{key-Dt894e0l.js → key-CD8i4ZB_.js} +2 -2
- package/dist/{key-zqk3iQJM.js → key-Ce8aGBE5.js} +5 -5
- package/dist/{key-D3Mc3n0F.js → key-D0WW7EHK.js} +3 -3
- package/dist/{key-DD4k9Ph4.js → key-Y8a6dgOq.js} +4 -4
- package/dist/{keycache-DXp-3NZn.js → keycache-BtADunPo.js} +1 -1
- package/dist/{keys-j3LZyq_M.js → keys-BIY57kjo.js} +1 -1
- package/dist/{ld-BJz01zAZ.js → ld-D4G5WL1G.js} +3 -3
- package/dist/{lookup-DTOPcLsZ.js → lookup-C8V37GPa.js} +1 -1
- package/dist/{lookup-dfyiwjbB.js → lookup-CQnVHXIh.js} +3 -3
- package/dist/{lookup-CNv4GGs7.js → lookup-Ds1_3qy2.js} +1 -1
- package/dist/middleware-DPuaf71I.js +17 -0
- package/dist/{middleware-BXqSM2dw.js → middleware-DRpRVwO7.js} +15 -15
- package/dist/{middleware-DB7wiPiW.js → middleware-Jvf6WsMN.js} +10 -10
- package/dist/middleware-XHndzOUD.js +33 -0
- package/dist/mod.js +10 -10
- package/dist/nodeinfo/client.test.js +15 -28
- package/dist/nodeinfo/handler.test.js +18 -18
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/{owner-DPR9iegf.js → owner-Dyk0zd-q.js} +3 -3
- package/dist/{proof-CIdBQp8W.js → proof-B8Hm2M5c.js} +3 -3
- package/dist/{proof-DozAJu8u.js → proof-D-CWdNQx.js} +3 -3
- package/dist/runtime/authdocloader.test.js +8 -8
- package/dist/runtime/docloader.test.js +61 -58
- package/dist/runtime/key.test.js +5 -5
- package/dist/runtime/mod.js +6 -6
- package/dist/{send-ZuWTBaWD.js → send-CJXTH3ST.js} +2 -2
- package/dist/sig/http.test.js +44 -39
- package/dist/sig/key.test.js +6 -6
- package/dist/sig/ld.test.js +7 -7
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +8 -8
- package/dist/sig/proof.test.js +7 -7
- package/dist/{types-BkYhmwmv.js → types-D3XNqpGz.js} +1 -1
- package/dist/vocab/actor.test.js +28 -17
- package/dist/vocab/lookup.test.js +4 -4
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +2 -2
- package/dist/vocab/vocab.test.js +3 -3
- package/dist/{vocab-CKuJcawO.js → vocab-CPrCb9BR.js} +3 -3
- package/dist/{vocab-D0LMe9FE.js → vocab-CaZSjoCB.js} +178 -178
- package/dist/webfinger/handler.test.js +18 -18
- package/dist/webfinger/lookup.test.js +33 -38
- package/dist/webfinger/mod.js +2 -2
- package/package.json +1 -2
- package/dist/hongminhee__deno-mock-fetch-Az7fJGtg.js +0 -188
- package/dist/middleware-HBJtiy_q.js +0 -17
- package/dist/middleware-ORyJDzKn.js +0 -33
- /package/dist/{denokv-iB_ggPGm.js → denokv-B_GFWjrl.js} +0 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
|
5
|
+
import "./transformers-ghwJuzGY.js";
|
6
|
+
import "./docloader-BFRgyDAa.js";
|
7
|
+
import "./actor-CwAL6Q82.js";
|
8
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-Jvf6WsMN.js";
|
9
|
+
import "./lookup-C8V37GPa.js";
|
10
|
+
import "./key-CD8i4ZB_.js";
|
11
|
+
import "./http-DC3mY9EG.js";
|
12
|
+
import "./proof-D-CWdNQx.js";
|
13
|
+
import "./types-D3XNqpGz.js";
|
14
|
+
import "./authdocloader-Df1y1MKv.js";
|
15
|
+
import "./vocab-CPrCb9BR.js";
|
16
|
+
|
17
|
+
export { FederationImpl };
|
@@ -3,26 +3,26 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { deno_default, getDocumentLoader, kvCache } from "./docloader-
|
7
|
-
import { getNodeInfo } from "./client-
|
6
|
+
import { deno_default, getDocumentLoader, kvCache } from "./docloader-BXc5egq6.js";
|
7
|
+
import { getNodeInfo } from "./client-CwjvB-Dh.js";
|
8
8
|
import { RouterError } from "./router-D_aVZZUc.js";
|
9
9
|
import { nodeInfoToJson } from "./types-CqoqWDkp.js";
|
10
|
-
import { Activity, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage } from "./vocab-
|
11
|
-
import { lookupWebFinger } from "./lookup-
|
10
|
+
import { Activity, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage } from "./vocab-CaZSjoCB.js";
|
11
|
+
import { lookupWebFinger } from "./lookup-Ds1_3qy2.js";
|
12
12
|
import { getTypeId } from "./type-D2s5lmbZ.js";
|
13
|
-
import { exportJwk, importJwk, validateCryptoKey } from "./key-
|
14
|
-
import { verifyRequest } from "./http-
|
15
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader-
|
16
|
-
import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-
|
17
|
-
import { doesActorOwnKey, getKeyOwner } from "./owner-
|
18
|
-
import { signObject, verifyObject } from "./proof-
|
19
|
-
import { lookupObject, traverseCollection } from "./lookup-
|
20
|
-
import { routeActivity } from "./inbox-
|
21
|
-
import { FederationBuilderImpl } from "./builder-
|
13
|
+
import { exportJwk, importJwk, validateCryptoKey } from "./key-D0WW7EHK.js";
|
14
|
+
import { verifyRequest } from "./http-3CJyDlPz.js";
|
15
|
+
import { getAuthenticatedDocumentLoader } from "./authdocloader-C-_Lr-KH.js";
|
16
|
+
import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-D4G5WL1G.js";
|
17
|
+
import { doesActorOwnKey, getKeyOwner } from "./owner-Dyk0zd-q.js";
|
18
|
+
import { signObject, verifyObject } from "./proof-B8Hm2M5c.js";
|
19
|
+
import { lookupObject, traverseCollection } from "./lookup-CQnVHXIh.js";
|
20
|
+
import { routeActivity } from "./inbox-CCbuuUqY.js";
|
21
|
+
import { FederationBuilderImpl } from "./builder-C8tsk_Xe.js";
|
22
22
|
import { buildCollectionSynchronizationHeader } from "./collection-Dfb0TPno.js";
|
23
|
-
import { KvKeyCache } from "./keycache-
|
23
|
+
import { KvKeyCache } from "./keycache-BtADunPo.js";
|
24
24
|
import { createExponentialBackoffPolicy } from "./retry-BiIhZWgD.js";
|
25
|
-
import { extractInboxes, sendActivity } from "./send-
|
25
|
+
import { extractInboxes, sendActivity } from "./send-CJXTH3ST.js";
|
26
26
|
import { getLogger, withContext } from "@logtape/logtape";
|
27
27
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
28
28
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
@@ -3,15 +3,15 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
5
|
import { getDefaultActivityTransformers } from "./transformers-ghwJuzGY.js";
|
6
|
-
import { deno_default, getDocumentLoader, kvCache } from "./docloader-
|
7
|
-
import { Activity, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-
|
8
|
-
import { lookupWebFinger } from "./lookup-
|
9
|
-
import { exportJwk, importJwk, validateCryptoKey } from "./key-
|
10
|
-
import { doubleKnock, verifyRequest } from "./http-
|
11
|
-
import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-
|
12
|
-
import { getNodeInfo, nodeInfoToJson } from "./types-
|
13
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader-
|
14
|
-
import { lookupObject, traverseCollection } from "./vocab-
|
6
|
+
import { deno_default, getDocumentLoader, kvCache } from "./docloader-BFRgyDAa.js";
|
7
|
+
import { Activity, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-CwAL6Q82.js";
|
8
|
+
import { lookupWebFinger } from "./lookup-C8V37GPa.js";
|
9
|
+
import { exportJwk, importJwk, validateCryptoKey } from "./key-CD8i4ZB_.js";
|
10
|
+
import { doubleKnock, verifyRequest } from "./http-DC3mY9EG.js";
|
11
|
+
import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-D-CWdNQx.js";
|
12
|
+
import { getNodeInfo, nodeInfoToJson } from "./types-D3XNqpGz.js";
|
13
|
+
import { getAuthenticatedDocumentLoader } from "./authdocloader-Df1y1MKv.js";
|
14
|
+
import { lookupObject, traverseCollection } from "./vocab-CPrCb9BR.js";
|
15
15
|
import { getLogger, withContext } from "@logtape/logtape";
|
16
16
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
17
17
|
import { encodeHex } from "byte-encodings/hex";
|
@@ -312,7 +312,7 @@ var FederationBuilderImpl = class {
|
|
312
312
|
this.objectTypeIds = {};
|
313
313
|
}
|
314
314
|
async build(options) {
|
315
|
-
const { FederationImpl: FederationImpl$1 } = await import("./middleware-
|
315
|
+
const { FederationImpl: FederationImpl$1 } = await import("./middleware-DPuaf71I.js");
|
316
316
|
const f = new FederationImpl$1(options);
|
317
317
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
318
318
|
f.router = this.router.clone();
|
@@ -0,0 +1,33 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
globalThis.addEventListener = () => {};
|
5
|
+
|
6
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-DRpRVwO7.js";
|
7
|
+
import "./docloader-BXc5egq6.js";
|
8
|
+
import "./url-kTAI6_KP.js";
|
9
|
+
import "./semver-CbbIgUsa.js";
|
10
|
+
import "./client-CwjvB-Dh.js";
|
11
|
+
import "./router-D_aVZZUc.js";
|
12
|
+
import "./types-CqoqWDkp.js";
|
13
|
+
import "./multibase-DeCHcK8L.js";
|
14
|
+
import "./vocab-CaZSjoCB.js";
|
15
|
+
import "./langstr-DbWheeIS.js";
|
16
|
+
import "./lookup-Ds1_3qy2.js";
|
17
|
+
import "./type-D2s5lmbZ.js";
|
18
|
+
import "./actor-DezwbbQX.js";
|
19
|
+
import "./key-D0WW7EHK.js";
|
20
|
+
import "./http-3CJyDlPz.js";
|
21
|
+
import "./authdocloader-C-_Lr-KH.js";
|
22
|
+
import "./ld-D4G5WL1G.js";
|
23
|
+
import "./owner-Dyk0zd-q.js";
|
24
|
+
import "./proof-B8Hm2M5c.js";
|
25
|
+
import "./lookup-CQnVHXIh.js";
|
26
|
+
import "./inbox-CCbuuUqY.js";
|
27
|
+
import "./builder-C8tsk_Xe.js";
|
28
|
+
import "./collection-Dfb0TPno.js";
|
29
|
+
import "./keycache-BtADunPo.js";
|
30
|
+
import "./retry-BiIhZWgD.js";
|
31
|
+
import "./send-CJXTH3ST.js";
|
32
|
+
|
33
|
+
export { FederationImpl };
|
package/dist/mod.js
CHANGED
@@ -4,17 +4,17 @@
|
|
4
4
|
|
5
5
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./transformers-ghwJuzGY.js";
|
6
6
|
import "./compat-Bb5myD13.js";
|
7
|
-
import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "./docloader-
|
8
|
-
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, LanguageString, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, exportMultibaseKey, exportSpki, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, importMultibaseKey, importPem, importPkcs1, importSpki, isActor, normalizeActorHandle } from "./actor-
|
9
|
-
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-
|
10
|
-
import { lookupWebFinger } from "./lookup-
|
11
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "./key-
|
12
|
-
import { signRequest, verifyRequest } from "./http-
|
13
|
-
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-
|
7
|
+
import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "./docloader-BFRgyDAa.js";
|
8
|
+
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, LanguageString, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, exportMultibaseKey, exportSpki, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, importMultibaseKey, importPem, importPkcs1, importSpki, isActor, normalizeActorHandle } from "./actor-CwAL6Q82.js";
|
9
|
+
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-Jvf6WsMN.js";
|
10
|
+
import { lookupWebFinger } from "./lookup-C8V37GPa.js";
|
11
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "./key-CD8i4ZB_.js";
|
12
|
+
import { signRequest, verifyRequest } from "./http-DC3mY9EG.js";
|
13
|
+
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-D-CWdNQx.js";
|
14
14
|
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation-3B6BDKCK.js";
|
15
|
-
import { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "./types-
|
16
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader-
|
17
|
-
import { PUBLIC_COLLECTION, lookupObject, traverseCollection } from "./vocab-
|
15
|
+
import { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "./types-D3XNqpGz.js";
|
16
|
+
import { getAuthenticatedDocumentLoader } from "./authdocloader-Df1y1MKv.js";
|
17
|
+
import { PUBLIC_COLLECTION, lookupObject, traverseCollection } from "./vocab-CPrCb9BR.js";
|
18
18
|
import "./nodeinfo-CyEbLjHs.js";
|
19
19
|
import "./runtime-BSkOVUWM.js";
|
20
20
|
import "./sig-BXJO--F9.js";
|
@@ -6,28 +6,25 @@
|
|
6
6
|
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
7
|
import "../assert-YJk-1DlZ.js";
|
8
8
|
import "../assert_instance_of-DBIoG5k7.js";
|
9
|
-
import "../docloader-
|
9
|
+
import "../docloader-BXc5egq6.js";
|
10
10
|
import "../url-kTAI6_KP.js";
|
11
11
|
import "../semver-CbbIgUsa.js";
|
12
|
-
import { getNodeInfo, parseInboundService, parseNodeInfo, parseOutboundService, parseProtocol, parseServices, parseSoftware, parseUsage } from "../client-
|
12
|
+
import { getNodeInfo, parseInboundService, parseNodeInfo, parseOutboundService, parseProtocol, parseServices, parseSoftware, parseUsage } from "../client-CwjvB-Dh.js";
|
13
13
|
import { test } from "../testing-jcGLO9Lp.js";
|
14
14
|
import "../std__assert-CHXwj7zk.js";
|
15
15
|
import "../assert_rejects-BZjUwo62.js";
|
16
16
|
import "../assert_is_error-jyzqjHud.js";
|
17
17
|
import "../assert_not_equals-wx-SRs4i.js";
|
18
18
|
import "../assert_throws-gBPv3v2V.js";
|
19
|
-
import {
|
19
|
+
import { esm_default } from "../esm-Btx3E8og.js";
|
20
20
|
|
21
21
|
//#region nodeinfo/client.test.ts
|
22
22
|
test("getNodeInfo()", async (t) => {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
href: "https://example.com/nodeinfo/2.1"
|
29
|
-
}] }));
|
30
|
-
});
|
23
|
+
esm_default.spyGlobal();
|
24
|
+
esm_default.get("https://example.com/.well-known/nodeinfo", { body: { links: [{
|
25
|
+
rel: "http://nodeinfo.diaspora.software/ns/schema/2.1",
|
26
|
+
href: "https://example.com/nodeinfo/2.1"
|
27
|
+
}] } });
|
31
28
|
const rawExpected = {
|
32
29
|
software: {
|
33
30
|
name: "foo",
|
@@ -40,14 +37,8 @@ test("getNodeInfo()", async (t) => {
|
|
40
37
|
localComments: 456
|
41
38
|
}
|
42
39
|
};
|
43
|
-
|
44
|
-
|
45
|
-
return new Response(JSON.stringify(rawExpected));
|
46
|
-
});
|
47
|
-
mock("GET@/404", (req) => {
|
48
|
-
assertEquals(new URL(req.url).host, "example.com");
|
49
|
-
return new Response(null, { status: 404 });
|
50
|
-
});
|
40
|
+
esm_default.get("https://example.com/nodeinfo/2.1", { body: rawExpected });
|
41
|
+
esm_default.get("https://example.com/404", { status: 404 });
|
51
42
|
const expected = {
|
52
43
|
software: {
|
53
44
|
name: "foo",
|
@@ -76,18 +67,14 @@ test("getNodeInfo()", async (t) => {
|
|
76
67
|
const info = await getNodeInfo("https://example.com/nodeinfo/2.1", { direct: true });
|
77
68
|
assertEquals(info, expected);
|
78
69
|
});
|
79
|
-
|
80
|
-
|
81
|
-
return new Response(JSON.stringify({ links: [] }));
|
82
|
-
});
|
70
|
+
esm_default.removeRoutes();
|
71
|
+
esm_default.get("https://example.com/.well-known/nodeinfo", { body: { links: [] } });
|
83
72
|
await t.step("indirect: no links", async () => {
|
84
73
|
const info = await getNodeInfo("https://example.com/");
|
85
74
|
assertEquals(info, void 0);
|
86
75
|
});
|
87
|
-
|
88
|
-
|
89
|
-
return new Response(null, { status: 404 });
|
90
|
-
});
|
76
|
+
esm_default.removeRoutes();
|
77
|
+
esm_default.get("https://example.com/.well-known/nodeinfo", { status: 404 });
|
91
78
|
await t.step("indirect: 404", async () => {
|
92
79
|
const info = await getNodeInfo("https://example.com/");
|
93
80
|
assertEquals(info, void 0);
|
@@ -98,7 +85,7 @@ test("getNodeInfo()", async (t) => {
|
|
98
85
|
const info2 = await getNodeInfo("https://example.com/404", { direct: true });
|
99
86
|
assertEquals(info2, void 0);
|
100
87
|
});
|
101
|
-
|
88
|
+
esm_default.hardReset();
|
102
89
|
});
|
103
90
|
test("parseNodeInfo()", () => {
|
104
91
|
const input = {
|
@@ -7,32 +7,32 @@ import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
|
7
7
|
import "../assert-YJk-1DlZ.js";
|
8
8
|
import "../assert_instance_of-DBIoG5k7.js";
|
9
9
|
import { MemoryKvStore } from "../kv-DohFOP2C.js";
|
10
|
-
import { createFederation, handleNodeInfo, handleNodeInfoJrd } from "../middleware-
|
11
|
-
import "../docloader-
|
10
|
+
import { createFederation, handleNodeInfo, handleNodeInfoJrd } from "../middleware-DRpRVwO7.js";
|
11
|
+
import "../docloader-BXc5egq6.js";
|
12
12
|
import "../url-kTAI6_KP.js";
|
13
13
|
import { parseSemVer } from "../semver-CbbIgUsa.js";
|
14
|
-
import "../client-
|
14
|
+
import "../client-CwjvB-Dh.js";
|
15
15
|
import "../router-D_aVZZUc.js";
|
16
16
|
import "../types-CqoqWDkp.js";
|
17
17
|
import "../multibase-DeCHcK8L.js";
|
18
|
-
import "../vocab-
|
18
|
+
import "../vocab-CaZSjoCB.js";
|
19
19
|
import "../langstr-DbWheeIS.js";
|
20
|
-
import "../lookup-
|
20
|
+
import "../lookup-Ds1_3qy2.js";
|
21
21
|
import "../type-D2s5lmbZ.js";
|
22
|
-
import "../actor-
|
23
|
-
import "../key-
|
24
|
-
import "../http-
|
25
|
-
import "../authdocloader-
|
26
|
-
import "../ld-
|
27
|
-
import "../owner-
|
28
|
-
import "../proof-
|
29
|
-
import "../lookup-
|
30
|
-
import "../inbox-
|
31
|
-
import "../builder-
|
22
|
+
import "../actor-DezwbbQX.js";
|
23
|
+
import "../key-D0WW7EHK.js";
|
24
|
+
import "../http-3CJyDlPz.js";
|
25
|
+
import "../authdocloader-C-_Lr-KH.js";
|
26
|
+
import "../ld-D4G5WL1G.js";
|
27
|
+
import "../owner-Dyk0zd-q.js";
|
28
|
+
import "../proof-B8Hm2M5c.js";
|
29
|
+
import "../lookup-CQnVHXIh.js";
|
30
|
+
import "../inbox-CCbuuUqY.js";
|
31
|
+
import "../builder-C8tsk_Xe.js";
|
32
32
|
import "../collection-Dfb0TPno.js";
|
33
|
-
import "../keycache-
|
33
|
+
import "../keycache-BtADunPo.js";
|
34
34
|
import "../retry-BiIhZWgD.js";
|
35
|
-
import "../send-
|
35
|
+
import "../send-CJXTH3ST.js";
|
36
36
|
import { test } from "../testing-jcGLO9Lp.js";
|
37
37
|
import "../std__assert-CHXwj7zk.js";
|
38
38
|
import "../assert_rejects-BZjUwo62.js";
|
@@ -40,7 +40,7 @@ import "../assert_is_error-jyzqjHud.js";
|
|
40
40
|
import "../assert_not_equals-wx-SRs4i.js";
|
41
41
|
import "../assert_throws-gBPv3v2V.js";
|
42
42
|
import "../docloader-09nVWLAZ.js";
|
43
|
-
import { createRequestContext } from "../context-
|
43
|
+
import { createRequestContext } from "../context-DfToVZY6.js";
|
44
44
|
|
45
45
|
//#region nodeinfo/handler.test.ts
|
46
46
|
test("handleNodeInfo()", async () => {
|
package/dist/nodeinfo/mod.js
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import "../docloader-
|
6
|
-
import { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "../types-
|
5
|
+
import "../docloader-BFRgyDAa.js";
|
6
|
+
import { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "../types-D3XNqpGz.js";
|
7
7
|
import "../nodeinfo-CyEbLjHs.js";
|
8
8
|
|
9
9
|
export { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer };
|
@@ -3,9 +3,9 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { getDocumentLoader } from "./docloader-
|
7
|
-
import { CryptographicKey, Object as Object$1 } from "./vocab-
|
8
|
-
import { isActor } from "./actor-
|
6
|
+
import { getDocumentLoader } from "./docloader-BXc5egq6.js";
|
7
|
+
import { CryptographicKey, Object as Object$1 } from "./vocab-CaZSjoCB.js";
|
8
|
+
import { isActor } from "./actor-DezwbbQX.js";
|
9
9
|
import { trace } from "@opentelemetry/api";
|
10
10
|
|
11
11
|
//#region sig/owner.ts
|
@@ -3,10 +3,10 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { deno_default } from "./docloader-
|
7
|
-
import { Activity, DataIntegrityProof, Multikey } from "./vocab-
|
6
|
+
import { deno_default } from "./docloader-BXc5egq6.js";
|
7
|
+
import { Activity, DataIntegrityProof, Multikey } from "./vocab-CaZSjoCB.js";
|
8
8
|
import { getTypeId } from "./type-D2s5lmbZ.js";
|
9
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
9
|
+
import { fetchKey, validateCryptoKey } from "./key-D0WW7EHK.js";
|
10
10
|
import { getLogger } from "@logtape/logtape";
|
11
11
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
12
12
|
import { encodeHex } from "byte-encodings/hex";
|
@@ -2,9 +2,9 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { deno_default, getDocumentLoader } from "./docloader-
|
6
|
-
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "./actor-
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
5
|
+
import { deno_default, getDocumentLoader } from "./docloader-BFRgyDAa.js";
|
6
|
+
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "./actor-CwAL6Q82.js";
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-CD8i4ZB_.js";
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
10
10
|
import jsonld from "jsonld";
|
@@ -6,17 +6,17 @@
|
|
6
6
|
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
7
|
import "../assert-YJk-1DlZ.js";
|
8
8
|
import "../assert_instance_of-DBIoG5k7.js";
|
9
|
-
import "../docloader-
|
9
|
+
import "../docloader-BXc5egq6.js";
|
10
10
|
import { UrlError } from "../url-kTAI6_KP.js";
|
11
11
|
import "../multibase-DeCHcK8L.js";
|
12
|
-
import "../vocab-
|
12
|
+
import "../vocab-CaZSjoCB.js";
|
13
13
|
import "../langstr-DbWheeIS.js";
|
14
|
-
import "../lookup-
|
14
|
+
import "../lookup-Ds1_3qy2.js";
|
15
15
|
import "../type-D2s5lmbZ.js";
|
16
|
-
import "../actor-
|
17
|
-
import "../key-
|
18
|
-
import { verifyRequest } from "../http-
|
19
|
-
import { getAuthenticatedDocumentLoader } from "../authdocloader-
|
16
|
+
import "../actor-DezwbbQX.js";
|
17
|
+
import "../key-D0WW7EHK.js";
|
18
|
+
import { verifyRequest } from "../http-3CJyDlPz.js";
|
19
|
+
import { getAuthenticatedDocumentLoader } from "../authdocloader-C-_Lr-KH.js";
|
20
20
|
import { test } from "../testing-jcGLO9Lp.js";
|
21
21
|
import "../std__assert-CHXwj7zk.js";
|
22
22
|
import { assertRejects } from "../assert_rejects-BZjUwo62.js";
|
@@ -24,7 +24,7 @@ import "../assert_is_error-jyzqjHud.js";
|
|
24
24
|
import "../assert_not_equals-wx-SRs4i.js";
|
25
25
|
import "../assert_throws-gBPv3v2V.js";
|
26
26
|
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
27
|
-
import { rsaPrivateKey2 } from "../keys-
|
27
|
+
import { rsaPrivateKey2 } from "../keys-BIY57kjo.js";
|
28
28
|
import { esm_default } from "../esm-Btx3E8og.js";
|
29
29
|
|
30
30
|
//#region runtime/authdocloader.test.ts
|
@@ -7,7 +7,7 @@ import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
|
7
7
|
import "../assert-YJk-1DlZ.js";
|
8
8
|
import "../assert_instance_of-DBIoG5k7.js";
|
9
9
|
import { MemoryKvStore } from "../kv-DohFOP2C.js";
|
10
|
-
import { FetchError, contexts_default, deno_default, getDocumentLoader, getUserAgent, kvCache } from "../docloader-
|
10
|
+
import { FetchError, contexts_default, deno_default, getDocumentLoader, getUserAgent, kvCache } from "../docloader-BXc5egq6.js";
|
11
11
|
import { UrlError } from "../url-kTAI6_KP.js";
|
12
12
|
import { test } from "../testing-jcGLO9Lp.js";
|
13
13
|
import "../std__assert-CHXwj7zk.js";
|
@@ -16,7 +16,7 @@ import "../assert_is_error-jyzqjHud.js";
|
|
16
16
|
import "../assert_not_equals-wx-SRs4i.js";
|
17
17
|
import { assertThrows } from "../assert_throws-gBPv3v2V.js";
|
18
18
|
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
19
|
-
import {
|
19
|
+
import { esm_default } from "../esm-Btx3E8og.js";
|
20
20
|
import process from "node:process";
|
21
21
|
|
22
22
|
//#region runtime/docloader.test.ts
|
@@ -31,13 +31,13 @@ test("new FetchError()", () => {
|
|
31
31
|
});
|
32
32
|
test("getDocumentLoader()", async (t) => {
|
33
33
|
const fetchDocumentLoader = getDocumentLoader();
|
34
|
-
|
35
|
-
|
34
|
+
esm_default.spyGlobal();
|
35
|
+
esm_default.get("https://example.com/object", { body: {
|
36
36
|
"@context": "https://www.w3.org/ns/activitystreams",
|
37
37
|
id: "https://example.com/object",
|
38
38
|
name: "Fetched object",
|
39
39
|
type: "Object"
|
40
|
-
}
|
40
|
+
} });
|
41
41
|
await t.step("ok", async () => {
|
42
42
|
assertEquals(await fetchDocumentLoader("https://example.com/object"), {
|
43
43
|
contextUrl: null,
|
@@ -50,43 +50,37 @@ test("getDocumentLoader()", async (t) => {
|
|
50
50
|
}
|
51
51
|
});
|
52
52
|
});
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
53
|
+
esm_default.get("https://example.com/link-ctx", {
|
54
|
+
body: {
|
55
|
+
id: "https://example.com/link-ctx",
|
56
|
+
name: "Fetched object",
|
57
|
+
type: "Object"
|
58
|
+
},
|
59
59
|
headers: {
|
60
60
|
"Content-Type": "application/activity+json",
|
61
61
|
Link: "<https://www.w3.org/ns/activitystreams>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""
|
62
62
|
}
|
63
|
-
})
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
"
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
"@context": "https://www.w3.org/ns/activitystreams",
|
80
|
-
id: "https://example.com/obj-w-wrong-link",
|
81
|
-
name: "Fetched object",
|
82
|
-
type: "Object"
|
83
|
-
}), {
|
84
|
-
status: 200,
|
63
|
+
});
|
64
|
+
esm_default.get("https://example.com/link-obj", { headers: {
|
65
|
+
"Content-Type": "text/html; charset=utf-8",
|
66
|
+
Link: "<https://example.com/object>; rel=\"alternate\"; type=\"application/activity+json\""
|
67
|
+
} });
|
68
|
+
esm_default.get("https://example.com/link-obj-relative", { headers: {
|
69
|
+
"Content-Type": "text/html; charset=utf-8",
|
70
|
+
Link: "</object>; rel=\"alternate\"; type=\"application/activity+json\""
|
71
|
+
} });
|
72
|
+
esm_default.get("https://example.com/obj-w-wrong-link", {
|
73
|
+
body: {
|
74
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
75
|
+
id: "https://example.com/obj-w-wrong-link",
|
76
|
+
name: "Fetched object",
|
77
|
+
type: "Object"
|
78
|
+
},
|
85
79
|
headers: {
|
86
80
|
"Content-Type": "text/html; charset=utf-8",
|
87
81
|
Link: "<https://example.com/object>; rel=\"alternate\"; type=\"application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"\""
|
88
82
|
}
|
89
|
-
})
|
83
|
+
});
|
90
84
|
await t.step("Link header", async () => {
|
91
85
|
assertEquals(await fetchDocumentLoader("https://example.com/link-ctx"), {
|
92
86
|
contextUrl: "https://www.w3.org/ns/activitystreams",
|
@@ -141,7 +135,8 @@ test("getDocumentLoader()", async (t) => {
|
|
141
135
|
}
|
142
136
|
});
|
143
137
|
});
|
144
|
-
|
138
|
+
esm_default.get("https://example.com/html-link", {
|
139
|
+
body: `<html>
|
145
140
|
<head>
|
146
141
|
<meta charset=utf-8>
|
147
142
|
<link
|
@@ -149,10 +144,9 @@ test("getDocumentLoader()", async (t) => {
|
|
149
144
|
type='application/activity+json'
|
150
145
|
href="https://example.com/object">
|
151
146
|
</head>
|
152
|
-
</html>`,
|
153
|
-
status: 200,
|
147
|
+
</html>`,
|
154
148
|
headers: { "Content-Type": "text/html; charset=utf-8" }
|
155
|
-
})
|
149
|
+
});
|
156
150
|
await t.step("HTML <link>", async () => {
|
157
151
|
assertEquals(await fetchDocumentLoader("https://example.com/html-link"), {
|
158
152
|
contextUrl: null,
|
@@ -165,7 +159,8 @@ test("getDocumentLoader()", async (t) => {
|
|
165
159
|
}
|
166
160
|
});
|
167
161
|
});
|
168
|
-
|
162
|
+
esm_default.get("https://example.com/html-a", {
|
163
|
+
body: `<html>
|
169
164
|
<head>
|
170
165
|
<meta charset=utf-8>
|
171
166
|
</head>
|
@@ -175,10 +170,9 @@ test("getDocumentLoader()", async (t) => {
|
|
175
170
|
type=application/activity+json
|
176
171
|
href=https://example.com/object>test</a>
|
177
172
|
</body>
|
178
|
-
</html>`,
|
179
|
-
status: 200,
|
173
|
+
</html>`,
|
180
174
|
headers: { "Content-Type": "text/html; charset=utf-8" }
|
181
|
-
})
|
175
|
+
});
|
182
176
|
await t.step("HTML <a>", async () => {
|
183
177
|
assertEquals(await fetchDocumentLoader("https://example.com/html-a"), {
|
184
178
|
contextUrl: null,
|
@@ -191,15 +185,15 @@ test("getDocumentLoader()", async (t) => {
|
|
191
185
|
}
|
192
186
|
});
|
193
187
|
});
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
188
|
+
esm_default.get("https://example.com/wrong-content-type", {
|
189
|
+
body: {
|
190
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
191
|
+
id: "https://example.com/wrong-content-type",
|
192
|
+
name: "Fetched object",
|
193
|
+
type: "Object"
|
194
|
+
},
|
201
195
|
headers: { "Content-Type": "text/html; charset=utf-8" }
|
202
|
-
})
|
196
|
+
});
|
203
197
|
await t.step("Wrong Content-Type", async () => {
|
204
198
|
assertEquals(await fetchDocumentLoader("https://example.com/wrong-content-type"), {
|
205
199
|
contextUrl: null,
|
@@ -212,7 +206,7 @@ test("getDocumentLoader()", async (t) => {
|
|
212
206
|
}
|
213
207
|
});
|
214
208
|
});
|
215
|
-
|
209
|
+
esm_default.get("https://example.com/404", { status: 404 });
|
216
210
|
await t.step("not ok", async () => {
|
217
211
|
await assertRejects(() => fetchDocumentLoader("https://example.com/404"), FetchError, "HTTP 404: https://example.com/404");
|
218
212
|
});
|
@@ -226,8 +220,12 @@ test("getDocumentLoader()", async (t) => {
|
|
226
220
|
await t.step("deny non-HTTP/HTTPS", async () => {
|
227
221
|
await assertRejects(() => fetchDocumentLoader("ftp://localhost"), UrlError);
|
228
222
|
});
|
229
|
-
|
230
|
-
|
223
|
+
esm_default.get("https://example.com/localhost-redirect", {
|
224
|
+
status: 302,
|
225
|
+
headers: { Location: "https://localhost/object" }
|
226
|
+
});
|
227
|
+
esm_default.get("https://example.com/localhost-link", {
|
228
|
+
body: `<html>
|
231
229
|
<head>
|
232
230
|
<meta charset=utf-8>
|
233
231
|
<link
|
@@ -235,10 +233,15 @@ test("getDocumentLoader()", async (t) => {
|
|
235
233
|
type='application/activity+json'
|
236
234
|
href="https://localhost/object">
|
237
235
|
</head>
|
238
|
-
</html>`,
|
239
|
-
status: 200,
|
236
|
+
</html>`,
|
240
237
|
headers: { "Content-Type": "text/html; charset=utf-8" }
|
241
|
-
})
|
238
|
+
});
|
239
|
+
esm_default.get("https://localhost/object", { body: {
|
240
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
241
|
+
id: "https://localhost/object",
|
242
|
+
name: "Fetched object",
|
243
|
+
type: "Object"
|
244
|
+
} });
|
242
245
|
await t.step("allowPrivateAddress: false", async () => {
|
243
246
|
await assertRejects(() => fetchDocumentLoader("https://localhost/object"), UrlError);
|
244
247
|
await assertRejects(() => fetchDocumentLoader("https://example.com/localhost-redirect"), UrlError);
|
@@ -251,7 +254,7 @@ test("getDocumentLoader()", async (t) => {
|
|
251
254
|
documentUrl: "https://localhost/object",
|
252
255
|
document: {
|
253
256
|
"@context": "https://www.w3.org/ns/activitystreams",
|
254
|
-
id: "https://
|
257
|
+
id: "https://localhost/object",
|
255
258
|
name: "Fetched object",
|
256
259
|
type: "Object"
|
257
260
|
}
|
@@ -260,7 +263,7 @@ test("getDocumentLoader()", async (t) => {
|
|
260
263
|
assertEquals(await fetchDocumentLoader2("https://example.com/localhost-redirect"), expected);
|
261
264
|
assertEquals(await fetchDocumentLoader2("https://example.com/localhost-link"), expected);
|
262
265
|
});
|
263
|
-
|
266
|
+
esm_default.hardReset();
|
264
267
|
});
|
265
268
|
test("kvCache()", async (t) => {
|
266
269
|
const kv = new MemoryKvStore();
|