@fedify/fedify 2.5.0-dev.2492 → 2.5.0-dev.2496

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 (101) hide show
  1. package/dist/{builder-DphK9v7f.mjs → builder-CUVoluZR.mjs} +2 -2
  2. package/dist/compat/mod.d.cts +1 -1
  3. package/dist/compat/mod.d.ts +1 -1
  4. package/dist/compat/transformers.test.mjs +1 -1
  5. package/dist/{compound-proof-cYtvlTgF.mjs → compound-proof-DSHBRvPr.mjs} +2 -2
  6. package/dist/{context-COHd1Rsh.mjs → context-A-Nde3u-.mjs} +1 -1
  7. package/dist/{context-DSuL3YWx.d.cts → context-De6_qvb7.d.cts} +12 -11
  8. package/dist/{context-DQJE9YfH.d.ts → context-TVf3fdlB.d.ts} +12 -11
  9. package/dist/{deno-iOAA7iRN.mjs → deno-Bd6U_y-w.mjs} +1 -1
  10. package/dist/{docloader-DCZkiTeF.mjs → docloader-CDPwFfMf.mjs} +2 -2
  11. package/dist/federation/builder.test.mjs +1 -1
  12. package/dist/federation/compound-fanout.test.mjs +3 -3
  13. package/dist/federation/handler-compound-proof.test.mjs +4 -4
  14. package/dist/federation/handler.test.mjs +10 -6
  15. package/dist/federation/hashlink-media.test.mjs +2 -2
  16. package/dist/federation/idempotency.test.mjs +2 -2
  17. package/dist/federation/inbox-actorless.test.mjs +55 -20
  18. package/dist/federation/inbox-authentication.test.mjs +112 -8
  19. package/dist/federation/inbox-report.test.mjs +13 -9
  20. package/dist/federation/inbox-view.test.mjs +1 -1
  21. package/dist/federation/inbox.test.mjs +1 -1
  22. package/dist/federation/metrics.test.mjs +1 -1
  23. package/dist/federation/middleware.test.mjs +8 -8
  24. package/dist/federation/mod.cjs +1 -1
  25. package/dist/federation/mod.d.cts +2 -2
  26. package/dist/federation/mod.d.ts +2 -2
  27. package/dist/federation/mod.js +1 -1
  28. package/dist/federation/mq.test.mjs +1 -1
  29. package/dist/federation/outgoing-proof.test.mjs +4 -4
  30. package/dist/federation/portable-actor.test.mjs +3 -3
  31. package/dist/federation/portable-chain.test.mjs +3 -3
  32. package/dist/federation/portable-collection.test.mjs +4 -4
  33. package/dist/federation/portable-delivery.test.mjs +2 -2
  34. package/dist/federation/portable-gateway-keys.test.mjs +6 -6
  35. package/dist/federation/portable-inbox.test.mjs +4 -4
  36. package/dist/federation/portable-parse-uri.test.mjs +1 -1
  37. package/dist/federation/portable-route-activity.test.mjs +2 -2
  38. package/dist/federation/portable.test.mjs +3 -3
  39. package/dist/federation/send.test.mjs +3 -3
  40. package/dist/federation/tasks/enqueue.test.mjs +2 -2
  41. package/dist/federation/tasks/tasks.test.mjs +3 -3
  42. package/dist/federation/temporal.test.mjs +1 -1
  43. package/dist/federation/webfinger.test.mjs +2 -2
  44. package/dist/{federation-D0AZw_aw.cjs → federation-BsYWlas-.cjs} +61 -49
  45. package/dist/{http-BoJCMnjY.mjs → http-Bexcl2MP.mjs} +4 -4
  46. package/dist/{http-kv1LZw-r.cjs → http-DRIP8OAf.cjs} +1 -1
  47. package/dist/{http-ChXUU_3c.js → http-DU8SkmyD.js} +1 -1
  48. package/dist/{inbox-BjihTKLo.mjs → inbox-DzY3wS80.mjs} +3 -3
  49. package/dist/{inbox-authentication-DflPYlLL.mjs → inbox-authentication-CgonVRkg.mjs} +41 -14
  50. package/dist/{inbox-view-D-skypg-.mjs → inbox-view-CXoRpTuL.mjs} +1 -1
  51. package/dist/{kv-cache-DQcte7ES.js → kv-cache-C1GxDlbI.js} +1 -1
  52. package/dist/{kv-cache-Ddh5sMxH.cjs → kv-cache-Dzr88ylV.cjs} +1 -1
  53. package/dist/{kv-cache-Cmsyke4d.mjs → kv-cache-fvy2JeOS.mjs} +1 -1
  54. package/dist/{ld-CdvcOEXQ.mjs → ld-DrQTMLaI.mjs} +2 -2
  55. package/dist/{metrics-CpxvUrBz.mjs → metrics-DS2ZFVe-.mjs} +1 -1
  56. package/dist/{middleware-CoBLrTKX.mjs → middleware-CREOtfQu.mjs} +26 -41
  57. package/dist/{middleware-BHb5toqA.js → middleware-DKlWAcyP.js} +53 -41
  58. package/dist/{middleware-BKs2DLUF.mjs → middleware-WhO2R1IG.mjs} +1 -1
  59. package/dist/{mod-6TQ4UQZb.d.cts → mod-oYNzF2VJ.d.cts} +1 -1
  60. package/dist/{mod-CIeBgsOC.d.ts → mod-xr6CN9Vz.d.ts} +1 -1
  61. package/dist/mod.cjs +4 -4
  62. package/dist/mod.d.cts +2 -2
  63. package/dist/mod.d.ts +2 -2
  64. package/dist/mod.js +4 -4
  65. package/dist/nodeinfo/handler.test.mjs +2 -2
  66. package/dist/{owner-DTnVpUKA.mjs → owner-56YVyohg.mjs} +3 -3
  67. package/dist/{portable-collection-DciwBIia.cjs → portable-collection-CnaKW3o7.cjs} +1 -1
  68. package/dist/{portable-collection-CJeYTL61.mjs → portable-collection-baJxIrh8.mjs} +2 -2
  69. package/dist/{portable-collection-TmtpzD4E.js → portable-collection-xCJQ3HQp.js} +1 -1
  70. package/dist/{portable-key-DcYok4ki.mjs → portable-key-v1tXVIxd.mjs} +1 -1
  71. package/dist/{proof-GH7Poos_.mjs → proof-CzS2dAmn.mjs} +3 -3
  72. package/dist/{send-BgGJh6pv.mjs → send-BqrsM02_.mjs} +3 -3
  73. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  74. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  75. package/dist/sig/compound-proof-verification.test.mjs +2 -2
  76. package/dist/sig/compound-proof.test.mjs +2 -2
  77. package/dist/sig/http.test.mjs +2 -2
  78. package/dist/sig/key.test.mjs +1 -1
  79. package/dist/sig/ld.test.mjs +1 -1
  80. package/dist/sig/mitra-receive-interop.test.mjs +4 -4
  81. package/dist/sig/mitra-send-interop.test.mjs +3 -3
  82. package/dist/sig/mod.cjs +2 -2
  83. package/dist/sig/mod.js +2 -2
  84. package/dist/sig/owner.test.mjs +1 -1
  85. package/dist/sig/portable-collection.test.mjs +1 -1
  86. package/dist/sig/portable-interop.test.mjs +3 -3
  87. package/dist/sig/portable-key.test.mjs +5 -5
  88. package/dist/sig/proof.test.mjs +3 -3
  89. package/dist/sig/tootik-request-interop.test.mjs +4 -4
  90. package/dist/sig/tootik-send-interop.test.mjs +3 -3
  91. package/dist/sig/verification.test.mjs +3 -3
  92. package/dist/{temporal-gJINzcL4.mjs → temporal-DgPS8S4x.mjs} +1 -1
  93. package/dist/testing/kv.test.mjs +1 -1
  94. package/dist/testing/mod.d.mts +12 -11
  95. package/dist/testing/mod.mjs +2 -2
  96. package/dist/{testing-Dbr21vZk.mjs → testing-_9kJHvqh.mjs} +1 -1
  97. package/dist/utils/docloader.test.mjs +2 -2
  98. package/dist/utils/kv-cache.test.mjs +1 -1
  99. package/dist/utils/mod.cjs +1 -1
  100. package/dist/utils/mod.js +1 -1
  101. package/package.json +6 -6
@@ -2,7 +2,7 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { i as getPortableDid, l as isPortableId, n as getCanonicalPortableId } from "./portable-key-id-Ca30-hOa.mjs";
5
- import { n as version, t as name } from "./deno-iOAA7iRN.mjs";
5
+ import { n as version, t as name } from "./deno-Bd6U_y-w.mjs";
6
6
  import { t as ActivityListenerSet } from "./activity-listener-CELFAodc.mjs";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { Router, RouterError, assertPath } from "@fedify/uri-template";
@@ -91,7 +91,7 @@ var FederationBuilderImpl = class {
91
91
  * specified.
92
92
  */
93
93
  async build(options) {
94
- const { FederationImpl } = await import("./middleware-BKs2DLUF.mjs");
94
+ const { FederationImpl } = await import("./middleware-WhO2R1IG.mjs");
95
95
  const f = new FederationImpl(options);
96
96
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
97
97
  f.router = this.router.clone();
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { in as ActivityTransformer, n as Context } from "../context-DSuL3YWx.cjs";
2
+ import { in as ActivityTransformer, n as Context } from "../context-De6_qvb7.cjs";
3
3
  import { Activity } from "@fedify/vocab";
4
4
 
5
5
  //#region src/compat/transformers.d.ts
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { in as ActivityTransformer, n as Context } from "../context-DQJE9YfH.js";
2
+ import { in as ActivityTransformer, n as Context } from "../context-TVf3fdlB.js";
3
3
  import { Activity } from "@fedify/vocab";
4
4
 
5
5
  //#region src/compat/transformers.d.ts
@@ -5,7 +5,7 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
6
  import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
7
7
  import { t as assert } from "../assert-D1Eafmd_.mjs";
8
- import { O as actorDehydrator, k as autoIdAssigner, n as FederationImpl } from "../middleware-CoBLrTKX.mjs";
8
+ import { O as actorDehydrator, k as autoIdAssigner, n as FederationImpl } from "../middleware-CREOtfQu.mjs";
9
9
  import { Follow, Person } from "@fedify/vocab";
10
10
  import { test } from "@fedify/fixture";
11
11
  //#region src/compat/transformers.test.ts
@@ -3,9 +3,9 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { a as getRawCanonicalPortableId, l as isPortableId, n as getCanonicalPortableId } from "./portable-key-id-Ca30-hOa.mjs";
5
5
  import { a as verificationObservation, t as observeAttempt } from "./verification-Dpfcw8ml.mjs";
6
- import { c as getNormalizationContextLoader } from "./ld-CdvcOEXQ.mjs";
6
+ import { c as getNormalizationContextLoader } from "./ld-DrQTMLaI.mjs";
7
7
  import { n as preloadedOnlyDocumentLoader } from "./public-audience--klBIOk1.mjs";
8
- import { c as verifyMapLocalProof, f as verifyPortableObjectProofPolicy, m as verifyPreparedPortableObjectProofPolicy, n as classifyFep2277CoreType, o as preparePortableObjectProofPolicy } from "./proof-GH7Poos_.mjs";
8
+ import { c as verifyMapLocalProof, f as verifyPortableObjectProofPolicy, m as verifyPreparedPortableObjectProofPolicy, n as classifyFep2277CoreType, o as preparePortableObjectProofPolicy } from "./proof-CzS2dAmn.mjs";
9
9
  import { parseIri, preloadedContexts } from "@fedify/vocab-runtime";
10
10
  import jsonld from "@fedify/vocab-runtime/jsonld";
11
11
  //#region src/sig/compound-proof.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as mockDocumentLoader } from "./dist-DJQM4u7i.mjs";
5
5
  import { t as isInAudience } from "./audience-CHQ-FlLD.mjs";
6
- import { i as getEmptyAuthenticationEvidence } from "./inbox-authentication-DflPYlLL.mjs";
6
+ import { i as getEmptyAuthenticationEvidence } from "./inbox-authentication-CgonVRkg.mjs";
7
7
  import { RouterError } from "@fedify/uri-template";
8
8
  import { lookupObject, traverseCollection } from "@fedify/vocab";
9
9
  import { lookupWebFinger } from "@fedify/webfinger";
@@ -77,7 +77,7 @@ type InboxAuthentication = {
77
77
  * [FEP-fe34]: https://w3id.org/fep/fe34
78
78
  * @since 2.5.0
79
79
  */
80
- readonly type: "activityOriginMismatch";
80
+ readonly type: "activity-origin-mismatch";
81
81
  readonly activityId: URL;
82
82
  readonly actorIds: readonly URL[];
83
83
  } | {
@@ -86,7 +86,7 @@ type InboxAuthentication = {
86
86
  * for it, although its listener allows activities without an actor.
87
87
  * @since 2.5.0
88
88
  */
89
- readonly type: "noAuthenticatedPrincipal";
89
+ readonly type: "no-authenticated-principal";
90
90
  };
91
91
  } | {
92
92
  readonly status: "skipped";
@@ -1155,27 +1155,27 @@ interface InboxPrincipal {
1155
1155
  *
1156
1156
  * - `"actor"`: an actor whose ownership of the verifying key Fedify
1157
1157
  * confirmed with the actor's own document.
1158
- * - `"portableAuthority"`: a DID whose verification method made a valid
1158
+ * - `"portable-authority"`: a DID whose verification method made a valid
1159
1159
  * Object Integrity Proof. It authenticates the [FEP-ef61] portable
1160
1160
  * actors of that DID, and nothing else.
1161
1161
  *
1162
1162
  * [FEP-ef61]: https://w3id.org/fep/ef61
1163
1163
  */
1164
- readonly kind: "actor" | "portableAuthority";
1165
- /** The actor ID, or the DID if {@link kind} is `"portableAuthority"`. */
1164
+ readonly kind: "actor" | "portable-authority";
1165
+ /** The actor ID, or the DID if {@link kind} is `"portable-authority"`. */
1166
1166
  readonly id: URL;
1167
1167
  /**
1168
1168
  * How the principal was authenticated:
1169
1169
  *
1170
- * - `"httpSignatures"`: it signed the HTTP request.
1171
- * - `"linkedDataSignatures"`: it made the Linked Data Signature of the
1170
+ * - `"http-signatures"`: it signed the HTTP request.
1171
+ * - `"linked-data-signatures"`: it made the Linked Data Signature of the
1172
1172
  * activity.
1173
- * - `"objectIntegrityProofs"`: it made an Object Integrity Proof of the
1173
+ * - `"object-integrity-proofs"`: it made an Object Integrity Proof of the
1174
1174
  * activity.
1175
1175
  * - `"origin"`: the activity was fetched again from the actor's own web
1176
1176
  * origin, which happens only for `Context.routeActivity()`.
1177
1177
  */
1178
- readonly mechanism: "httpSignatures" | "linkedDataSignatures" | "objectIntegrityProofs" | "origin";
1178
+ readonly mechanism: "http-signatures" | "linked-data-signatures" | "object-integrity-proofs" | "origin";
1179
1179
  /** The key or verification method that authenticated the principal. */
1180
1180
  readonly keyId: URL | null;
1181
1181
  }
@@ -1285,12 +1285,13 @@ interface IsActorAuthenticatedOptions {
1285
1285
  declare function isActorAuthenticated(evidence: InboxAuthenticationEvidence, actorId: URL, options?: IsActorAuthenticatedOptions): boolean;
1286
1286
  /**
1287
1287
  * A {@link InboxPrincipal} as stored in a queued message.
1288
+ * The wire spellings remain independent of the public API spellings.
1288
1289
  * @internal
1289
1290
  */
1290
1291
  interface SerializedInboxPrincipal {
1291
- readonly kind: InboxPrincipal["kind"];
1292
+ readonly kind: "actor" | "portableAuthority";
1292
1293
  readonly id: string;
1293
- readonly mechanism: InboxPrincipal["mechanism"];
1294
+ readonly mechanism: "httpSignatures" | "linkedDataSignatures" | "objectIntegrityProofs" | "origin";
1294
1295
  readonly keyId: string | null;
1295
1296
  }
1296
1297
  /**
@@ -79,7 +79,7 @@ type InboxAuthentication = {
79
79
  * [FEP-fe34]: https://w3id.org/fep/fe34
80
80
  * @since 2.5.0
81
81
  */
82
- readonly type: "activityOriginMismatch";
82
+ readonly type: "activity-origin-mismatch";
83
83
  readonly activityId: URL;
84
84
  readonly actorIds: readonly URL[];
85
85
  } | {
@@ -88,7 +88,7 @@ type InboxAuthentication = {
88
88
  * for it, although its listener allows activities without an actor.
89
89
  * @since 2.5.0
90
90
  */
91
- readonly type: "noAuthenticatedPrincipal";
91
+ readonly type: "no-authenticated-principal";
92
92
  };
93
93
  } | {
94
94
  readonly status: "skipped";
@@ -1157,27 +1157,27 @@ interface InboxPrincipal {
1157
1157
  *
1158
1158
  * - `"actor"`: an actor whose ownership of the verifying key Fedify
1159
1159
  * confirmed with the actor's own document.
1160
- * - `"portableAuthority"`: a DID whose verification method made a valid
1160
+ * - `"portable-authority"`: a DID whose verification method made a valid
1161
1161
  * Object Integrity Proof. It authenticates the [FEP-ef61] portable
1162
1162
  * actors of that DID, and nothing else.
1163
1163
  *
1164
1164
  * [FEP-ef61]: https://w3id.org/fep/ef61
1165
1165
  */
1166
- readonly kind: "actor" | "portableAuthority";
1167
- /** The actor ID, or the DID if {@link kind} is `"portableAuthority"`. */
1166
+ readonly kind: "actor" | "portable-authority";
1167
+ /** The actor ID, or the DID if {@link kind} is `"portable-authority"`. */
1168
1168
  readonly id: URL;
1169
1169
  /**
1170
1170
  * How the principal was authenticated:
1171
1171
  *
1172
- * - `"httpSignatures"`: it signed the HTTP request.
1173
- * - `"linkedDataSignatures"`: it made the Linked Data Signature of the
1172
+ * - `"http-signatures"`: it signed the HTTP request.
1173
+ * - `"linked-data-signatures"`: it made the Linked Data Signature of the
1174
1174
  * activity.
1175
- * - `"objectIntegrityProofs"`: it made an Object Integrity Proof of the
1175
+ * - `"object-integrity-proofs"`: it made an Object Integrity Proof of the
1176
1176
  * activity.
1177
1177
  * - `"origin"`: the activity was fetched again from the actor's own web
1178
1178
  * origin, which happens only for `Context.routeActivity()`.
1179
1179
  */
1180
- readonly mechanism: "httpSignatures" | "linkedDataSignatures" | "objectIntegrityProofs" | "origin";
1180
+ readonly mechanism: "http-signatures" | "linked-data-signatures" | "object-integrity-proofs" | "origin";
1181
1181
  /** The key or verification method that authenticated the principal. */
1182
1182
  readonly keyId: URL | null;
1183
1183
  }
@@ -1287,12 +1287,13 @@ interface IsActorAuthenticatedOptions {
1287
1287
  declare function isActorAuthenticated(evidence: InboxAuthenticationEvidence, actorId: URL, options?: IsActorAuthenticatedOptions): boolean;
1288
1288
  /**
1289
1289
  * A {@link InboxPrincipal} as stored in a queued message.
1290
+ * The wire spellings remain independent of the public API spellings.
1290
1291
  * @internal
1291
1292
  */
1292
1293
  interface SerializedInboxPrincipal {
1293
- readonly kind: InboxPrincipal["kind"];
1294
+ readonly kind: "actor" | "portableAuthority";
1294
1295
  readonly id: string;
1295
- readonly mechanism: InboxPrincipal["mechanism"];
1296
+ readonly mechanism: "httpSignatures" | "linkedDataSignatures" | "objectIntegrityProofs" | "origin";
1296
1297
  readonly keyId: string | null;
1297
1298
  }
1298
1299
  /**
@@ -3,6 +3,6 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  //#region deno.json
5
5
  var name = "@fedify/fedify";
6
- var version = "2.5.0-dev.2492+4648c04e";
6
+ var version = "2.5.0-dev.2496+e18c05f8";
7
7
  //#endregion
8
8
  export { version as n, name as t };
@@ -1,8 +1,8 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { D as validateCryptoKey } from "./ld-CdvcOEXQ.mjs";
5
- import { r as doubleKnockScoped } from "./http-BoJCMnjY.mjs";
4
+ import { D as validateCryptoKey } from "./ld-DrQTMLaI.mjs";
5
+ import { r as doubleKnockScoped } from "./http-Bexcl2MP.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest, resolveDocumentLoaderTimeout, withDocumentLoaderTimeout } from "@fedify/vocab-runtime";
8
8
  import { curry } from "es-toolkit";
@@ -7,7 +7,7 @@ import { t as assertExists } from "../assert_exists-cffSpJ7X.mjs";
7
7
  import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
8
8
  import "../std__assert-DvMDRPes.mjs";
9
9
  import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
10
- import { r as createFederationBuilder } from "../builder-DphK9v7f.mjs";
10
+ import { r as createFederationBuilder } from "../builder-CUVoluZR.mjs";
11
11
  import { DisallowedOperatorError, DisallowedVarSpecModifierError, DuplicateRouteVariableError, RouteTemplateOptionsNotMatchedError, RouterError } from "@fedify/uri-template";
12
12
  import { Activity, Note, Person } from "@fedify/vocab";
13
13
  import { test } from "@fedify/fixture";
@@ -6,11 +6,11 @@ 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
8
  import { t as assert } from "../assert-D1Eafmd_.mjs";
9
- import { x as exportJwk } from "../ld-CdvcOEXQ.mjs";
9
+ import { x as exportJwk } from "../ld-DrQTMLaI.mjs";
10
10
  import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
11
- import { h as verifyProof, s as signObject } from "../proof-GH7Poos_.mjs";
11
+ import { h as verifyProof, s as signObject } from "../proof-CzS2dAmn.mjs";
12
12
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
13
- import { n as FederationImpl } from "../middleware-CoBLrTKX.mjs";
13
+ import { n as FederationImpl } from "../middleware-CREOtfQu.mjs";
14
14
  import { Create, DataIntegrityProof, Note } from "@fedify/vocab";
15
15
  import { exportDidKey, parseIri } from "@fedify/vocab-runtime";
16
16
  import { mockDocumentLoader, test } from "@fedify/fixture";
@@ -1,14 +1,14 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { r as createRequestContext, t as createInboxContext } from "../context-COHd1Rsh.mjs";
4
+ import { r as createRequestContext, t as createInboxContext } from "../context-A-Nde3u-.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 { a as compactJsonLd, h as verifyCompactJsonLd, m as signJsonLd } from "../ld-CdvcOEXQ.mjs";
9
- import { u as signRequest } from "../http-BoJCMnjY.mjs";
8
+ import { a as compactJsonLd, h as verifyCompactJsonLd, m as signJsonLd } from "../ld-DrQTMLaI.mjs";
9
+ import { u as signRequest } from "../http-Bexcl2MP.mjs";
10
10
  import { a as rsaPrivateKey3, c as rsaPublicKey3, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
11
- import { f as handleInbox, o as createFederation } from "../middleware-CoBLrTKX.mjs";
11
+ import { f as handleInbox, o as createFederation } from "../middleware-CREOtfQu.mjs";
12
12
  import { t as ActivityListenerSet } from "../activity-listener-CELFAodc.mjs";
13
13
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
14
14
  import { Create, CryptographicKey, Multikey, Person, Update } from "@fedify/vocab";
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-COHd1Rsh.mjs";
4
+ import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-A-Nde3u-.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 { t as assertGreaterOrEqual } from "../assert_greater_or_equal-BlafOF4-.mjs";
@@ -11,11 +11,11 @@ import "../std__assert-DvMDRPes.mjs";
11
11
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
12
12
  import { t as assert } from "../assert-D1Eafmd_.mjs";
13
13
  import { r as parseAcceptSignature } from "../accept-CPVqki78.mjs";
14
- import { T as generateCryptoKeyPair, a as compactJsonLd, m as signJsonLd } from "../ld-CdvcOEXQ.mjs";
15
- import { s as signObject } from "../proof-GH7Poos_.mjs";
16
- import { u as signRequest } from "../http-BoJCMnjY.mjs";
14
+ import { T as generateCryptoKeyPair, a as compactJsonLd, m as signJsonLd } from "../ld-DrQTMLaI.mjs";
15
+ import { s as signObject } from "../proof-CzS2dAmn.mjs";
16
+ import { u as signRequest } from "../http-Bexcl2MP.mjs";
17
17
  import { a as rsaPrivateKey3, c as rsaPublicKey3, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
18
- import { d as handleCustomCollection, f as handleInbox, g as respondWithObjectIfAcceptable, h as respondWithObject, l as handleActor, m as handleOutbox, o as createFederation, p as handleObject, u as handleCollection } from "../middleware-CoBLrTKX.mjs";
18
+ import { d as handleCustomCollection, f as handleInbox, g as respondWithObjectIfAcceptable, h as respondWithObject, l as handleActor, m as handleOutbox, o as createFederation, p as handleObject, u as handleCollection } from "../middleware-CREOtfQu.mjs";
19
19
  import { t as ActivityListenerSet } from "../activity-listener-CELFAodc.mjs";
20
20
  import { t as FedifySpanExporter } from "../exporter-DVG68ozH.mjs";
21
21
  import { configure, getLogger, reset, withContext } from "@logtape/logtape";
@@ -4940,6 +4940,7 @@ test("handleInbox() nonce consumption on valid signed request", async () => {
4940
4940
  });
4941
4941
  test("handleInbox() nonce replay prevention", async () => {
4942
4942
  const [meterProvider, recorder] = createTestMeterProvider();
4943
+ const [tracerProvider, spanExporter] = createTestTracerProvider();
4943
4944
  const activity = new Create({
4944
4945
  id: new URL("https://example.com/activities/nonce-3"),
4945
4946
  actor: new URL("https://example.com/person2"),
@@ -4962,7 +4963,8 @@ test("handleInbox() nonce replay prevention", async () => {
4962
4963
  const context = createRequestContext({
4963
4964
  federation: createFederation({
4964
4965
  kv: new MemoryKvStore(),
4965
- meterProvider
4966
+ meterProvider,
4967
+ tracerProvider
4966
4968
  }),
4967
4969
  request: signedRequest,
4968
4970
  url: new URL(signedRequest.url),
@@ -4998,6 +5000,7 @@ test("handleInbox() nonce replay prevention", async () => {
4998
5000
  signatureTimeWindow: { minutes: 5 },
4999
5001
  skipSignatureVerification: false,
5000
5002
  meterProvider,
5003
+ tracerProvider,
5001
5004
  inboxChallengePolicy: {
5002
5005
  enabled: true,
5003
5006
  requestNonce: true,
@@ -5011,6 +5014,7 @@ test("handleInbox() nonce replay prevention", async () => {
5011
5014
  reason: { type: "invalidNonce" }
5012
5015
  });
5013
5016
  assertEquals(report.attempts.at(-1)?.status, "verified");
5017
+ assertEquals(spanExporter.getSpans("activitypub.inbox")[0].attributes["activitypub.verification.failure_reason"], "invalidNonce");
5014
5018
  const acceptSig = response.headers.get("Accept-Signature");
5015
5019
  assert(acceptSig != null, "Must emit fresh Accept-Signature challenge");
5016
5020
  const parsed = parseAcceptSignature(acceptSig);
@@ -10,8 +10,8 @@ import "../std__assert-DvMDRPes.mjs";
10
10
  import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
11
11
  import { t as assert } from "../assert-D1Eafmd_.mjs";
12
12
  import { r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
13
- import { o as createFederation, x as parseHashlinkGatewayRequest } from "../middleware-CoBLrTKX.mjs";
14
- import { r as createFederationBuilder } from "../builder-DphK9v7f.mjs";
13
+ import { o as createFederation, x as parseHashlinkGatewayRequest } from "../middleware-CREOtfQu.mjs";
14
+ import { r as createFederationBuilder } from "../builder-CUVoluZR.mjs";
15
15
  import { n as RouterError } from "../router-u5O5KCQr.mjs";
16
16
  import { Note } from "@fedify/vocab";
17
17
  import { computeDigestMultibase, encodeMultibase, exportDidKey } from "@fedify/vocab-runtime";
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
4
4
  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
- import { s as signObject } from "../proof-GH7Poos_.mjs";
7
+ import { s as signObject } from "../proof-CzS2dAmn.mjs";
8
8
  import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
9
- import { o as createFederation } from "../middleware-CoBLrTKX.mjs";
9
+ import { o as createFederation } from "../middleware-CREOtfQu.mjs";
10
10
  import { Create, Follow, Person } from "@fedify/vocab";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  //#region src/federation/idempotency.test.ts
@@ -1,21 +1,22 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { a as isActorAuthenticated } from "../inbox-authentication-DflPYlLL.mjs";
4
+ import { a as isActorAuthenticated } from "../inbox-authentication-CgonVRkg.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 { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
8
8
  import "../std__assert-DvMDRPes.mjs";
9
9
  import { t as assert } from "../assert-D1Eafmd_.mjs";
10
- import { m as signJsonLd } from "../ld-CdvcOEXQ.mjs";
11
- import { s as signObject } from "../proof-GH7Poos_.mjs";
12
- import { u as signRequest } from "../http-BoJCMnjY.mjs";
13
- import { a as rsaPrivateKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
14
- import { o as createFederation } from "../middleware-CoBLrTKX.mjs";
15
- import { c as expandDocument } from "../inbox-view-D-skypg-.mjs";
16
- import { Create, FeatureRequest, Person } from "@fedify/vocab";
10
+ import { m as signJsonLd } from "../ld-DrQTMLaI.mjs";
11
+ import { s as signObject } from "../proof-CzS2dAmn.mjs";
12
+ import { u as signRequest } from "../http-Bexcl2MP.mjs";
13
+ import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
14
+ import { o as createFederation } from "../middleware-CREOtfQu.mjs";
15
+ import { c as expandDocument } from "../inbox-view-CXoRpTuL.mjs";
16
+ import { t as KvKeyCache } from "../keycache-N2opu4-3.mjs";
17
+ import { Create, CryptographicKey, FeatureRequest, Person } from "@fedify/vocab";
17
18
  import { FetchError, encodeMultibase, preloadedContexts } from "@fedify/vocab-runtime";
18
- import { mockDocumentLoader, test } from "@fedify/fixture";
19
+ import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
19
20
  import serialize from "json-canon";
20
21
  //#region src/federation/inbox-actorless.test.ts
21
22
  const SIGNER = new URL("https://example.com/person2");
@@ -54,6 +55,8 @@ var CapturingQueue = class {
54
55
  };
55
56
  function setup(options = {}) {
56
57
  const received = [];
58
+ const reports = [];
59
+ const [tracerProvider, spanExporter] = createTestTracerProvider();
57
60
  let mutableLoads = 0;
58
61
  const loader = async (url, loaderOptions) => {
59
62
  options.contextLoads?.push(url);
@@ -90,7 +93,8 @@ function setup(options = {}) {
90
93
  return await mockDocumentLoader(url, loaderOptions);
91
94
  };
92
95
  const federation = createFederation({
93
- kv: new MemoryKvStore(),
96
+ kv: options.kv ?? new MemoryKvStore(),
97
+ tracerProvider,
94
98
  documentLoaderFactory: () => loader,
95
99
  contextLoaderFactory: () => loader,
96
100
  authenticatedDocumentLoaderFactory: () => loader,
@@ -114,10 +118,14 @@ function setup(options = {}) {
114
118
  authentication: ctx.authentication,
115
119
  rawActivity: ctx.activity
116
120
  });
117
- }, { allowActorless: options.allowActorless ?? true }).on(Create, () => {});
121
+ }, { allowActorless: options.allowActorless ?? true }).on(Create, () => {}).onRequestFinished((_ctx, report) => {
122
+ reports.push(report);
123
+ });
118
124
  return {
119
125
  federation,
120
- received
126
+ received,
127
+ reports,
128
+ spanExporter
121
129
  };
122
130
  }
123
131
  function post(body) {
@@ -201,7 +209,7 @@ test("Actorless FeatureRequest authenticated by HTTP Signatures", async () => {
201
209
  ]), [[
202
210
  "actor",
203
211
  SIGNER.href,
204
- "httpSignatures"
212
+ "http-signatures"
205
213
  ]]);
206
214
  assert(isActorAuthenticated(authentication, SIGNER));
207
215
  assertFalse(isActorAuthenticated(authentication, SIGNER, { scope: "document" }));
@@ -212,7 +220,7 @@ test("Actorless FeatureRequest authenticated by Linked Data Signatures", async (
212
220
  const document = await withLds(featureRequestDocument());
213
221
  assertEquals((await federation.fetch(post(document), { contextData: void 0 })).status, 202);
214
222
  assertEquals(received.length, 1);
215
- assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "linkedDataSignatures"]]);
223
+ assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "linked-data-signatures"]]);
216
224
  assertEquals(received[0].rawActivity, document);
217
225
  });
218
226
  test("Actorless FeatureRequest authenticated by Object Integrity Proofs", async () => {
@@ -228,7 +236,7 @@ test("Actorless FeatureRequest authenticated by Object Integrity Proofs", async
228
236
  ]), [[
229
237
  "actor",
230
238
  SIGNER.href,
231
- "objectIntegrityProofs",
239
+ "object-integrity-proofs",
232
240
  ED25519_KEY.href
233
241
  ]]);
234
242
  });
@@ -245,9 +253,36 @@ test("Actorless activities need an authenticated principal", async () => {
245
253
  assertEquals(received, []);
246
254
  });
247
255
  test("Actorless activities need the same origin as their signer", async () => {
248
- const { federation, received } = setup();
256
+ const { federation, received, reports, spanExporter } = setup();
249
257
  assertEquals((await federation.fetch(await postSigned(featureRequestDocument({ id: "https://other.example/requests/1" })), { contextData: void 0 })).status, 401);
250
258
  assertEquals(received, []);
259
+ assertEquals(reports[0].authentication, {
260
+ status: "rejected",
261
+ reason: {
262
+ type: "activity-origin-mismatch",
263
+ activityId: new URL("https://other.example/requests/1"),
264
+ actorIds: [SIGNER]
265
+ }
266
+ });
267
+ assertEquals(spanExporter.getSpans("activitypub.inbox")[0].attributes["activitypub.verification.failure_reason"], "activity-origin-mismatch");
268
+ });
269
+ test("Actorless activities reject a verified key with no authenticated principal", async () => {
270
+ const kv = new MemoryKvStore();
271
+ await new KvKeyCache(kv, ["_fedify", "publicKey"], { contextLoader: mockDocumentLoader }).set(RSA_KEY, new CryptographicKey({
272
+ id: RSA_KEY,
273
+ publicKey: rsaPublicKey3.publicKey
274
+ }));
275
+ const { federation, received, reports, spanExporter } = setup({ kv });
276
+ const response = await federation.fetch(await postSigned(featureRequestDocument()), { contextData: void 0 });
277
+ assertEquals(response.status, 401);
278
+ assertEquals(await response.text(), "No principal is authenticated for the activity.");
279
+ assertEquals(received, []);
280
+ assertEquals(reports[0].authentication, {
281
+ status: "rejected",
282
+ reason: { type: "no-authenticated-principal" }
283
+ });
284
+ assertEquals(reports[0].attempts.at(-1)?.status, "verified");
285
+ assertEquals(spanExporter.getSpans("activitypub.inbox")[0].attributes["activitypub.verification.failure_reason"], "no-authenticated-principal");
251
286
  });
252
287
  for (const [label, actor] of [
253
288
  ["an anonymous actor", {
@@ -372,7 +407,7 @@ test("Activities with an actor expose their evidence", async () => {
372
407
  p.keyId?.href
373
408
  ]), [[
374
409
  SIGNER.href,
375
- "httpSignatures",
410
+ "http-signatures",
376
411
  RSA_KEY.href
377
412
  ]]);
378
413
  });
@@ -382,7 +417,7 @@ test("An author's proof is preferred to a relay's Linked Data Signature", async
382
417
  const document = await signJsonLd(await withRawProof(featureRequestDocument()), rsaPrivateKey2, relayKey, { contextLoader: mockDocumentLoader });
383
418
  assertEquals((await federation.fetch(post(document), { contextData: void 0 })).status, 202);
384
419
  assertEquals(received.length, 1);
385
- assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "objectIntegrityProofs"]]);
420
+ assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "object-integrity-proofs"]]);
386
421
  });
387
422
  test("A proof that cannot be verified for now is not superseded", async () => {
388
423
  const { federation, received } = setup({ unavailable: ["https://example.com/person2", "https://example.com/person2#key4"] });
@@ -404,7 +439,7 @@ test("Context.routeActivity() exposes the evidence of verified proofs", async ()
404
439
  });
405
440
  assert(await federation.createContext(new URL("https://example.com/"), void 0).routeActivity("alice", activity));
406
441
  assertEquals(received.length, 1);
407
- assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "objectIntegrityProofs"]]);
442
+ assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "object-integrity-proofs"]]);
408
443
  assertEquals(received[0].authentication.originAuthenticated, []);
409
444
  });
410
445
  test("An author's aliased proof is preferred to a relay's signature", async () => {
@@ -412,7 +447,7 @@ test("An author's aliased proof is preferred to a relay's signature", async () =
412
447
  const document = await signJsonLd(await withRawProof(featureRequestDocument(), "integrity"), rsaPrivateKey2, RELAY_KEY, { contextLoader: mockDocumentLoader });
413
448
  assertEquals((await federation.fetch(post(document), { contextData: void 0 })).status, 202);
414
449
  assertEquals(received.length, 1);
415
- assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "objectIntegrityProofs"]]);
450
+ assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "object-integrity-proofs"]]);
416
451
  });
417
452
  for (const queued of [false, true]) test(`Context.routeActivity() keeps the fetched interpretation (queued: ${queued})`, async () => {
418
453
  const queue = queued ? new CapturingQueue() : void 0;