@fedify/fedify 2.1.31 → 2.1.32

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 (97) hide show
  1. package/dist/attachment-arrays-DZ4JHJD8.mjs +111 -0
  2. package/dist/{builder-isMRh_I6.mjs → builder--sc-rozj.mjs} +3 -3
  3. package/dist/callback-BARPujV7.d.mts +2388 -0
  4. package/dist/{client-BIBzqEIp.d.cts → client-9DPcy_Yx.d.ts} +16 -0
  5. package/dist/{client-jE7oGvRh.d.ts → client-B3ruDgWg.d.cts} +16 -0
  6. package/dist/{client-BZr7TGyu.mjs → client-cpPaW7Ww.mjs} +86 -11
  7. package/dist/compat/attachment-arrays.test.d.mts +2 -0
  8. package/dist/compat/attachment-arrays.test.mjs +254 -0
  9. package/dist/compat/mod.d.cts +1 -1
  10. package/dist/compat/mod.d.ts +1 -1
  11. package/dist/compat/transformers.test.mjs +1 -1
  12. package/dist/{context-C0uGVzgk.d.ts → context-DE2YrQwM.d.ts} +30 -13
  13. package/dist/{context-CLaLxi49.d.cts → context-y6ZUQCMf.d.cts} +30 -13
  14. package/dist/{deno-CiaJqTcu.mjs → deno-L23b3Hba.mjs} +1 -1
  15. package/dist/{docloader-DOrwedT7.mjs → docloader-DUXr9k_O.mjs} +2 -2
  16. package/dist/federation/attachment-responses.test.d.mts +2 -0
  17. package/dist/federation/attachment-responses.test.mjs +182 -0
  18. package/dist/federation/builder.test.mjs +1 -1
  19. package/dist/federation/collection.test.mjs +1 -1
  20. package/dist/federation/delivery-attachments.test.d.mts +2 -0
  21. package/dist/federation/delivery-attachments.test.mjs +280 -0
  22. package/dist/federation/handler.test.mjs +208 -16
  23. package/dist/federation/idempotency.test.mjs +2 -2
  24. package/dist/federation/inbox.test.mjs +1 -1
  25. package/dist/federation/middleware.test.mjs +1185 -8
  26. package/dist/federation/mod.cjs +1 -1
  27. package/dist/federation/mod.d.cts +2 -2
  28. package/dist/federation/mod.d.ts +2 -2
  29. package/dist/federation/mod.js +1 -1
  30. package/dist/federation/negotiation.test.mjs +1 -1
  31. package/dist/federation/retry.test.mjs +1 -1
  32. package/dist/federation/send.test.mjs +283 -3
  33. package/dist/federation/temporal.test.mjs +25 -1
  34. package/dist/federation/webfinger.test.mjs +1 -1
  35. package/dist/{http-Crml3gei.js → http-BtbMAgTA.js} +6 -4
  36. package/dist/{http-9IFUxdkp.d.cts → http-C8qLHs_Z.d.cts} +3 -3
  37. package/dist/{http-CRiVlZd5.cjs → http-D5woFKA_.cjs} +6 -4
  38. package/dist/{http-SbfezERn.d.ts → http-D8WmcRAF.d.ts} +3 -3
  39. package/dist/{http-A9mP2uM7.mjs → http-HX6wVyJh.mjs} +6 -4
  40. package/dist/{inbox-KESLudq4.mjs → inbox-CL7A0HXT.mjs} +1 -1
  41. package/dist/{key-Dg6-DV_O.mjs → key-Dai3f5yI.mjs} +3 -2
  42. package/dist/{kv-cache-Cqmm-yQa.cjs → kv-cache-B0V_e231.cjs} +1 -1
  43. package/dist/{kv-cache-DQcyZL5T.js → kv-cache-BsDg-cT8.js} +1 -1
  44. package/dist/{ld-COjDN6Nb.mjs → ld-DN6x1iZ8.mjs} +153 -21
  45. package/dist/ld-signature-DoZcbsZR.mjs +23 -0
  46. package/dist/{middleware-BtDQUCcz.cjs → middleware-Cl6k5Hrm.cjs} +1 -1
  47. package/dist/{middleware-BbgR7xOI.cjs → middleware-CrfRuKCf.cjs} +561 -101
  48. package/dist/{middleware-COFlKeYn.mjs → middleware-DiquMgtt.mjs} +378 -89
  49. package/dist/{middleware-DIW5S_5L.js → middleware-DunNtbo9.js} +560 -101
  50. package/dist/{middleware-CuQvczZd.mjs → middleware-SnQS8eIb.mjs} +1 -1
  51. package/dist/{mod-LOEOKbYd.d.cts → mod-CehHJOV4.d.cts} +30 -13
  52. package/dist/{mod-CFRocFeQ.d.ts → mod-DLJpnqdw.d.ts} +1 -1
  53. package/dist/{mod-C7w-QVUv.d.ts → mod-Mh3oIuRK.d.ts} +30 -13
  54. package/dist/{mod-BRnwh2oy.d.ts → mod-REfljt0T.d.ts} +3 -3
  55. package/dist/{mod-Co7LEK9X.d.cts → mod-UvIGUHqW.d.cts} +3 -3
  56. package/dist/{mod-CGUH8Ujp.d.cts → mod-sTa1Zzxk.d.cts} +1 -1
  57. package/dist/mod.cjs +5 -5
  58. package/dist/mod.d.cts +8 -8
  59. package/dist/mod.d.ts +8 -8
  60. package/dist/mod.js +5 -5
  61. package/dist/nodeinfo/client.test.mjs +432 -5
  62. package/dist/nodeinfo/handler.test.mjs +1 -1
  63. package/dist/nodeinfo/mod.cjs +1 -1
  64. package/dist/nodeinfo/mod.d.cts +1 -1
  65. package/dist/nodeinfo/mod.d.ts +1 -1
  66. package/dist/nodeinfo/mod.js +1 -1
  67. package/dist/nodeinfo/types.test.mjs +1 -1
  68. package/dist/{owner-CFHq61cq.mjs → owner-DwyDorZI.mjs} +2 -2
  69. package/dist/{proof-0JkSC_pT.cjs → proof-Be-4K4jn.cjs} +193 -46
  70. package/dist/{proof-KSHlbPCG.mjs → proof-DYjmyrHh.mjs} +38 -13
  71. package/dist/{proof-DzksJFK7.js → proof-Du4-5SHY.js} +187 -46
  72. package/dist/{send-DaDe2YCb.mjs → send-BGSfQkIK.mjs} +92 -21
  73. package/dist/sig/http.test.mjs +2 -2
  74. package/dist/sig/key-types.test.d.mts +218 -0
  75. package/dist/sig/key-types.test.mjs +8 -0
  76. package/dist/sig/key.test.mjs +2 -2
  77. package/dist/sig/ld.test.mjs +573 -8
  78. package/dist/sig/mod.cjs +2 -2
  79. package/dist/sig/mod.d.cts +3 -3
  80. package/dist/sig/mod.d.ts +3 -3
  81. package/dist/sig/mod.js +2 -2
  82. package/dist/sig/owner.test.mjs +1 -1
  83. package/dist/sig/proof.test.mjs +95 -3
  84. package/dist/{temporal-DNGH8o2E.mjs → temporal-CNCchWly.mjs} +3 -5
  85. package/dist/testing/mod.d.mts +2 -2203
  86. package/dist/{types-DOvyymM4.cjs → types-B5wRhemi.cjs} +85 -10
  87. package/dist/{types-B1_pRFE_.js → types-CXy2lRVU.js} +86 -11
  88. package/dist/utils/docloader.test.mjs +2 -2
  89. package/dist/utils/mod.cjs +1 -1
  90. package/dist/utils/mod.d.cts +1 -1
  91. package/dist/utils/mod.d.ts +1 -1
  92. package/dist/utils/mod.js +1 -1
  93. package/package.json +6 -6
  94. /package/dist/{collection-BD6-SZ6O.mjs → collection-DnoYNwBC.mjs} +0 -0
  95. /package/dist/{negotiation-BehA2uul.mjs → negotiation-xb0QR3u_.mjs} +0 -0
  96. /package/dist/{retry-B_E3V_Dx.mjs → retry-CI1flGDD.mjs} +0 -0
  97. /package/dist/{types-DCP0WLdt.mjs → types-s4mCTGkT.mjs} +0 -0
@@ -1,11 +1,12 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-CiaJqTcu.mjs";
5
- import { r as fetchKey, s as validateCryptoKey } from "./key-Dg6-DV_O.mjs";
4
+ import { n as version, t as name } from "./deno-L23b3Hba.mjs";
5
+ import { r as fetchKey, s as validateCryptoKey } from "./key-Dai3f5yI.mjs";
6
6
  import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
7
7
  import { SpanStatusCode, trace } from "@opentelemetry/api";
8
- import { getDocumentLoader } from "@fedify/vocab-runtime";
8
+ import { getDocumentLoader, preloadedContexts } from "@fedify/vocab-runtime";
9
+ import { asCryptoKey } from "@fedify/vocab-runtime/internal";
9
10
  import { getLogger } from "@logtape/logtape";
10
11
  import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
11
12
  import { encodeHex } from "byte-encodings/hex";
@@ -298,24 +299,110 @@ function assertSafeJsonLd(jsonLd) {
298
299
  }
299
300
  }
300
301
  }
302
+ const signatureTermDefinition = { "signature": "https://w3id.org/security#signature" };
303
+ const signatureDefiningContexts = new Set(["https://w3id.org/identity/v1", "https://w3id.org/security/v1"]);
304
+ const signatureFreeContexts = getSignatureFreeContexts();
305
+ function getSignatureFreeContexts() {
306
+ const urls = /* @__PURE__ */ new Set();
307
+ for (const [url, document] of globalThis.Object.entries(preloadedContexts)) {
308
+ if (typeof document !== "object" || document == null) continue;
309
+ const context = document["@context"];
310
+ if (typeof context !== "object" || context == null || Array.isArray(context)) continue;
311
+ const record = context;
312
+ if (!globalThis.Object.prototype.hasOwnProperty.call(record, "signature")) urls.add(url);
313
+ }
314
+ return urls;
315
+ }
316
+ function getContextEntryEffect(entry) {
317
+ if (entry == null) return "resets";
318
+ if (typeof entry === "string") {
319
+ if (signatureDefiningContexts.has(entry)) return "defines";
320
+ if (signatureFreeContexts.has(entry)) return "absent";
321
+ return "unknown";
322
+ }
323
+ if (typeof entry !== "object") return "absent";
324
+ const record = entry;
325
+ if (globalThis.Object.prototype.hasOwnProperty.call(record, "signature")) {
326
+ const definition = record["signature"];
327
+ const contextProtected = record["@protected"] === true;
328
+ const imported = globalThis.Object.prototype.hasOwnProperty.call(record, "@import");
329
+ if (definition == null) {
330
+ if (contextProtected) return "defines";
331
+ return imported ? "unknown" : "resets";
332
+ }
333
+ if (typeof definition === "object" && !Array.isArray(definition)) {
334
+ const term = definition;
335
+ const protectedTerm = contextProtected || term["@protected"] === true;
336
+ if (globalThis.Object.prototype.hasOwnProperty.call(term, "@id") && term["@id"] == null) {
337
+ if (protectedTerm) return "defines";
338
+ return imported ? "unknown" : "resets";
339
+ }
340
+ }
341
+ return "defines";
342
+ }
343
+ if (globalThis.Object.prototype.hasOwnProperty.call(record, "@import")) return "unknown";
344
+ return "absent";
345
+ }
346
+ function getSignatureTermState(context) {
347
+ if (context == null) return "absent";
348
+ if (!Array.isArray(context)) {
349
+ const effect = getContextEntryEffect(context);
350
+ return effect === "defines" ? "defined" : effect === "unknown" ? "unknown" : "absent";
351
+ }
352
+ let state = "absent";
353
+ for (const entry of context) {
354
+ const effect = getContextEntryEffect(entry);
355
+ if (effect === "defines") state = "defined";
356
+ else if (effect === "resets") state = "absent";
357
+ else if (effect === "unknown" && state !== "defined") state = "unknown";
358
+ }
359
+ return state;
360
+ }
361
+ function prepareSignatureDocument(jsonLd) {
362
+ if (typeof jsonLd !== "object" || jsonLd == null || Array.isArray(jsonLd)) return jsonLd;
363
+ const document = jsonLd;
364
+ if (document["proof"] != null) return { ...document };
365
+ const context = document["@context"];
366
+ if (getSignatureTermState(context) !== "absent") return { ...document };
367
+ const definition = { ...signatureTermDefinition };
368
+ return {
369
+ ...document,
370
+ "@context": context == null ? [definition] : Array.isArray(context) ? [...context, definition] : [context, definition]
371
+ };
372
+ }
301
373
  /**
302
374
  * Attaches a LD signature to the given JSON-LD document.
375
+ *
376
+ * When the document's context does not already define the `signature`
377
+ * property, the returned document adds a minimal inline context for it.
378
+ * Without that definition, expanding the attached signature would produce a
379
+ * blank node predicate, which is not valid RDF. Documents that already carry
380
+ * a `proof` are left unchanged, since a new context definition would invalidate
381
+ * the proof. Documents whose context includes an unrecognized remote context
382
+ * are also left unchanged, since that context may already define `signature`.
303
383
  * @param jsonLd The JSON-LD document to attach the signature to. It is not
304
384
  * modified.
305
385
  * @param signature The signature to attach.
306
386
  * @returns The JSON-LD document with the attached signature.
307
387
  * @throws {TypeError} If the input document is not a valid JSON-LD document.
388
+ * Top-level arrays are rejected, since a Linked Data
389
+ * Signature is attached to a single node.
308
390
  * @since 1.0.0
309
391
  */
310
392
  function attachSignature(jsonLd, signature) {
311
- if (typeof jsonLd !== "object" || jsonLd == null) throw new TypeError("Failed to attach signature; invalid JSON-LD document.");
312
- return {
313
- ...jsonLd,
314
- signature
315
- };
393
+ if (typeof jsonLd !== "object" || jsonLd == null || Array.isArray(jsonLd)) throw new TypeError("Failed to attach signature; invalid JSON-LD document.");
394
+ const output = prepareSignatureDocument(jsonLd);
395
+ output.signature = signature;
396
+ return output;
316
397
  }
317
398
  /**
318
399
  * Creates a LD signature for the given JSON-LD document.
400
+ *
401
+ * If the document's context does not define the `signature` property, the
402
+ * signature is computed over the document with a minimal inline definition
403
+ * added. Use {@link attachSignature} to attach the signature to that exact
404
+ * document. Documents that already carry a `proof`, or whose context includes
405
+ * an unrecognized remote context, are hashed unchanged.
319
406
  * @param jsonLd The JSON-LD document to sign.
320
407
  * @param privateKey The private key to sign the document.
321
408
  * @param keyId The ID of the public key that corresponds to the private key.
@@ -329,14 +416,17 @@ async function createSignature(jsonLd, privateKey, keyId, { contextLoader, creat
329
416
  validateCryptoKey(privateKey, "private");
330
417
  if (privateKey.algorithm.name !== "RSASSA-PKCS1-v1_5") throw new TypeError("Unsupported algorithm: " + privateKey.algorithm.name);
331
418
  const options = {
332
- "@context": "https://w3id.org/identity/v1",
333
419
  creator: keyId.href,
334
420
  created: created?.toString() ?? (/* @__PURE__ */ new Date()).toISOString()
335
421
  };
336
- const message = await hashJsonLd(options, contextLoader) + await hashJsonLd(jsonLd, contextLoader);
422
+ const message = await hashJsonLd({
423
+ "@context": "https://w3id.org/identity/v1",
424
+ ...options
425
+ }, contextLoader) + await hashJsonLd(prepareSignatureDocument(jsonLd), contextLoader);
337
426
  const messageBytes = new TextEncoder().encode(message);
338
- const signature = await crypto.subtle.sign("RSASSA-PKCS1-v1_5", privateKey, messageBytes);
427
+ const signature = await crypto.subtle.sign("RSASSA-PKCS1-v1_5", asCryptoKey(privateKey), messageBytes);
339
428
  return {
429
+ "@context": "https://w3id.org/security/v1",
340
430
  ...options,
341
431
  type: "RsaSignature2017",
342
432
  signatureValue: encodeBase64(signature)
@@ -375,6 +465,24 @@ async function signJsonLd(jsonLd, privateKey, keyId, options) {
375
465
  }
376
466
  });
377
467
  }
468
+ /** @internal */
469
+ function hasVerifiableSignature(jsonLd) {
470
+ if (typeof jsonLd !== "object" || jsonLd == null || Array.isArray(jsonLd) || !("signature" in jsonLd)) return false;
471
+ const signature = jsonLd.signature;
472
+ if (typeof signature !== "object" || signature == null || Array.isArray(signature)) return false;
473
+ return "type" in signature && signature.type === "RsaSignature2017" && "creator" in signature && typeof signature.creator === "string" && (!("created" in signature) || typeof signature.created === "string") && "signatureValue" in signature && typeof signature.signatureValue === "string";
474
+ }
475
+ /** @internal */
476
+ function describeSignatureShape(jsonLd) {
477
+ if (typeof jsonLd !== "object" || jsonLd == null || !("signature" in jsonLd)) return null;
478
+ const signature = jsonLd.signature;
479
+ const properties = typeof signature === "object" && signature != null ? globalThis.Object.keys(signature) : [];
480
+ return {
481
+ signatureKind: signature == null ? String(signature) : Array.isArray(signature) ? "array" : typeof signature,
482
+ signatureProperties: properties.sort().slice(0, 20).map((p) => p.slice(0, 80)),
483
+ signaturePropertyCount: properties.length
484
+ };
485
+ }
378
486
  /**
379
487
  * Checks if the given JSON-LD document has a Linked Data Signature.
380
488
  * @param jsonLd The JSON-LD document to check.
@@ -405,6 +513,9 @@ function detachSignature(jsonLd) {
405
513
  }
406
514
  /**
407
515
  * Verifies Linked Data Signatures of the given JSON-LD document.
516
+ * Unmapped properties discarded during JSON-LD processing are tolerated, but
517
+ * their values are not authenticated by the signature. Other unsafe
518
+ * canonicalization warnings, including relative IRIs, remain rejected.
408
519
  * @param jsonLd The JSON-LD document to verify.
409
520
  * @param options Options for verifying the signature.
410
521
  * @returns The public key that signed the document or `null` if the signature
@@ -412,7 +523,11 @@ function detachSignature(jsonLd) {
412
523
  * @since 1.0.0
413
524
  */
414
525
  async function verifySignature(jsonLd, options = {}) {
415
- if (!hasSignature(jsonLd)) return null;
526
+ if (!hasVerifiableSignature(jsonLd)) {
527
+ const shape = describeSignatureShape(jsonLd);
528
+ if (shape != null) logger.debug("Linked Data Signature has an unsupported shape: {signatureKind}; properties: {signatureProperties}.", shape);
529
+ return null;
530
+ }
416
531
  const sig = jsonLd.signature;
417
532
  let signature;
418
533
  try {
@@ -424,7 +539,14 @@ async function verifySignature(jsonLd, options = {}) {
424
539
  });
425
540
  return null;
426
541
  }
427
- const { key, cached } = await fetchKey(new URL(sig.creator), CryptographicKey, options);
542
+ let creator;
543
+ try {
544
+ creator = new URL(sig.creator);
545
+ } catch {
546
+ logger.debug("Failed to verify; signature creator is not a valid URL.");
547
+ return null;
548
+ }
549
+ const { key, cached } = await fetchKey(creator, CryptographicKey, options);
428
550
  if (key == null) return null;
429
551
  const sigOpts = {
430
552
  ...sig,
@@ -435,7 +557,7 @@ async function verifySignature(jsonLd, options = {}) {
435
557
  delete sigOpts.signatureValue;
436
558
  let sigOptsHash;
437
559
  try {
438
- sigOptsHash = await hashJsonLd(sigOpts, options.contextLoader);
560
+ sigOptsHash = await hashJsonLd(sigOpts, options.contextLoader, "verify");
439
561
  } catch (error) {
440
562
  logger.warn("Failed to verify; failed to hash the signature options: {signatureOptions}\n{error}", {
441
563
  signatureOptions: sigOpts,
@@ -447,7 +569,7 @@ async function verifySignature(jsonLd, options = {}) {
447
569
  delete document.signature;
448
570
  let docHash;
449
571
  try {
450
- docHash = await hashJsonLd(document, options.contextLoader);
572
+ docHash = await hashJsonLd(document, options.contextLoader, "verify");
451
573
  } catch (error) {
452
574
  logger.warn("Failed to verify; failed to hash the document: {document}\n{error}", {
453
575
  document,
@@ -464,7 +586,7 @@ async function verifySignature(jsonLd, options = {}) {
464
586
  keyId: sig.creator,
465
587
  ...sig
466
588
  });
467
- const { key } = await fetchKey(new URL(sig.creator), CryptographicKey, {
589
+ const { key } = await fetchKey(creator, CryptographicKey, {
468
590
  ...options,
469
591
  keyCache: {
470
592
  get: () => Promise.resolve(void 0),
@@ -486,6 +608,8 @@ async function verifySignature(jsonLd, options = {}) {
486
608
  * Signatures. If the document is signed, this function verifies the signature
487
609
  * and checks if the document is attributed to the owner of the public key.
488
610
  * If the document is not signed, this function returns `false`.
611
+ * Unmapped properties discarded during JSON-LD processing are not
612
+ * authenticated, even when verification succeeds.
489
613
  * @param jsonLd The JSON-LD document to verify.
490
614
  * @param options Options for verifying the document.
491
615
  * @returns `true` if the document is authentic; `false` otherwise.
@@ -500,11 +624,12 @@ async function verifyCompactJsonLd(jsonLd, options = {}) {
500
624
  async function verifyJsonLdInternal(jsonLd, options, compact) {
501
625
  return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("ld_signatures.verify", async (span) => {
502
626
  try {
503
- const verificationOptions = hasSignature(jsonLd) ? {
627
+ const hasLdSignature = hasVerifiableSignature(jsonLd);
628
+ const verificationOptions = hasLdSignature ? {
504
629
  ...options,
505
630
  contextLoader: getNormalizationContextLoader(options.contextLoader)
506
631
  } : options;
507
- const compacted = compact ? hasSignature(jsonLd) ? await compactJsonLd(jsonLd, options.contextLoader) : jsonLd : jsonLd;
632
+ const compacted = compact ? hasLdSignature ? await compactJsonLd(jsonLd, options.contextLoader) : jsonLd : jsonLd;
508
633
  const object = await Object$1.fromJsonLd(compacted, verificationOptions);
509
634
  if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
510
635
  span.setAttribute("activitypub.object.type", getTypeId(object).href);
@@ -538,13 +663,20 @@ async function verifyJsonLdInternal(jsonLd, options, compact) {
538
663
  }
539
664
  });
540
665
  }
541
- async function hashJsonLd(jsonLd, contextLoader) {
666
+ const tolerableVerificationWarnings = new Set(["blank node predicate", "invalid property"]);
667
+ function handleVerificationEvent({ event, next }) {
668
+ if (event.level === "warning" && !tolerableVerificationWarnings.has(event.code)) throw new TypeError(`Unsafe JSON-LD canonicalization warning: ${event.code}`);
669
+ next();
670
+ }
671
+ async function hashJsonLd(jsonLd, contextLoader, mode = "sign") {
542
672
  const canon = await jsonld.canonize(jsonLd, {
543
673
  format: "application/n-quads",
544
- documentLoader: contextLoader ?? getDocumentLoader()
674
+ documentLoader: contextLoader ?? getDocumentLoader(),
675
+ safe: mode === "sign",
676
+ eventHandler: mode === "verify" ? handleVerificationEvent : void 0
545
677
  });
546
678
  const encoder = new TextEncoder();
547
679
  return encodeHex(await crypto.subtle.digest("SHA-256", encoder.encode(canon)));
548
680
  }
549
681
  //#endregion
550
- export { compactJsonLd as a, getNormalizationContextLoader as c, isInvalidUrlTypeError as d, signJsonLd as f, wrapContextLoaderForJsonLd as g, verifySignature as h, attachSignature as i, hasSignature as l, verifyJsonLd as m, UnsafeJsonLdError as n, createSignature as o, verifyCompactJsonLd as p, assertSafeJsonLd as r, detachSignature as s, InvalidContextReferenceError as t, isClearlyMalformedContextReference as u };
682
+ export { verifySignature as _, compactJsonLd as a, detachSignature as c, hasVerifiableSignature as d, isClearlyMalformedContextReference as f, verifyJsonLd as g, verifyCompactJsonLd as h, attachSignature as i, getNormalizationContextLoader as l, signJsonLd as m, UnsafeJsonLdError as n, createSignature as o, isInvalidUrlTypeError as p, assertSafeJsonLd as r, describeSignatureShape as s, InvalidContextReferenceError as t, hasSignature as u, wrapContextLoaderForJsonLd as v };
@@ -0,0 +1,23 @@
1
+ import "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ //#region src/testing/ld-signature.ts
5
+ const ldSignatureWithoutCreated = {
6
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"],
7
+ "id": "https://example.com/activities/1",
8
+ "type": "Create",
9
+ "actor": "https://example.com/person2",
10
+ "object": {
11
+ "id": "https://example.com/notes/1",
12
+ "type": "Note",
13
+ "attributedTo": "https://example.com/person2",
14
+ "content": "hi"
15
+ },
16
+ "signature": {
17
+ "type": "RsaSignature2017",
18
+ "creator": "https://example.com/person2#key3",
19
+ "signatureValue": "xUGTqQ94q+3bhvorwJx42sa7nCuR2ggtJYjwhqsueMCOLEmTEpeGGhG4mRKjFDt/ZegE9Icbxau6YL6WeQxWLMwYs7vucAE6948UlDFn1l3M+papmwgbNpOnk/baj9NMzChtqwOIQ1ka5bJAZjTo5FgG1YBmMibTHb6GN5ULzxjTlch93tcBx/LVwdPU1MyYHHz55hiMQZkw9AZ521PebCrm8eUjsXHwjijeh7/GIFWW3bmwk1dHRxJbUmmQlxBxmaLXQ8aVkFN3R00FBUjnn54Bp+nQJI/VXcKs3nFYGZ9EsMQcXlYCbOuOfPAPWiqdLSOhDZtuisIcZcvOiZ/tgA5RlXro0AXv0f3gKpkoxPBsUIIM0gBeb6+MTbSAk6IqPf0qy81V0XEjEMKSZNGDeULH+zMFodtw07EmfR/y/3i9ge3htd7vQQ0XKLLUfBddzMqS+8AAuSl4ObAlWAM2xuw/4yuQ3AIQy9RtsiEjDSO1NtUK5wRXCeXo++CkVpODDdxNtWdZD6GzfX9PAuIfHlWE+CLDaY/iH4fWxumLu15dD9vVDjlYAAS/ZNOyiPSCh4mLZ65sKIp8UkPstYRBKcjiRJhKUh1Br8TvTt/j/iC9SnFw/8uiCkLYd6yhdgXQafocPIa6eeb4m/EhF1HY0v+6qKR5JOBT6mTA/BPRmWg="
20
+ }
21
+ };
22
+ //#endregion
23
+ export { ldSignatureWithoutCreated as t };
@@ -1,4 +1,4 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
- const require_middleware = require("./middleware-BbgR7xOI.cjs");
3
+ const require_middleware = require("./middleware-CrfRuKCf.cjs");
4
4
  exports.FederationImpl = require_middleware.FederationImpl;