@fedify/fedify 2.3.0-dev.1021 → 2.3.0-dev.1034

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 (95) hide show
  1. package/dist/{builder-Nn2r1dKd.mjs → builder-y06Dq5bp.mjs} +3 -3
  2. package/dist/chunk-QSgtlS85.mjs +29 -0
  3. package/dist/compat/mod.d.cts +1 -1
  4. package/dist/compat/mod.d.ts +1 -1
  5. package/dist/compat/outgoing-jsonld.test.mjs +1 -1
  6. package/dist/compat/public-audience.test.mjs +1 -1
  7. package/dist/compat/transformers.test.mjs +2 -2
  8. package/dist/{context-Dk_tacqz.mjs → context-7Azky82W.mjs} +3 -2
  9. package/dist/{context-Bxs4cdIZ.d.cts → context-BKLGj9QO.d.cts} +12 -1
  10. package/dist/{context-CVNXcFHR.d.ts → context-DrNqYkPw.d.ts} +12 -1
  11. package/dist/{deno-BnQyJ03o.mjs → deno-DB1H1VHx.mjs} +1 -1
  12. package/dist/{docloader-mEJ3hsMB.mjs → docloader-3HwiWeYL.mjs} +2 -2
  13. package/dist/{esm-DVILvP5e.mjs → esm-DhnRLoG9.mjs} +1 -24
  14. package/dist/execAsync-eck5rbtb.mjs +13 -0
  15. package/dist/federation/builder.test.mjs +2 -2
  16. package/dist/federation/collection.test.mjs +1 -1
  17. package/dist/federation/handler.test.mjs +48 -11
  18. package/dist/federation/idempotency.test.mjs +4 -4
  19. package/dist/federation/inbox.test.mjs +1 -1
  20. package/dist/federation/keycache.test.mjs +2 -2
  21. package/dist/federation/kv.test.mjs +1 -1
  22. package/dist/federation/middleware.test.mjs +103 -12
  23. package/dist/federation/mod.cjs +1 -1
  24. package/dist/federation/mod.d.cts +2 -2
  25. package/dist/federation/mod.d.ts +2 -2
  26. package/dist/federation/mod.js +1 -1
  27. package/dist/federation/negotiation.test.mjs +1 -1
  28. package/dist/federation/retry.test.mjs +1 -1
  29. package/dist/federation/send.test.mjs +4540 -11
  30. package/dist/federation/webfinger.test.mjs +3 -3
  31. package/dist/getMachineId-bsd-DqZ4QRFp.mjs +29 -0
  32. package/dist/getMachineId-darwin-DMbbW3m7.mjs +26 -0
  33. package/dist/getMachineId-linux-lyeD2ug3.mjs +22 -0
  34. package/dist/getMachineId-unsupported-JuKr57jY.mjs +17 -0
  35. package/dist/getMachineId-win-Dxyf5pJq.mjs +28 -0
  36. package/dist/{http-BJ-t29n_.js → http-BUr93aO6.js} +1 -1
  37. package/dist/{http-CfToB_iu.mjs → http-D9zG-L9N.mjs} +3 -3
  38. package/dist/{http-D4xMqSqO.cjs → http-FnUTcdMf.cjs} +1 -1
  39. package/dist/{key-CeANlo1H.mjs → key-CV57mOYH.mjs} +1 -1
  40. package/dist/{kv-cache-DRwOjOkl.cjs → kv-cache-BG9O8wVV.cjs} +1 -1
  41. package/dist/{kv-cache-B142kDZL.js → kv-cache-C3esyJFP.js} +1 -1
  42. package/dist/{ld-CUlVC-TS.mjs → ld-sUf94RJ8.mjs} +2 -2
  43. package/dist/{middleware-I5XEZ_pZ.cjs → middleware-CKkBrsOD.cjs} +185 -27
  44. package/dist/{middleware-Cgy7UwfR.mjs → middleware-cMxbPxDe.mjs} +1 -1
  45. package/dist/{middleware-CysDkaXo.js → middleware-fAuUxD9-.js} +185 -27
  46. package/dist/{middleware-ASvK22Do.cjs → middleware-ohzkLsW4.cjs} +1 -1
  47. package/dist/{middleware-BPZEcrMG.mjs → middleware-pb2EqN_r.mjs} +67 -22
  48. package/dist/{mod-Bc6p4npy.d.ts → mod-B8Z8mBLk.d.ts} +1 -1
  49. package/dist/{mod-zA6NZHUG.d.cts → mod-DClCOv0M.d.cts} +1 -1
  50. package/dist/mod.cjs +4 -4
  51. package/dist/mod.d.cts +2 -2
  52. package/dist/mod.d.ts +2 -2
  53. package/dist/mod.js +4 -4
  54. package/dist/nodeinfo/client.test.mjs +2 -2
  55. package/dist/nodeinfo/handler.test.mjs +3 -3
  56. package/dist/nodeinfo/types.test.mjs +1 -1
  57. package/dist/otel/exporter.test.mjs +25 -22
  58. package/dist/otel/mod.cjs +6 -5
  59. package/dist/otel/mod.d.cts +3 -2
  60. package/dist/otel/mod.d.ts +3 -2
  61. package/dist/otel/mod.js +6 -5
  62. package/dist/{outgoing-jsonld-CNmZLixq.mjs → outgoing-jsonld-Bi7n-dEy.mjs} +1 -1
  63. package/dist/{owner-CuW0S2XY.mjs → owner-DsPgl527.mjs} +2 -2
  64. package/dist/{proof-oGiWJkX0.cjs → proof-BhJpq_J9.cjs} +1 -1
  65. package/dist/{proof-CFPGr1xC.mjs → proof-iVfYyJpY.mjs} +4 -4
  66. package/dist/{proof-CtMmqa09.js → proof-k4mEvvdS.js} +1 -1
  67. package/dist/send-D-vYdfC6.mjs +306 -0
  68. package/dist/sig/accept.test.mjs +1 -1
  69. package/dist/sig/http.test.mjs +4 -4
  70. package/dist/sig/key.test.mjs +2 -2
  71. package/dist/sig/ld.test.mjs +3 -3
  72. package/dist/sig/mod.cjs +2 -2
  73. package/dist/sig/mod.js +2 -2
  74. package/dist/sig/owner.test.mjs +2 -2
  75. package/dist/sig/proof.test.mjs +3 -3
  76. package/dist/testing/mod.d.mts +6 -1
  77. package/dist/testing/mod.mjs +1 -1
  78. package/dist/utils/docloader.test.mjs +4 -4
  79. package/dist/utils/kv-cache.test.mjs +1 -1
  80. package/dist/utils/mod.cjs +1 -1
  81. package/dist/utils/mod.js +1 -1
  82. package/package.json +7 -6
  83. package/dist/send-dhl-s8G0.mjs +0 -193
  84. /package/dist/{accept-CPkZzmGN.mjs → accept-CceiKpCy.mjs} +0 -0
  85. /package/dist/{activity-listener-ell7W1s9.mjs → activity-listener-tztVvlNb.mjs} +0 -0
  86. /package/dist/{client-D_1QpnWt.mjs → client-CIiz1WX7.mjs} +0 -0
  87. /package/dist/{collection-D-HqUuA2.mjs → collection-CA3V5zyK.mjs} +0 -0
  88. /package/dist/{keycache-EGATflN-.mjs → keycache-BeU0LCII.mjs} +0 -0
  89. /package/dist/{keys-DGu1NFwu.mjs → keys-C3kae-6B.mjs} +0 -0
  90. /package/dist/{kv-cache-U__xU4qR.mjs → kv-cache-Bmv7tUzz.mjs} +0 -0
  91. /package/dist/{kv-rV3vodCc.mjs → kv-x2IvBUyq.mjs} +0 -0
  92. /package/dist/{negotiation-SQvQgUqe.mjs → negotiation-VnHNB0Q5.mjs} +0 -0
  93. /package/dist/{public-audience-DYFHzm_c.mjs → public-audience-PVTwU_Ex.mjs} +0 -0
  94. /package/dist/{retry-bMXBL97A.mjs → retry-_VvV0h9f.mjs} +0 -0
  95. /package/dist/{types-J53Kw7so.mjs → types-BFowWFTT.mjs} +0 -0
@@ -2,8 +2,8 @@ import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { n as RouterError, t as Router } from "./router-CrMLXoOr.mjs";
5
- import { n as version, t as name } from "./deno-BnQyJ03o.mjs";
6
- import { t as ActivityListenerSet } from "./activity-listener-ell7W1s9.mjs";
5
+ import { n as version, t as name } from "./deno-DB1H1VHx.mjs";
6
+ import { t as ActivityListenerSet } from "./activity-listener-tztVvlNb.mjs";
7
7
  import { Tombstone, getTypeId } from "@fedify/vocab";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
9
9
  import { getLogger } from "@logtape/logtape";
@@ -59,7 +59,7 @@ var FederationBuilderImpl = class {
59
59
  this.collectionTypeIds = {};
60
60
  }
61
61
  async build(options) {
62
- const { FederationImpl } = await import("./middleware-Cgy7UwfR.mjs");
62
+ const { FederationImpl } = await import("./middleware-cMxbPxDe.mjs");
63
63
  const f = new FederationImpl(options);
64
64
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
65
65
  f.router = this.router.clone();
@@ -0,0 +1,29 @@
1
+ import "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { createRequire } from "node:module";
5
+ //#region \0rolldown/runtime.js
6
+ var __create = Object.create;
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __getOwnPropNames = Object.getOwnPropertyNames;
10
+ var __getProtoOf = Object.getPrototypeOf;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
+ key = keys[i];
16
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: ((k) => from[k]).bind(null, key),
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
28
+ //#endregion
29
+ export { __require as n, __toESM as r, __commonJSMin as t };
@@ -1,4 +1,4 @@
1
- import { kt as ActivityTransformer, n as Context } from "../context-Bxs4cdIZ.cjs";
1
+ import { kt as ActivityTransformer, n as Context } from "../context-BKLGj9QO.cjs";
2
2
  import { Activity } from "@fedify/vocab";
3
3
 
4
4
  //#region src/compat/transformers.d.ts
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { kt as ActivityTransformer, n as Context } from "../context-CVNXcFHR.js";
3
+ import { kt as ActivityTransformer, n as Context } from "../context-DrNqYkPw.js";
4
4
  import { Activity } from "@fedify/vocab";
5
5
 
6
6
  //#region src/compat/transformers.d.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertStrictEquals } from "../assert_strict_equals-Dmjbg-bA.mjs";
6
- import { n as normalizeAttachmentArrays, r as normalizeOutgoingActivityJsonLd, t as isPreloadedContextAttachmentSafe } from "../outgoing-jsonld-CNmZLixq.mjs";
6
+ import { n as normalizeAttachmentArrays, r as normalizeOutgoingActivityJsonLd, t as isPreloadedContextAttachmentSafe } from "../outgoing-jsonld-Bi7n-dEy.mjs";
7
7
  import { mockDocumentLoader, test } from "@fedify/fixture";
8
8
  import { Create, Document, Note, PUBLIC_COLLECTION } from "@fedify/vocab";
9
9
  //#region src/compat/outgoing-jsonld.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
6
- import { t as normalizePublicAudience } from "../public-audience-DYFHzm_c.mjs";
6
+ import { t as normalizePublicAudience } from "../public-audience-PVTwU_Ex.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  import { Create, Note, PUBLIC_COLLECTION } from "@fedify/vocab";
9
9
  import { getDocumentLoader, preloadedContexts } from "@fedify/vocab-runtime";
@@ -4,8 +4,8 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
6
6
  import { t as assert } from "../assert-DikXweDx.mjs";
7
- import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
8
- import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-BPZEcrMG.mjs";
7
+ import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
8
+ import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-pb2EqN_r.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  import { Follow, Person } from "@fedify/vocab";
11
11
  //#region src/compat/transformers.test.ts
@@ -5,10 +5,10 @@ import { n as RouterError } from "./router-CrMLXoOr.mjs";
5
5
  import { mockDocumentLoader } from "@fedify/fixture";
6
6
  import { lookupObject, traverseCollection } from "@fedify/vocab";
7
7
  import { lookupWebFinger } from "@fedify/webfinger";
8
- import { trace } from "@opentelemetry/api";
8
+ import { metrics, trace } from "@opentelemetry/api";
9
9
  //#region src/testing/context.ts
10
10
  function createContext(values) {
11
- const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, tracerProvider, clone, getNodeInfoUri, getActorUri, getObjectUri, getCollectionUri, getOutboxUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger: lookupWebFinger$1, sendActivity, routeActivity } = values;
11
+ const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, meterProvider, tracerProvider, clone, getNodeInfoUri, getActorUri, getObjectUri, getCollectionUri, getOutboxUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger: lookupWebFinger$1, sendActivity, routeActivity } = values;
12
12
  function throwRouterError() {
13
13
  throw new RouterError("Not implemented");
14
14
  }
@@ -21,6 +21,7 @@ function createContext(values) {
21
21
  hostname: url.hostname,
22
22
  documentLoader: documentLoader ?? mockDocumentLoader,
23
23
  contextLoader: contextLoader ?? mockDocumentLoader,
24
+ meterProvider: meterProvider ?? metrics.getMeterProvider(),
24
25
  tracerProvider: tracerProvider ?? trace.getTracerProvider(),
25
26
  clone: clone ?? ((data) => createContext({
26
27
  ...values,
@@ -5,7 +5,7 @@ import { n as KvStore, t as KvKey } from "./kv-CbLNp3zQ.cjs";
5
5
  import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, Tombstone, TraverseCollectionOptions } from "@fedify/vocab";
6
6
  import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
7
7
  import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
8
- import { Span, Tracer, TracerProvider } from "@opentelemetry/api";
8
+ import { MeterProvider, Span, Tracer, TracerProvider } from "@opentelemetry/api";
9
9
 
10
10
  //#region src/compat/types.d.ts
11
11
  /**
@@ -1634,6 +1634,12 @@ interface FederationOptions<TContextData> {
1634
1634
  * @since 1.3.0
1635
1635
  */
1636
1636
  tracerProvider?: TracerProvider;
1637
+ /**
1638
+ * The OpenTelemetry meter provider for recording metrics. If not provided,
1639
+ * the default global meter provider is used.
1640
+ * @since 2.3.0
1641
+ */
1642
+ meterProvider?: MeterProvider;
1637
1643
  }
1638
1644
  /**
1639
1645
  * Additional settings for the actor dispatcher.
@@ -2051,6 +2057,11 @@ interface Context<TContextData> {
2051
2057
  */
2052
2058
  readonly tracerProvider: TracerProvider;
2053
2059
  /**
2060
+ * The OpenTelemetry meter provider.
2061
+ * @since 2.3.0
2062
+ */
2063
+ readonly meterProvider?: MeterProvider;
2064
+ /**
2054
2065
  * The document loader for loading remote JSON-LD documents.
2055
2066
  */
2056
2067
  readonly documentLoader: DocumentLoader;
@@ -5,7 +5,7 @@ import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from
5
5
  import { n as GetKeyOwnerOptions } from "./owner-74ARJ5TL.js";
6
6
  import { n as KvStore, t as KvKey } from "./kv-GFYnFoOl.js";
7
7
  import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, Tombstone, TraverseCollectionOptions } from "@fedify/vocab";
8
- import { Span, Tracer, TracerProvider } from "@opentelemetry/api";
8
+ import { MeterProvider, Span, Tracer, TracerProvider } from "@opentelemetry/api";
9
9
  import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
10
10
  import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
11
11
 
@@ -1636,6 +1636,12 @@ interface FederationOptions<TContextData> {
1636
1636
  * @since 1.3.0
1637
1637
  */
1638
1638
  tracerProvider?: TracerProvider;
1639
+ /**
1640
+ * The OpenTelemetry meter provider for recording metrics. If not provided,
1641
+ * the default global meter provider is used.
1642
+ * @since 2.3.0
1643
+ */
1644
+ meterProvider?: MeterProvider;
1639
1645
  }
1640
1646
  /**
1641
1647
  * Additional settings for the actor dispatcher.
@@ -2053,6 +2059,11 @@ interface Context<TContextData> {
2053
2059
  */
2054
2060
  readonly tracerProvider: TracerProvider;
2055
2061
  /**
2062
+ * The OpenTelemetry meter provider.
2063
+ * @since 2.3.0
2064
+ */
2065
+ readonly meterProvider?: MeterProvider;
2066
+ /**
2056
2067
  * The document loader for loading remote JSON-LD documents.
2057
2068
  */
2058
2069
  readonly documentLoader: DocumentLoader;
@@ -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.3.0-dev.1021+ab2fa4a9";
6
+ var version = "2.3.0-dev.1034+b85b5daa";
7
7
  //#endregion
8
8
  export { version as n, name as t };
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { o as validateCryptoKey } from "./key-CeANlo1H.mjs";
5
- import { n as doubleKnock } from "./http-CfToB_iu.mjs";
4
+ import { o as validateCryptoKey } from "./key-CV57mOYH.mjs";
5
+ import { n as doubleKnock } from "./http-D9zG-L9N.mjs";
6
6
  import { curry } from "es-toolkit";
7
7
  import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
8
8
  import { getLogger } from "@logtape/logtape";
@@ -1,30 +1,7 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import "node:module";
5
- //#region \0rolldown/runtime.js
6
- var __create = Object.create;
7
- var __defProp = Object.defineProperty;
8
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
- var __getOwnPropNames = Object.getOwnPropertyNames;
10
- var __getProtoOf = Object.getPrototypeOf;
11
- var __hasOwnProp = Object.prototype.hasOwnProperty;
12
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
- key = keys[i];
16
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
- get: ((k) => from[k]).bind(null, key),
18
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
- });
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
- value: mod,
25
- enumerable: true
26
- }) : target, mod));
27
- //#endregion
4
+ import { r as __toESM, t as __commonJSMin } from "./chunk-QSgtlS85.mjs";
28
5
  //#region ../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js
29
6
  var require_glob_to_regexp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30
7
  module.exports = function(glob, opts) {
@@ -0,0 +1,13 @@
1
+ import "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { n as __require, t as __commonJSMin } from "./chunk-QSgtlS85.mjs";
5
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.5.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js
6
+ var require_execAsync = /* @__PURE__ */ __commonJSMin(((exports) => {
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.execAsync = void 0;
9
+ const child_process = __require("child_process");
10
+ exports.execAsync = __require("util").promisify(child_process.exec);
11
+ }));
12
+ //#endregion
13
+ export { require_execAsync as t };
@@ -5,8 +5,8 @@ import { n as RouterError } from "../router-CrMLXoOr.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import { i as assertExists } from "../std__assert-CRDpx_HF.mjs";
7
7
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
8
- import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
9
- import { r as createFederationBuilder } from "../builder-Nn2r1dKd.mjs";
8
+ import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
9
+ import { r as createFederationBuilder } from "../builder-y06Dq5bp.mjs";
10
10
  import { test } from "@fedify/fixture";
11
11
  import { Activity, Note, Person } from "@fedify/vocab";
12
12
  //#region src/federation/builder.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import "../std__assert-CRDpx_HF.mjs";
6
- import { n as digest, t as buildCollectionSynchronizationHeader } from "../collection-D-HqUuA2.mjs";
6
+ import { n as digest, t as buildCollectionSynchronizationHeader } from "../collection-CA3V5zyK.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  import { decodeHex } from "byte-encodings/hex";
9
9
  //#region src/federation/collection.test.ts
@@ -1,18 +1,18 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-Dk_tacqz.mjs";
4
+ import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-7Azky82W.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
- import "../std__assert-CRDpx_HF.mjs";
6
+ import { r as assertGreaterOrEqual } from "../std__assert-CRDpx_HF.mjs";
7
7
  import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
8
8
  import { t as assert } from "../assert-DikXweDx.mjs";
9
- import { r as parseAcceptSignature } from "../accept-CPkZzmGN.mjs";
10
- import { s as signRequest } from "../http-CfToB_iu.mjs";
11
- import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-DGu1NFwu.mjs";
12
- import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
13
- import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-BPZEcrMG.mjs";
14
- import { t as ActivityListenerSet } from "../activity-listener-ell7W1s9.mjs";
15
- import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
9
+ import { r as parseAcceptSignature } from "../accept-CceiKpCy.mjs";
10
+ import { s as signRequest } from "../http-D9zG-L9N.mjs";
11
+ import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-C3kae-6B.mjs";
12
+ import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
13
+ import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-pb2EqN_r.mjs";
14
+ import { t as ActivityListenerSet } from "../activity-listener-tztVvlNb.mjs";
15
+ import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
16
16
  import { Activity, Create, Note, Person, Tombstone } from "@fedify/vocab";
17
17
  import { FetchError } from "@fedify/vocab-runtime";
18
18
  //#region src/federation/handler.test.ts
@@ -1910,9 +1910,11 @@ test("handleCustomCollection()", async () => {
1910
1910
  });
1911
1911
  test("handleInbox() records OpenTelemetry span events", async () => {
1912
1912
  const [tracerProvider, exporter] = createTestTracerProvider();
1913
+ const [meterProvider, recorder] = createTestMeterProvider();
1913
1914
  const kv = new MemoryKvStore();
1914
1915
  const federation = createFederation({
1915
1916
  kv,
1917
+ meterProvider,
1916
1918
  tracerProvider
1917
1919
  });
1918
1920
  const activity = new Create({
@@ -1974,6 +1976,7 @@ test("handleInbox() records OpenTelemetry span events", async () => {
1974
1976
  onNotFound: (_request) => new Response("Not found", { status: 404 }),
1975
1977
  signatureTimeWindow: false,
1976
1978
  skipSignatureVerification: true,
1979
+ meterProvider,
1977
1980
  tracerProvider
1978
1981
  })).status, 202);
1979
1982
  assert(receivedActivity != null);
@@ -1992,12 +1995,19 @@ test("handleInbox() records OpenTelemetry span events", async () => {
1992
1995
  const recordedActivity = JSON.parse(event.attributes["activitypub.activity.json"]);
1993
1996
  assertEquals(recordedActivity.id, "https://example.com/activity");
1994
1997
  assertEquals(recordedActivity.type, "Create");
1998
+ const durations = recorder.getMeasurements("activitypub.inbox.processing_duration");
1999
+ assertEquals(durations.length, 1);
2000
+ assertEquals(durations[0].type, "histogram");
2001
+ assertGreaterOrEqual(durations[0].value, 0);
2002
+ assertEquals(durations[0].attributes["activitypub.activity.type"], "https://www.w3.org/ns/activitystreams#Create");
1995
2003
  });
1996
2004
  test("handleInbox() records unverified HTTP signature details", async () => {
1997
2005
  const [tracerProvider, exporter] = createTestTracerProvider();
2006
+ const [meterProvider, recorder] = createTestMeterProvider();
1998
2007
  const kv = new MemoryKvStore();
1999
2008
  const federation = createFederation({
2000
2009
  kv,
2010
+ meterProvider,
2001
2011
  tracerProvider
2002
2012
  });
2003
2013
  const keyId = new URL("https://gone.example/users/someone#main-key");
@@ -2062,6 +2072,7 @@ test("handleInbox() records unverified HTTP signature details", async () => {
2062
2072
  onNotFound: (_request) => new Response("Not found", { status: 404 }),
2063
2073
  signatureTimeWindow: false,
2064
2074
  skipSignatureVerification: false,
2075
+ meterProvider,
2065
2076
  tracerProvider
2066
2077
  })).status, 202);
2067
2078
  const verifySpans = exporter.getSpans("http_signatures.verify");
@@ -2074,6 +2085,12 @@ test("handleInbox() records unverified HTTP signature details", async () => {
2074
2085
  assert(event.attributes != null);
2075
2086
  assertEquals(event.attributes["http_signatures.failure_reason"], "keyFetchError");
2076
2087
  assertEquals(event.attributes["http_signatures.key_fetch_status"], 410);
2088
+ const failures = recorder.getMeasurements("activitypub.signature.verification_failure");
2089
+ assertEquals(failures.length, 1);
2090
+ assertEquals(failures[0].type, "counter");
2091
+ assertEquals(failures[0].value, 1);
2092
+ assertEquals(failures[0].attributes["activitypub.remote.host"], "gone.example");
2093
+ assertEquals(failures[0].attributes["activitypub.verification.failure_reason"], "keyFetchError");
2077
2094
  });
2078
2095
  test("handleInbox() challenge policy enabled + unsigned request", async () => {
2079
2096
  const activity = new Create({
@@ -2476,6 +2493,7 @@ test("handleInbox() nonce consumption on valid signed request", async () => {
2476
2493
  ]), void 0, "Nonce must be consumed after use");
2477
2494
  });
2478
2495
  test("handleInbox() nonce replay prevention", async () => {
2496
+ const [meterProvider, recorder] = createTestMeterProvider();
2479
2497
  const activity = new Create({
2480
2498
  id: new URL("https://example.com/activities/nonce-3"),
2481
2499
  actor: new URL("https://example.com/person2"),
@@ -2496,7 +2514,10 @@ test("handleInbox() nonce replay prevention", async () => {
2496
2514
  rfc9421: { nonce }
2497
2515
  });
2498
2516
  const context = createRequestContext({
2499
- federation: createFederation({ kv: new MemoryKvStore() }),
2517
+ federation: createFederation({
2518
+ kv: new MemoryKvStore(),
2519
+ meterProvider
2520
+ }),
2500
2521
  request: signedRequest,
2501
2522
  url: new URL(signedRequest.url),
2502
2523
  data: void 0,
@@ -2526,6 +2547,7 @@ test("handleInbox() nonce replay prevention", async () => {
2526
2547
  onNotFound: () => new Response("Not found", { status: 404 }),
2527
2548
  signatureTimeWindow: { minutes: 5 },
2528
2549
  skipSignatureVerification: false,
2550
+ meterProvider,
2529
2551
  inboxChallengePolicy: {
2530
2552
  enabled: true,
2531
2553
  requestNonce: true,
@@ -2540,6 +2562,11 @@ test("handleInbox() nonce replay prevention", async () => {
2540
2562
  assert(parsed[0].parameters.nonce != null, "Fresh challenge must include a new nonce");
2541
2563
  assert(parsed[0].parameters.nonce !== nonce, "Fresh nonce must differ from the replayed one");
2542
2564
  assertEquals(response.headers.get("Cache-Control"), "no-store", "Challenge response must have Cache-Control: no-store");
2565
+ const failures = recorder.getMeasurements("activitypub.signature.verification_failure");
2566
+ assertEquals(failures.length, 1);
2567
+ assertEquals(failures[0].value, 1);
2568
+ assertEquals(failures[0].attributes["activitypub.remote.host"], "example.com");
2569
+ assertEquals(failures[0].attributes["activitypub.verification.failure_reason"], "invalidNonce");
2543
2570
  });
2544
2571
  test("handleInbox() nonce bypass: valid sig without nonce + invalid sig with nonce", async () => {
2545
2572
  const activity = new Create({
@@ -2619,6 +2646,7 @@ test("handleInbox() nonce bypass: valid sig without nonce + invalid sig with non
2619
2646
  ]), true, "Nonce must not be consumed when it comes from a non-verified signature");
2620
2647
  });
2621
2648
  test("handleInbox() actor/key mismatch does not consume nonce", async () => {
2649
+ const [meterProvider, recorder] = createTestMeterProvider();
2622
2650
  const maliciousActivity = new Create({
2623
2651
  id: new URL("https://attacker.example.com/activities/mismatch-nonce-1"),
2624
2652
  actor: new URL("https://victim.example.com/users/alice"),
@@ -2644,7 +2672,10 @@ test("handleInbox() actor/key mismatch does not consume nonce", async () => {
2644
2672
  rfc9421: { nonce }
2645
2673
  });
2646
2674
  const context = createRequestContext({
2647
- federation: createFederation({ kv: new MemoryKvStore() }),
2675
+ federation: createFederation({
2676
+ kv: new MemoryKvStore(),
2677
+ meterProvider
2678
+ }),
2648
2679
  request: maliciousRequest,
2649
2680
  url: new URL(maliciousRequest.url),
2650
2681
  data: void 0,
@@ -2674,6 +2705,7 @@ test("handleInbox() actor/key mismatch does not consume nonce", async () => {
2674
2705
  onNotFound: () => new Response("Not found", { status: 404 }),
2675
2706
  signatureTimeWindow: { minutes: 5 },
2676
2707
  skipSignatureVerification: false,
2708
+ meterProvider,
2677
2709
  inboxChallengePolicy: {
2678
2710
  enabled: true,
2679
2711
  requestNonce: true,
@@ -2687,6 +2719,11 @@ test("handleInbox() actor/key mismatch does not consume nonce", async () => {
2687
2719
  "acceptSignatureNonce",
2688
2720
  nonce
2689
2721
  ]), true, "Nonce must not be consumed when actor/key ownership check fails");
2722
+ const failures = recorder.getMeasurements("activitypub.signature.verification_failure");
2723
+ assertEquals(failures.length, 1);
2724
+ assertEquals(failures[0].value, 1);
2725
+ assertEquals(failures[0].attributes["activitypub.remote.host"], "example.com");
2726
+ assertEquals(failures[0].attributes["activitypub.verification.failure_reason"], "actorKeyMismatch");
2690
2727
  });
2691
2728
  test("handleInbox() challenge policy enabled + unverifiedActivityHandler returns undefined", async () => {
2692
2729
  const activity = new Create({
@@ -3,10 +3,10 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import "../std__assert-CRDpx_HF.mjs";
6
- import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
7
- import { r as signObject } from "../proof-CFPGr1xC.mjs";
8
- import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
9
- import { o as createFederation } from "../middleware-BPZEcrMG.mjs";
6
+ import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-C3kae-6B.mjs";
7
+ import { r as signObject } from "../proof-iVfYyJpY.mjs";
8
+ import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
9
+ import { o as createFederation } from "../middleware-pb2EqN_r.mjs";
10
10
  import { mockDocumentLoader, test } from "@fedify/fixture";
11
11
  import { Create, Follow, Person } from "@fedify/vocab";
12
12
  //#region src/federation/idempotency.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
6
- import { t as ActivityListenerSet } from "../activity-listener-ell7W1s9.mjs";
6
+ import { t as ActivityListenerSet } from "../activity-listener-tztVvlNb.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
9
9
  //#region src/federation/inbox.test.ts
@@ -4,8 +4,8 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
6
6
  import { t as assert } from "../assert-DikXweDx.mjs";
7
- import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
8
- import { t as KvKeyCache } from "../keycache-EGATflN-.mjs";
7
+ import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
8
+ import { t as KvKeyCache } from "../keycache-BeU0LCII.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  import { CryptographicKey, Multikey } from "@fedify/vocab";
11
11
  //#region src/federation/keycache.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import "../std__assert-CRDpx_HF.mjs";
6
- import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
6
+ import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  //#region src/federation/kv.test.ts
9
9
  test("MemoryKvStore", async (t) => {