@fedify/fedify 2.2.0-dev.918 → 2.2.0-dev.924
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/{builder-DsUC1ozb.mjs → builder-FoLsluZw.mjs} +3 -3
- package/dist/compat/public-audience.test.d.mts +2 -0
- package/dist/compat/public-audience.test.mjs +178 -0
- package/dist/compat/transformers.test.mjs +2 -2
- package/dist/{deno-chpMS297.mjs → deno-BukNyK1t.mjs} +1 -1
- package/dist/{docloader-mG59nV1T.mjs → docloader-BgBM76TI.mjs} +2 -2
- package/dist/federation/builder.test.mjs +2 -2
- package/dist/federation/collection.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +4 -4
- package/dist/federation/idempotency.test.mjs +3 -3
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/keycache.test.mjs +2 -2
- package/dist/federation/kv.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +17 -7
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/negotiation.test.mjs +1 -1
- package/dist/federation/retry.test.mjs +1 -1
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/webfinger.test.mjs +2 -2
- package/dist/{http-CFxkGu1t.cjs → http-1uLerNXX.cjs} +1 -1
- package/dist/{http-bSResatF.mjs → http-DSghOjS0.mjs} +2 -2
- package/dist/{http-Ctlxq_c2.js → http-DiNUVHGB.js} +1 -1
- package/dist/{key-DhlBs_9u.mjs → key-DAfSmMg7.mjs} +1 -1
- package/dist/{kv-cache-9uJ7MrJY.js → kv-cache-Dq9VS_Jn.js} +1 -1
- package/dist/{kv-cache-9GhjXosL.cjs → kv-cache-ia7oECIG.cjs} +1 -1
- package/dist/{ld-CphT6Px_.mjs → ld-DYpo7uUC.mjs} +2 -2
- package/dist/{middleware-1vJPAInk.mjs → middleware-CjJ_aBdD.mjs} +1 -1
- package/dist/{middleware-CRdGvmjc.cjs → middleware-Dt0fC6dK.cjs} +5 -4
- package/dist/{middleware-Dy-HEIMD.mjs → middleware-aawr753E.mjs} +17 -15
- package/dist/{middleware-DpvIk3Bx.js → middleware-olp7n2S4.js} +4 -3
- package/dist/{middleware-CswIHM4M.cjs → middleware-rZ0jYYM9.cjs} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/client.test.mjs +1 -1
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/nodeinfo/types.test.mjs +1 -1
- package/dist/otel/exporter.test.mjs +1 -1
- package/dist/{owner-CvmFP2YN.mjs → owner-B0_w8O-Y.mjs} +2 -2
- package/dist/{proof-BmbpGT6E.mjs → proof-DDZ2W7TX.mjs} +36 -31
- package/dist/{proof-UzqiUIZT.js → proof-DdnQ5edt.js} +218 -41
- package/dist/{proof-3d6mSNeR.cjs → proof-DgRfG4AE.cjs} +221 -38
- package/dist/public-audience-eovWqzOF.mjs +181 -0
- package/dist/{send-DCldNQNE.mjs → send-DMLb0UwP.mjs} +2 -2
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key.test.mjs +1 -1
- 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 +60 -2
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +5 -5
- /package/dist/{activity-listener-Ck3JZ_hR.mjs → activity-listener-CFzUqoCS.mjs} +0 -0
- /package/dist/{client-DEpOVgY1.mjs → client-DVu6Fmom.mjs} +0 -0
- /package/dist/{collection-BD6-SZ6O.mjs → collection-BQRKGS7L.mjs} +0 -0
- /package/dist/{keycache-CCSwkQcY.mjs → keycache-C2t1kvP5.mjs} +0 -0
- /package/dist/{kv-tL2TOE9X.mjs → kv-C-TG81Sv.mjs} +0 -0
- /package/dist/{negotiation-DnsfFF8I.mjs → negotiation-xb0QR3u_.mjs} +0 -0
- /package/dist/{retry-B_E3V_Dx.mjs → retry-CJL0poaU.mjs} +0 -0
- /package/dist/{types-DCP0WLdt.mjs → types-CGUnLkU3.mjs} +0 -0
package/dist/sig/proof.test.mjs
CHANGED
|
@@ -7,9 +7,10 @@ import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z
|
|
|
7
7
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
8
8
|
import { t as assert } from "../assert-ddO5KLpe.mjs";
|
|
9
9
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { t as normalizePublicAudience } from "../public-audience-eovWqzOF.mjs";
|
|
11
|
+
import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-DDZ2W7TX.mjs";
|
|
11
12
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
|
-
import { Create, DataIntegrityProof, Multikey, Note, Place } from "@fedify/vocab";
|
|
13
|
+
import { Create, DataIntegrityProof, Multikey, Note, PUBLIC_COLLECTION, Place } from "@fedify/vocab";
|
|
13
14
|
import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
|
|
14
15
|
import { decodeHex } from "byte-encodings/hex";
|
|
15
16
|
//#region src/sig/proof.test.ts
|
|
@@ -151,6 +152,39 @@ test("signObject()", async () => {
|
|
|
151
152
|
created,
|
|
152
153
|
contextLoader: mockDocumentLoader
|
|
153
154
|
}), TypeError, "Unsupported algorithm");
|
|
155
|
+
const signed = await signObject(new Create({
|
|
156
|
+
id: new URL("https://server.example/activities/2"),
|
|
157
|
+
actor: new URL("https://server.example/users/alice"),
|
|
158
|
+
object: new Note({
|
|
159
|
+
id: new URL("https://server.example/objects/2"),
|
|
160
|
+
attribution: new URL("https://server.example/users/alice"),
|
|
161
|
+
content: "Hello public"
|
|
162
|
+
}),
|
|
163
|
+
tos: [PUBLIC_COLLECTION]
|
|
164
|
+
}), fep8b32TestVectorPrivateKey, fep8b32TestVectorKeyId, {
|
|
165
|
+
...options,
|
|
166
|
+
created
|
|
167
|
+
});
|
|
168
|
+
const [proof] = await Array.fromAsync(signed.getProofs(options));
|
|
169
|
+
assertInstanceOf(proof, DataIntegrityProof);
|
|
170
|
+
const signedJson = await normalizePublicAudience(await signed.toJsonLd(options), mockDocumentLoader);
|
|
171
|
+
assertEquals(signedJson.to, PUBLIC_COLLECTION.href);
|
|
172
|
+
const verifyCache = {};
|
|
173
|
+
const verifyOptions = {
|
|
174
|
+
contextLoader: mockDocumentLoader,
|
|
175
|
+
documentLoader: mockDocumentLoader,
|
|
176
|
+
keyCache: {
|
|
177
|
+
get: (keyId) => Promise.resolve(verifyCache[keyId.href]),
|
|
178
|
+
set: (keyId, key) => {
|
|
179
|
+
verifyCache[keyId.href] = key;
|
|
180
|
+
return Promise.resolve();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
assertInstanceOf(await verifyProof(signedJson, proof, verifyOptions), Multikey);
|
|
185
|
+
const signedJsonWithCurie = await signed.toJsonLd(options);
|
|
186
|
+
assertEquals(signedJsonWithCurie.to, "as:Public");
|
|
187
|
+
assertInstanceOf(await verifyProof(signedJsonWithCurie, proof, verifyOptions), Multikey);
|
|
154
188
|
});
|
|
155
189
|
test("hasProofLike()", () => {
|
|
156
190
|
assert(hasProofLike({ proof: {
|
|
@@ -252,6 +286,30 @@ test("verifyProof()", async () => {
|
|
|
252
286
|
}
|
|
253
287
|
}, proof, options), null);
|
|
254
288
|
assertEquals(await verifyProof(jsonLd, proof.clone({ created: Temporal.Now.instant() }), options), null);
|
|
289
|
+
assertEquals(await verifyProof({
|
|
290
|
+
...jsonLd,
|
|
291
|
+
"https://w3id.org/security#proof": {
|
|
292
|
+
"@type": ["https://w3id.org/security#DataIntegrityProof"],
|
|
293
|
+
"https://w3id.org/security#proofValue": [{ "@value": "stale" }]
|
|
294
|
+
}
|
|
295
|
+
}, proof, options), expectedKey);
|
|
296
|
+
assertEquals(await verifyProof([jsonLd], proof, options), null);
|
|
297
|
+
assertEquals(await verifyProof({
|
|
298
|
+
"@context": ["https://www.w3.org/ns/activitystreams", "https://attacker.example/ctx"],
|
|
299
|
+
id: "https://server.example/activities/attacker",
|
|
300
|
+
type: "Create",
|
|
301
|
+
actor: "https://server.example/users/alice",
|
|
302
|
+
object: {
|
|
303
|
+
id: "https://server.example/objects/attacker",
|
|
304
|
+
type: "Note",
|
|
305
|
+
attributedTo: "https://server.example/users/alice",
|
|
306
|
+
content: "n/a",
|
|
307
|
+
to: "as:Public"
|
|
308
|
+
}
|
|
309
|
+
}, proof, {
|
|
310
|
+
documentLoader: mockDocumentLoader,
|
|
311
|
+
keyCache: options.keyCache
|
|
312
|
+
}), null);
|
|
255
313
|
});
|
|
256
314
|
test("verifyObject()", async () => {
|
|
257
315
|
const options = {
|
|
@@ -5,9 +5,9 @@ import { t as esm_default } from "../esm-DVILvP5e.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-Duiq_YC9.mjs";
|
|
7
7
|
import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
|
|
8
|
-
import { l as verifyRequest } from "../http-
|
|
8
|
+
import { l as verifyRequest } from "../http-DSghOjS0.mjs";
|
|
9
9
|
import { i as rsaPrivateKey2 } from "../keys-BAK-tUlf.mjs";
|
|
10
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
10
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-BgBM76TI.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
|
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-ia7oECIG.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 "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-
|
|
3
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-Dq9VS_Jn.js";
|
|
4
4
|
export { getAuthenticatedDocumentLoader, kvCache };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/fedify",
|
|
3
|
-
"version": "2.2.0-dev.
|
|
3
|
+
"version": "2.2.0-dev.924+c82ee90a",
|
|
4
4
|
"description": "An ActivityPub server framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ActivityPub",
|
|
@@ -153,9 +153,9 @@
|
|
|
153
153
|
"uri-template-router": "^1.0.0",
|
|
154
154
|
"url-template": "^3.1.1",
|
|
155
155
|
"urlpattern-polyfill": "^10.1.0",
|
|
156
|
-
"@fedify/vocab": "2.2.0-dev.
|
|
157
|
-
"@fedify/
|
|
158
|
-
"@fedify/
|
|
156
|
+
"@fedify/vocab": "2.2.0-dev.924+c82ee90a",
|
|
157
|
+
"@fedify/webfinger": "2.2.0-dev.924+c82ee90a",
|
|
158
|
+
"@fedify/vocab-runtime": "2.2.0-dev.924+c82ee90a"
|
|
159
159
|
},
|
|
160
160
|
"devDependencies": {
|
|
161
161
|
"@std/assert": "npm:@jsr/std__assert@^0.226.0",
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
"typescript": "^5.9.2",
|
|
169
169
|
"wrangler": "^4.17.0",
|
|
170
170
|
"@fedify/fixture": "2.0.0",
|
|
171
|
-
"@fedify/vocab-tools": "^2.2.0-dev.
|
|
171
|
+
"@fedify/vocab-tools": "^2.2.0-dev.924+c82ee90a"
|
|
172
172
|
},
|
|
173
173
|
"scripts": {
|
|
174
174
|
"build:self": "tsdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|