@fedify/fedify 2.4.0-dev.1570 → 2.4.0-dev.1571
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 +0 -4
- package/dist/{builder-CJnWbgbj.mjs → builder-CBgmNPaS.mjs} +2 -2
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{deno-klNxGW7W.mjs → deno-ColSXZB4.mjs} +1 -1
- package/dist/{docloader-CuFH35j1.mjs → docloader-BQGU0tG-.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +13 -3
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +7 -7
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/tasks/enqueue.test.mjs +1 -1
- package/dist/federation/tasks/tasks.test.mjs +2 -2
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{http-D0jH0kco.js → http-BciNZ5qO.js} +77 -11
- package/dist/{http-DeuPW1Oh.cjs → http-Be6MS-3k.cjs} +75 -9
- package/dist/{http-JdRPUYku.mjs → http-CuG4iKEH.mjs} +3 -3
- package/dist/{key-o0_ipvUR.mjs → key-C5fRM_21.mjs} +76 -10
- package/dist/{kv-cache-DSWq2JHU.js → kv-cache-6cpvv2tC.js} +1 -1
- package/dist/{kv-cache-CM7w20U5.mjs → kv-cache-Bn_DvESZ.mjs} +1 -1
- package/dist/{kv-cache-C3rqzQvu.cjs → kv-cache-C51pYkUU.cjs} +1 -1
- package/dist/{ld-C__CEgQH.mjs → ld-DxtnUVwj.mjs} +3 -3
- package/dist/{metrics-CLSPm4dZ.mjs → metrics-C60MEuIn.mjs} +3 -3
- package/dist/{middleware-CdMiavoh.mjs → middleware-B9bNYUM5.mjs} +1 -1
- package/dist/{middleware-B502nwxx.cjs → middleware-Cp410Lku.cjs} +3 -3
- package/dist/{middleware-zuLSkPIk.js → middleware-DY9SToNd.js} +3 -3
- package/dist/{middleware-CjHqy-1i.mjs → middleware-DkRMEKQc.mjs} +12 -12
- package/dist/mod.cjs +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/{owner-gz4TUfKG.mjs → owner-DA4lyeXg.mjs} +2 -2
- package/dist/{proof-DQWTf6oB.js → proof-BlD1HSeA.js} +1 -1
- package/dist/{proof-CuQpZ_AT.mjs → proof-BpDfPXQU.mjs} +3 -3
- package/dist/{proof-CiDzRtr0.cjs → proof-CB7yrPSS.cjs} +1 -1
- package/dist/{send-B60teucv.mjs → send-DfeB83F0.mjs} +3 -3
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key.test.mjs +187 -3
- package/dist/sig/ld.test.mjs +2 -2
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/proof.test.mjs +62 -2
- package/dist/{temporal-CvVMrvJJ.mjs → temporal-CIHMi9QT.mjs} +1 -1
- package/dist/utils/docloader.test.mjs +2 -2
- 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/sig/owner.test.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import "../std__assert-Dh6uLf_q.mjs";
|
|
|
6
6
|
import { r as assertFalse } from "../assert_rejects-DAdaaIWM.mjs";
|
|
7
7
|
import { t as assert } from "../assert-DvVHoIZ0.mjs";
|
|
8
8
|
import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-CSYsOMFG.mjs";
|
|
9
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-
|
|
9
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DA4lyeXg.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
|
@@ -8,10 +8,10 @@ import { t as assertInstanceOf } from "../assert_instance_of-CxoC8bVq.mjs";
|
|
|
8
8
|
import { t as assert } from "../assert-DvVHoIZ0.mjs";
|
|
9
9
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CSYsOMFG.mjs";
|
|
10
10
|
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-BNL8AC14.mjs";
|
|
11
|
-
import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-
|
|
11
|
+
import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-BpDfPXQU.mjs";
|
|
12
12
|
import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place } from "@fedify/vocab";
|
|
13
13
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
14
|
-
import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
|
|
14
|
+
import { decodeMultibase, exportDidKey, exportMultibaseKey, importMultibaseKey, parseIri } from "@fedify/vocab-runtime";
|
|
15
15
|
import { decodeHex } from "byte-encodings/hex";
|
|
16
16
|
//#region src/sig/proof.test.ts
|
|
17
17
|
const fep8b32TestVectorPrivateKey = await crypto.subtle.importKey("jwk", {
|
|
@@ -326,6 +326,66 @@ test("verifyProof()", async () => {
|
|
|
326
326
|
}), null);
|
|
327
327
|
assertFalse(contextLoaderCalls.includes("https://attacker.example/ctx"));
|
|
328
328
|
});
|
|
329
|
+
test("verifyProof() resolves did:key verification methods locally", async () => {
|
|
330
|
+
const multibaseKey = (await exportDidKey(ed25519PublicKey.publicKey)).slice(8);
|
|
331
|
+
const did = `did:key:${multibaseKey}`;
|
|
332
|
+
const keyId = new URL(`${did}#${multibaseKey}`);
|
|
333
|
+
const created = Temporal.Instant.from("2023-02-24T23:36:38Z");
|
|
334
|
+
const note = new Note({
|
|
335
|
+
id: parseIri(`ap://did:key:${multibaseKey}/objects/1`),
|
|
336
|
+
attribution: parseIri(`ap://did:key:${multibaseKey}/actor`),
|
|
337
|
+
content: "Portable hello"
|
|
338
|
+
});
|
|
339
|
+
const proof = await createProof(note, ed25519PrivateKey, keyId, {
|
|
340
|
+
created,
|
|
341
|
+
contextLoader: mockDocumentLoader,
|
|
342
|
+
context: ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"]
|
|
343
|
+
});
|
|
344
|
+
const jsonLd = await note.toJsonLd({
|
|
345
|
+
format: "compact",
|
|
346
|
+
contextLoader: mockDocumentLoader,
|
|
347
|
+
context: ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"]
|
|
348
|
+
});
|
|
349
|
+
let documentLoaderCalls = 0;
|
|
350
|
+
assertEquals(await verifyProof(jsonLd, proof, {
|
|
351
|
+
contextLoader: mockDocumentLoader,
|
|
352
|
+
documentLoader() {
|
|
353
|
+
documentLoaderCalls++;
|
|
354
|
+
throw new TypeError("did:key must not use the document loader");
|
|
355
|
+
}
|
|
356
|
+
}), new Multikey({
|
|
357
|
+
id: keyId,
|
|
358
|
+
controller: new URL(did),
|
|
359
|
+
publicKey: ed25519PublicKey.publicKey
|
|
360
|
+
}));
|
|
361
|
+
assertEquals(documentLoaderCalls, 0);
|
|
362
|
+
const tampered = { ...jsonLd };
|
|
363
|
+
tampered.content = "Portable goodbye";
|
|
364
|
+
assertEquals(await verifyProof(tampered, proof, {
|
|
365
|
+
contextLoader: mockDocumentLoader,
|
|
366
|
+
documentLoader() {
|
|
367
|
+
throw new TypeError("did:key must not use the document loader");
|
|
368
|
+
}
|
|
369
|
+
}), null);
|
|
370
|
+
assertEquals(await verifyProof(jsonLd, proof.clone({ verificationMethod: new URL(`${did}#z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK`) }), {
|
|
371
|
+
contextLoader: mockDocumentLoader,
|
|
372
|
+
documentLoader() {
|
|
373
|
+
throw new TypeError("did:key must not use the document loader");
|
|
374
|
+
}
|
|
375
|
+
}), null);
|
|
376
|
+
const unsupportedMultibaseKey = await exportMultibaseKey(rsaPublicKey2.publicKey);
|
|
377
|
+
const unsupportedDid = `did:key:${unsupportedMultibaseKey}`;
|
|
378
|
+
const unsupportedProof = proof.clone({ verificationMethod: new URL(`${unsupportedDid}#${unsupportedMultibaseKey}`) });
|
|
379
|
+
let unsupportedDocumentLoaderCalls = 0;
|
|
380
|
+
assertEquals(await verifyProof(jsonLd, unsupportedProof, {
|
|
381
|
+
contextLoader: mockDocumentLoader,
|
|
382
|
+
documentLoader() {
|
|
383
|
+
unsupportedDocumentLoaderCalls++;
|
|
384
|
+
throw new TypeError("did:key must not use the document loader");
|
|
385
|
+
}
|
|
386
|
+
}), null);
|
|
387
|
+
assertEquals(unsupportedDocumentLoaderCalls, 0);
|
|
388
|
+
});
|
|
329
389
|
test("verifyProof() records verification duration metric", async (t) => {
|
|
330
390
|
const jsonLd = {
|
|
331
391
|
"@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-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-DxtnUVwj.mjs";
|
|
5
5
|
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
6
6
|
//#region src/federation/temporal.ts
|
|
7
7
|
function isPlainObject(value) {
|
|
@@ -5,9 +5,9 @@ import { t as esm_default } from "../esm-vrlUxr60.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-PBVKNMJd.mjs";
|
|
6
6
|
import "../std__assert-Dh6uLf_q.mjs";
|
|
7
7
|
import { t as assertRejects } from "../assert_rejects-DAdaaIWM.mjs";
|
|
8
|
-
import { l as verifyRequest } from "../http-
|
|
8
|
+
import { l as verifyRequest } from "../http-CuG4iKEH.mjs";
|
|
9
9
|
import { i as rsaPrivateKey2 } from "../keys-CSYsOMFG.mjs";
|
|
10
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
10
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-BQGU0tG-.mjs";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
import { UrlError } from "@fedify/vocab-runtime";
|
|
13
13
|
//#region src/utils/docloader.test.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as kvCache, t as MockKvStore } from "../kv-cache-
|
|
4
|
+
import { n as kvCache, t as MockKvStore } from "../kv-cache-Bn_DvESZ.mjs";
|
|
5
5
|
import { deepStrictEqual, throws } from "node:assert";
|
|
6
6
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
7
7
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
package/dist/utils/mod.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const require_kv_cache = require("../kv-cache-
|
|
4
|
+
const require_kv_cache = require("../kv-cache-C51pYkUU.cjs");
|
|
5
5
|
exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
|
|
6
6
|
exports.kvCache = require_kv_cache.kvCache;
|
package/dist/utils/mod.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-
|
|
3
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-6cpvv2tC.js";
|
|
4
4
|
export { getAuthenticatedDocumentLoader, kvCache };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/fedify",
|
|
3
|
-
"version": "2.4.0-dev.
|
|
3
|
+
"version": "2.4.0-dev.1571+31e2786b",
|
|
4
4
|
"description": "An ActivityPub server framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ActivityPub",
|
|
@@ -151,10 +151,10 @@
|
|
|
151
151
|
"jsonld": "^9.0.0",
|
|
152
152
|
"structured-field-values": "^2.0.4",
|
|
153
153
|
"urlpattern-polyfill": "^10.1.0",
|
|
154
|
-
"@fedify/
|
|
155
|
-
"@fedify/vocab
|
|
156
|
-
"@fedify/
|
|
157
|
-
"@fedify/webfinger": "2.4.0-dev.
|
|
154
|
+
"@fedify/uri-template": "2.4.0-dev.1571+31e2786b",
|
|
155
|
+
"@fedify/vocab": "2.4.0-dev.1571+31e2786b",
|
|
156
|
+
"@fedify/vocab-runtime": "2.4.0-dev.1571+31e2786b",
|
|
157
|
+
"@fedify/webfinger": "2.4.0-dev.1571+31e2786b"
|
|
158
158
|
},
|
|
159
159
|
"devDependencies": {
|
|
160
160
|
"@std/assert": "npm:@jsr/std__assert@^0.226.0",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"typescript": "^6.0.0",
|
|
168
168
|
"wrangler": "^4.17.0",
|
|
169
169
|
"@fedify/fixture": "2.0.0",
|
|
170
|
-
"@fedify/vocab-tools": "^2.4.0-dev.
|
|
170
|
+
"@fedify/vocab-tools": "^2.4.0-dev.1571+31e2786b"
|
|
171
171
|
},
|
|
172
172
|
"scripts": {
|
|
173
173
|
"build:self": "tsdown",
|