@fedify/fedify 2.2.0-dev.898 → 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.
Files changed (64) hide show
  1. package/dist/{builder-BxNYaOv9.mjs → builder-FoLsluZw.mjs} +3 -3
  2. package/dist/compat/public-audience.test.d.mts +2 -0
  3. package/dist/compat/public-audience.test.mjs +178 -0
  4. package/dist/compat/transformers.test.mjs +2 -2
  5. package/dist/{deno-DJv-tEfT.mjs → deno-BukNyK1t.mjs} +1 -1
  6. package/dist/{docloader-iGAzD_2N.mjs → docloader-BgBM76TI.mjs} +2 -2
  7. package/dist/federation/builder.test.mjs +2 -2
  8. package/dist/federation/collection.test.mjs +1 -1
  9. package/dist/federation/handler.test.mjs +4 -4
  10. package/dist/federation/idempotency.test.mjs +3 -3
  11. package/dist/federation/inbox.test.mjs +1 -1
  12. package/dist/federation/keycache.test.mjs +2 -2
  13. package/dist/federation/kv.test.mjs +1 -1
  14. package/dist/federation/middleware.test.mjs +17 -7
  15. package/dist/federation/mod.cjs +1 -1
  16. package/dist/federation/mod.js +1 -1
  17. package/dist/federation/mq.test.mjs +15 -8
  18. package/dist/federation/negotiation.test.mjs +1 -1
  19. package/dist/federation/retry.test.mjs +1 -1
  20. package/dist/federation/send.test.mjs +3 -3
  21. package/dist/federation/webfinger.test.mjs +2 -2
  22. package/dist/{http-COBccATS.cjs → http-1uLerNXX.cjs} +1 -1
  23. package/dist/{http-ETgJ0kEf.mjs → http-DSghOjS0.mjs} +2 -2
  24. package/dist/{http-IT-3f4WJ.js → http-DiNUVHGB.js} +1 -1
  25. package/dist/{key-BdVfyalZ.mjs → key-DAfSmMg7.mjs} +1 -1
  26. package/dist/{kv-cache-NdVl1dI9.js → kv-cache-Dq9VS_Jn.js} +1 -1
  27. package/dist/{kv-cache-DoM8wkoM.cjs → kv-cache-ia7oECIG.cjs} +1 -1
  28. package/dist/{ld-BIwbyijT.mjs → ld-DYpo7uUC.mjs} +2 -2
  29. package/dist/{middleware-D2WkRjr9.mjs → middleware-CjJ_aBdD.mjs} +1 -1
  30. package/dist/{middleware-AcyKcnPJ.cjs → middleware-Dt0fC6dK.cjs} +5 -4
  31. package/dist/{middleware-MrcBc-JA.mjs → middleware-aawr753E.mjs} +17 -15
  32. package/dist/{middleware-PwlQ2vwv.js → middleware-olp7n2S4.js} +4 -3
  33. package/dist/{middleware-BdLMFU46.cjs → middleware-rZ0jYYM9.cjs} +1 -1
  34. package/dist/mod.cjs +4 -4
  35. package/dist/mod.js +4 -4
  36. package/dist/nodeinfo/client.test.mjs +1 -1
  37. package/dist/nodeinfo/handler.test.mjs +2 -2
  38. package/dist/nodeinfo/types.test.mjs +1 -1
  39. package/dist/otel/exporter.test.mjs +1 -1
  40. package/dist/{owner-ELkycVNn.mjs → owner-B0_w8O-Y.mjs} +2 -2
  41. package/dist/{proof-CdHJBGaI.mjs → proof-DDZ2W7TX.mjs} +36 -31
  42. package/dist/{proof-CngGDTG-.js → proof-DdnQ5edt.js} +218 -41
  43. package/dist/{proof-D3NCoYW3.cjs → proof-DgRfG4AE.cjs} +221 -38
  44. package/dist/public-audience-eovWqzOF.mjs +181 -0
  45. package/dist/{send-Bsg41P7e.mjs → send-DMLb0UwP.mjs} +2 -2
  46. package/dist/sig/http.test.mjs +2 -2
  47. package/dist/sig/key.test.mjs +1 -1
  48. package/dist/sig/ld.test.mjs +2 -2
  49. package/dist/sig/mod.cjs +2 -2
  50. package/dist/sig/mod.js +2 -2
  51. package/dist/sig/owner.test.mjs +1 -1
  52. package/dist/sig/proof.test.mjs +60 -2
  53. package/dist/utils/docloader.test.mjs +2 -2
  54. package/dist/utils/mod.cjs +1 -1
  55. package/dist/utils/mod.js +1 -1
  56. package/package.json +5 -5
  57. /package/dist/{activity-listener-Ck3JZ_hR.mjs → activity-listener-CFzUqoCS.mjs} +0 -0
  58. /package/dist/{client-DEpOVgY1.mjs → client-DVu6Fmom.mjs} +0 -0
  59. /package/dist/{collection-BD6-SZ6O.mjs → collection-BQRKGS7L.mjs} +0 -0
  60. /package/dist/{keycache-CCSwkQcY.mjs → keycache-C2t1kvP5.mjs} +0 -0
  61. /package/dist/{kv-tL2TOE9X.mjs → kv-C-TG81Sv.mjs} +0 -0
  62. /package/dist/{negotiation-DnsfFF8I.mjs → negotiation-xb0QR3u_.mjs} +0 -0
  63. /package/dist/{retry-B_E3V_Dx.mjs → retry-CJL0poaU.mjs} +0 -0
  64. /package/dist/{types-DCP0WLdt.mjs → types-CGUnLkU3.mjs} +0 -0
@@ -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 { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-CdHJBGaI.mjs";
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-ETgJ0kEf.mjs";
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-iGAzD_2N.mjs";
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
@@ -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-DoM8wkoM.cjs");
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-NdVl1dI9.js";
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.898+44ea8f2f",
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.898+44ea8f2f",
157
- "@fedify/webfinger": "2.2.0-dev.898+44ea8f2f",
158
- "@fedify/vocab-runtime": "2.2.0-dev.898+44ea8f2f"
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.898+44ea8f2f"
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