@fedify/fedify 1.7.13 → 1.7.15
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-CPpvuBKU.d.ts → actor.d.ts} +3 -3
- package/dist/{actor-BVilnhZ3.js → actor.js} +6 -6
- package/dist/{assert-LOEeCUK5.js → assert.js} +2 -2
- package/dist/{assert_equals-B44MxcIj.js → assert_equals.js} +16 -16
- package/dist/{assert_instance_of-XtuFevV_.js → assert_instance_of.js} +2 -2
- package/dist/{assert_is_error-BTlryvT0.js → assert_is_error.js} +2 -2
- package/dist/{assert_not_equals-C685gKx6.js → assert_not_equals.js} +3 -6
- package/dist/{assert_rejects-DWQ4jaf9.js → assert_rejects.js} +3 -3
- package/dist/{assert_throws-YetpVSc-.js → assert_throws.js} +3 -3
- package/dist/{authdocloader-DqCINL6u.js → authdocloader.js} +8 -8
- package/dist/{builder-CKUAOfcL.js → builder.js} +7 -7
- package/dist/{chunk-Cx8LTkjm.js → chunk.js} +22 -15
- package/dist/{client-DvtwXO7t.d.ts → client.d.ts} +2 -2
- package/dist/{client-C5xUY491.js → client.js} +3 -3
- package/dist/{collection-Dfb0TPno.js → collection.js} +2 -3
- package/dist/compat/mod.d.ts +79 -12
- package/dist/compat/mod.js +1 -2
- package/dist/compat/transformers.test.js +34 -38
- package/dist/{context-OBWjptjU.d.ts → context.d.ts} +11 -11
- package/dist/{context-aglzx1Ww.js → context.js} +5 -5
- package/dist/{docloader-Q42SMRIB.d.ts → docloader.d.ts} +2 -2
- package/dist/{docloader-Qfs9nPiy.js → docloader.js} +32 -152
- package/dist/{docloader-09nVWLAZ.js → docloader2.js} +1 -1
- package/dist/{esm-DO9PrujO.js → esm.js} +36 -22
- package/dist/federation/builder.test.js +20 -26
- package/dist/federation/collection.test.js +11 -16
- package/dist/federation/handler.test.js +41 -48
- package/dist/federation/inbox.test.js +11 -11
- package/dist/federation/keycache.test.js +12 -11
- package/dist/federation/kv.test.js +8 -10
- package/dist/federation/middleware.test.js +105 -134
- package/dist/federation/mod.d.ts +4 -13
- package/dist/federation/mod.js +206 -12
- package/dist/federation/mq.test.js +12 -17
- package/dist/federation/retry.test.js +5 -4
- package/dist/federation/router.test.js +9 -10
- package/dist/federation/send.test.js +23 -24
- package/dist/{http-DMTrO3Ye.d.ts → http.d.ts} +3 -3
- package/dist/{http-CjDwMreH.js → http.js} +25 -31
- package/dist/{inbox-ApPO50Ma.js → inbox.js} +5 -5
- package/dist/key.js +16 -0
- package/dist/{key-BPUM0v_S.js → key2.js} +5 -5
- package/dist/{keycache-B7Urghlu.js → keycache.js} +2 -2
- package/dist/{keys-DGJec4-R.js → keys.js} +2 -2
- package/dist/{kv-DRaeSXco.d.ts → kv.d.ts} +1 -1
- package/dist/{kv-BMY6Qf_A.js → kv.js} +1 -1
- package/dist/{langstr-DbWheeIS.js → langstr.js} +1 -1
- package/dist/{ld-DJTavNY3.js → ld.js} +9 -12
- package/dist/{lookup-Bf-K85bV.d.ts → lookup.d.ts} +2 -2
- package/dist/{lookup-CkOdKyYR.js → lookup.js} +4 -4
- package/dist/{lookup-CnkkF4Rf.js → lookup2.js} +6 -6
- package/dist/{middleware-BxHcZC4p.js → middleware.js} +35 -39
- package/dist/middleware2.js +32 -0
- package/dist/mod.d.ts +17 -17
- package/dist/mod.js +17 -17
- package/dist/{mod-CDzlVCUF.d.ts → mod2.d.ts} +3 -3
- package/dist/{mod-CCL2cvnI.d.ts → mod3.d.ts} +4 -4
- package/dist/{mq-DYKDDJmp.d.ts → mq.d.ts} +1 -1
- package/dist/{multibase-CnLHszip.js → multibase.js} +1 -1
- package/dist/nodeinfo/client.test.js +19 -28
- package/dist/nodeinfo/handler.test.js +37 -44
- package/dist/nodeinfo/mod.d.ts +2 -5
- package/dist/nodeinfo/mod.js +2 -3
- package/dist/nodeinfo/semver.test.js +13 -21
- package/dist/nodeinfo/types.test.js +9 -11
- package/dist/{owner-D0cOz8R5.d.ts → owner.d.ts} +4 -4
- package/dist/{owner-qKULzrkx.js → owner.js} +4 -4
- package/dist/{proof-d5P09-xk.js → proof.js} +11 -13
- package/dist/{retry-BiIhZWgD.js → retry.js} +1 -1
- package/dist/{router-D_aVZZUc.js → router.js} +1 -1
- package/dist/runtime/authdocloader.test.js +22 -26
- package/dist/runtime/docloader.test.js +56 -56
- package/dist/runtime/key.test.js +31 -53
- package/dist/runtime/langstr.test.js +8 -10
- package/dist/runtime/mod.d.ts +103 -6
- package/dist/runtime/mod.js +6 -7
- package/dist/runtime/multibase/multibase.test.js +12 -18
- package/dist/runtime/url.test.js +7 -6
- package/dist/{semver-BNrOOAs9.js → semver.js} +7 -17
- package/dist/{send-BnMY3Qxa.js → send.js} +4 -4
- package/dist/sig/http.test.js +104 -168
- package/dist/sig/key.test.js +17 -20
- package/dist/sig/ld.test.js +28 -35
- package/dist/sig/mod.d.ts +3 -7
- package/dist/sig/mod.js +6 -7
- package/dist/sig/owner.test.js +24 -30
- package/dist/sig/proof.test.js +24 -29
- package/dist/{std__assert-o_r9vqm1.js → std__assert.js} +7 -13
- package/dist/testing/docloader.test.js +9 -12
- package/dist/testing/mod.js +2 -1
- package/dist/{testing-DLyvtiiW.js → testing.js} +2 -2
- package/dist/{transformers-ghwJuzGY.js → transformers.js} +1 -1
- package/dist/{type-CFuiGLz9.js → type.js} +1 -1
- package/dist/{types-CJHS5pXl.js → types.js} +2 -2
- package/dist/{url-C2xuoQD1.js → url.js} +1 -1
- package/dist/vocab/actor.test.js +76 -128
- package/dist/vocab/lookup.test.js +19 -23
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +10 -10
- package/dist/vocab/vocab.test.js +90 -109
- package/dist/{vocab-CzEfWQk2.d.ts → vocab.d.ts} +2 -2
- package/dist/{vocab-S7fEn6XO.js → vocab.js} +318 -454
- package/dist/webfinger/handler.test.js +40 -48
- package/dist/webfinger/lookup.test.js +12 -15
- package/dist/webfinger/mod.d.ts +1 -4
- package/dist/webfinger/mod.js +2 -3
- package/dist/x/cfworkers.d.ts +2 -2
- package/dist/x/cfworkers.test.js +7 -9
- package/dist/x/hono.d.ts +2 -11
- package/dist/x/sveltekit.d.ts +2 -11
- package/package.json +1 -1
- package/dist/actor-CsmPeeHG.js +0 -34925
- package/dist/authdocloader-9g6RkEcR.js +0 -53
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/docloader-CchlnLWb.js +0 -4598
- package/dist/federation-B0aljx0V.js +0 -203
- package/dist/http-CP3h1SLi.js +0 -796
- package/dist/key--l6NVKdl.js +0 -257
- package/dist/key-1Fv7reaM.js +0 -16
- package/dist/key-DD37RpoD.js +0 -10
- package/dist/lookup-CN-LpF5e.js +0 -127
- package/dist/middleware-BQHe0X6Y.js +0 -17
- package/dist/middleware-C3TZ3P-v.js +0 -33
- package/dist/middleware-CEpilAEY.js +0 -3524
- package/dist/mod-1pDWKvUL.d.ts +0 -2
- package/dist/mod-DFncUgcE.d.ts +0 -82
- package/dist/mod-GIh5OYxW.d.ts +0 -2
- package/dist/mod-g0xFzAP9.d.ts +0 -2
- package/dist/mod-qFMzZ3iF.d.ts +0 -104
- package/dist/nodeinfo-CyEbLjHs.js +0 -4
- package/dist/proof-BfeWBNrY.js +0 -582
- package/dist/runtime-BSkOVUWM.js +0 -4
- package/dist/sig-BXJO--F9.js +0 -4
- package/dist/types-BZUzjGS0.js +0 -455
- package/dist/vocab-C_pE4SvE.js +0 -168
- package/dist/webfinger-C3GIyXIg.js +0 -4
- /package/dist/{denokv-CvROlGYX.js → denokv.js} +0 -0
package/dist/sig/key.test.js
CHANGED
|
@@ -3,26 +3,23 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import "../
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import
|
|
13
|
-
import "../
|
|
14
|
-
import "../
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import "../
|
|
20
|
-
import {
|
|
21
|
-
import "../
|
|
22
|
-
import "../
|
|
23
|
-
import { assertThrows } from "../assert_throws-YetpVSc-.js";
|
|
24
|
-
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
|
25
|
-
import { ed25519Multikey, rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey3 } from "../keys-DGJec4-R.js";
|
|
6
|
+
import "../chunk.js";
|
|
7
|
+
import { t as assertEquals } from "../assert_equals.js";
|
|
8
|
+
import "../docloader.js";
|
|
9
|
+
import "../url.js";
|
|
10
|
+
import "../multibase.js";
|
|
11
|
+
import { h as Multikey, o as CryptographicKey } from "../vocab.js";
|
|
12
|
+
import "../langstr.js";
|
|
13
|
+
import "../lookup.js";
|
|
14
|
+
import "../actor.js";
|
|
15
|
+
import { a as validateCryptoKey, i as importJwk, n as fetchKey, r as generateCryptoKeyPair, t as exportJwk } from "../key2.js";
|
|
16
|
+
import { t as test } from "../testing.js";
|
|
17
|
+
import "../std__assert.js";
|
|
18
|
+
import { t as assertRejects } from "../assert_rejects.js";
|
|
19
|
+
import "../assert_is_error.js";
|
|
20
|
+
import { t as assertThrows } from "../assert_throws.js";
|
|
21
|
+
import { t as mockDocumentLoader } from "../docloader2.js";
|
|
22
|
+
import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys.js";
|
|
26
23
|
|
|
27
24
|
//#region sig/key.test.ts
|
|
28
25
|
test("validateCryptoKey()", async () => {
|
package/dist/sig/ld.test.js
CHANGED
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import
|
|
12
|
-
import "../
|
|
13
|
-
import "../
|
|
14
|
-
import "../
|
|
15
|
-
import "../actor
|
|
16
|
-
import { generateCryptoKeyPair } from "../
|
|
17
|
-
import {
|
|
18
|
-
import { test } from "../testing
|
|
19
|
-
import { assertFalse, assertRejects } from "../assert_rejects
|
|
20
|
-
import "../assert_is_error
|
|
21
|
-
import { assertThrows } from "../assert_throws
|
|
22
|
-
import { mockDocumentLoader } from "../
|
|
23
|
-
import {
|
|
6
|
+
import "../chunk.js";
|
|
7
|
+
import { t as assertEquals } from "../assert_equals.js";
|
|
8
|
+
import { t as assert } from "../assert.js";
|
|
9
|
+
import "../docloader.js";
|
|
10
|
+
import "../url.js";
|
|
11
|
+
import "../multibase.js";
|
|
12
|
+
import { o as CryptographicKey } from "../vocab.js";
|
|
13
|
+
import "../langstr.js";
|
|
14
|
+
import "../lookup.js";
|
|
15
|
+
import "../actor.js";
|
|
16
|
+
import { r as generateCryptoKeyPair } from "../key2.js";
|
|
17
|
+
import { a as signJsonLd, n as createSignature, o as verifyJsonLd, r as detachSignature, s as verifySignature, t as attachSignature } from "../ld.js";
|
|
18
|
+
import { t as test } from "../testing.js";
|
|
19
|
+
import { n as assertFalse, t as assertRejects } from "../assert_rejects.js";
|
|
20
|
+
import "../assert_is_error.js";
|
|
21
|
+
import { t as assertThrows } from "../assert_throws.js";
|
|
22
|
+
import { t as mockDocumentLoader } from "../docloader2.js";
|
|
23
|
+
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys.js";
|
|
24
24
|
import { encodeBase64 } from "byte-encodings/base64";
|
|
25
25
|
|
|
26
26
|
//#region sig/ld.test.ts
|
|
@@ -49,27 +49,23 @@ test("createSignature()", async () => {
|
|
|
49
49
|
id: "https://example.com/1",
|
|
50
50
|
type: "Create"
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
const key = await verifySignature(attachSignature(doc, sig), {
|
|
52
|
+
assertEquals(await verifySignature(attachSignature(doc, await createSignature(doc, rsaPrivateKey2, rsaPublicKey2.id, { contextLoader: mockDocumentLoader })), {
|
|
54
53
|
documentLoader: mockDocumentLoader,
|
|
55
54
|
contextLoader: mockDocumentLoader
|
|
56
|
-
});
|
|
57
|
-
assertEquals(key, rsaPublicKey2);
|
|
55
|
+
}), rsaPublicKey2);
|
|
58
56
|
assertRejects(() => createSignature(doc, rsaPublicKey2.publicKey, rsaPublicKey2.id, { contextLoader: mockDocumentLoader }), TypeError);
|
|
59
57
|
assertRejects(() => createSignature(doc, ed25519PrivateKey, ed25519Multikey.id, { contextLoader: mockDocumentLoader }), TypeError);
|
|
60
58
|
});
|
|
61
59
|
test("signJsonLd()", async () => {
|
|
62
|
-
|
|
60
|
+
assert(await verifyJsonLd(await signJsonLd({
|
|
63
61
|
"@context": "https://www.w3.org/ns/activitystreams",
|
|
64
62
|
id: "https://example.com/1",
|
|
65
63
|
type: "Create",
|
|
66
64
|
actor: "https://example.com/person2"
|
|
67
|
-
}, rsaPrivateKey3, rsaPublicKey3.id, { contextLoader: mockDocumentLoader })
|
|
68
|
-
const verified = await verifyJsonLd(signed, {
|
|
65
|
+
}, rsaPrivateKey3, rsaPublicKey3.id, { contextLoader: mockDocumentLoader }), {
|
|
69
66
|
documentLoader: mockDocumentLoader,
|
|
70
67
|
contextLoader: mockDocumentLoader
|
|
71
|
-
});
|
|
72
|
-
assert(verified);
|
|
68
|
+
}));
|
|
73
69
|
});
|
|
74
70
|
const document = {
|
|
75
71
|
"@context": ["https://www.w3.org/ns/activitystreams", {
|
|
@@ -209,22 +205,19 @@ test("verifySignature()", async () => {
|
|
|
209
205
|
assertEquals(key4, key);
|
|
210
206
|
});
|
|
211
207
|
test("verifyJsonLd()", async () => {
|
|
212
|
-
|
|
208
|
+
assert(await verifyJsonLd(testVector, {
|
|
213
209
|
documentLoader: mockDocumentLoader,
|
|
214
210
|
contextLoader: mockDocumentLoader
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
const signed = await signJsonLd({
|
|
211
|
+
}));
|
|
212
|
+
assertFalse(await verifyJsonLd(await signJsonLd({
|
|
218
213
|
"@context": "https://www.w3.org/ns/activitystreams",
|
|
219
214
|
id: "https://example.com/1",
|
|
220
215
|
type: "Create",
|
|
221
216
|
actor: "https://example.com/person2"
|
|
222
|
-
}, rsaPrivateKey2, rsaPublicKey2.id, { contextLoader: mockDocumentLoader })
|
|
223
|
-
const verified2 = await verifyJsonLd(signed, {
|
|
217
|
+
}, rsaPrivateKey2, rsaPublicKey2.id, { contextLoader: mockDocumentLoader }), {
|
|
224
218
|
documentLoader: mockDocumentLoader,
|
|
225
219
|
contextLoader: mockDocumentLoader
|
|
226
|
-
});
|
|
227
|
-
assertFalse(verified2);
|
|
220
|
+
}));
|
|
228
221
|
});
|
|
229
222
|
|
|
230
223
|
//#endregion
|
package/dist/sig/mod.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import "../actor-CPpvuBKU.js";
|
|
7
|
-
import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-DMTrO3Ye.js";
|
|
8
|
-
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-D0cOz8R5.js";
|
|
9
|
-
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-CCL2cvnI.js";
|
|
3
|
+
import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryptoKeyPair, i as VerifyRequestOptions, l as KeyCache, n as HttpMessageSignaturesSpecDeterminer, o as verifyRequest, p as importJwk, r as SignRequestOptions, s as FetchKeyOptions, t as HttpMessageSignaturesSpec, u as exportJwk } from "../http.js";
|
|
4
|
+
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner.js";
|
|
5
|
+
import { _ as verifyJsonLd, a as createProof, c as verifyProof, d as VerifyJsonLdOptions, f as VerifySignatureOptions, g as signJsonLd, h as detachSignature, i as VerifyProofOptions, l as CreateSignatureOptions, m as createSignature, n as SignObjectOptions, o as signObject, p as attachSignature, r as VerifyObjectOptions, s as verifyObject, t as CreateProofOptions, u as SignJsonLdOptions, v as verifySignature } from "../mod3.js";
|
|
10
6
|
export { CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyOptions, FetchKeyResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/sig/mod.js
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import "../docloader
|
|
6
|
-
import "../actor
|
|
7
|
-
import "../lookup
|
|
8
|
-
import {
|
|
9
|
-
import { signRequest, verifyRequest } from "../http
|
|
10
|
-
import {
|
|
11
|
-
import "../sig-BXJO--F9.js";
|
|
5
|
+
import "../docloader.js";
|
|
6
|
+
import "../actor.js";
|
|
7
|
+
import "../lookup.js";
|
|
8
|
+
import { i as importJwk, n as fetchKey, r as generateCryptoKeyPair, t as exportJwk } from "../key2.js";
|
|
9
|
+
import { n as signRequest, r as verifyRequest } from "../http.js";
|
|
10
|
+
import { a as doesActorOwnKey, c as createSignature, d as signJsonLd, f as verifyJsonLd, i as verifyProof, l as detachSignature, n as signObject, o as getKeyOwner, p as verifySignature, r as verifyObject, s as attachSignature, t as createProof } from "../proof.js";
|
|
12
11
|
|
|
13
12
|
export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/sig/owner.test.js
CHANGED
|
@@ -3,28 +3,26 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import "../
|
|
9
|
-
import "../docloader
|
|
10
|
-
import "../url
|
|
11
|
-
import "../multibase
|
|
12
|
-
import { Create } from "../vocab
|
|
13
|
-
import "../langstr
|
|
14
|
-
import "../lookup
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import "../
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import "../
|
|
22
|
-
import
|
|
23
|
-
import "../
|
|
24
|
-
import "../
|
|
25
|
-
import "../
|
|
26
|
-
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
|
27
|
-
import { rsaPublicKey1, rsaPublicKey2 } from "../keys-DGJec4-R.js";
|
|
6
|
+
import "../chunk.js";
|
|
7
|
+
import { t as assertEquals } from "../assert_equals.js";
|
|
8
|
+
import { t as assert } from "../assert.js";
|
|
9
|
+
import "../docloader.js";
|
|
10
|
+
import "../url.js";
|
|
11
|
+
import "../multibase.js";
|
|
12
|
+
import { a as Create } from "../vocab.js";
|
|
13
|
+
import "../langstr.js";
|
|
14
|
+
import "../lookup.js";
|
|
15
|
+
import "../actor.js";
|
|
16
|
+
import "../key2.js";
|
|
17
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner.js";
|
|
18
|
+
import { t as lookupObject } from "../lookup2.js";
|
|
19
|
+
import { t as test } from "../testing.js";
|
|
20
|
+
import "../std__assert.js";
|
|
21
|
+
import { n as assertFalse } from "../assert_rejects.js";
|
|
22
|
+
import "../assert_is_error.js";
|
|
23
|
+
import "../assert_throws.js";
|
|
24
|
+
import { t as mockDocumentLoader } from "../docloader2.js";
|
|
25
|
+
import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys.js";
|
|
28
26
|
|
|
29
27
|
//#region sig/owner.test.ts
|
|
30
28
|
test("doesActorOwnKey()", async () => {
|
|
@@ -44,16 +42,12 @@ test("getKeyOwner()", async () => {
|
|
|
44
42
|
documentLoader: mockDocumentLoader,
|
|
45
43
|
contextLoader: mockDocumentLoader
|
|
46
44
|
};
|
|
47
|
-
|
|
48
|
-
assertEquals(owner, await lookupObject("https://example.com/users/handle", options));
|
|
45
|
+
assertEquals(await getKeyOwner(new URL("https://example.com/users/handle#main-key"), options), await lookupObject("https://example.com/users/handle", options));
|
|
49
46
|
const owner2 = await getKeyOwner(new URL("https://example.com/key"), options);
|
|
50
47
|
assertEquals(owner2, await lookupObject("https://example.com/person", options));
|
|
51
|
-
|
|
52
|
-
assertEquals(
|
|
53
|
-
|
|
54
|
-
assertEquals(noOwner, null);
|
|
55
|
-
const noOwner2 = await getKeyOwner(new URL("https://example.com/object"), options);
|
|
56
|
-
assertEquals(noOwner2, null);
|
|
48
|
+
assertEquals(await getKeyOwner(rsaPublicKey1, options), owner2);
|
|
49
|
+
assertEquals(await getKeyOwner(new URL("https://example.com/key2"), options), null);
|
|
50
|
+
assertEquals(await getKeyOwner(new URL("https://example.com/object"), options), null);
|
|
57
51
|
});
|
|
58
52
|
|
|
59
53
|
//#endregion
|
package/dist/sig/proof.test.js
CHANGED
|
@@ -3,27 +3,25 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import "../
|
|
8
|
-
import { assertInstanceOf } from "../assert_instance_of
|
|
9
|
-
import "../docloader
|
|
10
|
-
import "../url
|
|
11
|
-
import { decode } from "../multibase
|
|
12
|
-
import {
|
|
13
|
-
import "../langstr
|
|
14
|
-
import "../lookup
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import "../
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import "../
|
|
21
|
-
import
|
|
22
|
-
import "../
|
|
23
|
-
import "../
|
|
24
|
-
import "../
|
|
25
|
-
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
|
26
|
-
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-DGJec4-R.js";
|
|
6
|
+
import "../chunk.js";
|
|
7
|
+
import { t as assertEquals } from "../assert_equals.js";
|
|
8
|
+
import { t as assertInstanceOf } from "../assert_instance_of.js";
|
|
9
|
+
import "../docloader.js";
|
|
10
|
+
import "../url.js";
|
|
11
|
+
import { t as decode } from "../multibase.js";
|
|
12
|
+
import { C as Place, a as Create, g as Note, h as Multikey, j as importMultibaseKey, s as DataIntegrityProof } from "../vocab.js";
|
|
13
|
+
import "../langstr.js";
|
|
14
|
+
import "../lookup.js";
|
|
15
|
+
import "../actor.js";
|
|
16
|
+
import "../key2.js";
|
|
17
|
+
import { i as verifyProof, n as signObject, r as verifyObject, t as createProof } from "../proof.js";
|
|
18
|
+
import { t as test } from "../testing.js";
|
|
19
|
+
import "../std__assert.js";
|
|
20
|
+
import { t as assertRejects } from "../assert_rejects.js";
|
|
21
|
+
import "../assert_is_error.js";
|
|
22
|
+
import "../assert_throws.js";
|
|
23
|
+
import { t as mockDocumentLoader } from "../docloader2.js";
|
|
24
|
+
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys.js";
|
|
27
25
|
import { decodeHex, encodeHex } from "byte-encodings/hex";
|
|
28
26
|
|
|
29
27
|
//#region sig/proof.test.ts
|
|
@@ -125,11 +123,10 @@ test("signObject()", async () => {
|
|
|
125
123
|
created: "2023-02-24T23:36:38Z"
|
|
126
124
|
}
|
|
127
125
|
});
|
|
128
|
-
|
|
126
|
+
assertEquals(await (await signObject(signedObject, ed25519PrivateKey, ed25519Multikey.id, {
|
|
129
127
|
...options,
|
|
130
128
|
created
|
|
131
|
-
})
|
|
132
|
-
assertEquals(await signedObject2.toJsonLd(options), {
|
|
129
|
+
})).toJsonLd(options), {
|
|
133
130
|
"@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
|
|
134
131
|
id: "https://server.example/activities/1",
|
|
135
132
|
type: "Create",
|
|
@@ -217,16 +214,14 @@ test("verifyProof()", async () => {
|
|
|
217
214
|
cache["https://server.example/users/alice#ed25519-key"] = ed25519Multikey;
|
|
218
215
|
assertEquals(await verifyProof(jsonLd, proof, options), expectedKey);
|
|
219
216
|
assertEquals(cache["https://server.example/users/alice#ed25519-key"], expectedKey);
|
|
220
|
-
|
|
217
|
+
assertEquals(await verifyProof({
|
|
221
218
|
...jsonLd,
|
|
222
219
|
object: {
|
|
223
220
|
...jsonLd.object,
|
|
224
221
|
content: "bye"
|
|
225
222
|
}
|
|
226
|
-
};
|
|
227
|
-
assertEquals(await verifyProof(
|
|
228
|
-
const wrongProof = proof.clone({ created: Temporal.Now.instant() });
|
|
229
|
-
assertEquals(await verifyProof(jsonLd, wrongProof, options), null);
|
|
223
|
+
}, proof, options), null);
|
|
224
|
+
assertEquals(await verifyProof(jsonLd, proof.clone({ created: Temporal.Now.instant() }), options), null);
|
|
230
225
|
});
|
|
231
226
|
test("verifyObject()", async () => {
|
|
232
227
|
const options = {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { a as diff, i as diffStr, o as buildMessage, r as format, s as red, u as AssertionError } from "./assert_equals.js";
|
|
7
7
|
|
|
8
8
|
//#region node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_exists.js
|
|
9
9
|
/**
|
|
@@ -23,8 +23,7 @@ import { AssertionError, buildMessage, diff, diffStr, format, red } from "./asse
|
|
|
23
23
|
* @param msg The optional message to include in the error if the assertion fails.
|
|
24
24
|
*/ function assertExists(actual, msg) {
|
|
25
25
|
if (actual === void 0 || actual === null) {
|
|
26
|
-
|
|
27
|
-
msg = `Expected actual: "${actual}" to not be null or undefined${msgSuffix}`;
|
|
26
|
+
msg = `Expected actual: "${actual}" to not be null or undefined${msg ? `: ${msg}` : "."}`;
|
|
28
27
|
throw new AssertionError(msg);
|
|
29
28
|
}
|
|
30
29
|
}
|
|
@@ -110,14 +109,10 @@ import { AssertionError, buildMessage, diff, diffStr, format, red } from "./asse
|
|
|
110
109
|
let message;
|
|
111
110
|
const actualString = format(actual);
|
|
112
111
|
const expectedString = format(expected);
|
|
113
|
-
if (actualString === expectedString) {
|
|
114
|
-
|
|
115
|
-
message = `Values have the same structure but are not reference-equal${msgSuffix}\n\n${red(withOffset)}\n`;
|
|
116
|
-
} else {
|
|
112
|
+
if (actualString === expectedString) message = `Values have the same structure but are not reference-equal${msgSuffix}\n\n${red(actualString.split("\n").map((l) => ` ${l}`).join("\n"))}\n`;
|
|
113
|
+
else {
|
|
117
114
|
const stringDiff = typeof actual === "string" && typeof expected === "string";
|
|
118
|
-
|
|
119
|
-
const diffMsg = buildMessage(diffResult, { stringDiff }).join("\n");
|
|
120
|
-
message = `Values are not strictly equal${msgSuffix}\n${diffMsg}`;
|
|
115
|
+
message = `Values are not strictly equal${msgSuffix}\n${buildMessage(stringDiff ? diffStr(actual, expected) : diff(actualString.split("\n"), expectedString.split("\n")), { stringDiff }).join("\n")}`;
|
|
121
116
|
}
|
|
122
117
|
throw new AssertionError(message);
|
|
123
118
|
}
|
|
@@ -141,11 +136,10 @@ import { AssertionError, buildMessage, diff, diffStr, format, red } from "./asse
|
|
|
141
136
|
* @param msg The optional message to display if the assertion fails.
|
|
142
137
|
*/ function assertStringIncludes(actual, expected, msg) {
|
|
143
138
|
if (!actual.includes(expected)) {
|
|
144
|
-
|
|
145
|
-
msg = `Expected actual: "${actual}" to contain: "${expected}"${msgSuffix}`;
|
|
139
|
+
msg = `Expected actual: "${actual}" to contain: "${expected}"${msg ? `: ${msg}` : "."}`;
|
|
146
140
|
throw new AssertionError(msg);
|
|
147
141
|
}
|
|
148
142
|
}
|
|
149
143
|
|
|
150
144
|
//#endregion
|
|
151
|
-
export { assertExists
|
|
145
|
+
export { assertExists as a, assertGreaterOrEqual as i, assertStrictEquals as n, assertGreater as r, assertStringIncludes as t };
|
|
@@ -3,21 +3,18 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import "../
|
|
8
|
-
import "../
|
|
9
|
-
import
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import "../
|
|
14
|
-
import "../assert_throws-YetpVSc-.js";
|
|
15
|
-
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
|
6
|
+
import "../chunk.js";
|
|
7
|
+
import { t as assertEquals } from "../assert_equals.js";
|
|
8
|
+
import { t as test } from "../testing.js";
|
|
9
|
+
import "../std__assert.js";
|
|
10
|
+
import "../assert_rejects.js";
|
|
11
|
+
import "../assert_is_error.js";
|
|
12
|
+
import "../assert_throws.js";
|
|
13
|
+
import { t as mockDocumentLoader } from "../docloader2.js";
|
|
16
14
|
|
|
17
15
|
//#region testing/docloader.test.ts
|
|
18
16
|
test("mockDocumentLoader()", async () => {
|
|
19
|
-
|
|
20
|
-
assertEquals(await response.document, { "https://example.com/prop/test": { "@value": "foo" } });
|
|
17
|
+
assertEquals(await (await mockDocumentLoader("https://example.com/test")).document, { "https://example.com/prop/test": { "@value": "foo" } });
|
|
21
18
|
});
|
|
22
19
|
|
|
23
20
|
//#endregion
|
package/dist/testing/mod.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import "../chunk.js";
|
|
7
|
+
import { n as testDefinitions, t as test } from "../testing.js";
|
|
7
8
|
|
|
8
9
|
export { test, testDefinitions };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { __require } from "./chunk
|
|
6
|
+
import { r as __require } from "./chunk.js";
|
|
7
7
|
import { configure, getConsoleSink, reset } from "@logtape/logtape";
|
|
8
8
|
|
|
9
9
|
//#region testing/mod.ts
|
|
@@ -138,4 +138,4 @@ function caller() {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
//#endregion
|
|
141
|
-
export {
|
|
141
|
+
export { testDefinitions as n, test as t };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { formatSemVer } from "./semver
|
|
6
|
+
import { t as formatSemVer } from "./semver.js";
|
|
7
7
|
|
|
8
8
|
//#region nodeinfo/types.ts
|
|
9
9
|
/**
|
|
@@ -48,4 +48,4 @@ function nodeInfoToJson(nodeInfo) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
//#endregion
|
|
51
|
-
export { nodeInfoToJson };
|
|
51
|
+
export { nodeInfoToJson as t };
|
|
@@ -63,4 +63,4 @@ function expandIPv6Address(address) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
//#endregion
|
|
66
|
-
export {
|
|
66
|
+
export { validatePublicUrl as a, isValidPublicIPv6Address as i, expandIPv6Address as n, isValidPublicIPv4Address as r, UrlError as t };
|