@fedify/fedify 2.2.20 → 2.2.21

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 (102) hide show
  1. package/dist/attachment-arrays-CalAATqD.mjs +16 -0
  2. package/dist/{builder-BolQ56ab.mjs → builder-4ImvtjG4.mjs} +3 -3
  3. package/dist/callback-0KrwzutD.d.mts +2607 -0
  4. package/dist/{client-jE7oGvRh.d.ts → client-9DPcy_Yx.d.ts} +16 -0
  5. package/dist/{client-BIBzqEIp.d.cts → client-B3ruDgWg.d.cts} +16 -0
  6. package/dist/{client-DhxaVgOv.mjs → client-XYMC0Mmk.mjs} +86 -11
  7. package/dist/compat/attachment-arrays.test.d.mts +2 -0
  8. package/dist/compat/attachment-arrays.test.mjs +255 -0
  9. package/dist/compat/mod.d.cts +1 -1
  10. package/dist/compat/mod.d.ts +1 -1
  11. package/dist/compat/outgoing-jsonld.test.mjs +1 -1
  12. package/dist/compat/public-audience.test.mjs +1 -1
  13. package/dist/compat/transformers.test.mjs +1 -1
  14. package/dist/{context-CFQGaq5x.d.cts → context-CjWuov0g.d.cts} +31 -14
  15. package/dist/{context-DdbLVV_k.d.ts → context-DZqI2LJD.d.ts} +31 -14
  16. package/dist/{deno-BUj4roJc.mjs → deno-AWk3S2Ug.mjs} +1 -1
  17. package/dist/{docloader-CbtF_0cD.mjs → docloader-Bogpjg4d.mjs} +2 -2
  18. package/dist/federation/attachment-responses.test.d.mts +2 -0
  19. package/dist/federation/attachment-responses.test.mjs +182 -0
  20. package/dist/federation/builder.test.mjs +1 -1
  21. package/dist/federation/collection.test.mjs +1 -1
  22. package/dist/federation/delivery-attachments.test.d.mts +2 -0
  23. package/dist/federation/delivery-attachments.test.mjs +288 -0
  24. package/dist/federation/handler.test.mjs +208 -16
  25. package/dist/federation/idempotency.test.mjs +2 -2
  26. package/dist/federation/inbox.test.mjs +2 -2
  27. package/dist/federation/middleware.test.mjs +1184 -8
  28. package/dist/federation/mod.cjs +1 -1
  29. package/dist/federation/mod.d.cts +2 -2
  30. package/dist/federation/mod.d.ts +2 -2
  31. package/dist/federation/mod.js +1 -1
  32. package/dist/federation/negotiation.test.mjs +1 -1
  33. package/dist/federation/retry.test.mjs +1 -1
  34. package/dist/federation/send.test.mjs +283 -3
  35. package/dist/federation/temporal.test.mjs +25 -1
  36. package/dist/federation/webfinger.test.mjs +1 -1
  37. package/dist/{http-CQMVisM0.mjs → http-B3wCvgu8.mjs} +6 -4
  38. package/dist/{http-D8I7LBfx.cjs → http-BNaPJVnF.cjs} +6 -4
  39. package/dist/{http-C5g_VrA_.js → http-BpdLaGy8.js} +6 -4
  40. package/dist/{http-9IFUxdkp.d.cts → http-C8qLHs_Z.d.cts} +3 -3
  41. package/dist/{http-SbfezERn.d.ts → http-D8WmcRAF.d.ts} +3 -3
  42. package/dist/{inbox-CD8IDILN.mjs → inbox-DLy6WBXU.mjs} +1 -1
  43. package/dist/{key-C3o3DGap.mjs → key-Bhc8cQC7.mjs} +3 -2
  44. package/dist/{kv-cache-DC9LcfoC.cjs → kv-cache-Bj3CY9Jo.cjs} +1 -1
  45. package/dist/{kv-cache-CSKXXleR.js → kv-cache-CvjLUQTf.js} +1 -1
  46. package/dist/{ld-ijSr-0AB.mjs → ld-DTeykI0e.mjs} +153 -21
  47. package/dist/ld-signature-Dgz_b89j.mjs +23 -0
  48. package/dist/{middleware-DNueR0GD.cjs → middleware-BSQP4d9p.cjs} +475 -107
  49. package/dist/{middleware-DmcY2TWS.cjs → middleware-CWOzxb3o.cjs} +1 -1
  50. package/dist/{middleware-yqqfI7oJ.mjs → middleware-DkMsC5mQ.mjs} +1 -1
  51. package/dist/{middleware-sjhz30sm.js → middleware-Dx1iwFk8.js} +474 -107
  52. package/dist/{middleware-CYAaUTi5.mjs → middleware-dlGvSrXl.mjs} +386 -96
  53. package/dist/{mod-BYWp77-z.d.cts → mod-BmxqcEnU.d.ts} +30 -13
  54. package/dist/{mod-CVSKw-5H.d.cts → mod-DWEx2D4q.d.cts} +1 -1
  55. package/dist/{mod-BuRRdsfD.d.ts → mod-DnPmz3-S.d.ts} +1 -1
  56. package/dist/{mod-CM5_J_cx.d.ts → mod-INjDw-m0.d.cts} +30 -13
  57. package/dist/{mod-BRnwh2oy.d.ts → mod-REfljt0T.d.ts} +3 -3
  58. package/dist/{mod-Co7LEK9X.d.cts → mod-UvIGUHqW.d.cts} +3 -3
  59. package/dist/mod.cjs +5 -5
  60. package/dist/mod.d.cts +8 -8
  61. package/dist/mod.d.ts +8 -8
  62. package/dist/mod.js +5 -5
  63. package/dist/nodeinfo/client.test.mjs +432 -4
  64. package/dist/nodeinfo/handler.test.mjs +1 -1
  65. package/dist/nodeinfo/mod.cjs +1 -1
  66. package/dist/nodeinfo/mod.d.cts +1 -1
  67. package/dist/nodeinfo/mod.d.ts +1 -1
  68. package/dist/nodeinfo/mod.js +1 -1
  69. package/dist/nodeinfo/types.test.mjs +1 -1
  70. package/dist/{outgoing-jsonld-amccRMrV.mjs → outgoing-jsonld-DHf_DYXp.mjs} +38 -8
  71. package/dist/{owner-B8kXzD0q.mjs → owner-BsA7qMHB.mjs} +2 -2
  72. package/dist/{proof-CBQOjOgA.mjs → proof-C63Hqt9N.mjs} +40 -15
  73. package/dist/{proof-qiuGJCD7.cjs → proof-Dbz6ApNP.cjs} +1190 -1007
  74. package/dist/{proof-DKX6nASL.js → proof-QV_o5ZqS.js} +1174 -1003
  75. package/dist/{send-DRpisX_f.mjs → send-CAdpwbFX.mjs} +92 -21
  76. package/dist/sig/http.test.mjs +2 -2
  77. package/dist/sig/key-types.test.d.mts +218 -0
  78. package/dist/sig/key-types.test.mjs +8 -0
  79. package/dist/sig/key.test.mjs +2 -2
  80. package/dist/sig/ld.test.mjs +573 -8
  81. package/dist/sig/mod.cjs +2 -2
  82. package/dist/sig/mod.d.cts +3 -3
  83. package/dist/sig/mod.d.ts +3 -3
  84. package/dist/sig/mod.js +2 -2
  85. package/dist/sig/owner.test.mjs +1 -1
  86. package/dist/sig/proof.test.mjs +96 -4
  87. package/dist/{temporal-BQGEINad.mjs → temporal-B3JGkVgk.mjs} +3 -5
  88. package/dist/testing/mod.d.mts +2 -2422
  89. package/dist/{types-DOvyymM4.cjs → types-BWx7zw3Y.cjs} +85 -10
  90. package/dist/{types-B1_pRFE_.js → types-Dx_w2JSM.js} +86 -11
  91. package/dist/utils/docloader.test.mjs +2 -2
  92. package/dist/utils/mod.cjs +1 -1
  93. package/dist/utils/mod.d.cts +1 -1
  94. package/dist/utils/mod.d.ts +1 -1
  95. package/dist/utils/mod.js +1 -1
  96. package/package.json +5 -5
  97. /package/dist/{activity-listener-ell7W1s9.mjs → activity-listener-tztVvlNb.mjs} +0 -0
  98. /package/dist/{collection-D-HqUuA2.mjs → collection-CA3V5zyK.mjs} +0 -0
  99. /package/dist/{negotiation-SQvQgUqe.mjs → negotiation-VnHNB0Q5.mjs} +0 -0
  100. /package/dist/{public-audience-DpJqzPuh.mjs → public-audience-4g3_Ze4y.mjs} +0 -0
  101. /package/dist/{retry-v_sGLH1d.mjs → retry-CXg_MBI-.mjs} +0 -0
  102. /package/dist/{types-J53Kw7so.mjs → types-BFowWFTT.mjs} +0 -0
package/dist/sig/mod.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
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-SbfezERn.js";
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-D8WmcRAF.js";
3
3
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-CiBPcC6F.js";
4
- import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "../mod-CM5_J_cx.js";
5
- export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, 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, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
4
+ import { S as verifySignature, _ as createSignature, a as VerifyObjectOptions, b as signJsonLd, c as hasProofLike, d as verifyProof, f as CreateSignatureOptions, g as attachSignature, h as VerifySignatureOptions, i as SignObjectOptions, l as signObject, m as VerifyJsonLdOptions, n as CryptoKeyPairLike, o as VerifyProofOptions, p as SignJsonLdOptions, r as CreateProofOptions, s as createProof, t as CryptoKeyLike, u as verifyObject, v as detachSignature, x as verifyJsonLd, y as hasSignatureLike } from "../mod-BmxqcEnU.js";
5
+ export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, CryptoKeyLike, CryptoKeyPairLike, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, 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, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
package/dist/sig/mod.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { _ as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, g as parseAcceptSignature, h as fulfillAcceptSignature, i as verifyRequest, l as fetchKeyDetailed, m as formatAcceptSignature, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "../http-C5g_VrA_.js";
4
- import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "../proof-DKX6nASL.js";
3
+ import { _ as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, g as parseAcceptSignature, h as fulfillAcceptSignature, i as verifyRequest, l as fetchKeyDetailed, m as formatAcceptSignature, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "../http-BpdLaGy8.js";
4
+ import { C as verifySignature, S as verifyJsonLd, a as verifyProof, b as signJsonLd, f as createSignature, g as hasSignatureLike, i as verifyObject, m as detachSignature, n as hasProofLike, o as doesActorOwnKey, r as signObject, s as getKeyOwner, t as createProof, u as attachSignature } from "../proof-QV_o5ZqS.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, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
@@ -6,7 +6,7 @@ import "../std__assert-DNZ4Liil.mjs";
6
6
  import { r as assertFalse } from "../assert_throws-D4DNWrux.mjs";
7
7
  import { t as assert } from "../assert-BhQd8QHP.mjs";
8
8
  import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-BAK-tUlf.mjs";
9
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-B8kXzD0q.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-BsA7qMHB.mjs";
10
10
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
11
11
  import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
12
12
  //#region src/sig/owner.test.ts
@@ -7,10 +7,11 @@ import { r as assertFalse } from "../assert_throws-D4DNWrux.mjs";
7
7
  import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
8
8
  import { t as assertRejects } from "../assert_rejects-WyYSTDDX.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 { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-amccRMrV.mjs";
11
- import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-CBQOjOgA.mjs";
10
+ import { c as detachSignature, h as signJsonLd, v as verifySignature } from "../ld-DTeykI0e.mjs";
11
+ import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-DHf_DYXp.mjs";
12
+ import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-C63Hqt9N.mjs";
12
13
  import { mockDocumentLoader, test } from "@fedify/fixture";
13
- import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place } from "@fedify/vocab";
14
+ import { Create, DataIntegrityProof, Document, Multikey, Note, OrderedCollectionPage, PUBLIC_COLLECTION, Place } from "@fedify/vocab";
14
15
  import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
15
16
  import { decodeHex } from "byte-encodings/hex";
16
17
  //#region src/sig/proof.test.ts
@@ -49,7 +50,7 @@ test("createProof()", async () => {
49
50
  assertEquals(proof.cryptosuite, "eddsa-jcs-2022");
50
51
  assertEquals(proof.verificationMethodId, ed25519PublicKey.id);
51
52
  assertEquals(proof.proofPurpose, "assertionMethod");
52
- assertEquals(proof.proofValue, decodeHex("0e63238fdb50a979a7fbd906b471d328a03504de7aa3a0409fad1500b85d6fecafa2223bfde21ba2eac9446d36f6583c45cb55a98017a0a6a275f50262a4ea06"));
53
+ assertEquals(proof.proofValue, decodeHex("471e7aefd4ce4be462d1d7e1194ccfe3c177e10986740e47b60330e1655a0242202e47d3fa6599a83bf9f989c05a1507907e3bbea44c6391243a8e5c29d8ba00"));
53
54
  assertEquals(proof.created, created);
54
55
  assertEquals(await verifyProof(await create.toJsonLd({
55
56
  format: "compact",
@@ -237,6 +238,71 @@ test("hasProofLike()", () => {
237
238
  proofPurpose: "assertionMethod"
238
239
  } }));
239
240
  });
241
+ test("collection serialization preserves cached object integrity proofs", async () => {
242
+ const options = {
243
+ documentLoader: mockDocumentLoader,
244
+ contextLoader: mockDocumentLoader
245
+ };
246
+ const source = await (await signObject(fep8b32TestVectorActivity, fep8b32TestVectorPrivateKey, fep8b32TestVectorKeyId, {
247
+ ...options,
248
+ created: Temporal.Instant.from("2023-02-24T23:36:38Z")
249
+ })).toJsonLd(options);
250
+ assertInstanceOf(await verifyObject(Create, source, options), Create);
251
+ const cached = await Create.fromJsonLd(source, options);
252
+ const json = await new OrderedCollectionPage({
253
+ id: new URL("https://server.example/outbox?page=1"),
254
+ items: [cached]
255
+ }).toJsonLd(options);
256
+ assertEquals(json.orderedItems[0], source);
257
+ assertEquals(await cached.toJsonLd(), source);
258
+ assertInstanceOf(await verifyObject(Create, json.orderedItems[0], options), Create);
259
+ const restored = await OrderedCollectionPage.fromJsonLd(json, options);
260
+ const items = await Array.fromAsync(restored.getItems(options));
261
+ assertEquals(items.length, 1);
262
+ assertEquals(await items[0].toJsonLd(), source);
263
+ });
264
+ test("signObject() migrates proofs from an older context", async () => {
265
+ const oldContext = [
266
+ "https://w3id.org/identity/v1",
267
+ "https://www.w3.org/ns/activitystreams",
268
+ "https://w3id.org/security/data-integrity/v1"
269
+ ];
270
+ const oldJson = await (await signObject(new Create({
271
+ id: new URL("https://example.com/activities/1"),
272
+ actor: new URL("https://example.com/users/alice")
273
+ }), ed25519PrivateKey, ed25519Multikey.id, {
274
+ contextLoader: mockDocumentLoader,
275
+ context: oldContext
276
+ })).toJsonLd({
277
+ format: "compact",
278
+ contextLoader: mockDocumentLoader,
279
+ context: oldContext
280
+ });
281
+ const json = await (await signObject(await Create.fromJsonLd(oldJson, {
282
+ contextLoader: mockDocumentLoader,
283
+ documentLoader: mockDocumentLoader
284
+ }), ed25519PrivateKey, ed25519Multikey.id, { contextLoader: mockDocumentLoader })).toJsonLd({
285
+ format: "compact",
286
+ contextLoader: mockDocumentLoader
287
+ });
288
+ const proofs = Array.isArray(json.proof) ? json.proof : [json.proof];
289
+ assertEquals(proofs.length, 1);
290
+ assertEquals(proofs[0].verificationMethod, ed25519Multikey.id.href);
291
+ });
292
+ test("signObject() skips context comparison for proofless objects", async () => {
293
+ const activity = new Create({
294
+ id: new URL("https://example.com/activities/1"),
295
+ actor: new URL("https://example.com/users/alice")
296
+ });
297
+ let unformattedSerializations = 0;
298
+ const originalToJsonLd = activity.toJsonLd.bind(activity);
299
+ Object.defineProperty(activity, "toJsonLd", { value: async (options) => {
300
+ if (options?.format == null) unformattedSerializations++;
301
+ return await originalToJsonLd(options);
302
+ } });
303
+ await signObject(activity, ed25519PrivateKey, ed25519Multikey.id, { contextLoader: mockDocumentLoader });
304
+ assertEquals(unformattedSerializations, 0);
305
+ });
240
306
  test("verifyProof()", async () => {
241
307
  const cache = {};
242
308
  const options = {
@@ -326,6 +392,32 @@ test("verifyProof()", async () => {
326
392
  }), null);
327
393
  assertFalse(contextLoaderCalls.includes("https://attacker.example/ctx"));
328
394
  });
395
+ test("signJsonLd() does not invalidate an existing proof", async () => {
396
+ const options = {
397
+ documentLoader: mockDocumentLoader,
398
+ contextLoader: mockDocumentLoader
399
+ };
400
+ const note = new Note({
401
+ id: new URL("https://example.com/notes/1"),
402
+ attribution: new URL("https://example.com/users/alice"),
403
+ content: "Hello"
404
+ });
405
+ const proof = await createProof(note, ed25519PrivateKey, ed25519PublicKey.id, options);
406
+ const withProof = {
407
+ ...await note.toJsonLd({
408
+ format: "compact",
409
+ contextLoader: mockDocumentLoader
410
+ }),
411
+ proof: await proof.toJsonLd({
412
+ format: "compact",
413
+ contextLoader: mockDocumentLoader
414
+ })
415
+ };
416
+ const signed = await signJsonLd(withProof, rsaPrivateKey2, rsaPublicKey2.id, options);
417
+ assertEquals(signed["@context"], withProof["@context"]);
418
+ assertEquals(await verifyProof(detachSignature(signed), proof, options), ed25519Multikey);
419
+ assertEquals(await verifySignature(signed, options), rsaPublicKey2);
420
+ });
329
421
  test("verifyObject()", async () => {
330
422
  const options = {
331
423
  documentLoader: mockDocumentLoader,
@@ -1,15 +1,13 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { c as getNormalizationContextLoader } from "./ld-ijSr-0AB.mjs";
4
+ import { l as getNormalizationContextLoader } from "./ld-DTeykI0e.mjs";
5
5
  import jsonld from "@fedify/vocab-runtime/jsonld";
6
+ import { normalizeDateTimeLiteral } from "@fedify/vocab-runtime/temporal";
6
7
  //#region src/federation/temporal.ts
7
8
  function isPlainObject(value) {
8
9
  return typeof value === "object" && value != null && !Array.isArray(value);
9
10
  }
10
- function normalizeDateTimeLiteral(value) {
11
- return value.substring(19).match(/[Z+-]/) ? value : value + "Z";
12
- }
13
11
  function isMalformedDateTimeLiteral(value) {
14
12
  if (typeof value !== "string") return false;
15
13
  try {
@@ -51,7 +49,7 @@ function hasMalformedExpandedQuestionClosedLiteral(value) {
51
49
  if (typeof literal === "boolean") return false;
52
50
  if (typeof literal !== "string") return false;
53
51
  if (value["@type"] !== XSD_DATE_TIME_IRI) return false;
54
- if (new Date(literal).toString() === "Invalid Date") return false;
52
+ if (new Date(literal).toString() === "Invalid Date" && new Date(normalizeDateTimeLiteral(literal)).toString() === "Invalid Date") return false;
55
53
  return isMalformedDateTimeLiteral(literal);
56
54
  }
57
55
  function hasMalformedExpandedDurationLiteral(value) {