@fedify/fedify 2.5.0-dev.2440 → 2.5.0-dev.2448

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 (117) hide show
  1. package/dist/{activity-listener-C-BSbKI7.mjs → activity-listener-CELFAodc.mjs} +8 -4
  2. package/dist/{builder-CTasaZgj.mjs → builder-DbC8bn6k.mjs} +5 -5
  3. package/dist/compat/mod.d.cts +1 -1
  4. package/dist/compat/mod.d.ts +1 -1
  5. package/dist/compat/transformers.test.mjs +1 -1
  6. package/dist/{compound-proof-D5r-dQMr.mjs → compound-proof-heeXW2_A.mjs} +2 -2
  7. package/dist/{context-DPocjp1l.d.cts → context-BazwQrHn.d.cts} +307 -5
  8. package/dist/{context-8Tu9kea0.mjs → context-COHd1Rsh.mjs} +2 -0
  9. package/dist/{context-2wLkQrjb.d.ts → context-GlHrzdSP.d.ts} +307 -5
  10. package/dist/{deno-DR1uYWpm.mjs → deno-Dpewt_jJ.mjs} +1 -1
  11. package/dist/{docloader-BpCJ2dHm.mjs → docloader-CpsDyqVN.mjs} +2 -2
  12. package/dist/federation/builder.test.mjs +1 -1
  13. package/dist/federation/compound-fanout.test.mjs +3 -3
  14. package/dist/federation/handler-compound-proof.test.mjs +5 -5
  15. package/dist/federation/handler.test.mjs +21 -6
  16. package/dist/federation/hashlink-media.test.mjs +2 -2
  17. package/dist/federation/idempotency.test.mjs +2 -2
  18. package/dist/federation/inbox-actorless.test.d.mts +2 -0
  19. package/dist/federation/inbox-actorless.test.mjs +487 -0
  20. package/dist/federation/inbox-authentication.test.d.mts +2 -0
  21. package/dist/federation/inbox-authentication.test.mjs +116 -0
  22. package/dist/federation/inbox-report.test.mjs +5 -5
  23. package/dist/federation/inbox-view.test.d.mts +2 -0
  24. package/dist/federation/inbox-view.test.mjs +369 -0
  25. package/dist/federation/inbox.test.mjs +22 -12
  26. package/dist/federation/metrics.test.mjs +1 -1
  27. package/dist/federation/middleware.test.mjs +24 -9
  28. package/dist/federation/mod.cjs +2 -1
  29. package/dist/federation/mod.d.cts +3 -3
  30. package/dist/federation/mod.d.ts +3 -3
  31. package/dist/federation/mod.js +8 -2
  32. package/dist/federation/mq.test.mjs +36 -1
  33. package/dist/federation/outgoing-proof.test.mjs +4 -4
  34. package/dist/federation/portable-actor.test.mjs +3 -3
  35. package/dist/federation/portable-chain.test.mjs +3 -3
  36. package/dist/federation/portable-collection.test.mjs +4 -4
  37. package/dist/federation/portable-delivery.test.mjs +2 -2
  38. package/dist/federation/portable-gateway-keys.test.mjs +6 -6
  39. package/dist/federation/portable-inbox.test.mjs +4 -4
  40. package/dist/federation/portable-parse-uri.test.mjs +1 -1
  41. package/dist/federation/portable-route-activity.test.mjs +2 -2
  42. package/dist/federation/portable.test.mjs +3 -3
  43. package/dist/federation/send.test.mjs +3 -3
  44. package/dist/federation/tasks/enqueue.test.mjs +3 -3
  45. package/dist/federation/tasks/tasks.test.mjs +4 -4
  46. package/dist/federation/temporal.test.mjs +1 -1
  47. package/dist/federation/webfinger.test.mjs +2 -2
  48. package/dist/{federation-eYRUxkUW.cjs → federation-D8YexkP1.cjs} +1174 -132
  49. package/dist/{http-CgaoFGXV.js → http-BBr-VLil.js} +143 -16
  50. package/dist/{http-CRrg14tX.mjs → http-BZkyQIkb.mjs} +4 -4
  51. package/dist/{http-CmFHJm6o.cjs → http-CAl7Num5.cjs} +161 -16
  52. package/dist/inbox-authentication-DflPYlLL.mjs +171 -0
  53. package/dist/inbox-view-NE9wXdLo.mjs +385 -0
  54. package/dist/inbox-wDuMKaFW.mjs +312 -0
  55. package/dist/{kv-cache-MxJrD9gD.mjs → kv-cache-CTQSfkmp.mjs} +1 -1
  56. package/dist/{kv-cache-DvVRGOMw.cjs → kv-cache-CjgCOz3i.cjs} +1 -1
  57. package/dist/{kv-cache-DeagaIIB.js → kv-cache-U7uz5nx4.js} +1 -1
  58. package/dist/{ld-CUM16-EE.mjs → ld-CQFuiah9.mjs} +52 -9
  59. package/dist/ld-CcuZ4NZa.d.ts +250 -0
  60. package/dist/ld-Cel1RRZ5.d.cts +250 -0
  61. package/dist/{metrics-DIM8ZCKq.mjs → metrics-B-QxRSSR.mjs} +1 -1
  62. package/dist/{middleware-Bx_QxJ0s.mjs → middleware-BdlNa8BD.mjs} +1 -1
  63. package/dist/{middleware-CDdFG6xf.mjs → middleware-CuVa0UuS.mjs} +461 -99
  64. package/dist/{middleware-CGfFooYv.js → middleware-P-AZEQMn.js} +1171 -142
  65. package/dist/mod-B2783_3v.d.cts +154 -0
  66. package/dist/mod-BHQE-7WQ.d.ts +154 -0
  67. package/dist/{mod-Dm-7RdhR.d.ts → mod-DjZfJj9R.d.ts} +1 -1
  68. package/dist/{mod-DKGoPoQC.d.cts → mod-DvWOv2Ho.d.cts} +1 -1
  69. package/dist/mod.cjs +5 -4
  70. package/dist/mod.d.cts +6 -6
  71. package/dist/mod.d.ts +6 -6
  72. package/dist/mod.js +5 -5
  73. package/dist/{mq-Dm1Wmtm-.mjs → mq-eF96QxUT.mjs} +6 -0
  74. package/dist/nodeinfo/handler.test.mjs +2 -2
  75. package/dist/{owner-DoQDS_g0.mjs → owner-ccKkQOAf.mjs} +3 -3
  76. package/dist/{portable-collection-DiBqtGSM.mjs → portable-collection-CndnpXfo.mjs} +2 -2
  77. package/dist/{portable-collection-BVKSWfBe.js → portable-collection-DUlQ3s2M.js} +1 -1
  78. package/dist/{portable-collection-C-etRRF0.cjs → portable-collection-TC-kvkVI.cjs} +1 -1
  79. package/dist/{portable-key-DSRuCUpF.mjs → portable-key-D5tFOoV-.mjs} +1 -1
  80. package/dist/{proof-DWpruPWs.mjs → proof-DPoF06nz.mjs} +98 -10
  81. package/dist/{send-H0z9Ey5l.mjs → send-CF44O1Df.mjs} +3 -3
  82. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  83. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  84. package/dist/sig/compound-proof-verification.test.mjs +2 -2
  85. package/dist/sig/compound-proof.test.mjs +2 -2
  86. package/dist/sig/http.test.mjs +2 -2
  87. package/dist/sig/key.test.mjs +1 -1
  88. package/dist/sig/ld.test.mjs +1 -1
  89. package/dist/sig/mitra-receive-interop.test.mjs +4 -4
  90. package/dist/sig/mitra-send-interop.test.mjs +3 -3
  91. package/dist/sig/mod.cjs +2 -2
  92. package/dist/sig/mod.d.cts +2 -2
  93. package/dist/sig/mod.d.ts +2 -2
  94. package/dist/sig/mod.js +2 -2
  95. package/dist/sig/owner.test.mjs +1 -1
  96. package/dist/sig/portable-collection.test.mjs +1 -1
  97. package/dist/sig/portable-interop.test.mjs +3 -3
  98. package/dist/sig/portable-key.test.mjs +5 -5
  99. package/dist/sig/proof.test.mjs +44 -4
  100. package/dist/sig/tootik-request-interop.test.mjs +4 -4
  101. package/dist/sig/tootik-send-interop.test.mjs +3 -3
  102. package/dist/sig/verification.test.mjs +3 -3
  103. package/dist/{temporal-BiSBCImA.mjs → temporal-XlZ4Wb94.mjs} +1 -1
  104. package/dist/testing/kv.test.mjs +1 -1
  105. package/dist/testing/mod.d.mts +265 -3
  106. package/dist/testing/mod.mjs +2 -2
  107. package/dist/{testing-t8xDeJZ5.mjs → testing-Dbr21vZk.mjs} +1 -1
  108. package/dist/utils/docloader.test.mjs +2 -2
  109. package/dist/utils/kv-cache.test.mjs +1 -1
  110. package/dist/utils/mod.cjs +1 -1
  111. package/dist/utils/mod.js +1 -1
  112. package/package.json +7 -7
  113. package/dist/inbox-BwPoSUEv.mjs +0 -188
  114. package/dist/mod-BRpER-B0.d.ts +0 -320
  115. package/dist/mod-xAfaLS4T.d.cts +0 -320
  116. package/dist/owner-BF0L9cMt.d.cts +0 -78
  117. package/dist/owner-BSzr5-I8.d.ts +0 -78
@@ -1,5 +1,5 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
- const require_http = require("./http-CmFHJm6o.cjs");
2
+ const require_http = require("./http-CAl7Num5.cjs");
3
3
  let _logtape_logtape = require("@logtape/logtape");
4
4
  let _fedify_vocab = require("@fedify/vocab");
5
5
  let _opentelemetry_api = require("@opentelemetry/api");
@@ -2,7 +2,7 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { a as getRawCanonicalPortableId, c as isPortableActorDocument, d as isPortableUri, n as getCanonicalPortableId, p as isSamePublicKey } from "./portable-key-id-Ca30-hOa.mjs";
5
- import { d as verifyPortableObjectProofWithRoot } from "./proof-DWpruPWs.mjs";
5
+ import { p as verifyPortableObjectProofWithRoot } from "./proof-DPoF06nz.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { CryptographicKey, Multikey, Object as Object$1 } from "@fedify/vocab";
8
8
  import { FetchError, formatIri, getDocumentLoader, isGatewayUrl, parseIri, toCompatibleEf61Id } from "@fedify/vocab-runtime";
@@ -3,15 +3,15 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { i as getPortableDid, l as isPortableId } from "./portable-key-id-Ca30-hOa.mjs";
5
5
  import { a as verificationObservation, i as triedKey, n as observeCheck, t as observeAttempt } from "./verification-Dpfcw8ml.mjs";
6
- import { n as version, t as name } from "./deno-DR1uYWpm.mjs";
7
- import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-DIM8ZCKq.mjs";
8
- import { T as validateCryptoKey, c as getNormalizationContextLoader, v as bypassKeyCacheReads, x as fetchKey } from "./ld-CUM16-EE.mjs";
6
+ import { n as version, t as name } from "./deno-Dpewt_jJ.mjs";
7
+ import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-B-QxRSSR.mjs";
8
+ import { C as fetchKey, D as validateCryptoKey, b as bypassKeyCacheReads, c as getNormalizationContextLoader } from "./ld-CQFuiah9.mjs";
9
9
  import { n as preloadedOnlyDocumentLoader } from "./public-audience--klBIOk1.mjs";
10
10
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
11
11
  import { getLogger } from "@logtape/logtape";
12
12
  import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
13
13
  import { SpanStatusCode, trace } from "@opentelemetry/api";
14
- import { encodeMultibase, formatIri, fromCompatibleEf61Id, getDocumentLoader, getFe34Origin, parseGatewayUrl, parseIri } from "@fedify/vocab-runtime";
14
+ import { encodeMultibase, formatIri, fromCompatibleEf61Id, getDocumentLoader, getFe34Origin, isTransientFetchError, parseGatewayUrl, parseIri } from "@fedify/vocab-runtime";
15
15
  import { encodeHex } from "byte-encodings/hex";
16
16
  import { getPortableActorGateways } from "@fedify/vocab-runtime/internal/jsonld-cache";
17
17
  import { isPlainJsonTree, retainSignedRepresentation } from "@fedify/vocab-runtime/internal/signed-representation";
@@ -671,6 +671,12 @@ async function verifyProofInternal(jsonLd, proof, options, messageDigestCache, r
671
671
  keyId: proof.verificationMethodId.href,
672
672
  error
673
673
  });
674
+ const check = options[verificationObservation]?.check;
675
+ if (check != null && check.reason == null) check.reason = {
676
+ type: "keyFetchError",
677
+ keyId: new URL(proof.verificationMethodId.href),
678
+ result: { error: error instanceof Error ? error : new Error(String(error)) }
679
+ };
674
680
  return null;
675
681
  }
676
682
  const publicKey = fetchedKey.key;
@@ -1199,6 +1205,39 @@ async function verifyPreparedPortableObjectProof(jsonLd, prepared, options, mess
1199
1205
  * @since 0.10.0
1200
1206
  */
1201
1207
  async function verifyObject(cls, jsonLd, options = {}) {
1208
+ const result = await verifyObjectDetailed(cls, jsonLd, options);
1209
+ return result.status === "verified" ? result.object : null;
1210
+ }
1211
+ /**
1212
+ * Same as {@link verifyObject}, but also tells who signed the verified proofs,
1213
+ * and whether a failure was caused by a key that could not be obtained for
1214
+ * a retryable reason.
1215
+ * @param cls The class of the object to verify.
1216
+ * @param jsonLd The JSON-LD object to verify.
1217
+ * @param options Additional options.
1218
+ * @returns The result.
1219
+ * @throws {TypeError} If the object is invalid or unsupported.
1220
+ * @internal
1221
+ */
1222
+ async function verifyObjectDetailed(cls, jsonLd, options = {}) {
1223
+ const classify = (result, checks) => {
1224
+ if (result != null) return {
1225
+ status: "verified",
1226
+ object: result.object,
1227
+ signers: result.signers
1228
+ };
1229
+ for (const check of checks) {
1230
+ if (check.status === "error" && isTransientFetchError(check.error)) return {
1231
+ status: "unavailable",
1232
+ error: check.error
1233
+ };
1234
+ if (check.status === "rejected" && check.reason.type === "keyFetchError" && isRetryableKeyFetchError(check.reason.result)) return {
1235
+ status: "unavailable",
1236
+ error: "error" in check.reason.result ? check.reason.result.error : /* @__PURE__ */ new Error(`Fetching key ${check.reason.keyId.href} failed with ${check.reason.result.status}.`)
1237
+ };
1238
+ }
1239
+ return { status: "invalid" };
1240
+ };
1202
1241
  if (options[verificationObservation]?.attempt == null) {
1203
1242
  const observedOptions = {
1204
1243
  ...options,
@@ -1210,16 +1249,16 @@ async function verifyObject(cls, jsonLd, options = {}) {
1210
1249
  return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("object_integrity_proofs.verify_object", async (span) => {
1211
1250
  try {
1212
1251
  return await observeAttempt(observedOptions, "objectIntegrity", async (observation) => {
1213
- const object = await verifyObject(cls, jsonLd, {
1252
+ const result = await verifyObjectCore(cls, jsonLd, {
1214
1253
  ...options,
1215
1254
  [verificationObservation]: observation
1216
1255
  });
1217
- if (object == null) {
1256
+ if (result == null) {
1218
1257
  span.setStatus({ code: SpanStatusCode.ERROR });
1219
1258
  span.setAttribute("activitypub.verification.failure_reason", observation.attempt?.reason?.type ?? "signatureVerificationFailed");
1220
1259
  }
1221
- return object;
1222
- }, (value) => value != null);
1260
+ return classify(result, observation.attempt?.checks ?? []);
1261
+ }, (value) => value.status === "verified");
1223
1262
  } catch (error) {
1224
1263
  span.setStatus({
1225
1264
  code: SpanStatusCode.ERROR,
@@ -1231,6 +1270,15 @@ async function verifyObject(cls, jsonLd, options = {}) {
1231
1270
  }
1232
1271
  });
1233
1272
  }
1273
+ const checks = options[verificationObservation].attempt.checks;
1274
+ const before = checks.length;
1275
+ return classify(await verifyObjectCore(cls, jsonLd, options), checks.slice(before));
1276
+ }
1277
+ function isRetryableKeyFetchError(result) {
1278
+ if ("error" in result) return isTransientFetchError(result.error);
1279
+ return result.status >= 500 || result.status === 408 || result.status === 429;
1280
+ }
1281
+ async function verifyObjectCore(cls, jsonLd, options) {
1234
1282
  const observation = options[verificationObservation];
1235
1283
  const logger = getLogger([
1236
1284
  "fedify",
@@ -1243,6 +1291,7 @@ async function verifyObject(cls, jsonLd, options = {}) {
1243
1291
  const defaultDocumentLoader = getDocumentLoader();
1244
1292
  const proofContextLoader = options.contextLoader ?? defaultDocumentLoader;
1245
1293
  const attributions = new Set(object.attributionIds.map((uri) => uri.href));
1294
+ const signers = [];
1246
1295
  if (object instanceof Activity) for (const uri of object.actorIds) attributions.add(uri.href);
1247
1296
  const rawProofValues = isJsonLdNode(jsonLd) ? await getRawProofValues(jsonLd, proofContextLoader) : [];
1248
1297
  const rawProofCandidates = isJsonLdNode(jsonLd) ? await parseRawProofCandidates(jsonLd, rawProofValues, options, proofContextLoader) : [];
@@ -1301,6 +1350,11 @@ async function verifyObject(cls, jsonLd, options = {}) {
1301
1350
  continue;
1302
1351
  }
1303
1352
  deleteAuthenticatedAttribution(attributions, key.controllerId, proof.verificationMethodId);
1353
+ const signer = getAuthenticatedController(key.controllerId, proof.verificationMethodId);
1354
+ if (signer != null && !signers.some((s) => s.kind === signer.kind && s.id.href === signer.id.href && s.keyId.href === proof.verificationMethodId.href)) signers.push({
1355
+ ...signer,
1356
+ keyId: proof.verificationMethodId
1357
+ });
1304
1358
  }
1305
1359
  if (acceptedPortableProofs < loadedPortableProofs) {
1306
1360
  logger.debug("Some portable proof references could not be dereferenced.");
@@ -1314,7 +1368,41 @@ async function verifyObject(cls, jsonLd, options = {}) {
1314
1368
  logger.debug("Some attributions are not authenticated by the proofs: {attributions}.", { attributions: [...attributions] });
1315
1369
  return null;
1316
1370
  }
1317
- return object;
1371
+ return {
1372
+ object,
1373
+ signers
1374
+ };
1375
+ }
1376
+ /**
1377
+ * Tells whom a key that verified an Object Integrity Proof authenticates.
1378
+ * @param key The key, i.e., the proof's verification method.
1379
+ * @returns The signer, or `null` if the key authenticates nobody.
1380
+ * @internal
1381
+ */
1382
+ function getProofSigner(key) {
1383
+ if (key.id == null || key.controllerId == null) return null;
1384
+ const signer = getAuthenticatedController(key.controllerId, key.id);
1385
+ return signer == null ? null : {
1386
+ ...signer,
1387
+ keyId: key.id
1388
+ };
1389
+ }
1390
+ /**
1391
+ * Tells whom a verified proof authenticates: the key's controller if it is an
1392
+ * ordinary actor, or the DID of a portable controller if the verification
1393
+ * method belongs to the same DID.
1394
+ */
1395
+ function getAuthenticatedController(controllerId, verificationMethodId) {
1396
+ if (!hasCryptographicOrigin(controllerId.href) && !isPortableId(controllerId)) return {
1397
+ kind: "actor",
1398
+ id: controllerId
1399
+ };
1400
+ const did = getPortableDid(controllerId);
1401
+ if (did == null || !hasCryptographicOrigin(verificationMethodId.href) || getPortableDid(verificationMethodId) !== did || !URL.canParse(did)) return null;
1402
+ return {
1403
+ kind: "portableAuthority",
1404
+ id: new URL(did)
1405
+ };
1318
1406
  }
1319
1407
  function deleteAuthenticatedAttribution(attributions, controllerId, verificationMethodId) {
1320
1408
  if (!hasCryptographicOrigin(controllerId.href) && !isPortableId(controllerId)) {
@@ -1329,4 +1417,4 @@ function hasCryptographicOrigin(iri) {
1329
1417
  return /^did:/i.test(iri) || /^ap(?:\+ef61)?:\/\//i.test(iri);
1330
1418
  }
1331
1419
  //#endregion
1332
- export { preparePortableObjectProofPolicy as a, verifyObject as c, verifyPortableObjectProofWithRoot as d, verifyPreparedPortableObjectProofPolicy as f, hasProofLike as i, verifyPortableObjectProof as l, classifyFep2277CoreType as n, signObject as o, verifyProof as p, createProof as r, verifyMapLocalProof as s, InvalidPortableObjectIdError as t, verifyPortableObjectProofPolicy as u };
1420
+ export { hasProofLike as a, verifyMapLocalProof as c, verifyPortableObjectProof as d, verifyPortableObjectProofPolicy as f, verifyProof as h, getProofSigner as i, verifyObject as l, verifyPreparedPortableObjectProofPolicy as m, classifyFep2277CoreType as n, preparePortableObjectProofPolicy as o, verifyPortableObjectProofWithRoot as p, createProof as r, signObject as s, InvalidPortableObjectIdError as t, verifyObjectDetailed as u };
@@ -2,9 +2,9 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { d as isPortableUri } from "./portable-key-id-Ca30-hOa.mjs";
5
- import { n as version, t as name } from "./deno-DR1uYWpm.mjs";
6
- import { n as getDurationMs, r as getFederationMetrics } from "./metrics-DIM8ZCKq.mjs";
7
- import { n as doubleKnock } from "./http-CRrg14tX.mjs";
5
+ import { n as version, t as name } from "./deno-Dpewt_jJ.mjs";
6
+ import { n as getDurationMs, r as getFederationMetrics } from "./metrics-B-QxRSSR.mjs";
7
+ import { n as doubleKnock } from "./http-BZkyQIkb.mjs";
8
8
  import { getLogger, withContext } from "@logtape/logtape";
9
9
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
10
10
  import { FetchError, UrlError, canonicalizePortableUri, getFe34Origin, isGatewayUrl, toCompatibleEf61Id, validatePublicUrl } from "@fedify/vocab-runtime";
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
- import { a as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-D5r-dQMr.mjs";
6
+ import { a as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-heeXW2_A.mjs";
7
7
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
8
8
  import { test } from "@fedify/fixture";
9
9
  //#region src/sig/compound-proof-discovery.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
- import { a as inspectCompoundPortableObjectApplicability, i as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-D5r-dQMr.mjs";
6
+ import { a as inspectCompoundPortableObjectApplicability, i as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-heeXW2_A.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  //#region src/sig/compound-proof-producer.test.ts
9
9
  const portableId = "ap+ef61://did:key:z6MkAlice/objects/1";
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
6
  import { t as assert } from "../assert-D1Eafmd_.mjs";
7
- import { s as verifyMapLocalProof, u as verifyPortableObjectProofPolicy } from "../proof-DWpruPWs.mjs";
7
+ import { c as verifyMapLocalProof, f as verifyPortableObjectProofPolicy } from "../proof-DPoF06nz.mjs";
8
8
  import { n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
9
- import { a as inspectCompoundPortableObjectApplicability, o as verifyCompoundPortableObjectProofs, s as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-D5r-dQMr.mjs";
9
+ import { a as inspectCompoundPortableObjectApplicability, o as verifyCompoundPortableObjectProofs, s as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-heeXW2_A.mjs";
10
10
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
11
11
  import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
12
12
  import { CryptographicKey, Multikey, Person } from "@fedify/vocab";
@@ -6,9 +6,9 @@ import "../std__assert-DvMDRPes.mjs";
6
6
  import { t as assert } from "../assert-D1Eafmd_.mjs";
7
7
  import { n as preloadedOnlyDocumentLoader } from "../public-audience--klBIOk1.mjs";
8
8
  import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
9
- import { o as signObject, p as verifyProof } from "../proof-DWpruPWs.mjs";
9
+ import { h as verifyProof, s as signObject } from "../proof-DPoF06nz.mjs";
10
10
  import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
11
- import { s as verifyCompoundProofDocuments } from "../compound-proof-D5r-dQMr.mjs";
11
+ import { s as verifyCompoundProofDocuments } from "../compound-proof-heeXW2_A.mjs";
12
12
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
13
13
  import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
14
14
  import { Create, DataIntegrityProof, Note, Question } from "@fedify/vocab";
@@ -12,8 +12,8 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
12
12
  import "../std__assert-DvMDRPes.mjs";
13
13
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
14
14
  import { t as assert } from "../assert-D1Eafmd_.mjs";
15
- import { y as exportJwk } from "../ld-CUM16-EE.mjs";
16
- import { a as listRequestSignatures, c as selectRequestSignature, f as verifyRequest, i as formatRfc9421SignatureParameters, l as signRequest, n as doubleKnock, o as parseRfc9421Signature, p as verifyRequestDetailed, r as formatRfc9421Signature, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as timingSafeEqual } from "../http-CRrg14tX.mjs";
15
+ import { x as exportJwk } from "../ld-CQFuiah9.mjs";
16
+ import { a as listRequestSignatures, c as selectRequestSignature, f as verifyRequest, i as formatRfc9421SignatureParameters, l as signRequest, n as doubleKnock, o as parseRfc9421Signature, p as verifyRequestDetailed, r as formatRfc9421Signature, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as timingSafeEqual } from "../http-BZkyQIkb.mjs";
17
17
  import { a as rsaPrivateKey3, i as rsaPrivateKey2, l as rsaPublicKey5, n as ed25519PrivateKey, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
18
18
  import { t as KvKeyCache } from "../keycache-N2opu4-3.mjs";
19
19
  import { FetchError, UrlError, exportSpki, getDocumentLoader } from "@fedify/vocab-runtime";
@@ -8,7 +8,7 @@ import "../std__assert-DvMDRPes.mjs";
8
8
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
9
9
  import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
10
10
  import { t as assert } from "../assert-D1Eafmd_.mjs";
11
- import { C as generateCryptoKeyPair, S as fetchKeyDetailed, T as validateCryptoKey, _ as wrapContextLoaderForJsonLd, w as importJwk, x as fetchKey, y as exportJwk } from "../ld-CUM16-EE.mjs";
11
+ import { C as fetchKey, D as validateCryptoKey, E as importJwk, T as generateCryptoKeyPair, w as fetchKeyDetailed, x as exportJwk, y as wrapContextLoaderForJsonLd } from "../ld-CQFuiah9.mjs";
12
12
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
13
13
  import { CryptographicKey, Multikey, Person } from "@fedify/vocab";
14
14
  import { FetchError, UrlError, exportDidKey, getDocumentLoader } from "@fedify/vocab-runtime";
@@ -8,7 +8,7 @@ import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
8
8
  import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
9
9
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
10
10
  import { t as assert } from "../assert-D1Eafmd_.mjs";
11
- import { C as generateCryptoKeyPair, a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-CUM16-EE.mjs";
11
+ import { T as generateCryptoKeyPair, _ as verifyJsonLd, a as compactJsonLd, f as isInvalidUrlTypeError, i as attachSignature, m as signJsonLd, n as UnsafeJsonLdError, o as createSignature, s as detachSignature, u as hasSignatureLike, v as verifySignature } from "../ld-CQFuiah9.mjs";
12
12
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
13
13
  import { CryptographicKey } from "@fedify/vocab";
14
14
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -5,10 +5,10 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assert } from "../assert-D1Eafmd_.mjs";
8
- import { l as verifyPortableObjectProof } from "../proof-DWpruPWs.mjs";
9
- import { p as verifyRequestDetailed } from "../http-CRrg14tX.mjs";
10
- import { o as createFederation } from "../middleware-CDdFG6xf.mjs";
11
- import { t as doesActorOwnKey } from "../owner-DoQDS_g0.mjs";
8
+ import { d as verifyPortableObjectProof } from "../proof-DPoF06nz.mjs";
9
+ import { p as verifyRequestDetailed } from "../http-BZkyQIkb.mjs";
10
+ import { o as createFederation } from "../middleware-CuVa0UuS.mjs";
11
+ import { t as doesActorOwnKey } from "../owner-ccKkQOAf.mjs";
12
12
  import { Create, Person } from "@fedify/vocab";
13
13
  import { canonicalizePortableUri, decodeMultibase, importDidKey } from "@fedify/vocab-runtime";
14
14
  import { mockDocumentLoader, test } from "@fedify/fixture";
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
6
  import { t as assert } from "../assert-D1Eafmd_.mjs";
7
- import { l as verifyPortableObjectProof } from "../proof-DWpruPWs.mjs";
8
- import { p as verifyRequestDetailed } from "../http-CRrg14tX.mjs";
9
- import { t as doesActorOwnKey } from "../owner-DoQDS_g0.mjs";
7
+ import { d as verifyPortableObjectProof } from "../proof-DPoF06nz.mjs";
8
+ import { p as verifyRequestDetailed } from "../http-BZkyQIkb.mjs";
9
+ import { t as doesActorOwnKey } from "../owner-ccKkQOAf.mjs";
10
10
  import { Create } from "@fedify/vocab";
11
11
  import { canonicalizePortableUri, decodeMultibase, fromCompatibleEf61Id, importDidKey } from "@fedify/vocab-runtime";
12
12
  import { mockDocumentLoader, test } from "@fedify/fixture";
package/dist/sig/mod.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_http = require("../http-CmFHJm6o.cjs");
4
- const require_portable_collection = require("../portable-collection-C-etRRF0.cjs");
3
+ const require_http = require("../http-CAl7Num5.cjs");
4
+ const require_portable_collection = require("../portable-collection-TC-kvkVI.cjs");
5
5
  exports.attachSignature = require_http.attachSignature;
6
6
  exports.createProof = require_http.createProof;
7
7
  exports.createSignature = require_http.createSignature;
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { A as AcceptSignatureParameters, B as VerifyPortableObjectProofOptions, C as VerifyRequestDetailedResult, D as verifyRequest, E as signRequest, F as validateAcceptSignature, G as signObject, H as VerifyProofOptions, I as CreateProofOptions, J as verifyProof, K as verifyObject, L as SignObjectOptions, M as formatAcceptSignature, N as fulfillAcceptSignature, O as verifyRequestDetailed, P as parseAcceptSignature, R as VerifyObjectOptions, S as SignRequestOptions, T as VerifyRequestOptions, U as createProof, V as VerifyPortableObjectProofResult, W as hasProofLike, a as KeyCache, b as HttpMessageSignaturesSpecDeterminer, c as fetchKeyDetailed, i as FetchKeyResult, j as FulfillAcceptSignatureResult, k as AcceptSignatureMember, l as generateCryptoKeyPair, n as FetchKeyErrorResult, o as exportJwk, q as verifyPortableObjectProof, r as FetchKeyOptions, s as fetchKey, t as FetchKeyDetailedResult, u as importJwk, w as VerifyRequestFailureReason, x as Rfc9421SignRequestOptions, y as HttpMessageSignaturesSpec, z as VerifyPortableObjectProofFailureReason } from "../key-nYGY4QB9.cjs";
3
- import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BF0L9cMt.cjs";
4
- import { a as CreateSignatureOptions, c as VerifySignatureOptions, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyPortableObject, l as attachSignature, m as verifyJsonLd, n as VerifyPortableObjectOptions, o as SignJsonLdOptions, p as signJsonLd, r as VerifyPortableObjectResult, s as VerifyJsonLdOptions, t as VerifyPortableObjectFailureReason, u as createSignature } from "../mod-xAfaLS4T.cjs";
3
+ import { a as VerifySignatureOptions, c as detachSignature, d as verifyJsonLd, f as verifySignature, g as getKeyOwner, h as doesActorOwnKey, i as VerifyJsonLdOptions, l as hasSignatureLike, m as GetKeyOwnerOptions, o as attachSignature, p as DoesActorOwnKeyOptions, r as SignJsonLdOptions, s as createSignature, t as CreateSignatureOptions, u as signJsonLd } from "../ld-Cel1RRZ5.cjs";
4
+ import { i as verifyPortableObject, n as VerifyPortableObjectOptions, r as VerifyPortableObjectResult, t as VerifyPortableObjectFailureReason } from "../mod-B2783_3v.cjs";
5
5
  export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectFailureReason, VerifyPortableObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyPortableObjectResult, 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, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
package/dist/sig/mod.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { A as AcceptSignatureParameters, B as VerifyPortableObjectProofOptions, C as VerifyRequestDetailedResult, D as verifyRequest, E as signRequest, F as validateAcceptSignature, G as signObject, H as VerifyProofOptions, I as CreateProofOptions, J as verifyProof, K as verifyObject, L as SignObjectOptions, M as formatAcceptSignature, N as fulfillAcceptSignature, O as verifyRequestDetailed, P as parseAcceptSignature, R as VerifyObjectOptions, S as SignRequestOptions, T as VerifyRequestOptions, U as createProof, V as VerifyPortableObjectProofResult, W as hasProofLike, a as KeyCache, b as HttpMessageSignaturesSpecDeterminer, c as fetchKeyDetailed, i as FetchKeyResult, j as FulfillAcceptSignatureResult, k as AcceptSignatureMember, l as generateCryptoKeyPair, n as FetchKeyErrorResult, o as exportJwk, q as verifyPortableObjectProof, r as FetchKeyOptions, s as fetchKey, t as FetchKeyDetailedResult, u as importJwk, w as VerifyRequestFailureReason, x as Rfc9421SignRequestOptions, y as HttpMessageSignaturesSpec, z as VerifyPortableObjectProofFailureReason } from "../key-DhsBxxZN.js";
3
- import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BSzr5-I8.js";
4
- import { a as CreateSignatureOptions, c as VerifySignatureOptions, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyPortableObject, l as attachSignature, m as verifyJsonLd, n as VerifyPortableObjectOptions, o as SignJsonLdOptions, p as signJsonLd, r as VerifyPortableObjectResult, s as VerifyJsonLdOptions, t as VerifyPortableObjectFailureReason, u as createSignature } from "../mod-BRpER-B0.js";
3
+ import { a as VerifySignatureOptions, c as detachSignature, d as verifyJsonLd, f as verifySignature, g as getKeyOwner, h as doesActorOwnKey, i as VerifyJsonLdOptions, l as hasSignatureLike, m as GetKeyOwnerOptions, o as attachSignature, p as DoesActorOwnKeyOptions, r as SignJsonLdOptions, s as createSignature, t as CreateSignatureOptions, u as signJsonLd } from "../ld-CcuZ4NZa.js";
4
+ import { i as verifyPortableObject, n as VerifyPortableObjectOptions, r as VerifyPortableObjectResult, t as VerifyPortableObjectFailureReason } from "../mod-BHQE-7WQ.js";
5
5
  export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectFailureReason, VerifyPortableObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyPortableObjectResult, 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, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
package/dist/sig/mod.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { A as detachSignature, C as verifyProof, D as attachSignature, G as generateCryptoKeyPair, I as signJsonLd, K as importJwk, N as hasSignatureLike, R as verifyJsonLd, U as fetchKey, V as exportJwk, W as fetchKeyDetailed, _t as fulfillAcceptSignature, a as signRequest, c as verifyRequestDetailed, g as signObject, gt as formatAcceptSignature, k as createSignature, m as hasProofLike, p as createProof, s as verifyRequest, v as verifyObject, vt as parseAcceptSignature, y as verifyPortableObjectProof, yt as validateAcceptSignature, z as verifySignature } from "../http-CgaoFGXV.js";
4
- import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-BVKSWfBe.js";
3
+ import { F as hasSignatureLike, H as verifySignature, J as generateCryptoKeyPair, K as fetchKey, M as detachSignature, St as validateAcceptSignature, T as verifyProof, V as verifyJsonLd, W as exportJwk, Y as importJwk, _ as signObject, a as signRequest, bt as fulfillAcceptSignature, c as verifyRequestDetailed, h as hasProofLike, j as createSignature, k as attachSignature, p as createProof, q as fetchKeyDetailed, s as verifyRequest, x as verifyPortableObjectProof, xt as parseAcceptSignature, y as verifyObject, yt as formatAcceptSignature, z as signJsonLd } from "../http-BBr-VLil.js";
4
+ import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-DUlQ3s2M.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, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
@@ -6,7 +6,7 @@ import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assert } from "../assert-D1Eafmd_.mjs";
8
8
  import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
9
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DoQDS_g0.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-ccKkQOAf.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
@@ -2,7 +2,7 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
5
- import { t as verifyPortableObject } from "../portable-collection-DiBqtGSM.mjs";
5
+ import { t as verifyPortableObject } from "../portable-collection-CndnpXfo.mjs";
6
6
  import { Collection, CollectionPage, Note, OrderedCollection, Person, traverseCollection } from "@fedify/vocab";
7
7
  import { FetchError, encodeMultibase, exportDidKey, preloadedContexts } from "@fedify/vocab-runtime";
8
8
  import { test } from "@fedify/fixture";
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
6
  import { t as assert } from "../assert-D1Eafmd_.mjs";
7
- import { l as verifyPortableObjectProof, p as verifyProof } from "../proof-DWpruPWs.mjs";
8
- import { n as getKeyOwner } from "../owner-DoQDS_g0.mjs";
9
- import { t as verifyPortableObject } from "../portable-collection-DiBqtGSM.mjs";
7
+ import { d as verifyPortableObjectProof, h as verifyProof } from "../proof-DPoF06nz.mjs";
8
+ import { n as getKeyOwner } from "../owner-ccKkQOAf.mjs";
9
+ import { t as verifyPortableObject } from "../portable-collection-CndnpXfo.mjs";
10
10
  import { Application, DataIntegrityProof, lookupObject } from "@fedify/vocab";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  //#region test-vectors/fep-ef61/tootik-v0.25.4/actor.json
@@ -2,12 +2,12 @@ import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
5
- import { S as fetchKeyDetailed, h as verifyJsonLd, p as signJsonLd, x as fetchKey } from "../ld-CUM16-EE.mjs";
6
- import { p as verifyProof, r as createProof } from "../proof-DWpruPWs.mjs";
7
- import { n as resolvePortableActorKey } from "../portable-key-DSRuCUpF.mjs";
8
- import { f as verifyRequest, l as signRequest, p as verifyRequestDetailed } from "../http-CRrg14tX.mjs";
5
+ import { C as fetchKey, _ as verifyJsonLd, m as signJsonLd, w as fetchKeyDetailed } from "../ld-CQFuiah9.mjs";
6
+ import { h as verifyProof, r as createProof } from "../proof-DPoF06nz.mjs";
7
+ import { n as resolvePortableActorKey } from "../portable-key-D5tFOoV-.mjs";
8
+ import { f as verifyRequest, l as signRequest, p as verifyRequestDetailed } from "../http-BZkyQIkb.mjs";
9
9
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
10
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DoQDS_g0.mjs";
10
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-ccKkQOAf.mjs";
11
11
  import { t as KvKeyCache } from "../keycache-N2opu4-3.mjs";
12
12
  import { Create, CryptographicKey, Multikey, Note, Person } from "@fedify/vocab";
13
13
  import { FetchError, encodeMultibase, exportDidKey, exportSpki, parseIri, preloadedContexts } from "@fedify/vocab-runtime";
@@ -11,12 +11,12 @@ import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
11
11
  import { t as assert } from "../assert-D1Eafmd_.mjs";
12
12
  import { a as verificationObservation } from "../verification-Dpfcw8ml.mjs";
13
13
  import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
14
- import { c as verifyObject, i as hasProofLike, l as verifyPortableObjectProof, o as signObject, p as verifyProof, r as createProof, s as verifyMapLocalProof } from "../proof-DWpruPWs.mjs";
15
- import { f as verifyRequest } from "../http-CRrg14tX.mjs";
14
+ import { a as hasProofLike, c as verifyMapLocalProof, d as verifyPortableObjectProof, h as verifyProof, l as verifyObject, r as createProof, s as signObject, u as verifyObjectDetailed } from "../proof-DPoF06nz.mjs";
15
+ import { f as verifyRequest } from "../http-BZkyQIkb.mjs";
16
16
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
17
- import { t as getAuthenticatedDocumentLoader } from "../docloader-BpCJ2dHm.mjs";
17
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-CpsDyqVN.mjs";
18
18
  import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place, Translation } from "@fedify/vocab";
19
- import { decodeMultibase, encodeMultibase, exportDidKey, exportMultibaseKey, formatIri, importMultibaseKey, parseIri } from "@fedify/vocab-runtime";
19
+ import { FetchError, decodeMultibase, encodeMultibase, exportDidKey, exportMultibaseKey, formatIri, importMultibaseKey, parseIri } from "@fedify/vocab-runtime";
20
20
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
21
21
  import { decodeHex } from "byte-encodings/hex";
22
22
  import jsonld from "@fedify/vocab-runtime/jsonld";
@@ -2594,5 +2594,45 @@ test("verifyObject() rejects a key whose controller redirects to another actor",
2594
2594
  contextLoader: mockDocumentLoader
2595
2595
  }), null);
2596
2596
  });
2597
+ test("verifyObjectDetailed() tells who signed the proofs", async () => {
2598
+ const keyId = new URL("https://example.com/person2#key4");
2599
+ const actor = new URL("https://example.com/person2");
2600
+ const json = await (await signObject(new Create({
2601
+ id: new URL("https://example.com/activities/detailed"),
2602
+ actor,
2603
+ object: new Note({ content: "Hello" })
2604
+ }), ed25519PrivateKey, keyId, { contextLoader: mockDocumentLoader })).toJsonLd({ contextLoader: mockDocumentLoader });
2605
+ const options = {
2606
+ documentLoader: mockDocumentLoader,
2607
+ contextLoader: mockDocumentLoader
2608
+ };
2609
+ const result = await verifyObjectDetailed(Create, json, options);
2610
+ assertEquals(result.status, "verified");
2611
+ assertEquals(result.status === "verified" ? result.signers.map((s) => [
2612
+ s.kind,
2613
+ s.id.href,
2614
+ s.keyId.href
2615
+ ]) : [], [[
2616
+ "actor",
2617
+ actor.href,
2618
+ keyId.href
2619
+ ]]);
2620
+ const unsigned = await verifyObjectDetailed(Note, {
2621
+ "@context": "https://www.w3.org/ns/activitystreams",
2622
+ id: "https://example.com/notes/unsigned",
2623
+ type: "Note"
2624
+ }, options);
2625
+ assertEquals(unsigned.status, "verified");
2626
+ assertEquals(unsigned.status === "verified" ? unsigned.signers : null, []);
2627
+ assertEquals((await verifyObjectDetailed(Create, json, {
2628
+ ...options,
2629
+ documentLoader: (url) => url.startsWith("https://example.com/person2") ? Promise.reject(new FetchError(url, "Unavailable", new Response(null, { status: 503 }))) : mockDocumentLoader(url)
2630
+ })).status, "unavailable");
2631
+ assertEquals((await verifyObjectDetailed(Create, json, {
2632
+ ...options,
2633
+ documentLoader: (url) => url.startsWith("https://example.com/person2") ? Promise.reject(new FetchError(url, "Gone", new Response(null, { status: 410 }))) : mockDocumentLoader(url)
2634
+ })).status, "invalid");
2635
+ assertEquals(await verifyObject(Create, json, options) != null, true);
2636
+ });
2597
2637
  //#endregion
2598
2638
  export {};
@@ -5,10 +5,10 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assert } from "../assert-D1Eafmd_.mjs";
8
- import { l as verifyPortableObjectProof } from "../proof-DWpruPWs.mjs";
9
- import { p as verifyRequestDetailed } from "../http-CRrg14tX.mjs";
10
- import { o as createFederation } from "../middleware-CDdFG6xf.mjs";
11
- import { t as doesActorOwnKey } from "../owner-DoQDS_g0.mjs";
8
+ import { d as verifyPortableObjectProof } from "../proof-DPoF06nz.mjs";
9
+ import { p as verifyRequestDetailed } from "../http-BZkyQIkb.mjs";
10
+ import { o as createFederation } from "../middleware-CuVa0UuS.mjs";
11
+ import { t as doesActorOwnKey } from "../owner-ccKkQOAf.mjs";
12
12
  import { Follow, Person } from "@fedify/vocab";
13
13
  import { mockDocumentLoader, test } from "@fedify/fixture";
14
14
  import { encodeHex } from "byte-encodings/hex";
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
6
  import { t as assert } from "../assert-D1Eafmd_.mjs";
7
- import { l as verifyPortableObjectProof } from "../proof-DWpruPWs.mjs";
8
- import { p as verifyRequestDetailed } from "../http-CRrg14tX.mjs";
9
- import { t as doesActorOwnKey } from "../owner-DoQDS_g0.mjs";
7
+ import { d as verifyPortableObjectProof } from "../proof-DPoF06nz.mjs";
8
+ import { p as verifyRequestDetailed } from "../http-BZkyQIkb.mjs";
9
+ import { t as doesActorOwnKey } from "../owner-ccKkQOAf.mjs";
10
10
  import { Create } from "@fedify/vocab";
11
11
  import { decodeMultibase, importDidKey } from "@fedify/vocab-runtime";
12
12
  import { mockDocumentLoader, test } from "@fedify/fixture";
@@ -2,9 +2,9 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { a as verificationObservation } from "../verification-Dpfcw8ml.mjs";
5
- import { h as verifyJsonLd, p as signJsonLd } from "../ld-CUM16-EE.mjs";
6
- import { c as verifyObject, o as signObject } from "../proof-DWpruPWs.mjs";
7
- import { l as signRequest, p as verifyRequestDetailed } from "../http-CRrg14tX.mjs";
5
+ import { _ as verifyJsonLd, m as signJsonLd } from "../ld-CQFuiah9.mjs";
6
+ import { l as verifyObject, s as signObject } from "../proof-DPoF06nz.mjs";
7
+ import { l as signRequest, p as verifyRequestDetailed } from "../http-BZkyQIkb.mjs";
8
8
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
9
9
  import { Activity, Create, CryptographicKey, Multikey } from "@fedify/vocab";
10
10
  import { FetchError } from "@fedify/vocab-runtime";
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { c as getNormalizationContextLoader } from "./ld-CUM16-EE.mjs";
4
+ import { c as getNormalizationContextLoader } from "./ld-CQFuiah9.mjs";
5
5
  import jsonld from "@fedify/vocab-runtime/jsonld";
6
6
  //#region src/federation/temporal.ts
7
7
  function isPlainObject(value) {
@@ -6,7 +6,7 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
6
6
  import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
7
7
  import { n as baseOptions, o as stringSchema, t as MockQueue } from "../tasks-IG3pHfvZ.mjs";
8
8
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
9
- import { o as createFederation } from "../middleware-CDdFG6xf.mjs";
9
+ import { o as createFederation } from "../middleware-CuVa0UuS.mjs";
10
10
  //#region src/testing/kv.test.ts
11
11
  test("ManualClockKvStore keeps an entry at its exact expiration instant", async () => {
12
12
  const kv = new ManualClockKvStore();