@fedify/fedify 1.8.1-pr.350.1285 → 1.8.1
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/README.md +2 -0
- package/dist/{actor-CaMRRcub.js → actor-BDPKTUai.js} +179 -179
- package/dist/{actor-D_mYtQ--.js → actor-CLRQDEV9.js} +1 -1
- package/dist/{actor-C2nhWp6O.d.ts → actor-Uh1YDuVl.d.ts} +2 -2
- package/dist/{authdocloader-CQh4IJfT.js → authdocloader-BBwf1_f7.js} +6 -5
- package/dist/{authdocloader-K0Peq1hX.js → authdocloader-C2mtQBvn.js} +6 -5
- package/dist/{builder-fPWs-TI4.js → builder-C2kEWQ9P.js} +4 -4
- package/dist/{client-D2tgjFk3.d.ts → client-DF8anIB5.d.ts} +1 -1
- package/dist/{client-9cPnAibf.js → client-DQZ4AQIk.js} +1 -1
- package/dist/compat/mod.d.ts +10 -10
- package/dist/compat/transformers.test.js +16 -16
- package/dist/{context-BBD2ZH_P.d.ts → context-CnveeHUR.d.ts} +8 -8
- package/dist/{docloader-Bz56sKV5.d.ts → docloader-CxWcuWqQ.d.ts} +14 -1
- package/dist/{docloader-BBtyRca1.js → docloader-Dvsvkvlo.js} +23 -27
- package/dist/{esm-QBbiQNo4.js → esm-BWVigQCO.js} +1 -1
- package/dist/federation/builder.test.js +5 -5
- package/dist/federation/collection.test.js +3 -3
- package/dist/federation/handler.test.js +17 -17
- package/dist/federation/inbox.test.js +4 -4
- package/dist/federation/keycache.test.js +4 -4
- package/dist/federation/kv.test.js +3 -3
- package/dist/federation/middleware.test.js +18 -18
- package/dist/federation/mod.d.ts +9 -9
- package/dist/federation/mod.js +10 -10
- package/dist/federation/mq.test.js +3 -3
- package/dist/federation/retry.test.js +3 -3
- package/dist/federation/router.test.js +3 -3
- package/dist/federation/send.test.js +10 -10
- package/dist/{http-B0NkMLuT.js → http-Cdw1rmQb.js} +11 -5
- package/dist/{http-DWJVfkyZ.js → http-CgMHCKJe.js} +12 -6
- package/dist/{http-l4uEvaAw.d.ts → http-DtG44GdM.d.ts} +2 -2
- package/dist/{inbox-B1nIxc0q.js → inbox-CvnAgO-D.js} +1 -1
- package/dist/{key-BDCSCae-.js → key-C5L8OQYQ.js} +3 -3
- package/dist/{key-BRl4AtNh.js → key-CK11m7Rs.js} +2 -2
- package/dist/{key-CKINuzqT.js → key-CuoSylWi.js} +4 -4
- package/dist/{key-Bpdjmig5.js → key-I8MiG9nK.js} +2 -2
- package/dist/{keycache-CoDCGPU_.js → keycache-Z0xx1tPQ.js} +1 -1
- package/dist/{keys--rBfRBtT.js → keys-Ddyoaf_e.js} +1 -1
- package/dist/{ld-C3oVh0YJ.js → ld-DTtWNgiE.js} +2 -2
- package/dist/{lookup-BJelGpWr.d.ts → lookup-3czM5mmU.d.ts} +7 -1
- package/dist/{lookup-BLwnybnA.js → lookup-BBjrfjI5.js} +5 -4
- package/dist/{lookup-BxBwlMQM.js → lookup-nB-tCGVP.js} +3 -2
- package/dist/middleware-BQe2VdJO.js +26 -0
- package/dist/middleware-DOSupjKJ.js +17 -0
- package/dist/{middleware-KK44603T.js → middleware-DScUEBAy.js} +10 -10
- package/dist/{middleware-hQ-rKnGR.js → middleware-TVCxZbNW.js} +13 -13
- package/dist/{mod-DDwnlIlm.d.ts → mod-DPpunL8j.d.ts} +2 -2
- package/dist/{mod-D79SaXL-.d.ts → mod-cz-tNIqP.d.ts} +7 -2
- package/dist/{mod-DM7ZpXF4.d.ts → mod-mSMqo9JU.d.ts} +2 -2
- package/dist/{mod-DwquBB1g.d.ts → mod-tQVUxQ_D.d.ts} +3 -3
- package/dist/mod.d.ts +12 -12
- package/dist/mod.js +10 -10
- package/dist/nodeinfo/client.test.js +5 -5
- package/dist/nodeinfo/handler.test.js +16 -16
- package/dist/nodeinfo/mod.d.ts +2 -2
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/semver.test.js +3 -3
- package/dist/nodeinfo/types.test.js +3 -3
- package/dist/{owner-fFqUg4lq.d.ts → owner-C12klfeG.d.ts} +3 -3
- package/dist/{owner-D42JugRm.js → owner-H5ZC_lkd.js} +2 -2
- package/dist/{proof-wEvE3AbS.js → proof-Chg3ytBc.js} +3 -3
- package/dist/{proof-CIm_fnDK.js → proof-De02H0W-.js} +2 -2
- package/dist/runtime/authdocloader.test.js +49 -9
- package/dist/runtime/docloader.test.js +60 -4
- package/dist/runtime/key.test.js +5 -5
- package/dist/runtime/langstr.test.js +3 -3
- package/dist/runtime/mod.d.ts +4 -4
- package/dist/runtime/mod.js +6 -6
- package/dist/runtime/multibase/multibase.test.js +3 -3
- package/dist/runtime/url.test.js +3 -3
- package/dist/{send-BRA7aMRV.js → send-CL5-bPSf.js} +2 -2
- package/dist/sig/http.test.js +51 -9
- package/dist/sig/key.test.js +6 -6
- package/dist/sig/ld.test.js +7 -7
- package/dist/sig/mod.d.ts +6 -6
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +7 -7
- package/dist/sig/proof.test.js +7 -7
- package/dist/testing/docloader.test.js +3 -3
- package/dist/testing/mod.d.ts +24 -1
- package/dist/testing/mod.js +3 -3
- package/dist/{testing-C7zAnwt8.js → testing-BVNNmwCi.js} +3 -3
- package/dist/{type-gkozZs_Y.js → type-iB-6GI3W.js} +202 -205
- package/dist/{types-YGkwBxol.js → types-mbUbOJzp.js} +1 -1
- package/dist/vocab/actor.test.js +5 -5
- package/dist/vocab/lookup.test.js +98 -6
- package/dist/vocab/mod.d.ts +4 -4
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +4 -4
- package/dist/{vocab-DQ4SEIWh.js → vocab-Bpo_epAX.js} +7 -6
- package/dist/{vocab-CA7YwVEz.d.ts → vocab-Ukxjz3TM.d.ts} +1 -1
- package/dist/webfinger/handler.test.js +16 -16
- package/dist/webfinger/lookup.test.js +58 -4
- package/dist/webfinger/mod.d.ts +2 -2
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/cfworkers.test.js +3 -3
- package/dist/x/hono.d.ts +9 -9
- package/dist/x/sveltekit.d.ts +9 -9
- package/package.json +1 -1
- package/dist/middleware-BEG0MAZG.js +0 -26
- package/dist/middleware-BtSPPgam.js +0 -17
package/dist/mod.js
CHANGED
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./transformers-Dna8Fg7k.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-Dvsvkvlo.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-BDPKTUai.js";
|
|
9
|
+
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-DScUEBAy.js";
|
|
10
|
+
import { lookupWebFinger } from "./lookup-nB-tCGVP.js";
|
|
11
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "./key-CK11m7Rs.js";
|
|
12
|
+
import { signRequest, verifyRequest } from "./http-CgMHCKJe.js";
|
|
13
|
+
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-Chg3ytBc.js";
|
|
14
14
|
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation-CMX7WzeL.js";
|
|
15
|
-
import { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "./types-
|
|
16
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader-
|
|
17
|
-
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "./vocab-
|
|
15
|
+
import { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "./types-mbUbOJzp.js";
|
|
16
|
+
import { getAuthenticatedDocumentLoader } from "./authdocloader-C2mtQBvn.js";
|
|
17
|
+
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "./vocab-Bpo_epAX.js";
|
|
18
18
|
import "./nodeinfo-CyEbLjHs.js";
|
|
19
19
|
import "./runtime-BSkOVUWM.js";
|
|
20
20
|
import "./sig-BXJO--F9.js";
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../type-
|
|
6
|
+
import "../type-iB-6GI3W.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
10
|
import "../semver-dArNLkR9.js";
|
|
11
|
-
import { getNodeInfo, parseInboundService, parseNodeInfo, parseOutboundService, parseProtocol, parseServices, parseSoftware, parseUsage } from "../client-
|
|
12
|
-
import "../lookup-
|
|
13
|
-
import { test } from "../testing-
|
|
11
|
+
import { getNodeInfo, parseInboundService, parseNodeInfo, parseOutboundService, parseProtocol, parseServices, parseSoftware, parseUsage } from "../client-DQZ4AQIk.js";
|
|
12
|
+
import "../lookup-BBjrfjI5.js";
|
|
13
|
+
import { test } from "../testing-BVNNmwCi.js";
|
|
14
14
|
import "../std__assert-X-_kMxKM.js";
|
|
15
15
|
import "../assert_rejects-DiIiJbZn.js";
|
|
16
16
|
import "../assert_is_error-BPGph1Jx.js";
|
|
17
17
|
import "../assert_not_equals-f3m3epl3.js";
|
|
18
18
|
import "../assert_throws-BOO88avQ.js";
|
|
19
|
-
import { esm_default } from "../esm-
|
|
19
|
+
import { esm_default } from "../esm-BWVigQCO.js";
|
|
20
20
|
|
|
21
21
|
//#region src/nodeinfo/client.test.ts
|
|
22
22
|
test("getNodeInfo()", async (t) => {
|
|
@@ -3,30 +3,30 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../type-
|
|
6
|
+
import "../type-iB-6GI3W.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
10
|
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
|
|
11
|
-
import { createFederation, handleNodeInfo, handleNodeInfoJrd } from "../middleware-
|
|
11
|
+
import { createFederation, handleNodeInfo, handleNodeInfoJrd } from "../middleware-TVCxZbNW.js";
|
|
12
12
|
import { parseSemVer } from "../semver-dArNLkR9.js";
|
|
13
|
-
import "../client-
|
|
14
|
-
import "../lookup-
|
|
13
|
+
import "../client-DQZ4AQIk.js";
|
|
14
|
+
import "../lookup-BBjrfjI5.js";
|
|
15
15
|
import "../types-BIgY6c-l.js";
|
|
16
|
-
import "../actor-
|
|
17
|
-
import "../key-
|
|
18
|
-
import "../http-
|
|
19
|
-
import "../authdocloader-
|
|
20
|
-
import "../ld-
|
|
21
|
-
import "../owner-
|
|
22
|
-
import "../proof-
|
|
23
|
-
import "../inbox-
|
|
24
|
-
import "../builder-
|
|
16
|
+
import "../actor-CLRQDEV9.js";
|
|
17
|
+
import "../key-I8MiG9nK.js";
|
|
18
|
+
import "../http-Cdw1rmQb.js";
|
|
19
|
+
import "../authdocloader-BBwf1_f7.js";
|
|
20
|
+
import "../ld-DTtWNgiE.js";
|
|
21
|
+
import "../owner-H5ZC_lkd.js";
|
|
22
|
+
import "../proof-De02H0W-.js";
|
|
23
|
+
import "../inbox-CvnAgO-D.js";
|
|
24
|
+
import "../builder-C2kEWQ9P.js";
|
|
25
25
|
import "../collection-CSzG2j1P.js";
|
|
26
|
-
import "../keycache-
|
|
26
|
+
import "../keycache-Z0xx1tPQ.js";
|
|
27
27
|
import "../retry-D4GJ670a.js";
|
|
28
|
-
import "../send-
|
|
29
|
-
import { createRequestContext, test } from "../testing-
|
|
28
|
+
import "../send-CL5-bPSf.js";
|
|
29
|
+
import { createRequestContext, test } from "../testing-BVNNmwCi.js";
|
|
30
30
|
import "../std__assert-X-_kMxKM.js";
|
|
31
31
|
import "../assert_rejects-DiIiJbZn.js";
|
|
32
32
|
import "../assert_is_error-BPGph1Jx.js";
|
package/dist/nodeinfo/mod.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
import "../kv-C7sopW2E.js";
|
|
4
|
-
import "../docloader-
|
|
5
|
-
import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, SemVer, Services, Software, Usage, formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "../client-
|
|
4
|
+
import "../docloader-CxWcuWqQ.js";
|
|
5
|
+
import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, SemVer, Services, Software, Usage, formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "../client-DF8anIB5.js";
|
|
6
6
|
import "../mod-1pDWKvUL.js";
|
|
7
7
|
export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, SemVer, Services, Software, Usage, formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer };
|
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-Dvsvkvlo.js";
|
|
6
|
+
import { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "../types-mbUbOJzp.js";
|
|
7
7
|
import "../nodeinfo-CyEbLjHs.js";
|
|
8
8
|
|
|
9
9
|
export { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer };
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../type-
|
|
6
|
+
import "../type-iB-6GI3W.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
10
|
import { formatSemVer, parseSemVer } from "../semver-dArNLkR9.js";
|
|
11
|
-
import "../lookup-
|
|
12
|
-
import { test } from "../testing-
|
|
11
|
+
import "../lookup-BBjrfjI5.js";
|
|
12
|
+
import { test } from "../testing-BVNNmwCi.js";
|
|
13
13
|
import "../std__assert-X-_kMxKM.js";
|
|
14
14
|
import "../assert_rejects-DiIiJbZn.js";
|
|
15
15
|
import "../assert_is_error-BPGph1Jx.js";
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../type-
|
|
6
|
+
import "../type-iB-6GI3W.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
10
|
import "../semver-dArNLkR9.js";
|
|
11
|
-
import "../lookup-
|
|
11
|
+
import "../lookup-BBjrfjI5.js";
|
|
12
12
|
import { nodeInfoToJson } from "../types-BIgY6c-l.js";
|
|
13
|
-
import { test } from "../testing-
|
|
13
|
+
import { test } from "../testing-BVNNmwCi.js";
|
|
14
14
|
import "../std__assert-X-_kMxKM.js";
|
|
15
15
|
import "../assert_rejects-DiIiJbZn.js";
|
|
16
16
|
import "../assert_is_error-BPGph1Jx.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { DocumentLoader } from "./docloader-
|
|
4
|
-
import { Activity, CryptographicKey } from "./vocab-
|
|
5
|
-
import { Actor } from "./actor-
|
|
3
|
+
import { DocumentLoader } from "./docloader-CxWcuWqQ.js";
|
|
4
|
+
import { Activity, CryptographicKey } from "./vocab-Ukxjz3TM.js";
|
|
5
|
+
import { Actor } from "./actor-Uh1YDuVl.js";
|
|
6
6
|
import { TracerProvider } from "@opentelemetry/api";
|
|
7
7
|
|
|
8
8
|
//#region src/sig/owner.d.ts
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { CryptographicKey, Object as Object$1, getDocumentLoader } from "./type-
|
|
7
|
-
import { isActor } from "./actor-
|
|
6
|
+
import { CryptographicKey, Object as Object$1, getDocumentLoader } from "./type-iB-6GI3W.js";
|
|
7
|
+
import { isActor } from "./actor-CLRQDEV9.js";
|
|
8
8
|
import { trace } from "@opentelemetry/api";
|
|
9
9
|
|
|
10
10
|
//#region src/sig/owner.ts
|
|
@@ -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-Dvsvkvlo.js";
|
|
6
|
+
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "./actor-BDPKTUai.js";
|
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-CK11m7Rs.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import jsonld from "jsonld";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Activity, DataIntegrityProof, Multikey, deno_default, getTypeId } from "./type-
|
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
|
6
|
+
import { Activity, DataIntegrityProof, Multikey, deno_default, getTypeId } from "./type-iB-6GI3W.js";
|
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-I8MiG9nK.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import { encodeHex } from "byte-encodings/hex";
|
|
@@ -3,23 +3,23 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { UrlError } from "../type-
|
|
6
|
+
import { UrlError } from "../type-iB-6GI3W.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../lookup-
|
|
11
|
-
import "../actor-
|
|
12
|
-
import "../key-
|
|
13
|
-
import { verifyRequest } from "../http-
|
|
14
|
-
import { getAuthenticatedDocumentLoader } from "../authdocloader-
|
|
15
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import "../lookup-BBjrfjI5.js";
|
|
11
|
+
import "../actor-CLRQDEV9.js";
|
|
12
|
+
import "../key-I8MiG9nK.js";
|
|
13
|
+
import { verifyRequest } from "../http-Cdw1rmQb.js";
|
|
14
|
+
import { getAuthenticatedDocumentLoader } from "../authdocloader-BBwf1_f7.js";
|
|
15
|
+
import { mockDocumentLoader, test } from "../testing-BVNNmwCi.js";
|
|
16
16
|
import "../std__assert-X-_kMxKM.js";
|
|
17
17
|
import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
18
18
|
import "../assert_is_error-BPGph1Jx.js";
|
|
19
19
|
import "../assert_not_equals-f3m3epl3.js";
|
|
20
20
|
import "../assert_throws-BOO88avQ.js";
|
|
21
|
-
import { rsaPrivateKey2 } from "../keys
|
|
22
|
-
import { esm_default } from "../esm-
|
|
21
|
+
import { rsaPrivateKey2 } from "../keys-Ddyoaf_e.js";
|
|
22
|
+
import { esm_default } from "../esm-BWVigQCO.js";
|
|
23
23
|
|
|
24
24
|
//#region src/runtime/authdocloader.test.ts
|
|
25
25
|
test("getAuthenticatedDocumentLoader()", async (t) => {
|
|
@@ -59,5 +59,45 @@ test("getAuthenticatedDocumentLoader()", async (t) => {
|
|
|
59
59
|
assertRejects(() => loader("http://localhost"), UrlError);
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
|
+
test("getAuthenticatedDocumentLoader() cancellation", {
|
|
63
|
+
sanitizeResources: false,
|
|
64
|
+
sanitizeOps: false
|
|
65
|
+
}, async (t) => {
|
|
66
|
+
esm_default.spyGlobal();
|
|
67
|
+
await t.step("document loader cancellation", async () => {
|
|
68
|
+
esm_default.get("https://example.com/slow-object", () => new Promise((resolve) => {
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
resolve({
|
|
71
|
+
status: 200,
|
|
72
|
+
headers: { "Content-Type": "application/activity+json" },
|
|
73
|
+
body: {
|
|
74
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
75
|
+
type: "Note",
|
|
76
|
+
content: "Slow response"
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}, 1e3);
|
|
80
|
+
}));
|
|
81
|
+
const loader = getAuthenticatedDocumentLoader({
|
|
82
|
+
keyId: new URL("https://example.com/key2"),
|
|
83
|
+
privateKey: rsaPrivateKey2
|
|
84
|
+
});
|
|
85
|
+
const controller = new AbortController();
|
|
86
|
+
const promise = loader("https://example.com/slow-object", { signal: controller.signal });
|
|
87
|
+
controller.abort();
|
|
88
|
+
await assertRejects(() => promise, Error);
|
|
89
|
+
await assertRejects(() => loader("https://example.com/object", { signal: controller.signal }), Error);
|
|
90
|
+
});
|
|
91
|
+
await t.step("immediate cancellation", async () => {
|
|
92
|
+
const loader = getAuthenticatedDocumentLoader({
|
|
93
|
+
keyId: new URL("https://example.com/key2"),
|
|
94
|
+
privateKey: rsaPrivateKey2
|
|
95
|
+
});
|
|
96
|
+
const controller = new AbortController();
|
|
97
|
+
controller.abort();
|
|
98
|
+
await assertRejects(() => loader("https://example.com/object", { signal: controller.signal }), Error);
|
|
99
|
+
});
|
|
100
|
+
esm_default.hardReset();
|
|
101
|
+
});
|
|
62
102
|
|
|
63
103
|
//#endregion
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { FetchError, UrlError, contexts_default, deno_default, getDocumentLoader, getUserAgent, kvCache } from "../type-
|
|
6
|
+
import { FetchError, UrlError, contexts_default, deno_default, getDocumentLoader, getUserAgent, kvCache } from "../type-iB-6GI3W.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
10
|
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
|
|
11
|
-
import "../lookup-
|
|
12
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
11
|
+
import "../lookup-BBjrfjI5.js";
|
|
12
|
+
import { mockDocumentLoader, test } from "../testing-BVNNmwCi.js";
|
|
13
13
|
import "../std__assert-X-_kMxKM.js";
|
|
14
14
|
import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
15
15
|
import "../assert_is_error-BPGph1Jx.js";
|
|
16
16
|
import "../assert_not_equals-f3m3epl3.js";
|
|
17
17
|
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
|
18
|
-
import { esm_default } from "../esm-
|
|
18
|
+
import { esm_default } from "../esm-BWVigQCO.js";
|
|
19
19
|
import process from "node:process";
|
|
20
20
|
|
|
21
21
|
//#region src/runtime/docloader.test.ts
|
|
@@ -402,6 +402,62 @@ test("kvCache()", async (t) => {
|
|
|
402
402
|
}
|
|
403
403
|
});
|
|
404
404
|
});
|
|
405
|
+
await t.step("preloaded contexts bypass cache", async () => {
|
|
406
|
+
const kv$1 = new MemoryKvStore();
|
|
407
|
+
let loaderCalled = false;
|
|
408
|
+
const mockLoader = (url) => {
|
|
409
|
+
loaderCalled = true;
|
|
410
|
+
return Promise.resolve({
|
|
411
|
+
contextUrl: null,
|
|
412
|
+
documentUrl: url,
|
|
413
|
+
document: { "mock": "document" }
|
|
414
|
+
});
|
|
415
|
+
};
|
|
416
|
+
const loader = kvCache({
|
|
417
|
+
kv: kv$1,
|
|
418
|
+
loader: mockLoader,
|
|
419
|
+
prefix: ["_test", "preloaded"]
|
|
420
|
+
});
|
|
421
|
+
const activityStreamsUrl = "https://www.w3.org/ns/activitystreams";
|
|
422
|
+
loaderCalled = false;
|
|
423
|
+
const result = await loader(activityStreamsUrl);
|
|
424
|
+
assertEquals(result, {
|
|
425
|
+
contextUrl: null,
|
|
426
|
+
documentUrl: activityStreamsUrl,
|
|
427
|
+
document: contexts_default[activityStreamsUrl]
|
|
428
|
+
});
|
|
429
|
+
assertEquals(loaderCalled, false, "Loader should not be called for preloaded contexts");
|
|
430
|
+
const cachedValue = await kv$1.get([
|
|
431
|
+
"_test",
|
|
432
|
+
"preloaded",
|
|
433
|
+
activityStreamsUrl
|
|
434
|
+
]);
|
|
435
|
+
assertEquals(cachedValue, void 0, "Preloaded contexts should not be cached in KV store");
|
|
436
|
+
const securityUrl = "https://w3id.org/security/v1";
|
|
437
|
+
loaderCalled = false;
|
|
438
|
+
const result2 = await loader(securityUrl);
|
|
439
|
+
assertEquals(result2, {
|
|
440
|
+
contextUrl: null,
|
|
441
|
+
documentUrl: securityUrl,
|
|
442
|
+
document: contexts_default[securityUrl]
|
|
443
|
+
});
|
|
444
|
+
assertEquals(loaderCalled, false, "Loader should not be called for preloaded contexts");
|
|
445
|
+
const nonPreloadedUrl = "https://example.com/not-preloaded";
|
|
446
|
+
loaderCalled = false;
|
|
447
|
+
const result3 = await loader(nonPreloadedUrl);
|
|
448
|
+
assertEquals(result3, {
|
|
449
|
+
contextUrl: null,
|
|
450
|
+
documentUrl: nonPreloadedUrl,
|
|
451
|
+
document: { "mock": "document" }
|
|
452
|
+
});
|
|
453
|
+
assertEquals(loaderCalled, true, "Loader should be called for non-preloaded URLs");
|
|
454
|
+
const cachedValue2 = await kv$1.get([
|
|
455
|
+
"_test",
|
|
456
|
+
"preloaded",
|
|
457
|
+
nonPreloadedUrl
|
|
458
|
+
]);
|
|
459
|
+
assertEquals(cachedValue2, result3, "Non-preloaded URLs should be cached");
|
|
460
|
+
});
|
|
405
461
|
});
|
|
406
462
|
test("getUserAgent()", () => {
|
|
407
463
|
if ("Deno" in globalThis) {
|
package/dist/runtime/key.test.js
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../type-
|
|
6
|
+
import { exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../type-iB-6GI3W.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../lookup-
|
|
11
|
-
import "../actor-
|
|
12
|
-
import { exportJwk, importJwk } from "../key-
|
|
13
|
-
import { test } from "../testing-
|
|
10
|
+
import "../lookup-BBjrfjI5.js";
|
|
11
|
+
import "../actor-CLRQDEV9.js";
|
|
12
|
+
import { exportJwk, importJwk } from "../key-I8MiG9nK.js";
|
|
13
|
+
import { test } from "../testing-BVNNmwCi.js";
|
|
14
14
|
import "../std__assert-X-_kMxKM.js";
|
|
15
15
|
import "../assert_rejects-DiIiJbZn.js";
|
|
16
16
|
import "../assert_is_error-BPGph1Jx.js";
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { LanguageString } from "../type-
|
|
6
|
+
import { LanguageString } from "../type-iB-6GI3W.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../lookup-
|
|
11
|
-
import { test } from "../testing-
|
|
10
|
+
import "../lookup-BBjrfjI5.js";
|
|
11
|
+
import { test } from "../testing-BVNNmwCi.js";
|
|
12
12
|
import "../std__assert-X-_kMxKM.js";
|
|
13
13
|
import "../assert_rejects-DiIiJbZn.js";
|
|
14
14
|
import "../assert_is_error-BPGph1Jx.js";
|
package/dist/runtime/mod.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
import "../kv-C7sopW2E.js";
|
|
4
|
-
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, DocumentLoaderFactoryOptions, FetchError, GetDocumentLoaderOptions, GetUserAgentOptions, KvCacheParameters, RemoteDocument, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "../docloader-
|
|
5
|
-
import { LanguageString } from "../vocab-
|
|
6
|
-
import "../http-
|
|
7
|
-
import { GetAuthenticatedDocumentLoaderOptions, exportMultibaseKey, exportSpki, getAuthenticatedDocumentLoader, importMultibaseKey, importPem, importPkcs1, importSpki } from "../mod-
|
|
4
|
+
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, DocumentLoaderFactoryOptions, FetchError, GetDocumentLoaderOptions, GetUserAgentOptions, KvCacheParameters, RemoteDocument, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "../docloader-CxWcuWqQ.js";
|
|
5
|
+
import { LanguageString } from "../vocab-Ukxjz3TM.js";
|
|
6
|
+
import "../http-DtG44GdM.js";
|
|
7
|
+
import { GetAuthenticatedDocumentLoaderOptions, exportMultibaseKey, exportSpki, getAuthenticatedDocumentLoader, importMultibaseKey, importPem, importPkcs1, importSpki } from "../mod-mSMqo9JU.js";
|
|
8
8
|
export { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, DocumentLoaderFactoryOptions, FetchError, GetAuthenticatedDocumentLoaderOptions, GetDocumentLoaderOptions, GetUserAgentOptions, KvCacheParameters, LanguageString, RemoteDocument, exportMultibaseKey, exportSpki, fetchDocumentLoader, getAuthenticatedDocumentLoader, getDocumentLoader, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, kvCache };
|
package/dist/runtime/mod.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "../docloader-
|
|
6
|
-
import { LanguageString, exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../actor-
|
|
7
|
-
import "../lookup-
|
|
8
|
-
import "../key-
|
|
9
|
-
import "../http-
|
|
10
|
-
import { getAuthenticatedDocumentLoader } from "../authdocloader-
|
|
5
|
+
import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "../docloader-Dvsvkvlo.js";
|
|
6
|
+
import { LanguageString, exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../actor-BDPKTUai.js";
|
|
7
|
+
import "../lookup-nB-tCGVP.js";
|
|
8
|
+
import "../key-CK11m7Rs.js";
|
|
9
|
+
import "../http-CgMHCKJe.js";
|
|
10
|
+
import { getAuthenticatedDocumentLoader } from "../authdocloader-C2mtQBvn.js";
|
|
11
11
|
import "../runtime-BSkOVUWM.js";
|
|
12
12
|
|
|
13
13
|
export { FetchError, LanguageString, exportMultibaseKey, exportSpki, fetchDocumentLoader, getAuthenticatedDocumentLoader, getDocumentLoader, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, kvCache };
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { codes, decode, decodeText, encode, encodeText, names } from "../../type-
|
|
6
|
+
import { codes, decode, decodeText, encode, encodeText, names } from "../../type-iB-6GI3W.js";
|
|
7
7
|
import { assertEquals } from "../../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../../assert-MZs1qjMx.js";
|
|
9
9
|
import "../../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../../lookup-
|
|
11
|
-
import { test } from "../../testing-
|
|
10
|
+
import "../../lookup-BBjrfjI5.js";
|
|
11
|
+
import { test } from "../../testing-BVNNmwCi.js";
|
|
12
12
|
import "../../std__assert-X-_kMxKM.js";
|
|
13
13
|
import "../../assert_rejects-DiIiJbZn.js";
|
|
14
14
|
import "../../assert_is_error-BPGph1Jx.js";
|
package/dist/runtime/url.test.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { UrlError, expandIPv6Address, isValidPublicIPv4Address, isValidPublicIPv6Address, validatePublicUrl } from "../type-
|
|
6
|
+
import { UrlError, expandIPv6Address, isValidPublicIPv4Address, isValidPublicIPv6Address, validatePublicUrl } from "../type-iB-6GI3W.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
|
-
import "../lookup-
|
|
10
|
-
import { test } from "../testing-
|
|
9
|
+
import "../lookup-BBjrfjI5.js";
|
|
10
|
+
import { test } from "../testing-BVNNmwCi.js";
|
|
11
11
|
import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
12
12
|
import "../assert_is_error-BPGph1Jx.js";
|
|
13
13
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./type-
|
|
7
|
-
import { doubleKnock } from "./http-
|
|
6
|
+
import { deno_default } from "./type-iB-6GI3W.js";
|
|
7
|
+
import { doubleKnock } from "./http-Cdw1rmQb.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
|
package/dist/sig/http.test.js
CHANGED
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { exportSpki } from "../type-
|
|
6
|
+
import { exportSpki } from "../type-iB-6GI3W.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../lookup-
|
|
11
|
-
import "../actor-
|
|
12
|
-
import { exportJwk } from "../key-
|
|
13
|
-
import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-
|
|
14
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import "../lookup-BBjrfjI5.js";
|
|
11
|
+
import "../actor-CLRQDEV9.js";
|
|
12
|
+
import { exportJwk } from "../key-I8MiG9nK.js";
|
|
13
|
+
import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-Cdw1rmQb.js";
|
|
14
|
+
import { mockDocumentLoader, test } from "../testing-BVNNmwCi.js";
|
|
15
15
|
import { assertExists, assertStringIncludes } from "../std__assert-X-_kMxKM.js";
|
|
16
|
-
import { assertFalse } from "../assert_rejects-DiIiJbZn.js";
|
|
16
|
+
import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
17
17
|
import "../assert_is_error-BPGph1Jx.js";
|
|
18
18
|
import "../assert_not_equals-f3m3epl3.js";
|
|
19
19
|
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
|
20
|
-
import { rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey5 } from "../keys
|
|
21
|
-
import { esm_default } from "../esm-
|
|
20
|
+
import { rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey5 } from "../keys-Ddyoaf_e.js";
|
|
21
|
+
import { esm_default } from "../esm-BWVigQCO.js";
|
|
22
22
|
import { encodeBase64 } from "byte-encodings/base64";
|
|
23
23
|
|
|
24
24
|
//#region src/sig/http.test.ts
|
|
@@ -1176,5 +1176,47 @@ test("doubleKnock() regression test for redirect handling bug", async () => {
|
|
|
1176
1176
|
assertEquals(response.status, 200);
|
|
1177
1177
|
esm_default.hardReset();
|
|
1178
1178
|
});
|
|
1179
|
+
test("signRequest() and verifyRequest() cancellation", {
|
|
1180
|
+
sanitizeResources: false,
|
|
1181
|
+
sanitizeOps: false
|
|
1182
|
+
}, async (t) => {
|
|
1183
|
+
esm_default.spyGlobal();
|
|
1184
|
+
await t.step("doubleKnock cancellation", async () => {
|
|
1185
|
+
esm_default.post("https://example.com/slow-endpoint", () => new Promise((resolve) => {
|
|
1186
|
+
setTimeout(() => {
|
|
1187
|
+
resolve(new Response("", { status: 202 }));
|
|
1188
|
+
}, 1e3);
|
|
1189
|
+
}));
|
|
1190
|
+
const request = new Request("https://example.com/slow-endpoint", {
|
|
1191
|
+
method: "POST",
|
|
1192
|
+
body: "Test message",
|
|
1193
|
+
headers: { "Content-Type": "text/plain" }
|
|
1194
|
+
});
|
|
1195
|
+
const controller = new AbortController();
|
|
1196
|
+
const promise = doubleKnock(request, {
|
|
1197
|
+
keyId: rsaPublicKey2.id,
|
|
1198
|
+
privateKey: rsaPrivateKey2
|
|
1199
|
+
}, { signal: controller.signal });
|
|
1200
|
+
controller.abort();
|
|
1201
|
+
await assertRejects(() => promise, Error);
|
|
1202
|
+
});
|
|
1203
|
+
await t.step("doubleKnock immediate cancellation", async () => {
|
|
1204
|
+
const request = new Request("https://example.com/", {
|
|
1205
|
+
method: "POST",
|
|
1206
|
+
body: "Hello, world!",
|
|
1207
|
+
headers: {
|
|
1208
|
+
"Content-Type": "text/plain; charset=utf-8",
|
|
1209
|
+
Accept: "text/plain"
|
|
1210
|
+
}
|
|
1211
|
+
});
|
|
1212
|
+
const controller = new AbortController();
|
|
1213
|
+
controller.abort();
|
|
1214
|
+
await assertRejects(() => doubleKnock(request, {
|
|
1215
|
+
keyId: rsaPublicKey2.id,
|
|
1216
|
+
privateKey: rsaPrivateKey2
|
|
1217
|
+
}, { signal: controller.signal }), Error);
|
|
1218
|
+
});
|
|
1219
|
+
esm_default.hardReset();
|
|
1220
|
+
});
|
|
1179
1221
|
|
|
1180
1222
|
//#endregion
|
package/dist/sig/key.test.js
CHANGED
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { CryptographicKey, Multikey } from "../type-
|
|
6
|
+
import { CryptographicKey, Multikey } from "../type-iB-6GI3W.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../lookup-
|
|
11
|
-
import "../actor-
|
|
12
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-
|
|
13
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import "../lookup-BBjrfjI5.js";
|
|
11
|
+
import "../actor-CLRQDEV9.js";
|
|
12
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-I8MiG9nK.js";
|
|
13
|
+
import { mockDocumentLoader, test } from "../testing-BVNNmwCi.js";
|
|
14
14
|
import "../std__assert-X-_kMxKM.js";
|
|
15
15
|
import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
16
16
|
import "../assert_is_error-BPGph1Jx.js";
|
|
17
17
|
import "../assert_not_equals-f3m3epl3.js";
|
|
18
18
|
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
|
19
|
-
import { ed25519Multikey, rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey3 } from "../keys
|
|
19
|
+
import { ed25519Multikey, rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey3 } from "../keys-Ddyoaf_e.js";
|
|
20
20
|
|
|
21
21
|
//#region src/sig/key.test.ts
|
|
22
22
|
test("validateCryptoKey()", async () => {
|