@fedify/fedify 2.4.0-dev.2010 → 2.4.0-dev.2030
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/{assert-CebeUf0C.mjs → assert-D1Eafmd_.mjs} +1 -1
- package/dist/{assert_equals-CBlRfA-_.mjs → assert_equals-Z6IcEbWU.mjs} +2 -28
- package/dist/{assert_exists-DtzkXC47.mjs → assert_exists-cffSpJ7X.mjs} +1 -1
- package/dist/{assert_false-3pLLLsO4.mjs → assert_false-CPdRnc3E.mjs} +1 -1
- package/dist/{assert_greater_or_equal-BApOTh1h.mjs → assert_greater_or_equal-BlafOF4-.mjs} +2 -1
- package/dist/{assert_instance_of-g3WcyYNR.mjs → assert_instance_of-mrXWWNY-.mjs} +1 -1
- package/dist/{assert_not_equals-BN7yDMWe.mjs → assert_not_equals-CpPK2t89.mjs} +2 -1
- package/dist/{assert_rejects-wFbSPn1O.mjs → assert_rejects-CTptdYck.mjs} +2 -2
- package/dist/{assert_strict_equals-Bpjl4Psw.mjs → assert_strict_equals-CYvBmkpC.mjs} +2 -1
- package/dist/{assert_throws-BJ5wuvR2.mjs → assert_throws-BYITOvPO.mjs} +2 -1
- package/dist/assertion_error-B-cx0fFA.mjs +31 -0
- package/dist/{builder-asm96yV1.mjs → builder-BYJ5otJa.mjs} +2 -2
- package/dist/compat/outgoing-jsonld.test.mjs +71 -3
- package/dist/compat/public-audience.test.mjs +3 -3
- package/dist/compat/secured-document.test.d.mts +2 -0
- package/dist/compat/secured-document.test.mjs +58 -0
- package/dist/compat/transformers.test.mjs +4 -4
- package/dist/{compound-proof-7UIAueLV.mjs → compound-proof-BIvUoJxm.mjs} +74 -2
- package/dist/{deno-Ckq9TwCv.mjs → deno-Vj_9wePq.mjs} +1 -1
- package/dist/{docloader-DUKEPG-O.mjs → docloader-qUudHZVH.mjs} +2 -2
- package/dist/federation/builder.test.mjs +5 -5
- package/dist/federation/circuit-breaker.test.mjs +3 -3
- package/dist/federation/collection.test.mjs +2 -2
- package/dist/federation/compound-fanout.test.d.mts +2 -0
- package/dist/federation/compound-fanout.test.mjs +228 -0
- package/dist/federation/handler-compound-proof.test.mjs +5 -5
- package/dist/federation/handler.test.mjs +11 -11
- package/dist/federation/idempotency.test.mjs +4 -4
- package/dist/federation/inbox.test.mjs +2 -2
- package/dist/federation/keycache.test.mjs +3 -3
- package/dist/federation/kv.test.mjs +2 -2
- package/dist/federation/metrics.test.mjs +4 -4
- package/dist/federation/middleware.test.mjs +17 -17
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/mq.test.mjs +7 -6
- package/dist/federation/negotiation.test.mjs +3 -3
- package/dist/federation/outgoing-proof.test.d.mts +2 -0
- package/dist/federation/outgoing-proof.test.mjs +396 -0
- package/dist/federation/retry.test.mjs +3 -2
- package/dist/federation/router.test.mjs +5 -5
- package/dist/federation/send.test.mjs +11 -11
- package/dist/federation/tasks/enqueue.test.mjs +1 -1
- package/dist/federation/tasks/tasks.test.mjs +2 -2
- package/dist/federation/temporal.test.mjs +4 -4
- package/dist/federation/webfinger.test.mjs +4 -4
- package/dist/{federation-CgbvMauV.cjs → federation-CTnaljmy.cjs} +203 -37
- package/dist/{http-DQBfmkrS.cjs → http-B5F1JMh0.cjs} +1 -1
- package/dist/{http-DQA2JOEJ.js → http-By8tnmEr.js} +1 -1
- package/dist/{http-DZaAutqg.mjs → http-D4WPcJUe.mjs} +3 -3
- package/dist/{key-zxzx01Ec.mjs → key-B_Zc5Jbd.mjs} +2 -2
- package/dist/{kv-cache-sy8OMNT8.cjs → kv-cache-8K70pjtX.cjs} +1 -1
- package/dist/{kv-cache-CbrUX90H.mjs → kv-cache-BXdT7pJQ.mjs} +1 -1
- package/dist/{kv-cache-BBoePTOJ.js → kv-cache-BswMKQjC.js} +1 -1
- package/dist/{ld-CD_TN0e8.mjs → ld-B16KUSIQ.mjs} +3 -3
- package/dist/{metrics-B47Cm5gK.mjs → metrics-DpQqUAmh.mjs} +1 -1
- package/dist/{middleware-U_Gannqi.mjs → middleware-BL5HFFVU.mjs} +1 -1
- package/dist/{middleware-pHwDTAnq.mjs → middleware-C7_hqDnl.mjs} +143 -49
- package/dist/{middleware-U0OIuqwD.js → middleware-Cxto6Bq2.js} +204 -38
- package/dist/{mod-UDwMjuHM.d.ts → mod-CNRAxXEb.d.ts} +1 -5
- package/dist/{mod-CbKDOnCt.d.cts → mod-CVQFWefn.d.cts} +1 -5
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +1 -1
- package/dist/mod.d.ts +1 -1
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/client.test.mjs +2 -2
- package/dist/nodeinfo/handler.test.mjs +3 -3
- package/dist/nodeinfo/types.test.mjs +3 -3
- package/dist/otel/exporter.test.mjs +2 -2
- package/dist/{outgoing-jsonld-B5Ne7JoL.mjs → outgoing-jsonld-4IJqPYos.mjs} +11 -9
- package/dist/{owner-u3IJRhVx.mjs → owner-BIOIhZoM.mjs} +2 -2
- package/dist/{owner-BNKC3s6G.js → owner-D-E0bT2O.js} +127 -35
- package/dist/{owner--mNatWct.cjs → owner-WUYke16i.cjs} +126 -34
- package/dist/{proof-D3te0SP-.mjs → proof-BVxJu5vv.mjs} +80 -23
- package/dist/{public-audience-Cc2YJ3ip.mjs → public-audience--klBIOk1.mjs} +13 -9
- package/dist/secured-document-CxzZZ9nL.mjs +35 -0
- package/dist/{send-CDr0Zivk.mjs → send-Cr5FJ7iu.mjs} +3 -3
- package/dist/sig/compound-proof-discovery.test.mjs +3 -3
- package/dist/sig/compound-proof-producer.test.d.mts +2 -0
- package/dist/sig/compound-proof-producer.test.mjs +107 -0
- package/dist/sig/compound-proof-verification.test.mjs +5 -5
- package/dist/sig/compound-proof.test.mjs +145 -58
- package/dist/sig/http.test.mjs +11 -10
- package/dist/sig/key.test.mjs +6 -6
- package/dist/sig/ld.test.mjs +9 -9
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.d.cts +1 -1
- package/dist/sig/mod.d.ts +1 -1
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +5 -5
- package/dist/sig/proof.test.mjs +9 -9
- package/dist/std__assert-DvMDRPes.mjs +8 -0
- package/dist/{temporal-DKhVF_Uk.mjs → temporal-CCf0lZV3.mjs} +1 -1
- package/dist/testing/kv.test.mjs +2 -2
- package/dist/utils/docloader.test.mjs +5 -5
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +6 -6
- package/dist/std__assert-CxFT0MNt.mjs +0 -8
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import "temporal-polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
6
|
+
import { i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-BIvUoJxm.mjs";
|
|
7
|
+
import { test } from "@fedify/fixture";
|
|
8
|
+
//#region src/sig/compound-proof-producer.test.ts
|
|
9
|
+
const portableId = "ap+ef61://did:key:z6MkAlice/objects/1";
|
|
10
|
+
const proof = {
|
|
11
|
+
type: "DataIntegrityProof",
|
|
12
|
+
proofValue: "z"
|
|
13
|
+
};
|
|
14
|
+
function nest(depth, leaf) {
|
|
15
|
+
let value = leaf;
|
|
16
|
+
for (let i = 0; i < depth; i++) value = {
|
|
17
|
+
type: "Note",
|
|
18
|
+
content: value
|
|
19
|
+
};
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
test("containsCompoundPortableObject() finds portable maps", () => {
|
|
23
|
+
const cases = [
|
|
24
|
+
[{ id: portableId }, true],
|
|
25
|
+
[{ "@id": "AP://did:key:z6MkAlice/actor" }, true],
|
|
26
|
+
[{
|
|
27
|
+
id: "https://example.com/1",
|
|
28
|
+
object: [{}, { id: portableId }]
|
|
29
|
+
}, true],
|
|
30
|
+
[{
|
|
31
|
+
id: "https://example.com/1",
|
|
32
|
+
actor: portableId
|
|
33
|
+
}, false],
|
|
34
|
+
[{
|
|
35
|
+
id: "https://example.com/1",
|
|
36
|
+
proof: { id: portableId }
|
|
37
|
+
}, false],
|
|
38
|
+
[{
|
|
39
|
+
"@context": [{ id: portableId }],
|
|
40
|
+
id: "https://example.com/1"
|
|
41
|
+
}, false],
|
|
42
|
+
[{
|
|
43
|
+
id: "https://example.com/1",
|
|
44
|
+
object: { id: "ap-like" }
|
|
45
|
+
}, false],
|
|
46
|
+
[[{ id: portableId }], true],
|
|
47
|
+
[null, false]
|
|
48
|
+
];
|
|
49
|
+
for (const [json, expected] of cases) assertEquals(containsCompoundPortableObject(json), expected, `${json}`);
|
|
50
|
+
});
|
|
51
|
+
test("containsCompoundPortableObject() ignores the inbox limits", () => {
|
|
52
|
+
const deep = nest(100, { id: portableId });
|
|
53
|
+
const limits = {
|
|
54
|
+
maxDepth: 64,
|
|
55
|
+
maxMaps: 1e4,
|
|
56
|
+
maxProofs: 32,
|
|
57
|
+
maxBytes: 10 * 1024 * 1024
|
|
58
|
+
};
|
|
59
|
+
assertEquals(inspectCompoundPortableObjectApplicability(deep, limits), "indeterminate");
|
|
60
|
+
assertEquals(containsCompoundPortableObject(deep), true);
|
|
61
|
+
const large = {
|
|
62
|
+
id: "https://example.com/1",
|
|
63
|
+
content: "x".repeat(11 * 1024 * 1024),
|
|
64
|
+
proof: [proof, proof]
|
|
65
|
+
};
|
|
66
|
+
assertEquals(inspectCompoundPortableObjectApplicability(large, limits), "indeterminate");
|
|
67
|
+
assertEquals(containsCompoundPortableObject(large), false);
|
|
68
|
+
});
|
|
69
|
+
test("containsCompoundPortableObject() terminates on repeated maps", () => {
|
|
70
|
+
const shared = { type: "Note" };
|
|
71
|
+
const cyclic = {
|
|
72
|
+
a: shared,
|
|
73
|
+
b: shared
|
|
74
|
+
};
|
|
75
|
+
shared.parent = cyclic;
|
|
76
|
+
assertEquals(containsCompoundPortableObject(cyclic), false);
|
|
77
|
+
shared.id = portableId;
|
|
78
|
+
assertEquals(containsCompoundPortableObject(cyclic), true);
|
|
79
|
+
});
|
|
80
|
+
test("findUnsupportedCompoundProofShape() reports non-map proofs", () => {
|
|
81
|
+
const cases = [
|
|
82
|
+
[{ proof }, null],
|
|
83
|
+
[{ proof: [proof, proof] }, "/proof"],
|
|
84
|
+
[{ proof: [proof] }, "/proof"],
|
|
85
|
+
[{ proof: [] }, "/proof"],
|
|
86
|
+
[{ proof: null }, "/proof"],
|
|
87
|
+
[{ proof: "z" }, "/proof"],
|
|
88
|
+
[{ proof: 1 }, "/proof"],
|
|
89
|
+
[{ proof: true }, "/proof"],
|
|
90
|
+
[{
|
|
91
|
+
proof,
|
|
92
|
+
object: { proof: [proof, proof] }
|
|
93
|
+
}, "/object/proof"],
|
|
94
|
+
[{ items: [{ proof }, { proof: [proof] }] }, "/items/1/proof"],
|
|
95
|
+
[{ "a/b~c": { proof: [proof] } }, "/a~1b~0c/proof"],
|
|
96
|
+
[{ proof: {
|
|
97
|
+
...proof,
|
|
98
|
+
nested: { proof: [proof] }
|
|
99
|
+
} }, null],
|
|
100
|
+
[{ "@context": [{ proof: [proof] }] }, null],
|
|
101
|
+
[{ object: { id: portableId } }, null]
|
|
102
|
+
];
|
|
103
|
+
for (const [json, expected] of cases) assertEquals(findUnsupportedCompoundProofShape(json), expected, JSON.stringify(json));
|
|
104
|
+
assertEquals(findUnsupportedCompoundProofShape(nest(100, { proof: [proof, proof] })), "/content".repeat(100) + "/proof");
|
|
105
|
+
});
|
|
106
|
+
//#endregion
|
|
107
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as assert } from "../assert-
|
|
7
|
-
import { i as verifyMapLocalProof, s as verifyPortableObjectProofPolicy } from "../proof-
|
|
8
|
-
import {
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
6
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
7
|
+
import { i as verifyMapLocalProof, s as verifyPortableObjectProofPolicy } from "../proof-BVxJu5vv.mjs";
|
|
8
|
+
import { a as verifyCompoundPortableObjectProofs, o as verifyCompoundProofDocuments } from "../compound-proof-BIvUoJxm.mjs";
|
|
9
9
|
import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
|
|
10
10
|
import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as assert } from "../assert-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
6
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
7
7
|
import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
8
|
-
import { n as preloadedOnlyDocumentLoader } from "../public-audience
|
|
9
|
-
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-
|
|
10
|
-
import { c as verifyProof, r as signObject } from "../proof-
|
|
8
|
+
import { n as preloadedOnlyDocumentLoader } from "../public-audience--klBIOk1.mjs";
|
|
9
|
+
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
|
|
10
|
+
import { c as verifyProof, r as signObject } from "../proof-BVxJu5vv.mjs";
|
|
11
|
+
import { o as verifyCompoundProofDocuments } from "../compound-proof-BIvUoJxm.mjs";
|
|
11
12
|
import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
|
|
12
13
|
import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
|
|
13
|
-
import { Create, DataIntegrityProof, Note } from "@fedify/vocab";
|
|
14
|
+
import { Create, DataIntegrityProof, Note, Question } from "@fedify/vocab";
|
|
14
15
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
15
16
|
import { encodeMultibase, exportDidKey, parseIri } from "@fedify/vocab-runtime";
|
|
16
17
|
import { encodeHex } from "byte-encodings/hex";
|
|
@@ -46,6 +47,16 @@ const options = {
|
|
|
46
47
|
contextLoader: mockDocumentLoader,
|
|
47
48
|
documentLoader: mockDocumentLoader
|
|
48
49
|
};
|
|
50
|
+
const inboundOptions = {
|
|
51
|
+
contextLoader: preloadedOnlyDocumentLoader,
|
|
52
|
+
documentLoader: preloadedOnlyDocumentLoader
|
|
53
|
+
};
|
|
54
|
+
const compoundLimits = {
|
|
55
|
+
maxDepth: 16,
|
|
56
|
+
maxMaps: 32,
|
|
57
|
+
maxProofs: 8,
|
|
58
|
+
maxBytes: 16384
|
|
59
|
+
};
|
|
49
60
|
async function parseProof(document) {
|
|
50
61
|
const proof = document.proof;
|
|
51
62
|
assert(proof != null && typeof proof === "object" && !Array.isArray(proof));
|
|
@@ -171,10 +182,6 @@ test("the context-conflict vector records valid proofs and divergent semantics",
|
|
|
171
182
|
hashes: map_local_context_conflict_default.hashes.inner,
|
|
172
183
|
proofValue: map_local_context_conflict_default.proofValues.inner
|
|
173
184
|
});
|
|
174
|
-
const inboundOptions = {
|
|
175
|
-
contextLoader: preloadedOnlyDocumentLoader,
|
|
176
|
-
documentLoader: preloadedOnlyDocumentLoader
|
|
177
|
-
};
|
|
178
185
|
const verifiedInner = await verifyProof(embedded, await parseProof(embedded), inboundOptions);
|
|
179
186
|
assertEquals(verifiedInner != null, map_local_context_conflict_default.expectedVerification.original.inner);
|
|
180
187
|
assertEquals(verifiedInner?.id, conflictVectorInnerKeyId);
|
|
@@ -226,10 +233,9 @@ test("the raw same-context baseline verifies map-locally", async () => {
|
|
|
226
233
|
assertEquals(replacementInnerKey?.id, vectorInnerKeyId);
|
|
227
234
|
assertEquals(await verifyProof(replaced, await parseProof(replaced), options) != null, map_local_create_note_default.expectedVerification.replacedInnerProof.outer);
|
|
228
235
|
});
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
id: parseIri(`ap+ef61://${innerDid}/objects/distinct-context`),
|
|
236
|
+
async function signDistinctContextNote(created, path) {
|
|
237
|
+
return await signObject(new Note({
|
|
238
|
+
id: parseIri(`ap+ef61://${innerDid}/objects/${path}`),
|
|
233
239
|
attribution: parseIri(`ap+ef61://${innerDid}/actor`),
|
|
234
240
|
content: "A portable note with its own context"
|
|
235
241
|
}), ed25519PrivateKey, innerKeyId, {
|
|
@@ -237,65 +243,131 @@ test("typed Create serialization bypasses a parsed child's JSON-LD cache", async
|
|
|
237
243
|
context: distinctInnerContext,
|
|
238
244
|
created
|
|
239
245
|
});
|
|
240
|
-
|
|
246
|
+
}
|
|
247
|
+
async function serializeOutgoing(object, context) {
|
|
248
|
+
return await normalizeOutgoingActivityJsonLd(await object.toJsonLd({
|
|
241
249
|
format: "compact",
|
|
242
250
|
...options,
|
|
243
|
-
context:
|
|
244
|
-
}), mockDocumentLoader);
|
|
245
|
-
|
|
246
|
-
|
|
251
|
+
context: context ?? options.context
|
|
252
|
+
}), mockDocumentLoader, { preserveNestedSecuredDocuments: true });
|
|
253
|
+
}
|
|
254
|
+
async function signOuterCreate(created, path, child) {
|
|
255
|
+
return await signObject(new Create({
|
|
256
|
+
id: parseIri(`ap+ef61://${outerDid}/activities/${path}`),
|
|
247
257
|
actor: parseIri(`ap+ef61://${outerDid}/actor`),
|
|
248
|
-
object:
|
|
258
|
+
object: child
|
|
249
259
|
}), outerPrivateKey, outerKeyId, {
|
|
250
260
|
...options,
|
|
251
261
|
created
|
|
252
|
-
})
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
test("typed Create serialization embeds the signed child representation", async () => {
|
|
265
|
+
const created = Temporal.Instant.from("2023-02-24T23:36:38Z");
|
|
266
|
+
const inner = await signDistinctContextNote(created, "distinct-context");
|
|
267
|
+
assert(inner instanceof Note);
|
|
268
|
+
const standaloneInner = await serializeOutgoing(inner, distinctInnerContext);
|
|
269
|
+
const outer = await signOuterCreate(created, "distinct-context", inner);
|
|
270
|
+
assert(outer instanceof Create);
|
|
271
|
+
const compound = await serializeOutgoing(outer);
|
|
256
272
|
const embedded = compound.object;
|
|
257
273
|
const embeddedProof = embedded.proof;
|
|
258
|
-
|
|
259
|
-
assertEquals(
|
|
260
|
-
assertEquals(
|
|
261
|
-
assertEquals(embedded
|
|
262
|
-
assertEquals(
|
|
263
|
-
assertEquals(
|
|
264
|
-
const compactedStandalone = structuredClone(standaloneInner);
|
|
265
|
-
const compactedStandaloneProof = compactedStandalone.proof;
|
|
266
|
-
delete compactedStandalone["@context"];
|
|
267
|
-
delete compactedStandaloneProof["@context"];
|
|
268
|
-
assertEquals(embedded, compactedStandalone);
|
|
269
|
-
assertEquals((await verifyProof(standaloneInner, standaloneProof, options))?.id, innerKeyId);
|
|
270
|
-
const rewrittenContext = structuredClone(standaloneInner);
|
|
271
|
-
rewrittenContext["@context"] = context;
|
|
272
|
-
assertEquals(await verifyProof(rewrittenContext, standaloneProof, options), null);
|
|
273
|
-
assertEquals(await verifyProof(embedded, standaloneProof, options), null);
|
|
274
|
+
assertEquals(embedded["@context"], distinctInnerContext);
|
|
275
|
+
assertEquals(embeddedProof["@context"], distinctInnerContext);
|
|
276
|
+
assertEquals(compound["@context"], context);
|
|
277
|
+
assertEquals(serialize(embedded), serialize(standaloneInner));
|
|
278
|
+
assertEquals(embedded.type, "Note");
|
|
279
|
+
assertEquals((await verifyProof(embedded, await parseProof(embedded), options))?.id, innerKeyId);
|
|
274
280
|
assertEquals((await verifyProof(compound, await parseProof(compound), options))?.id, outerKeyId);
|
|
281
|
+
const mapLocal = await verifyCompoundProofDocuments(compound, compoundLimits, inboundOptions);
|
|
282
|
+
assertEquals(mapLocal.status, "ok");
|
|
283
|
+
assert(mapLocal.status === "ok");
|
|
284
|
+
assert(mapLocal.verified);
|
|
285
|
+
assertEquals(mapLocal.documents.map(({ path, verified }) => ({
|
|
286
|
+
path,
|
|
287
|
+
verified
|
|
288
|
+
})), [{
|
|
289
|
+
path: "/object",
|
|
290
|
+
verified: true
|
|
291
|
+
}, {
|
|
292
|
+
path: "",
|
|
293
|
+
verified: true
|
|
294
|
+
}]);
|
|
295
|
+
});
|
|
296
|
+
test("tampering with an embedded signed child invalidates both proofs", async () => {
|
|
297
|
+
const created = Temporal.Instant.from("2023-02-24T23:36:38Z");
|
|
298
|
+
const tampered = await serializeOutgoing(await signOuterCreate(created, "tampered", await signDistinctContextNote(created, "tampered")));
|
|
299
|
+
const tamperedInner = tampered.object;
|
|
300
|
+
tamperedInner.content = "A tampered portable note";
|
|
301
|
+
assertEquals(await verifyProof(tamperedInner, await parseProof(tamperedInner), options), null);
|
|
302
|
+
assertEquals(await verifyProof(tampered, await parseProof(tampered), options), null);
|
|
303
|
+
});
|
|
304
|
+
test("replacing an embedded child proof invalidates only the outer proof", async () => {
|
|
305
|
+
const created = Temporal.Instant.from("2023-02-24T23:36:38Z");
|
|
306
|
+
const replacementCreated = Temporal.Instant.from("2023-02-25T23:36:38Z");
|
|
307
|
+
const inner = await signDistinctContextNote(created, "replaced-proof");
|
|
308
|
+
const replacementProof = (await serializeOutgoing(await signDistinctContextNote(replacementCreated, "replaced-proof"), distinctInnerContext)).proof;
|
|
309
|
+
const compound = await serializeOutgoing(await signOuterCreate(created, "replaced-proof", inner));
|
|
310
|
+
const replacedInner = compound.object;
|
|
311
|
+
replacedInner.proof = replacementProof;
|
|
312
|
+
assertEquals((await verifyProof(replacedInner, await parseProof(replacedInner), options))?.id, innerKeyId);
|
|
313
|
+
assertEquals(await verifyProof(compound, await parseProof(compound), options), null);
|
|
314
|
+
});
|
|
315
|
+
test("cloning or re-signing a signed child drops its retained representation", async () => {
|
|
316
|
+
const created = Temporal.Instant.from("2023-02-24T23:36:38Z");
|
|
317
|
+
const inner = await signDistinctContextNote(created, "cloned");
|
|
318
|
+
const cloned = inner.clone({});
|
|
319
|
+
assert(cloned instanceof Note);
|
|
320
|
+
const clonedEmbedded = (await serializeOutgoing(await signOuterCreate(created, "cloned", cloned))).object;
|
|
321
|
+
assertEquals(clonedEmbedded["@context"], void 0);
|
|
322
|
+
assertEquals(clonedEmbedded.proof["@context"], void 0);
|
|
323
|
+
const reSignedEmbedded = (await serializeOutgoing(await signOuterCreate(created, "re-signed", await signObject(inner, ed25519PrivateKey, innerKeyId, {
|
|
324
|
+
...options,
|
|
325
|
+
context: distinctInnerContext,
|
|
326
|
+
created
|
|
327
|
+
})))).object;
|
|
328
|
+
assertEquals(reSignedEmbedded["@context"], void 0);
|
|
329
|
+
});
|
|
330
|
+
test("mutating a signed child does not change its embedded representation", async () => {
|
|
331
|
+
const created = Temporal.Instant.from("2023-02-24T23:36:38Z");
|
|
332
|
+
const inner = await signDistinctContextNote(created, "mutated");
|
|
333
|
+
const standaloneInner = await serializeOutgoing(inner, distinctInnerContext);
|
|
334
|
+
const proof = (await Array.fromAsync(inner.getProofs(options)))[0];
|
|
335
|
+
assert(proof.proofValue != null);
|
|
336
|
+
proof.proofValue[0] ^= 255;
|
|
337
|
+
const embedded = (await serializeOutgoing(await signOuterCreate(created, "mutated", inner))).object;
|
|
338
|
+
assertEquals(serialize(embedded), serialize(standaloneInner));
|
|
339
|
+
assertEquals((await verifyProof(embedded, await parseProof(embedded), options))?.id, innerKeyId);
|
|
340
|
+
});
|
|
341
|
+
test("a signed child is embedded through a compactable ancestor too", async () => {
|
|
342
|
+
const inner = await signDistinctContextNote(Temporal.Instant.from("2023-02-24T23:36:38Z"), "compactable-parent");
|
|
343
|
+
const standaloneInner = await serializeOutgoing(inner, distinctInnerContext);
|
|
344
|
+
const wrapper = new Note({
|
|
345
|
+
id: parseIri(`ap+ef61://${innerDid}/objects/wrapper`),
|
|
346
|
+
attachments: [inner]
|
|
347
|
+
});
|
|
348
|
+
const embedded = (await new Question({
|
|
349
|
+
id: parseIri(`ap+ef61://${outerDid}/objects/question`),
|
|
350
|
+
exclusiveOptions: [wrapper]
|
|
351
|
+
}).toJsonLd()).oneOf.attachment;
|
|
352
|
+
assertEquals(serialize(embedded), serialize(standaloneInner));
|
|
353
|
+
assertEquals((await verifyProof(embedded, await parseProof(embedded), options))?.id, innerKeyId);
|
|
354
|
+
});
|
|
355
|
+
test("typed Create serialization bypasses a parsed child's JSON-LD cache", async () => {
|
|
356
|
+
const created = Temporal.Instant.from("2023-02-24T23:36:38Z");
|
|
357
|
+
const standaloneInner = await serializeOutgoing(await signDistinctContextNote(created, "reparsed-context"), distinctInnerContext);
|
|
358
|
+
const standaloneProof = await parseProof(standaloneInner);
|
|
275
359
|
const reparsedInner = await Note.fromJsonLd(standaloneInner, {
|
|
276
360
|
contextLoader: mockDocumentLoader,
|
|
277
361
|
documentLoader: mockDocumentLoader
|
|
278
362
|
});
|
|
279
363
|
assert(reparsedInner instanceof Note);
|
|
280
364
|
assertEquals(await reparsedInner.toJsonLd(), standaloneInner);
|
|
281
|
-
const reparsedCompound = await
|
|
282
|
-
id: parseIri(`ap+ef61://${outerDid}/activities/reparsed-context`),
|
|
283
|
-
actor: parseIri(`ap+ef61://${outerDid}/actor`),
|
|
284
|
-
object: reparsedInner
|
|
285
|
-
}), outerPrivateKey, outerKeyId, {
|
|
286
|
-
...options,
|
|
287
|
-
created
|
|
288
|
-
})).toJsonLd({
|
|
289
|
-
format: "compact",
|
|
290
|
-
...options
|
|
291
|
-
}), mockDocumentLoader);
|
|
365
|
+
const reparsedCompound = await serializeOutgoing(await signOuterCreate(created, "reparsed-context", reparsedInner));
|
|
292
366
|
const reparsedEmbedded = reparsedCompound.object;
|
|
293
367
|
const reparsedEmbeddedProof = reparsedEmbedded.proof;
|
|
294
368
|
assertEquals(reparsedEmbedded["@context"], void 0);
|
|
295
369
|
assertEquals(reparsedEmbeddedProof["@context"], void 0);
|
|
296
370
|
assertEquals(reparsedEmbeddedProof.proofValue, standaloneInner.proof.proofValue);
|
|
297
|
-
assertEquals(reparsedEmbedded, compactedStandalone);
|
|
298
|
-
assertEquals(reparsedEmbedded, embedded);
|
|
299
371
|
assertEquals(await verifyProof(reparsedEmbedded, standaloneProof, options), null);
|
|
300
372
|
assertEquals((await verifyProof(reparsedCompound, await parseProof(reparsedCompound), options))?.id, outerKeyId);
|
|
301
373
|
});
|
|
@@ -305,10 +377,6 @@ test("verifyProof() does not invent a missing child context", async () => {
|
|
|
305
377
|
const receivedInnerProof = receivedInner.proof;
|
|
306
378
|
delete receivedInner["@context"];
|
|
307
379
|
delete receivedInnerProof["@context"];
|
|
308
|
-
const inboundOptions = {
|
|
309
|
-
contextLoader: preloadedOnlyDocumentLoader,
|
|
310
|
-
documentLoader: preloadedOnlyDocumentLoader
|
|
311
|
-
};
|
|
312
380
|
const snapshot = structuredClone(received);
|
|
313
381
|
const proof = await DataIntegrityProof.fromJsonLd(received.proof, inboundOptions);
|
|
314
382
|
assertEquals(await verifyProof(received, proof, inboundOptions), null);
|
|
@@ -320,5 +388,24 @@ test("verifyProof() does not invent a missing child context", async () => {
|
|
|
320
388
|
guessedInnerProof["@context"] = structuredClone(guessed["@context"]);
|
|
321
389
|
assertEquals((await verifyProof(guessed, proof, inboundOptions))?.id, outerKeyId);
|
|
322
390
|
});
|
|
391
|
+
test("signing a document too deep to retain still succeeds", async () => {
|
|
392
|
+
const created = Temporal.Instant.from("2023-02-24T23:36:38Z");
|
|
393
|
+
let deep = new Note({
|
|
394
|
+
id: parseIri(`ap+ef61://${innerDid}/objects/deep-leaf`),
|
|
395
|
+
content: "A portable note nested past the retention bounds"
|
|
396
|
+
});
|
|
397
|
+
for (let i = 0; i < 40; i++) deep = new Note({
|
|
398
|
+
id: parseIri(`ap+ef61://${innerDid}/objects/deep-${i}`),
|
|
399
|
+
attachments: [deep]
|
|
400
|
+
});
|
|
401
|
+
const signed = await signObject(deep, ed25519PrivateKey, innerKeyId, {
|
|
402
|
+
...options,
|
|
403
|
+
context: distinctInnerContext,
|
|
404
|
+
created
|
|
405
|
+
});
|
|
406
|
+
assertEquals((await Array.fromAsync(signed.getProofs(options))).length, 1);
|
|
407
|
+
const embedded = (await serializeOutgoing(await signOuterCreate(created, "deep", signed))).object;
|
|
408
|
+
assertEquals(embedded["@context"], void 0);
|
|
409
|
+
});
|
|
323
410
|
//#endregion
|
|
324
411
|
export {};
|
package/dist/sig/http.test.mjs
CHANGED
|
@@ -2,16 +2,17 @@ import { Temporal } from "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import "../
|
|
11
|
-
import
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import {
|
|
5
|
+
import { t as AssertionError } from "../assertion_error-B-cx0fFA.mjs";
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
|
+
import { t as assertExists } from "../assert_exists-cffSpJ7X.mjs";
|
|
8
|
+
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
9
|
+
import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-BlafOF4-.mjs";
|
|
10
|
+
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
11
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
12
|
+
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
13
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
14
|
+
import { t as exportJwk } from "../key-B_Zc5Jbd.mjs";
|
|
15
|
+
import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-D4WPcJUe.mjs";
|
|
15
16
|
import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
16
17
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
17
18
|
import { FetchError, exportSpki } from "@fedify/vocab-runtime";
|
package/dist/sig/key.test.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import { t as assertThrows } from "../assert_throws-
|
|
6
|
-
import "../std__assert-
|
|
7
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
8
|
-
import { t as assert } from "../assert-
|
|
9
|
-
import { a as generateCryptoKeyPair, i as fetchKeyDetailed, o as importJwk, r as fetchKey, s as validateCryptoKey, t as exportJwk } from "../key-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
|
+
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
6
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
7
|
+
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
8
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
9
|
+
import { a as generateCryptoKeyPair, i as fetchKeyDetailed, o as importJwk, r as fetchKey, s as validateCryptoKey, t as exportJwk } from "../key-B_Zc5Jbd.mjs";
|
|
10
10
|
import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
11
11
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
12
12
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
package/dist/sig/ld.test.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import { t as assertFalse } from "../assert_false-
|
|
6
|
-
import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-
|
|
7
|
-
import { t as assertInstanceOf } from "../assert_instance_of-
|
|
8
|
-
import { t as assertThrows } from "../assert_throws-
|
|
9
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
10
|
-
import { t as assert } from "../assert-
|
|
11
|
-
import { a as generateCryptoKeyPair } from "../key-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
|
+
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
6
|
+
import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-BlafOF4-.mjs";
|
|
7
|
+
import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
8
|
+
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
9
|
+
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
10
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
11
|
+
import { a as generateCryptoKeyPair } from "../key-B_Zc5Jbd.mjs";
|
|
12
12
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
13
|
-
import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-
|
|
13
|
+
import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-B16KUSIQ.mjs";
|
|
14
14
|
import { CryptographicKey } from "@fedify/vocab";
|
|
15
15
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { encodeBase64 } from "byte-encodings/base64";
|
package/dist/sig/mod.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_http = require("../http-
|
|
4
|
-
const require_owner = require("../owner
|
|
3
|
+
const require_http = require("../http-B5F1JMh0.cjs");
|
|
4
|
+
const require_owner = require("../owner-WUYke16i.cjs");
|
|
5
5
|
exports.attachSignature = require_owner.attachSignature;
|
|
6
6
|
exports.createProof = require_owner.createProof;
|
|
7
7
|
exports.createSignature = require_owner.createSignature;
|
package/dist/sig/mod.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "../http-CP-7OdSq.cjs";
|
|
3
3
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BF0L9cMt.cjs";
|
|
4
|
-
import { C as verifyJsonLd, S as signJsonLd, _ as VerifySignatureOptions, a as VerifyPortableObjectProofOptions, b as detachSignature, c as createProof, d as verifyObject, f as verifyPortableObjectProof, g as VerifyJsonLdOptions, h as SignJsonLdOptions, i as VerifyPortableObjectProofFailureReason, l as hasProofLike, m as CreateSignatureOptions, n as SignObjectOptions, o as VerifyPortableObjectProofResult, p as verifyProof, r as VerifyObjectOptions, s as VerifyProofOptions, t as CreateProofOptions, u as signObject, v as attachSignature, w as verifySignature, x as hasSignatureLike, y as createSignature } from "../mod-
|
|
4
|
+
import { C as verifyJsonLd, S as signJsonLd, _ as VerifySignatureOptions, a as VerifyPortableObjectProofOptions, b as detachSignature, c as createProof, d as verifyObject, f as verifyPortableObjectProof, g as VerifyJsonLdOptions, h as SignJsonLdOptions, i as VerifyPortableObjectProofFailureReason, l as hasProofLike, m as CreateSignatureOptions, n as SignObjectOptions, o as VerifyPortableObjectProofResult, p as verifyProof, r as VerifyObjectOptions, s as VerifyProofOptions, t as CreateProofOptions, u as signObject, v as attachSignature, w as verifySignature, x as hasSignatureLike, y as createSignature } from "../mod-CVQFWefn.cjs";
|
|
5
5
|
export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
package/dist/sig/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "../http-65PYi9jY.js";
|
|
3
3
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BSzr5-I8.js";
|
|
4
|
-
import { C as verifyJsonLd, S as signJsonLd, _ as VerifySignatureOptions, a as VerifyPortableObjectProofOptions, b as detachSignature, c as createProof, d as verifyObject, f as verifyPortableObjectProof, g as VerifyJsonLdOptions, h as SignJsonLdOptions, i as VerifyPortableObjectProofFailureReason, l as hasProofLike, m as CreateSignatureOptions, n as SignObjectOptions, o as VerifyPortableObjectProofResult, p as verifyProof, r as VerifyObjectOptions, s as VerifyProofOptions, t as CreateProofOptions, u as signObject, v as attachSignature, w as verifySignature, x as hasSignatureLike, y as createSignature } from "../mod-
|
|
4
|
+
import { C as verifyJsonLd, S as signJsonLd, _ as VerifySignatureOptions, a as VerifyPortableObjectProofOptions, b as detachSignature, c as createProof, d as verifyObject, f as verifyPortableObjectProof, g as VerifyJsonLdOptions, h as SignJsonLdOptions, i as VerifyPortableObjectProofFailureReason, l as hasProofLike, m as CreateSignatureOptions, n as SignObjectOptions, o as VerifyPortableObjectProofResult, p as verifyProof, r as VerifyObjectOptions, s as VerifyProofOptions, t as CreateProofOptions, u as signObject, v as attachSignature, w as verifySignature, x as hasSignatureLike, y as createSignature } from "../mod-CNRAxXEb.js";
|
|
5
5
|
export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
package/dist/sig/mod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { F as validateAcceptSignature, M as formatAcceptSignature, N as fulfillAcceptSignature, P as parseAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, i as verifyRequest, l as fetchKeyDetailed, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "../http-
|
|
4
|
-
import { S as signJsonLd, T as verifySignature, a as signObject, c as verifyPortableObjectProof, g as detachSignature, h as createSignature, i as hasProofLike, n as getKeyOwner, p as attachSignature, r as createProof, s as verifyObject, t as doesActorOwnKey, u as verifyProof, w as verifyJsonLd, y as hasSignatureLike } from "../owner-
|
|
3
|
+
import { F as validateAcceptSignature, M as formatAcceptSignature, N as fulfillAcceptSignature, P as parseAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, i as verifyRequest, l as fetchKeyDetailed, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "../http-By8tnmEr.js";
|
|
4
|
+
import { S as signJsonLd, T as verifySignature, a as signObject, c as verifyPortableObjectProof, g as detachSignature, h as createSignature, i as hasProofLike, n as getKeyOwner, p as attachSignature, r as createProof, s as verifyObject, t as doesActorOwnKey, u as verifyProof, w as verifyJsonLd, y as hasSignatureLike } from "../owner-D-E0bT2O.js";
|
|
5
5
|
export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
package/dist/sig/owner.test.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import { t as assertFalse } from "../assert_false-
|
|
6
|
-
import "../std__assert-
|
|
7
|
-
import { t as assert } from "../assert-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
|
+
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
6
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
7
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
8
8
|
import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
9
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-
|
|
9
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-BIOIhZoM.mjs";
|
|
10
10
|
import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
|
|
11
11
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
//#region src/sig/owner.test.ts
|
package/dist/sig/proof.test.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import { t as assertFalse } from "../assert_false-
|
|
6
|
-
import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-
|
|
7
|
-
import { t as assertInstanceOf } from "../assert_instance_of-
|
|
8
|
-
import "../std__assert-
|
|
9
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
10
|
-
import { t as assert } from "../assert-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
|
+
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
6
|
+
import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-BlafOF4-.mjs";
|
|
7
|
+
import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
8
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
9
|
+
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
10
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
11
11
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
12
|
-
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-
|
|
13
|
-
import { a as verifyObject, c as verifyProof, n as hasProofLike, o as verifyPortableObjectProof, r as signObject, t as createProof } from "../proof-
|
|
12
|
+
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
|
|
13
|
+
import { a as verifyObject, c as verifyProof, n as hasProofLike, o as verifyPortableObjectProof, r as signObject, t as createProof } from "../proof-BVxJu5vv.mjs";
|
|
14
14
|
import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place, Translation } from "@fedify/vocab";
|
|
15
15
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { decodeMultibase, encodeMultibase, exportDidKey, exportMultibaseKey, formatIri, importMultibaseKey, parseIri } from "@fedify/vocab-runtime";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "temporal-polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import "./assert_equals-Z6IcEbWU.mjs";
|
|
5
|
+
import "./assert_throws-BYITOvPO.mjs";
|
|
6
|
+
import "./assert_rejects-CTptdYck.mjs";
|
|
7
|
+
import "./assert_strict_equals-CYvBmkpC.mjs";
|
|
8
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { c as getNormalizationContextLoader } from "./ld-
|
|
4
|
+
import { c as getNormalizationContextLoader } from "./ld-B16KUSIQ.mjs";
|
|
5
5
|
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
6
6
|
//#region src/federation/temporal.ts
|
|
7
7
|
function isPlainObject(value) {
|
package/dist/testing/kv.test.mjs
CHANGED
|
@@ -5,8 +5,8 @@ import { n as test } from "../dist-BQvArojP.mjs";
|
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
6
|
import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
|
|
7
7
|
import { n as baseOptions, o as stringSchema, t as MockQueue } from "../tasks-dbCShlCb.mjs";
|
|
8
|
-
import { t as assertEquals } from "../assert_equals-
|
|
9
|
-
import { o as createFederation } from "../middleware-
|
|
8
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
9
|
+
import { o as createFederation } from "../middleware-C7_hqDnl.mjs";
|
|
10
10
|
//#region src/testing/kv.test.ts
|
|
11
11
|
test("ManualClockKvStore keeps an entry at its exact expiration instant", async () => {
|
|
12
12
|
const kv = new ManualClockKvStore();
|
|
@@ -2,12 +2,12 @@ import { Temporal } from "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
|
|
5
|
-
import { t as assertEquals } from "../assert_equals-
|
|
6
|
-
import "../std__assert-
|
|
7
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
8
|
-
import { l as verifyRequest } from "../http-
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
7
|
+
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
8
|
+
import { l as verifyRequest } from "../http-D4WPcJUe.mjs";
|
|
9
9
|
import { i as rsaPrivateKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
10
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
10
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-qUudHZVH.mjs";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
import { FetchError, UrlError } from "@fedify/vocab-runtime";
|
|
13
13
|
//#region src/utils/docloader.test.ts
|