@fedify/fedify 2.4.0-dev.2190 → 2.4.0-dev.2193

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 (78) hide show
  1. package/dist/{builder-CFF0YNTp.mjs → builder-0onlMY4u.mjs} +25 -5
  2. package/dist/compat/transformers.test.mjs +1 -1
  3. package/dist/{compound-proof-F2jjkrt0.mjs → compound-proof-B-Fk6Slo.mjs} +2 -2
  4. package/dist/{deno-EopndaNb.mjs → deno-DB_Sh0LK.mjs} +1 -1
  5. package/dist/{docloader-u6zzOExF.mjs → docloader-DpWYYY6a.mjs} +2 -2
  6. package/dist/federation/builder.test.mjs +1 -1
  7. package/dist/federation/compound-fanout.test.mjs +3 -3
  8. package/dist/federation/handler-compound-proof.test.mjs +52 -3
  9. package/dist/federation/handler.test.mjs +5 -5
  10. package/dist/federation/hashlink-media.test.mjs +2 -2
  11. package/dist/federation/idempotency.test.mjs +2 -2
  12. package/dist/federation/metrics.test.mjs +1 -1
  13. package/dist/federation/middleware.test.mjs +52 -7
  14. package/dist/federation/mod.cjs +1 -1
  15. package/dist/federation/mod.js +1 -1
  16. package/dist/federation/outgoing-proof.test.mjs +5 -5
  17. package/dist/federation/portable-actor.test.mjs +3 -3
  18. package/dist/federation/portable-chain.test.mjs +3 -3
  19. package/dist/federation/portable-collection.test.mjs +4 -4
  20. package/dist/federation/portable-gateway-keys.test.mjs +4 -4
  21. package/dist/federation/portable-inbox.test.mjs +4 -4
  22. package/dist/federation/portable-parse-uri.test.mjs +1 -1
  23. package/dist/federation/portable-route-activity.test.mjs +2 -2
  24. package/dist/federation/portable.test.mjs +49 -5
  25. package/dist/federation/send.test.mjs +3 -3
  26. package/dist/federation/tasks/enqueue.test.mjs +1 -1
  27. package/dist/federation/tasks/tasks.test.mjs +2 -2
  28. package/dist/federation/temporal.test.mjs +1 -1
  29. package/dist/federation/webfinger.test.mjs +1 -1
  30. package/dist/{federation-BSS2dUO7.cjs → federation-BsGo0EH2.cjs} +41 -17
  31. package/dist/{http-CCr2_ipG.cjs → http-BEivI0TS.cjs} +44 -2
  32. package/dist/{http-BqN5kyUf.js → http-BGmxtpo2.js} +45 -3
  33. package/dist/{http-Y1ObT1A8.mjs → http-DQf9Mw4V.mjs} +4 -4
  34. package/dist/{key-DyXf88bq.mjs → key-DA3Yx8p2.mjs} +2 -2
  35. package/dist/{kv-cache-DUXluAc0.cjs → kv-cache-1hafSoqH.cjs} +1 -1
  36. package/dist/{kv-cache-C02XitwK.js → kv-cache-DduYhpee.js} +1 -1
  37. package/dist/{kv-cache-C8YjNAi_.mjs → kv-cache-OFBvrKh3.mjs} +1 -1
  38. package/dist/{ld-oQj6j_hP.mjs → ld-C15yzuY6.mjs} +3 -3
  39. package/dist/{metrics-zMe834ID.mjs → metrics-B1H23mlq.mjs} +1 -1
  40. package/dist/{middleware-Ck9yghxs.mjs → middleware-BZQnf0nI.mjs} +1 -1
  41. package/dist/{middleware-Bdu2-OPD.mjs → middleware-BqqycC0P.mjs} +29 -25
  42. package/dist/{middleware-CaR2MRWY.js → middleware-ClaUFaLb.js} +41 -17
  43. package/dist/{mod-Ck9_lSJB.d.ts → mod-Cy9VNHVw.d.ts} +12 -1
  44. package/dist/{mod-DHTuu3l8.d.cts → mod-DoTWIc7F.d.cts} +12 -1
  45. package/dist/mod.cjs +4 -4
  46. package/dist/mod.d.cts +1 -1
  47. package/dist/mod.d.ts +1 -1
  48. package/dist/mod.js +4 -4
  49. package/dist/nodeinfo/handler.test.mjs +1 -1
  50. package/dist/{owner-Dem4fbwc.mjs → owner-BVpZBM-V.mjs} +3 -3
  51. package/dist/{portable-collection-DJe_bk50.cjs → portable-collection-BFSShzwh.cjs} +1 -1
  52. package/dist/{portable-collection-BEqLrMW3.js → portable-collection-D535cSz_.js} +1 -1
  53. package/dist/{portable-collection-BL6aZlQ0.mjs → portable-collection-Dn2GdZdI.mjs} +2 -2
  54. package/dist/{portable-key-Duue9Y2Y.mjs → portable-key-Bmwmq7Y6.mjs} +1 -1
  55. package/dist/{proof-C9115DX_.mjs → proof-DrJWKeOl.mjs} +48 -6
  56. package/dist/{send-D0hxFFRB.mjs → send-CT3a-0Vd.mjs} +3 -3
  57. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  58. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  59. package/dist/sig/compound-proof-verification.test.mjs +2 -2
  60. package/dist/sig/compound-proof.test.mjs +2 -2
  61. package/dist/sig/http.test.mjs +2 -2
  62. package/dist/sig/key.test.mjs +1 -1
  63. package/dist/sig/ld.test.mjs +2 -2
  64. package/dist/sig/mod.cjs +2 -2
  65. package/dist/sig/mod.d.cts +1 -1
  66. package/dist/sig/mod.d.ts +1 -1
  67. package/dist/sig/mod.js +2 -2
  68. package/dist/sig/owner.test.mjs +1 -1
  69. package/dist/sig/portable-collection.test.mjs +1 -1
  70. package/dist/sig/portable-key.test.mjs +6 -6
  71. package/dist/sig/proof.test.mjs +141 -7
  72. package/dist/{temporal-DKchpKyp.mjs → temporal-DNqluyEc.mjs} +1 -1
  73. package/dist/testing/kv.test.mjs +1 -1
  74. package/dist/utils/docloader.test.mjs +2 -2
  75. package/dist/utils/kv-cache.test.mjs +1 -1
  76. package/dist/utils/mod.cjs +1 -1
  77. package/dist/utils/mod.js +1 -1
  78. package/package.json +6 -6
@@ -2,10 +2,10 @@ import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { t as __exportAll } from "./rolldown-runtime-BC-Eo5Mj.js";
4
4
  import { r as getDefaultActivityTransformers } from "./transformers-DAtXl_Kc.js";
5
- import { $ as instrumentDocumentLoader, A as hasSignature, At as name, C as InvalidContextReferenceError, Ct as hasPortableActor, Dt as isPortableUri, E as compactJsonLd, Et as isPortableKeyId, F as verifyCompactJsonLd, G as validateCryptoKey, M as isClearlyMalformedContextReference, N as isInvalidUrlTypeError, O as detachSignature, Ot as isSameObjectId, P as signJsonLd, Q as getRemoteHost, R as wrapContextLoaderForJsonLd, S as normalizeOutgoingActivityJsonLd, St as getRawCanonicalPortableId, Tt as isPortableId, W as importJwk, X as getDurationMs, Z as getFederationMetrics, _ as verifyObject, at as recordCollectionTotalItems, b as verifyPortableObjectProofWithRoot, bt as getGatewayKeyBase, c as verifyRequestDetailed, ct as recordInboxActivity, d as InvalidPortableObjectIdError, dt as recordWebFingerHandle, et as isAbortError, f as classifyFep2277CoreType, ft as registerQueueDepthGauge, g as verifyMapLocalProof, h as signObject, i as selectRequestSignature, it as recordCollectionRequest, j as hasSignatureLike, jt as version, k as getNormalizationContextLoader, lt as recordOutboxActivity, m as hasProofLike, mt as formatAcceptSignature, n as listRequestSignatures, nt as recordCollectionDispatchDuration, o as validateMaxSignatures, pt as preloadedOnlyDocumentLoader, q as MAX_PORTABLE_KEY_TTL, r as parseRfc9421SignatureInput, rt as recordCollectionPageItems, s as verifyRequest, st as recordFanoutRecipients, t as doubleKnock, tt as recordCircuitBreakerStateChange, ut as recordOutboxEnqueue, v as verifyPortableObjectProof, vt as getAuthenticationOrigin, w as assertSafeJsonLd, wt as isCompatibleKeyId, xt as getPortableDid, y as verifyPortableObjectProofPolicy, yt as getCanonicalPortableId, z as exportJwk } from "./http-BqN5kyUf.js";
5
+ import { $ as instrumentDocumentLoader, A as hasSignature, At as name, C as InvalidContextReferenceError, Ct as hasPortableActor, Dt as isPortableUri, E as compactJsonLd, Et as isPortableKeyId, F as verifyCompactJsonLd, G as validateCryptoKey, M as isClearlyMalformedContextReference, N as isInvalidUrlTypeError, O as detachSignature, Ot as isSameObjectId, P as signJsonLd, Q as getRemoteHost, R as wrapContextLoaderForJsonLd, S as normalizeOutgoingActivityJsonLd, St as getRawCanonicalPortableId, Tt as isPortableId, W as importJwk, X as getDurationMs, Z as getFederationMetrics, _ as verifyObject, at as recordCollectionTotalItems, b as verifyPortableObjectProofWithRoot, bt as getGatewayKeyBase, c as verifyRequestDetailed, ct as recordInboxActivity, d as InvalidPortableObjectIdError, dt as recordWebFingerHandle, et as isAbortError, f as classifyFep2277CoreType, ft as registerQueueDepthGauge, g as verifyMapLocalProof, h as signObject, i as selectRequestSignature, it as recordCollectionRequest, j as hasSignatureLike, jt as version, k as getNormalizationContextLoader, lt as recordOutboxActivity, m as hasProofLike, mt as formatAcceptSignature, n as listRequestSignatures, nt as recordCollectionDispatchDuration, o as validateMaxSignatures, pt as preloadedOnlyDocumentLoader, q as MAX_PORTABLE_KEY_TTL, r as parseRfc9421SignatureInput, rt as recordCollectionPageItems, s as verifyRequest, st as recordFanoutRecipients, t as doubleKnock, tt as recordCircuitBreakerStateChange, ut as recordOutboxEnqueue, v as verifyPortableObjectProof, vt as getAuthenticationOrigin, w as assertSafeJsonLd, wt as isCompatibleKeyId, xt as getPortableDid, y as verifyPortableObjectProofPolicy, yt as getCanonicalPortableId, z as exportJwk } from "./http-BGmxtpo2.js";
6
6
  import { a as MAX_BODY_SIZE, i as BodyTooLargeError, n as getNodeInfo, o as readBoundedText, t as nodeInfoToJson } from "./types-_S2_MeLF.js";
7
- import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-BEqLrMW3.js";
8
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-C02XitwK.js";
7
+ import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-D535cSz_.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-DduYhpee.js";
9
9
  import { getLogger, withContext } from "@logtape/logtape";
10
10
  import { Router, RouterError, assertPath } from "@fedify/uri-template";
11
11
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, isActor, lookupObject, traverseCollection } from "@fedify/vocab";
@@ -210,6 +210,7 @@ var FederationBuilderImpl = class {
210
210
  if (actor.id == null) logger.warn("Actor dispatcher returned an actor without an id property. Set the property with Context.getActorUri(identifier).");
211
211
  else if (!portable && actor.id.href != context.getActorUri(identifier).href) logger.warn("Actor dispatcher returned an actor with an id property that does not match the actor URI. Set the property with Context.getActorUri(identifier).");
212
212
  if (actor instanceof Tombstone) return actor;
213
+ if (portable && actor.id != null) warnPortableActorGateways(actor.id, actor.gateways);
213
214
  if (actor.id != null && isCompatibleEf61Iri(actor.id)) warnCompatibleActorId(actor.id, actor.gateway);
214
215
  if (portable) this.#warnPortableCollectionIds(context, identifier, actor);
215
216
  if (this.followingCallbacks != null && this.followingCallbacks.dispatcher != null) {
@@ -813,9 +814,28 @@ function warnMismatchedTombstoneId(context, cls, values, tombstone) {
813
814
  });
814
815
  }
815
816
  /**
817
+ * Warns about an FEP-ef61 portable actor whose `gateways` is empty or has
818
+ * an item that is not an HTTP(S) origin, which FEP-ef61 does not allow.
819
+ * Every item is checked, since the list and its URLs can be mutated after
820
+ * the actor is constructed.
821
+ */
822
+ function warnPortableActorGateways(actorId, gateways) {
823
+ if (gateways.length > 0 && gateways.every(isGatewayUrl)) return;
824
+ getLogger([
825
+ "fedify",
826
+ "federation",
827
+ "actor"
828
+ ]).warn("Actor dispatcher returned an FEP-ef61 portable actor, {actorId}, whose gateways property is empty or has an item that is not an HTTP(S) origin. FEP-ef61 requires a portable actor to have at least one gateway, and every gateway to be an HTTP(S) URI with an empty path, query, and fragment. Set the gateways property.", {
829
+ actorId: actorId.href,
830
+ gateways: gateways.map((g) => g.href)
831
+ });
832
+ }
833
+ /**
816
834
  * Warns about an FEP-ef61 portable actor identified by a compatible identifier
817
835
  * that is malformed, or is not on the actor's first gateway, where FEP-ef61
818
- * requires publishers to construct compatible identifiers.
836
+ * requires publishers to construct compatible identifiers. A missing or
837
+ * invalid first gateway is reported by {@link warnPortableActorGateways}
838
+ * instead.
819
839
  */
820
840
  function warnCompatibleActorId(actorId, gateway) {
821
841
  const logger = getLogger([
@@ -833,8 +853,8 @@ function warnCompatibleActorId(actorId, gateway) {
833
853
  });
834
854
  return;
835
855
  }
836
- if (gateway == null || !isGatewayUrl(gateway)) logger.warn("Actor dispatcher returned an actor whose id property, {actorId}, is an FEP-ef61 compatible identifier, but whose first gateway is not an HTTP(S) origin. Set the gateways property, and construct the compatible identifier with its first gateway.", { actorId: actorId.href });
837
- else if (actorId.origin !== gateway.origin) logger.warn("Actor dispatcher returned an actor whose id property, {actorId}, is an FEP-ef61 compatible identifier on another gateway than its first gateway, {gateway}. FEP-ef61 requires publishers to construct compatible identifiers with the first gateway in the actor's gateways.", {
856
+ if (gateway == null || !isGatewayUrl(gateway)) return;
857
+ if (actorId.origin !== gateway.origin) logger.warn("Actor dispatcher returned an actor whose id property, {actorId}, is an FEP-ef61 compatible identifier on another gateway than its first gateway, {gateway}. FEP-ef61 requires publishers to construct compatible identifiers with the first gateway in the actor's gateways.", {
838
858
  actorId: actorId.href,
839
859
  gateway: gateway.origin
840
860
  });
@@ -3786,7 +3806,7 @@ function isInvalidJsonLdError(error) {
3786
3806
  return name === "UnsafeJsonLdError" || error instanceof InvalidContextReferenceError || isPermanentRemoteContextError$1(error) || name === "jsonld.SyntaxError" && !isRemoteContextLoadingFailure$1(error);
3787
3807
  }
3788
3808
  function isValidationTypeError(error) {
3789
- return error instanceof TypeError && (/^(Invalid JSON-LD:|Invalid type:|Unexpected type:|Invalid @id:)/.test(error.message) || isInvalidUrlTypeError(error));
3809
+ return error instanceof TypeError && (/^(Invalid JSON-LD:|Invalid type:|Unexpected type:|Invalid @id:|Invalid FEP-ef61 gateway:)/.test(error.message) || isInvalidUrlTypeError(error));
3790
3810
  }
3791
3811
  function isPermanentActivityParseError(error) {
3792
3812
  return isInvalidJsonLdError(error) || isValidationTypeError(error);
@@ -3929,7 +3949,11 @@ async function handlePortableObject(request, { values, context, objectDispatcher
3929
3949
  return await onNotFound(request);
3930
3950
  }
3931
3951
  if (tombstone || result.reason.type !== "unsecuredCollection" && result.reason.type !== "unsupportedObjectType") {
3932
- logger.error("Refusing to serve the portable object {portableId}, as it does not satisfy the FEP-ef61 proof policy: {reason}. Portable actors, activities, objects, and tombstones need an Object Integrity Proof made with a key of the DID in their ID.", {
3952
+ if (result.reason.type === "invalidGateways") logger.error("Refusing to serve the portable actor {portableId}, as its gateways property is missing, empty, or has an item that is not an HTTP(S) origin. FEP-ef61 requires a portable actor to list at least one gateway where it can be retrieved.", {
3953
+ portableId: canonicalId,
3954
+ reason: result.reason.type
3955
+ });
3956
+ else logger.error("Refusing to serve the portable object {portableId}, as it does not satisfy the FEP-ef61 proof policy: {reason}. Portable actors, activities, objects, and tombstones need an Object Integrity Proof made with a key of the DID in their ID.", {
3933
3957
  portableId: canonicalId,
3934
3958
  reason: result.reason.type
3935
3959
  });
@@ -4048,13 +4072,13 @@ function recordCollectionMetrics(meterProvider, base, result, options = {}) {
4048
4072
  * @param parameters The parameters for handling the collection.
4049
4073
  * @returns A promise that resolves to an HTTP response.
4050
4074
  */
4051
- async function handleCollection(request, { name: name$1, identifier, uriGetter, filter, filterPredicate, context, collectionCallbacks, portable, tracerProvider, meterProvider, onUnauthorized, onNotFound }) {
4052
- const spanName = name$1.trim().replace(/\s+/g, "_");
4075
+ async function handleCollection(request, { name: name$2, identifier, uriGetter, filter, filterPredicate, context, collectionCallbacks, portable, tracerProvider, meterProvider, onUnauthorized, onNotFound }) {
4076
+ const spanName = name$2.trim().replace(/\s+/g, "_");
4053
4077
  tracerProvider = tracerProvider ?? trace.getTracerProvider();
4054
4078
  const tracer = tracerProvider.getTracer(name, version);
4055
4079
  const cursor = new URL(request.url).searchParams.get("cursor");
4056
4080
  const metricBase = {
4057
- kind: getCollectionMetricKind(name$1),
4081
+ kind: getCollectionMetricKind(name$2),
4058
4082
  page: cursor != null,
4059
4083
  dispatcher: "built_in"
4060
4084
  };
@@ -4100,7 +4124,7 @@ async function handleCollection(request, { name: name$1, identifier, uriGetter,
4100
4124
  span.setStatus({ code: SpanStatusCode.ERROR });
4101
4125
  return await onNotFound(request);
4102
4126
  }
4103
- const items = filterCollectionItems(page.items, name$1, filterPredicate);
4127
+ const items = filterCollectionItems(page.items, name$2, filterPredicate);
4104
4128
  itemCount = items.length;
4105
4129
  span.setAttribute("fedify.collection.items", itemCount);
4106
4130
  return items;
@@ -4142,7 +4166,7 @@ async function handleCollection(request, { name: name$1, identifier, uriGetter,
4142
4166
  } else {
4143
4167
  const uri = new URL(portable == null ? baseUri : pageBase);
4144
4168
  uri.searchParams.set("cursor", cursor);
4145
- const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name$1}`, {
4169
+ const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name$2}`, {
4146
4170
  kind: SpanKind.SERVER,
4147
4171
  attributes: {
4148
4172
  "activitypub.collection.id": uri.href,
@@ -4158,7 +4182,7 @@ async function handleCollection(request, { name: name$1, identifier, uriGetter,
4158
4182
  span.setStatus({ code: SpanStatusCode.ERROR });
4159
4183
  return await onNotFound(request);
4160
4184
  }
4161
- const items = filterCollectionItems(page.items, name$1, filterPredicate);
4185
+ const items = filterCollectionItems(page.items, name$2, filterPredicate);
4162
4186
  itemCount = items.length;
4163
4187
  span.setAttribute("fedify.collection.items", itemCount);
4164
4188
  return {
@@ -5349,8 +5373,8 @@ var CustomCollectionHandler = class {
5349
5373
  * @param CollectionPage The CollectionPage constructor.
5350
5374
  * @param filterPredicate Optional filter predicate for items.
5351
5375
  */
5352
- constructor(name$2, values, context, callbacks, tracerProvider = trace.getTracerProvider(), meterProvider, Collection, CollectionPage, filterPredicate, portable) {
5353
- this.name = name$2;
5376
+ constructor(name$1, values, context, callbacks, tracerProvider = trace.getTracerProvider(), meterProvider, Collection, CollectionPage, filterPredicate, portable) {
5377
+ this.name = name$1;
5354
5378
  this.values = values;
5355
5379
  this.context = context;
5356
5380
  this.callbacks = callbacks;
@@ -7138,7 +7162,7 @@ function isPermanentRemoteContextError(error) {
7138
7162
  return isRemoteContextLoadingFailure(error) && typeof details?.url === "string" && !URL.canParse(details.url) && isClearlyMalformedContextReference(details.url);
7139
7163
  }
7140
7164
  function isPermanentInboxParseError(error) {
7141
- return error instanceof Error && (error.name === "UnsafeJsonLdError" || error instanceof InvalidContextReferenceError || isPermanentRemoteContextError(error) || error.name === "jsonld.SyntaxError" && !isRemoteContextLoadingFailure(error)) || error instanceof TypeError && (/^(Invalid JSON-LD:|Invalid type:|Unexpected type:|Invalid @id:)/.test(error.message) || isInvalidUrlTypeError(error));
7165
+ return error instanceof Error && (error.name === "UnsafeJsonLdError" || error instanceof InvalidContextReferenceError || isPermanentRemoteContextError(error) || error.name === "jsonld.SyntaxError" && !isRemoteContextLoadingFailure(error)) || error instanceof TypeError && (/^(Invalid JSON-LD:|Invalid type:|Unexpected type:|Invalid @id:|Invalid FEP-ef61 gateway:)/.test(error.message) || isInvalidUrlTypeError(error));
7142
7166
  }
7143
7167
  function hasLinkedDataSignatureJsonLdProcessingError(error) {
7144
7168
  if (error.message.startsWith("Maximum deep iterations exceeded")) return true;
@@ -305,6 +305,14 @@ type VerifyPortableObjectProofFailureReason = {
305
305
  readonly objectType: "verificationMethod" | "publicKey" | "link";
306
306
  } | {
307
307
  /** A portable actor, activity, or object has no proof. */readonly type: "missingProof";
308
+ } | {
309
+ /**
310
+ * A portable actor's `gateways` is missing or empty, or has an item that
311
+ * is not an HTTP(S) URI with an empty path, query, and fragment.
312
+ * The document is rejected before its proofs are verified, so this
313
+ * reason does not mean that the proofs are valid.
314
+ */
315
+ readonly type: "invalidGateways";
308
316
  } | {
309
317
  /** The proof is malformed, unsupported, or cryptographically invalid. */readonly type: "invalidProof"; /** The zero-based index of the invalid proof. */
310
318
  readonly proofIndex: number;
@@ -358,7 +366,10 @@ declare function verifyProof(jsonLd: unknown, proof: DataIntegrityProof, options
358
366
  *
359
367
  * Every proof must use a DID URL whose DID matches the portable object's
360
368
  * authority, i.e., the DID of its canonical portable ID, and every proof must
361
- * pass {@link verifyProof}. The proofs are verified over the document as
369
+ * pass {@link verifyProof}. A portable actor must also have a non-empty
370
+ * `gateways` list whose items are all HTTP(S) URIs with an empty path, query,
371
+ * and fragment; otherwise, it is rejected with the `invalidGateways` reason
372
+ * before its proofs are verified. The proofs are verified over the document as
362
373
  * given; a compatible identifier is never rewritten into a portable ID.
363
374
  *
364
375
  * [FEP-ef61]: https://w3id.org/fep/ef61
@@ -305,6 +305,14 @@ type VerifyPortableObjectProofFailureReason = {
305
305
  readonly objectType: "verificationMethod" | "publicKey" | "link";
306
306
  } | {
307
307
  /** A portable actor, activity, or object has no proof. */readonly type: "missingProof";
308
+ } | {
309
+ /**
310
+ * A portable actor's `gateways` is missing or empty, or has an item that
311
+ * is not an HTTP(S) URI with an empty path, query, and fragment.
312
+ * The document is rejected before its proofs are verified, so this
313
+ * reason does not mean that the proofs are valid.
314
+ */
315
+ readonly type: "invalidGateways";
308
316
  } | {
309
317
  /** The proof is malformed, unsupported, or cryptographically invalid. */readonly type: "invalidProof"; /** The zero-based index of the invalid proof. */
310
318
  readonly proofIndex: number;
@@ -358,7 +366,10 @@ declare function verifyProof(jsonLd: unknown, proof: DataIntegrityProof, options
358
366
  *
359
367
  * Every proof must use a DID URL whose DID matches the portable object's
360
368
  * authority, i.e., the DID of its canonical portable ID, and every proof must
361
- * pass {@link verifyProof}. The proofs are verified over the document as
369
+ * pass {@link verifyProof}. A portable actor must also have a non-empty
370
+ * `gateways` list whose items are all HTTP(S) URIs with an empty path, query,
371
+ * and fragment; otherwise, it is rejected with the `invalidGateways` reason
372
+ * before its proofs are verified. The proofs are verified over the document as
362
373
  * given; a compatible identifier is never rewritten into a portable ID.
363
374
  *
364
375
  * [FEP-ef61]: https://w3id.org/fep/ef61
package/dist/mod.cjs CHANGED
@@ -3,11 +3,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("./rolldown-runtime-Dmm3t92W.cjs");
4
4
  const require_transformers = require("./transformers-BalCrSsr.cjs");
5
5
  require("./compat/mod.cjs");
6
- const require_http = require("./http-CCr2_ipG.cjs");
7
- const require_federation = require("./federation-BSS2dUO7.cjs");
6
+ const require_http = require("./http-BEivI0TS.cjs");
7
+ const require_federation = require("./federation-BsGo0EH2.cjs");
8
8
  const require_types = require("./types-poIao40f.cjs");
9
- const require_portable_collection = require("./portable-collection-DJe_bk50.cjs");
10
- const require_kv_cache = require("./kv-cache-DUXluAc0.cjs");
9
+ const require_portable_collection = require("./portable-collection-BFSShzwh.cjs");
10
+ const require_kv_cache = require("./kv-cache-1hafSoqH.cjs");
11
11
  require("./nodeinfo/mod.cjs");
12
12
  require("./runtime/mod.cjs");
13
13
  require("./sig/mod.cjs");
package/dist/mod.d.cts CHANGED
@@ -6,7 +6,7 @@ import { $ as respondWithObjectIfAcceptable, $t as ActivityTransformer, A as Inb
6
6
  import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-BhNbN8Ed.cjs";
7
7
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
8
8
  import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-D58KCqUg.cjs";
9
- import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "./mod-DHTuu3l8.cjs";
9
+ import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "./mod-DoTWIc7F.cjs";
10
10
  import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-Dp3Ij7sw.cjs";
11
11
  export * from "@fedify/vocab-runtime";
12
12
 
package/dist/mod.d.ts CHANGED
@@ -6,7 +6,7 @@ import { $ as respondWithObjectIfAcceptable, $t as ActivityTransformer, A as Inb
6
6
  import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-BhNbN8Ed.js";
7
7
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
8
8
  import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-B3OBLj5g.js";
9
- import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "./mod-Ck9_lSJB.js";
9
+ import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "./mod-Cy9VNHVw.js";
10
10
  import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-C5Mwx5ty.js";
11
11
  export * from "@fedify/vocab-runtime";
12
12
 
package/dist/mod.js CHANGED
@@ -3,11 +3,11 @@ import { URLPattern } from "urlpattern-polyfill";
3
3
  import "./rolldown-runtime-BC-Eo5Mj.js";
4
4
  import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-DAtXl_Kc.js";
5
5
  import "./compat/mod.js";
6
- import { D as createSignature, H as fetchKeyDetailed, I as verifyJsonLd, L as verifySignature, O as detachSignature, P as signJsonLd, T as attachSignature, U as generateCryptoKeyPair, V as fetchKey, W as importJwk, _ as verifyObject, _t as validateAcceptSignature, a as signRequest, c as verifyRequestDetailed, gt as parseAcceptSignature, h as signObject, ht as fulfillAcceptSignature, j as hasSignatureLike, m as hasProofLike, mt as formatAcceptSignature, p as createProof, s as verifyRequest, v as verifyPortableObjectProof, x as verifyProof, z as exportJwk } from "./http-BqN5kyUf.js";
7
- import { a as respondWithObjectIfAcceptable, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as respondWithObject, l as CircuitBreaker, n as handleWebFinger, o as SendActivityError, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "./middleware-CaR2MRWY.js";
6
+ import { D as createSignature, H as fetchKeyDetailed, I as verifyJsonLd, L as verifySignature, O as detachSignature, P as signJsonLd, T as attachSignature, U as generateCryptoKeyPair, V as fetchKey, W as importJwk, _ as verifyObject, _t as validateAcceptSignature, a as signRequest, c as verifyRequestDetailed, gt as parseAcceptSignature, h as signObject, ht as fulfillAcceptSignature, j as hasSignatureLike, m as hasProofLike, mt as formatAcceptSignature, p as createProof, s as verifyRequest, v as verifyPortableObjectProof, x as verifyProof, z as exportJwk } from "./http-BGmxtpo2.js";
7
+ import { a as respondWithObjectIfAcceptable, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as respondWithObject, l as CircuitBreaker, n as handleWebFinger, o as SendActivityError, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "./middleware-ClaUFaLb.js";
8
8
  import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-_S2_MeLF.js";
9
- import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-BEqLrMW3.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-C02XitwK.js";
9
+ import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-D535cSz_.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-DduYhpee.js";
11
11
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError } from "./federation/mod.js";
12
12
  import "./nodeinfo/mod.js";
13
13
  import "./runtime/mod.js";
@@ -5,7 +5,7 @@ import { r as createRequestContext } from "../context-B2rlkkyJ.mjs";
5
5
  import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
6
6
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
7
7
  import "../std__assert-DvMDRPes.mjs";
8
- import { C as handleNodeInfo, o as createFederation, w as handleNodeInfoJrd } from "../middleware-Bdu2-OPD.mjs";
8
+ import { C as handleNodeInfo, o as createFederation, w as handleNodeInfoJrd } from "../middleware-BqqycC0P.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  //#region src/nodeinfo/handler.test.ts
11
11
  test("handleNodeInfo()", async () => {
@@ -1,11 +1,11 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-EopndaNb.mjs";
4
+ import { n as version, t as name } from "./deno-DB_Sh0LK.mjs";
5
5
  import { d as isPortableUri, l as isPortableId, n as getCanonicalPortableId, p as isSamePublicKey$1, s as isCompatibleKeyId } from "./portable-key-id-Ca30-hOa.mjs";
6
6
  import { i as parseKeyOwnerEvidence, r as getVerifiedKeyOwnerEvidence } from "./key-owner-evidence-APB6NpSk.mjs";
7
- import { l as verifyKeyOwnership, n as exportJwk, r as fetchActorDocument } from "./key-DyXf88bq.mjs";
8
- import { n as resolvePortableActorKey, t as fetchPortableGatewayKey } from "./portable-key-Duue9Y2Y.mjs";
7
+ import { l as verifyKeyOwnership, n as exportJwk, r as fetchActorDocument } from "./key-DA3Yx8p2.mjs";
8
+ import { n as resolvePortableActorKey, t as fetchPortableGatewayKey } from "./portable-key-Bmwmq7Y6.mjs";
9
9
  import { getLogger } from "@logtape/logtape";
10
10
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
11
11
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -1,5 +1,5 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
- const require_http = require("./http-CCr2_ipG.cjs");
2
+ const require_http = require("./http-BEivI0TS.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");
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { At as name, B as fetchActorDocument, Dt as isPortableUri, J as getVerifiedKeyOwnerEvidence, K as verifyKeyOwnership, Tt as isPortableId, Y as parseKeyOwnerEvidence, b as verifyPortableObjectProofWithRoot, jt as version, kt as isSamePublicKey$1, l as fetchPortableGatewayKey, u as resolvePortableActorKey, v as verifyPortableObjectProof, wt as isCompatibleKeyId, yt as getCanonicalPortableId, z as exportJwk } from "./http-BqN5kyUf.js";
3
+ import { At as name, B as fetchActorDocument, Dt as isPortableUri, J as getVerifiedKeyOwnerEvidence, K as verifyKeyOwnership, Tt as isPortableId, Y as parseKeyOwnerEvidence, b as verifyPortableObjectProofWithRoot, jt as version, kt as isSamePublicKey$1, l as fetchPortableGatewayKey, u as resolvePortableActorKey, v as verifyPortableObjectProof, wt as isCompatibleKeyId, yt as getCanonicalPortableId, z as exportJwk } from "./http-BGmxtpo2.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { CollectionPage, CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
6
6
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -1,8 +1,8 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-EopndaNb.mjs";
5
- import { c as verifyPortableObjectProof, u as verifyPortableObjectProofWithRoot } from "./proof-C9115DX_.mjs";
4
+ import { n as version, t as name } from "./deno-DB_Sh0LK.mjs";
5
+ import { c as verifyPortableObjectProof, u as verifyPortableObjectProofWithRoot } from "./proof-DrJWKeOl.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { CollectionPage, Object as Object$1, isActor } from "@fedify/vocab";
8
8
  import { trace } from "@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 { u as verifyPortableObjectProofWithRoot } from "./proof-C9115DX_.mjs";
5
+ import { u as verifyPortableObjectProofWithRoot } from "./proof-DrJWKeOl.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";
@@ -1,17 +1,17 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-EopndaNb.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-zMe834ID.mjs";
4
+ import { n as version, t as name } from "./deno-DB_Sh0LK.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-B1H23mlq.mjs";
6
6
  import { i as getPortableDid, l as isPortableId } from "./portable-key-id-Ca30-hOa.mjs";
7
- import { c as validateCryptoKey, i as fetchKey, t as bypassKeyCacheReads } from "./key-DyXf88bq.mjs";
7
+ import { c as validateCryptoKey, i as fetchKey, t as bypassKeyCacheReads } from "./key-DA3Yx8p2.mjs";
8
8
  import { n as preloadedOnlyDocumentLoader } from "./public-audience--klBIOk1.mjs";
9
9
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
10
- import { c as getNormalizationContextLoader } from "./ld-oQj6j_hP.mjs";
10
+ import { c as getNormalizationContextLoader } from "./ld-C15yzuY6.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, parseIri } from "@fedify/vocab-runtime";
14
+ import { encodeMultibase, formatIri, fromCompatibleEf61Id, getDocumentLoader, getFe34Origin, parseGatewayUrl, parseIri } from "@fedify/vocab-runtime";
15
15
  import { encodeHex } from "byte-encodings/hex";
16
16
  import { isPlainJsonTree, retainSignedRepresentation } from "@fedify/vocab-runtime/internal/signed-representation";
17
17
  import jsonld from "@fedify/vocab-runtime/jsonld";
@@ -676,6 +676,7 @@ const FEP_2277_COLLECTION_PROPERTIES = [
676
676
  "prev",
677
677
  "current"
678
678
  ].map((property) => AS_NAMESPACE + property);
679
+ const FEP_EF61_GATEWAYS = "https://w3id.org/fep/ef61/gateways";
679
680
  const PORTABLE_OBJECT_ID_PATTERN = /^ap(?:\+ef61)?:\/\//i;
680
681
  const FUNCTIONAL_PROOF_PROPERTIES = [
681
682
  `${SECURITY_NAMESPACE}cryptosuite`,
@@ -702,6 +703,35 @@ function hasValidPortableProofShape(proofValue) {
702
703
  });
703
704
  }
704
705
  /**
706
+ * Checks whether an expanded portable actor node has the `gateways` that
707
+ * FEP-ef61 requires: a non-empty list whose items are all HTTP(S) URIs with
708
+ * an empty path, query, and fragment. Like the generated vocabulary decoder,
709
+ * this also tolerates a plain set of values instead of a `@list`, and gateway
710
+ * strings given as `@value`s instead of `@id`s.
711
+ */
712
+ function hasValidPortableActorGateways(node) {
713
+ const values = node[FEP_EF61_GATEWAYS];
714
+ if (!Array.isArray(values)) return false;
715
+ let items = values;
716
+ if (values.some((value) => isJsonLdNode(value) && "@list" in value)) {
717
+ if (values.length !== 1) return false;
718
+ items = values[0]["@list"];
719
+ }
720
+ if (!Array.isArray(items) || items.length < 1) return false;
721
+ return items.every((item) => {
722
+ if (!isJsonLdNode(item)) return false;
723
+ const gateway = typeof item["@id"] === "string" ? item["@id"] : item["@value"];
724
+ if (typeof gateway !== "string") return false;
725
+ try {
726
+ parseGatewayUrl(gateway);
727
+ } catch (error) {
728
+ if (error instanceof TypeError) return false;
729
+ throw error;
730
+ }
731
+ return true;
732
+ });
733
+ }
734
+ /**
705
735
  * Classifies an expanded JSON-LD node into an FEP-2277 core type by the
706
736
  * properties it has.
707
737
  * @internal
@@ -905,6 +935,15 @@ async function preparePortableObjectProof(jsonLd, options) {
905
935
  }
906
936
  };
907
937
  }
938
+ if (objectType === "actor" && !hasValidPortableActorGateways(root)) return {
939
+ prepared: false,
940
+ root,
941
+ objectType,
942
+ result: {
943
+ verified: false,
944
+ reason: { type: "invalidGateways" }
945
+ }
946
+ };
908
947
  return {
909
948
  prepared: true,
910
949
  root,
@@ -958,7 +997,10 @@ async function verifyPortableObjectProofPolicy(jsonLd, key, options = {}) {
958
997
  *
959
998
  * Every proof must use a DID URL whose DID matches the portable object's
960
999
  * authority, i.e., the DID of its canonical portable ID, and every proof must
961
- * pass {@link verifyProof}. The proofs are verified over the document as
1000
+ * pass {@link verifyProof}. A portable actor must also have a non-empty
1001
+ * `gateways` list whose items are all HTTP(S) URIs with an empty path, query,
1002
+ * and fragment; otherwise, it is rejected with the `invalidGateways` reason
1003
+ * before its proofs are verified. The proofs are verified over the document as
962
1004
  * given; a compatible identifier is never rewritten into a portable ID.
963
1005
  *
964
1006
  * [FEP-ef61]: https://w3id.org/fep/ef61
@@ -1,9 +1,9 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-EopndaNb.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics } from "./metrics-zMe834ID.mjs";
6
- import { n as doubleKnock } from "./http-Y1ObT1A8.mjs";
4
+ import { n as version, t as name } from "./deno-DB_Sh0LK.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics } from "./metrics-B1H23mlq.mjs";
6
+ import { n as doubleKnock } from "./http-DQf9Mw4V.mjs";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
9
9
  import { FetchError, UrlError, 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 { i as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-F2jjkrt0.mjs";
6
+ import { i as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-B-Fk6Slo.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 { i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-F2jjkrt0.mjs";
6
+ import { i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-B-Fk6Slo.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 { l as verifyPortableObjectProofPolicy, o as verifyMapLocalProof } from "../proof-C9115DX_.mjs";
7
+ import { l as verifyPortableObjectProofPolicy, o as verifyMapLocalProof } from "../proof-DrJWKeOl.mjs";
8
8
  import { n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
9
- import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, o as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-F2jjkrt0.mjs";
9
+ import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, o as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-B-Fk6Slo.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 { a as signObject, d as verifyProof } from "../proof-C9115DX_.mjs";
9
+ import { a as signObject, d as verifyProof } from "../proof-DrJWKeOl.mjs";
10
10
  import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
11
- import { o as verifyCompoundProofDocuments } from "../compound-proof-F2jjkrt0.mjs";
11
+ import { o as verifyCompoundProofDocuments } from "../compound-proof-B-Fk6Slo.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 { n as exportJwk } from "../key-DyXf88bq.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-Y1ObT1A8.mjs";
15
+ import { n as exportJwk } from "../key-DA3Yx8p2.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-DQf9Mw4V.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-Da8A8mZa.mjs";
19
19
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -6,7 +6,7 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
8
8
  import { t as assert } from "../assert-D1Eafmd_.mjs";
9
- import { a as fetchKeyDetailed, c as validateCryptoKey, i as fetchKey, n as exportJwk, o as generateCryptoKeyPair, s as importJwk } from "../key-DyXf88bq.mjs";
9
+ import { a as fetchKeyDetailed, c as validateCryptoKey, i as fetchKey, n as exportJwk, o as generateCryptoKeyPair, s as importJwk } from "../key-DA3Yx8p2.mjs";
10
10
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
11
11
  import { CryptographicKey, Multikey } from "@fedify/vocab";
12
12
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -8,8 +8,8 @@ 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 { o as generateCryptoKeyPair } from "../key-DyXf88bq.mjs";
12
- import { 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-oQj6j_hP.mjs";
11
+ import { o as generateCryptoKeyPair } from "../key-DA3Yx8p2.mjs";
12
+ import { 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-C15yzuY6.mjs";
13
13
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
14
14
  import { CryptographicKey } from "@fedify/vocab";
15
15
  import { createTestMeterProvider, 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-CCr2_ipG.cjs");
4
- const require_portable_collection = require("../portable-collection-DJe_bk50.cjs");
3
+ const require_http = require("../http-BEivI0TS.cjs");
4
+ const require_portable_collection = require("../portable-collection-BFSShzwh.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 { 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-BrwKINQn.cjs";
3
3
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BF0L9cMt.cjs";
4
- import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "../mod-DHTuu3l8.cjs";
4
+ import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "../mod-DoTWIc7F.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 { 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-DGx0KOws.js";
3
3
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BSzr5-I8.js";
4
- import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "../mod-Ck9_lSJB.js";
4
+ import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "../mod-Cy9VNHVw.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 { D as createSignature, H as fetchKeyDetailed, I as verifyJsonLd, L as verifySignature, O as detachSignature, P as signJsonLd, T as attachSignature, U as generateCryptoKeyPair, V as fetchKey, W as importJwk, _ as verifyObject, _t as validateAcceptSignature, a as signRequest, c as verifyRequestDetailed, gt as parseAcceptSignature, h as signObject, ht as fulfillAcceptSignature, j as hasSignatureLike, m as hasProofLike, mt as formatAcceptSignature, p as createProof, s as verifyRequest, v as verifyPortableObjectProof, x as verifyProof, z as exportJwk } from "../http-BqN5kyUf.js";
4
- import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-BEqLrMW3.js";
3
+ import { D as createSignature, H as fetchKeyDetailed, I as verifyJsonLd, L as verifySignature, O as detachSignature, P as signJsonLd, T as attachSignature, U as generateCryptoKeyPair, V as fetchKey, W as importJwk, _ as verifyObject, _t as validateAcceptSignature, a as signRequest, c as verifyRequestDetailed, gt as parseAcceptSignature, h as signObject, ht as fulfillAcceptSignature, j as hasSignatureLike, m as hasProofLike, mt as formatAcceptSignature, p as createProof, s as verifyRequest, v as verifyPortableObjectProof, x as verifyProof, z as exportJwk } from "../http-BGmxtpo2.js";
4
+ import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-D535cSz_.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-Dem4fbwc.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-BVpZBM-V.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