@fedify/fedify 2.0.0-dev.1961 → 2.0.0-dev.85
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.
- package/README.md +3 -0
- package/dist/{actor-DhgrrgXz.cjs → actor-Bpgsv6Ii.cjs} +185 -185
- package/dist/{actor-DiKHxw_H.js → actor-D3v8T9kQ.js} +185 -185
- package/dist/{actor-Kqyoic-M.js → actor-DrvDW-tK.js} +1 -1
- package/dist/{builder-BrqBKkVi.js → builder-D2trc6p7.js} +3 -3
- package/dist/compat/mod.d.cts +3 -3
- package/dist/compat/mod.d.ts +3 -3
- package/dist/compat/transformers.test.js +16 -16
- package/dist/{context-PxGADCsD.d.cts → context-DBQ7nMCw.d.cts} +1 -1
- package/dist/{context-V-XS2_6O.d.ts → context-mM0Nu5yo.d.ts} +1 -1
- package/dist/{docloader-HB61Uc88.js → docloader-DlSrn4Io.js} +2 -2
- package/dist/{esm-DaZiDvFW.js → esm-DQKBkSAc.js} +1 -1
- package/dist/federation/builder.test.js +5 -5
- package/dist/federation/collection.test.js +2 -2
- package/dist/federation/handler.test.js +104 -17
- package/dist/federation/idempotency.test.js +17 -17
- package/dist/federation/inbox.test.js +3 -3
- package/dist/federation/keycache.test.js +4 -4
- package/dist/federation/kv.test.js +57 -3
- package/dist/federation/middleware.test.js +18 -18
- package/dist/federation/mod.cjs +8 -8
- package/dist/federation/mod.d.cts +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +8 -8
- package/dist/federation/mq.test.js +2 -2
- package/dist/federation/negotiation.test.js +2 -2
- package/dist/federation/retry.test.js +2 -2
- package/dist/federation/router.test.js +2 -2
- package/dist/federation/send.test.js +52 -9
- package/dist/{federation-CRpdnOMS.cjs → federation-CoW-KDKv.cjs} +22 -0
- package/dist/{federation-jcR8-ZxP.js → federation-D0hkM4T7.js} +22 -0
- package/dist/{http-B2bao4EB.js → http-BNxhNjYm.js} +2 -2
- package/dist/{http-CUsGQiwU.js → http-Bz4YpW-D.js} +2 -2
- package/dist/{http-BxgYWxTY.cjs → http-Dr7V4DY7.cjs} +2 -2
- package/dist/{inbox-CAojlSWc.js → inbox-CXOoDyEH.js} +1 -1
- package/dist/{key-Dz-KWCap.js → key-C_b1t1Na.js} +2 -2
- package/dist/{keycache-Czcf33al.js → keycache-zfG6F1PW.js} +1 -1
- package/dist/{keys-BN4nelft.js → keys-C01rMN22.js} +1 -1
- package/dist/{kv-BKNZ-Tb-.d.ts → kv-BpJND1Hr.d.ts} +30 -1
- package/dist/{kv-CRZrzyXm.js → kv-QzKcOQgP.js} +22 -0
- package/dist/{kv-Bxr0Q87_.d.cts → kv-cD_d4hg-.d.cts} +30 -1
- package/dist/{kv-cache-Bq6kUUoG.js → kv-cache-4I_O-pli.js} +1 -1
- package/dist/{kv-cache-5j5Pb-V6.cjs → kv-cache-CpjdzlKh.cjs} +1 -1
- package/dist/{kv-cache-DN9pfMBe.js → kv-cache-D7LFlByV.js} +13 -0
- package/dist/{ld-CEJHYq8u.js → ld-Ba0jIf7k.js} +2 -2
- package/dist/{lookup-gMu_9ZKY.js → lookup-BUqdDUac.js} +6 -5
- package/dist/{lookup-_Hap2IXS.cjs → lookup-UA4SKewV.cjs} +6 -5
- package/dist/{lookup-D8hvtZHY.js → lookup-kl47RWf3.js} +195 -189
- package/dist/middleware-B64_UxVQ.js +26 -0
- package/dist/middleware-BK7fptEJ.cjs +15 -0
- package/dist/{middleware-DW3rJHWy.cjs → middleware-BYqpBCFp.cjs} +21 -9
- package/dist/{middleware-DgrceAHB.js → middleware-CwpDL0KB.js} +19 -12
- package/dist/{middleware-Df9OWALM.js → middleware-Cx0KwuzQ.js} +21 -9
- package/dist/middleware-_DVIaAFk.js +15 -0
- package/dist/{mod-aAE2wOWV.d.ts → mod-CAdoBu0x.d.ts} +1 -1
- package/dist/{mod-BoRKfJPE.d.cts → mod-Dy2fJtmN.d.cts} +1 -1
- package/dist/{mod-Cdo6SYlJ.d.ts → mod-GetHzY6F.d.ts} +1 -1
- package/dist/{mod-DMpuiKXi.d.cts → mod-fxr25Gv7.d.cts} +1 -1
- package/dist/mod.cjs +8 -8
- package/dist/mod.d.cts +5 -5
- package/dist/mod.d.ts +5 -5
- package/dist/mod.js +8 -8
- package/dist/nodeinfo/client.test.js +3 -3
- package/dist/nodeinfo/handler.test.js +16 -16
- package/dist/nodeinfo/types.test.js +2 -2
- package/dist/otel/exporter.test.d.ts +3 -0
- package/dist/otel/exporter.test.js +900 -0
- package/dist/otel/mod.cjs +262 -0
- package/dist/otel/mod.d.cts +230 -0
- package/dist/otel/mod.d.ts +232 -0
- package/dist/otel/mod.js +261 -0
- package/dist/otel-Bfe_BgOV.js +63 -0
- package/dist/{owner-JwI-WzF-.js → owner-CgznkTZ6.js} +44 -8
- package/dist/{proof-CObJuclI.cjs → proof-AEFUz3SS.cjs} +44 -8
- package/dist/{proof-xH0V1mdD.js → proof-BrsOl9bB.js} +45 -9
- package/dist/{proof-Dhqndmfg.js → proof-rFeNfcVE.js} +2 -2
- package/dist/{send-1o7D-GGL.js → send-w_IyjZ0S.js} +9 -4
- package/dist/sig/http.test.js +7 -7
- package/dist/sig/key.test.js +5 -5
- package/dist/sig/ld.test.js +6 -6
- package/dist/sig/mod.cjs +4 -4
- package/dist/sig/mod.js +4 -4
- package/dist/sig/owner.test.js +30 -6
- package/dist/sig/proof.test.js +6 -6
- package/dist/testing/docloader.test.js +2 -2
- package/dist/testing/mod.js +2 -2
- package/dist/{testing-DpRy1YTU.js → testing-fIO3Z258.js} +1 -1
- package/dist/utils/docloader.test.js +8 -8
- package/dist/utils/kv-cache.test.js +6 -3
- package/dist/utils/mod.cjs +4 -4
- package/dist/utils/mod.d.cts +2 -2
- package/dist/utils/mod.d.ts +2 -2
- package/dist/utils/mod.js +4 -4
- package/dist/vocab/actor.test.js +4 -4
- package/dist/vocab/lookup.test.js +26 -4
- package/dist/vocab/mod.cjs +3 -3
- package/dist/vocab/mod.js +3 -3
- package/dist/vocab/type.test.js +2 -2
- package/dist/vocab/vocab.test.js +3 -3
- package/dist/{vocab-CAwj263k.js → vocab-BtqMcZvq.js} +7 -2
- package/dist/{vocab-DgHGCFcw.cjs → vocab-COVHviQ5.cjs} +7 -2
- package/dist/webfinger/handler.test.js +16 -16
- package/dist/webfinger/lookup.test.js +3 -3
- package/dist/webfinger/mod.cjs +1 -1
- package/dist/webfinger/mod.js +1 -1
- package/package.json +19 -9
- package/dist/middleware-19QFZj7b.js +0 -26
- package/dist/middleware-BbbcXY4w.cjs +0 -15
- package/dist/middleware-CSTK543z.js +0 -15
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { deno_default } from "./lookup-
|
|
6
|
-
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "./actor-
|
|
7
|
-
import { fetchKey, validateCryptoKey } from "./http-
|
|
5
|
+
import { deno_default } from "./lookup-BUqdDUac.js";
|
|
6
|
+
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "./actor-D3v8T9kQ.js";
|
|
7
|
+
import { fetchKey, validateCryptoKey } from "./http-Bz4YpW-D.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
|
-
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
9
|
+
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import jsonld from "jsonld";
|
|
11
11
|
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
12
12
|
import { encodeHex } from "byte-encodings/hex";
|
|
@@ -276,11 +276,47 @@ async function hashJsonLd(jsonLd, contextLoader) {
|
|
|
276
276
|
* @returns Whether the actor is the owner of the key.
|
|
277
277
|
*/
|
|
278
278
|
async function doesActorOwnKey(activity, key, options) {
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
279
|
+
const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
|
|
280
|
+
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
|
281
|
+
return await tracer.startActiveSpan("activitypub.verify_key_ownership", {
|
|
282
|
+
kind: SpanKind.INTERNAL,
|
|
283
|
+
attributes: {
|
|
284
|
+
"activitypub.actor.id": activity.actorId?.href ?? "",
|
|
285
|
+
"activitypub.key.id": key.id?.href ?? ""
|
|
286
|
+
}
|
|
287
|
+
}, async (span) => {
|
|
288
|
+
try {
|
|
289
|
+
if (key.ownerId != null) {
|
|
290
|
+
const owns = key.ownerId.href === activity.actorId?.href;
|
|
291
|
+
span.setAttribute("activitypub.key_ownership.verified", owns);
|
|
292
|
+
span.setAttribute("activitypub.key_ownership.method", "owner_id");
|
|
293
|
+
return owns;
|
|
294
|
+
}
|
|
295
|
+
const actor = await activity.getActor(options);
|
|
296
|
+
if (actor == null || !isActor(actor)) {
|
|
297
|
+
span.setAttribute("activitypub.key_ownership.verified", false);
|
|
298
|
+
span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
|
|
299
|
+
return false;
|
|
300
|
+
}
|
|
301
|
+
for (const publicKeyId of actor.publicKeyIds) if (key.id != null && publicKeyId.href === key.id.href) {
|
|
302
|
+
span.setAttribute("activitypub.key_ownership.verified", true);
|
|
303
|
+
span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
|
|
304
|
+
return true;
|
|
305
|
+
}
|
|
306
|
+
span.setAttribute("activitypub.key_ownership.verified", false);
|
|
307
|
+
span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
|
|
308
|
+
return false;
|
|
309
|
+
} catch (error) {
|
|
310
|
+
span.recordException(error);
|
|
311
|
+
span.setStatus({
|
|
312
|
+
code: SpanStatusCode.ERROR,
|
|
313
|
+
message: String(error)
|
|
314
|
+
});
|
|
315
|
+
throw error;
|
|
316
|
+
} finally {
|
|
317
|
+
span.end();
|
|
318
|
+
}
|
|
319
|
+
});
|
|
284
320
|
}
|
|
285
321
|
/**
|
|
286
322
|
* Gets the actor that owns the specified key. Returns `null` if the key has no
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Activity, DataIntegrityProof, Multikey, deno_default, getTypeId } from "./lookup-
|
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
|
6
|
+
import { Activity, DataIntegrityProof, Multikey, deno_default, getTypeId } from "./lookup-kl47RWf3.js";
|
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-C_b1t1Na.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import { encodeHex } from "byte-encodings/hex";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./lookup-
|
|
7
|
-
import { doubleKnock } from "./http-
|
|
6
|
+
import { deno_default } from "./lookup-kl47RWf3.js";
|
|
7
|
+
import { doubleKnock } from "./http-BNxhNjYm.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
|
|
@@ -55,7 +55,7 @@ function sendActivity(options) {
|
|
|
55
55
|
await sendActivityInternal({
|
|
56
56
|
...options,
|
|
57
57
|
tracerProvider
|
|
58
|
-
});
|
|
58
|
+
}, span);
|
|
59
59
|
} catch (e) {
|
|
60
60
|
span.setStatus({
|
|
61
61
|
code: SpanStatusCode.ERROR,
|
|
@@ -67,7 +67,7 @@ function sendActivity(options) {
|
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
async function sendActivityInternal({ activity, activityId, keys, inbox, headers, specDeterminer, tracerProvider }) {
|
|
70
|
+
async function sendActivityInternal({ activity, activityId, keys, inbox, headers, specDeterminer, tracerProvider }, span) {
|
|
71
71
|
const logger = getLogger([
|
|
72
72
|
"fedify",
|
|
73
73
|
"federation",
|
|
@@ -122,6 +122,11 @@ async function sendActivityInternal({ activity, activityId, keys, inbox, headers
|
|
|
122
122
|
});
|
|
123
123
|
throw new Error(`Failed to send activity ${activityId} to ${inbox.href} (${response.status} ${response.statusText}):\n${error}`);
|
|
124
124
|
}
|
|
125
|
+
span.addEvent("activitypub.activity.sent", {
|
|
126
|
+
"activitypub.activity.json": JSON.stringify(activity),
|
|
127
|
+
"activitypub.inbox.url": inbox.href,
|
|
128
|
+
"activitypub.activity.id": activityId ?? ""
|
|
129
|
+
});
|
|
125
130
|
}
|
|
126
131
|
|
|
127
132
|
//#endregion
|
package/dist/sig/http.test.js
CHANGED
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../lookup-
|
|
6
|
+
import "../lookup-kl47RWf3.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../actor-
|
|
11
|
-
import { exportJwk } from "../key-
|
|
12
|
-
import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-
|
|
13
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import "../actor-DrvDW-tK.js";
|
|
11
|
+
import { exportJwk } from "../key-C_b1t1Na.js";
|
|
12
|
+
import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-BNxhNjYm.js";
|
|
13
|
+
import { mockDocumentLoader, test } from "../testing-fIO3Z258.js";
|
|
14
14
|
import { assertExists, assertStringIncludes } from "../std__assert-DWivtrGR.js";
|
|
15
15
|
import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
16
16
|
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
|
17
17
|
import "../assert_not_equals-C80BG-_5.js";
|
|
18
|
-
import { rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey5 } from "../keys-
|
|
19
|
-
import { esm_default } from "../esm-
|
|
18
|
+
import { rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey5 } from "../keys-C01rMN22.js";
|
|
19
|
+
import { esm_default } from "../esm-DQKBkSAc.js";
|
|
20
20
|
import { exportSpki } from "@fedify/vocab-runtime";
|
|
21
21
|
import { encodeBase64 } from "byte-encodings/base64";
|
|
22
22
|
|
package/dist/sig/key.test.js
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { CryptographicKey, Multikey } from "../lookup-
|
|
6
|
+
import { CryptographicKey, Multikey } from "../lookup-kl47RWf3.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../actor-
|
|
11
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-
|
|
12
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import "../actor-DrvDW-tK.js";
|
|
11
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-C_b1t1Na.js";
|
|
12
|
+
import { mockDocumentLoader, test } from "../testing-fIO3Z258.js";
|
|
13
13
|
import "../std__assert-DWivtrGR.js";
|
|
14
14
|
import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
15
15
|
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
|
16
16
|
import "../assert_not_equals-C80BG-_5.js";
|
|
17
|
-
import { ed25519Multikey, rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey3 } from "../keys-
|
|
17
|
+
import { ed25519Multikey, rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey3 } from "../keys-C01rMN22.js";
|
|
18
18
|
|
|
19
19
|
//#region src/sig/key.test.ts
|
|
20
20
|
test("validateCryptoKey()", async () => {
|
package/dist/sig/ld.test.js
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { CryptographicKey } from "../lookup-
|
|
6
|
+
import { CryptographicKey } from "../lookup-kl47RWf3.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
|
-
import "../actor-
|
|
10
|
-
import { generateCryptoKeyPair } from "../key-
|
|
11
|
-
import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-
|
|
12
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
9
|
+
import "../actor-DrvDW-tK.js";
|
|
10
|
+
import { generateCryptoKeyPair } from "../key-C_b1t1Na.js";
|
|
11
|
+
import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-Ba0jIf7k.js";
|
|
12
|
+
import { mockDocumentLoader, test } from "../testing-fIO3Z258.js";
|
|
13
13
|
import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
14
14
|
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
|
15
|
-
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-
|
|
15
|
+
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-C01rMN22.js";
|
|
16
16
|
import { encodeBase64 } from "byte-encodings/base64";
|
|
17
17
|
|
|
18
18
|
//#region src/sig/ld.test.ts
|
package/dist/sig/mod.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
|
-
require('../lookup-
|
|
6
|
-
require('../actor-
|
|
7
|
-
const require_http = require('../http-
|
|
8
|
-
const require_proof = require('../proof-
|
|
5
|
+
require('../lookup-UA4SKewV.cjs');
|
|
6
|
+
require('../actor-Bpgsv6Ii.cjs');
|
|
7
|
+
const require_http = require('../http-Dr7V4DY7.cjs');
|
|
8
|
+
const require_proof = require('../proof-AEFUz3SS.cjs');
|
|
9
9
|
require('../sig-YYj5tCnr.cjs');
|
|
10
10
|
|
|
11
11
|
exports.attachSignature = require_proof.attachSignature;
|
package/dist/sig/mod.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import "../lookup-
|
|
6
|
-
import "../actor-
|
|
7
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-
|
|
8
|
-
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-
|
|
5
|
+
import "../lookup-BUqdDUac.js";
|
|
6
|
+
import "../actor-D3v8T9kQ.js";
|
|
7
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-Bz4YpW-D.js";
|
|
8
|
+
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-BrsOl9bB.js";
|
|
9
9
|
import "../sig-C34-oHBl.js";
|
|
10
10
|
|
|
11
11
|
export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/sig/owner.test.js
CHANGED
|
@@ -3,19 +3,20 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Create, lookupObject } from "../lookup-
|
|
6
|
+
import { Create, CryptographicKey, lookupObject } from "../lookup-kl47RWf3.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../actor-
|
|
11
|
-
import "../key-
|
|
12
|
-
import { doesActorOwnKey, getKeyOwner } from "../owner-
|
|
13
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import "../actor-DrvDW-tK.js";
|
|
11
|
+
import "../key-C_b1t1Na.js";
|
|
12
|
+
import { doesActorOwnKey, getKeyOwner } from "../owner-CgznkTZ6.js";
|
|
13
|
+
import { mockDocumentLoader, test } from "../testing-fIO3Z258.js";
|
|
14
14
|
import "../std__assert-DWivtrGR.js";
|
|
15
15
|
import { assertFalse } from "../assert_rejects-Ce45JcFg.js";
|
|
16
16
|
import "../assert_throws-BNXdRGWP.js";
|
|
17
17
|
import "../assert_not_equals-C80BG-_5.js";
|
|
18
|
-
import { rsaPublicKey1, rsaPublicKey2 } from "../keys-
|
|
18
|
+
import { rsaPublicKey1, rsaPublicKey2 } from "../keys-C01rMN22.js";
|
|
19
|
+
import { createTestTracerProvider } from "../otel-Bfe_BgOV.js";
|
|
19
20
|
|
|
20
21
|
//#region src/sig/owner.test.ts
|
|
21
22
|
test("doesActorOwnKey()", async () => {
|
|
@@ -46,5 +47,28 @@ test("getKeyOwner()", async () => {
|
|
|
46
47
|
const noOwner2 = await getKeyOwner(new URL("https://example.com/object"), options);
|
|
47
48
|
assertEquals(noOwner2, null);
|
|
48
49
|
});
|
|
50
|
+
test("doesActorOwnKey() records OpenTelemetry span", async () => {
|
|
51
|
+
const [tracerProvider, exporter] = createTestTracerProvider();
|
|
52
|
+
const activity = new Create({
|
|
53
|
+
id: new URL("https://example.com/activity"),
|
|
54
|
+
actor: new URL("https://example.com/person")
|
|
55
|
+
});
|
|
56
|
+
const key = new CryptographicKey({
|
|
57
|
+
id: new URL("https://example.com/person#key"),
|
|
58
|
+
owner: new URL("https://example.com/person")
|
|
59
|
+
});
|
|
60
|
+
const result = await doesActorOwnKey(activity, key, {
|
|
61
|
+
documentLoader: mockDocumentLoader,
|
|
62
|
+
tracerProvider
|
|
63
|
+
});
|
|
64
|
+
assert(result);
|
|
65
|
+
const spans = exporter.getSpans("activitypub.verify_key_ownership");
|
|
66
|
+
assertEquals(spans.length, 1);
|
|
67
|
+
const span = spans[0];
|
|
68
|
+
assertEquals(span.attributes["activitypub.actor.id"], "https://example.com/person");
|
|
69
|
+
assertEquals(span.attributes["activitypub.key.id"], "https://example.com/person#key");
|
|
70
|
+
assertEquals(span.attributes["activitypub.key_ownership.verified"], true);
|
|
71
|
+
assertEquals(span.attributes["activitypub.key_ownership.method"], "owner_id");
|
|
72
|
+
});
|
|
49
73
|
|
|
50
74
|
//#endregion
|
package/dist/sig/proof.test.js
CHANGED
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Create, DataIntegrityProof, Multikey, Note, Place } from "../lookup-
|
|
6
|
+
import { Create, DataIntegrityProof, Multikey, Note, Place } from "../lookup-kl47RWf3.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../actor-
|
|
11
|
-
import "../key-
|
|
12
|
-
import { createProof, signObject, verifyObject, verifyProof } from "../proof-
|
|
13
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import "../actor-DrvDW-tK.js";
|
|
11
|
+
import "../key-C_b1t1Na.js";
|
|
12
|
+
import { createProof, signObject, verifyObject, verifyProof } from "../proof-rFeNfcVE.js";
|
|
13
|
+
import { mockDocumentLoader, test } from "../testing-fIO3Z258.js";
|
|
14
14
|
import "../std__assert-DWivtrGR.js";
|
|
15
15
|
import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
16
16
|
import "../assert_throws-BNXdRGWP.js";
|
|
17
17
|
import "../assert_not_equals-C80BG-_5.js";
|
|
18
|
-
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-
|
|
18
|
+
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-C01rMN22.js";
|
|
19
19
|
import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
|
|
20
20
|
import { decodeHex, encodeHex } from "byte-encodings/hex";
|
|
21
21
|
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../lookup-
|
|
6
|
+
import "../lookup-kl47RWf3.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import { mockDocumentLoader, test } from "../testing-fIO3Z258.js";
|
|
11
11
|
import "../std__assert-DWivtrGR.js";
|
|
12
12
|
import "../assert_rejects-Ce45JcFg.js";
|
|
13
13
|
import "../assert_throws-BNXdRGWP.js";
|
package/dist/testing/mod.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../lookup-
|
|
7
|
-
import { createInboxContext, createRequestContext, test, testDefinitions } from "../testing-
|
|
6
|
+
import "../lookup-kl47RWf3.js";
|
|
7
|
+
import { createInboxContext, createRequestContext, test, testDefinitions } from "../testing-fIO3Z258.js";
|
|
8
8
|
|
|
9
9
|
export { createInboxContext, createRequestContext, test, testDefinitions };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { RouterError, __require, lookupObject, lookupWebFinger, traverseCollection } from "./lookup-
|
|
6
|
+
import { RouterError, __require, lookupObject, lookupWebFinger, traverseCollection } from "./lookup-kl47RWf3.js";
|
|
7
7
|
import { configure, getConsoleSink, getLogger, reset } from "@logtape/logtape";
|
|
8
8
|
import { trace } from "@opentelemetry/api";
|
|
9
9
|
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../lookup-
|
|
6
|
+
import "../lookup-kl47RWf3.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../actor-
|
|
11
|
-
import "../key-
|
|
12
|
-
import { verifyRequest } from "../http-
|
|
13
|
-
import { getAuthenticatedDocumentLoader } from "../docloader-
|
|
14
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import "../actor-DrvDW-tK.js";
|
|
11
|
+
import "../key-C_b1t1Na.js";
|
|
12
|
+
import { verifyRequest } from "../http-BNxhNjYm.js";
|
|
13
|
+
import { getAuthenticatedDocumentLoader } from "../docloader-DlSrn4Io.js";
|
|
14
|
+
import { mockDocumentLoader, test } from "../testing-fIO3Z258.js";
|
|
15
15
|
import "../std__assert-DWivtrGR.js";
|
|
16
16
|
import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
17
17
|
import "../assert_throws-BNXdRGWP.js";
|
|
18
18
|
import "../assert_not_equals-C80BG-_5.js";
|
|
19
|
-
import { rsaPrivateKey2 } from "../keys-
|
|
20
|
-
import { esm_default } from "../esm-
|
|
19
|
+
import { rsaPrivateKey2 } from "../keys-C01rMN22.js";
|
|
20
|
+
import { esm_default } from "../esm-DQKBkSAc.js";
|
|
21
21
|
import { UrlError } from "@fedify/vocab-runtime";
|
|
22
22
|
|
|
23
23
|
//#region src/utils/docloader.test.ts
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../lookup-
|
|
7
|
-
import { MockKvStore, kvCache } from "../kv-cache-
|
|
8
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
6
|
+
import "../lookup-kl47RWf3.js";
|
|
7
|
+
import { MockKvStore, kvCache } from "../kv-cache-D7LFlByV.js";
|
|
8
|
+
import { mockDocumentLoader, test } from "../testing-fIO3Z258.js";
|
|
9
9
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
10
10
|
import { deepStrictEqual, throws } from "node:assert";
|
|
11
11
|
|
|
@@ -125,6 +125,9 @@ test("kvCache()", async (t) => {
|
|
|
125
125
|
delete(_key) {
|
|
126
126
|
throw new Error("Failed to delete key");
|
|
127
127
|
}
|
|
128
|
+
async *list(_prefix) {
|
|
129
|
+
throw new Error("Failed to list keys");
|
|
130
|
+
}
|
|
128
131
|
}
|
|
129
132
|
const loader = kvCache({
|
|
130
133
|
kv: new KvStoreThrowsException(),
|
package/dist/utils/mod.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
|
-
require('../lookup-
|
|
6
|
-
require('../actor-
|
|
7
|
-
require('../http-
|
|
8
|
-
const require_kv_cache = require('../kv-cache-
|
|
5
|
+
require('../lookup-UA4SKewV.cjs');
|
|
6
|
+
require('../actor-Bpgsv6Ii.cjs');
|
|
7
|
+
require('../http-Dr7V4DY7.cjs');
|
|
8
|
+
const require_kv_cache = require('../kv-cache-CpjdzlKh.cjs');
|
|
9
9
|
require('../utils-DyRU1gdZ.cjs');
|
|
10
10
|
|
|
11
11
|
exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
|
package/dist/utils/mod.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../vocab-CeDBzu-f.cjs";
|
|
2
2
|
import "../http-M8k5mKc0.cjs";
|
|
3
|
-
import "../kv-
|
|
4
|
-
import { getAuthenticatedDocumentLoader, kvCache } from "../mod-
|
|
3
|
+
import "../kv-cD_d4hg-.cjs";
|
|
4
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "../mod-fxr25Gv7.cjs";
|
|
5
5
|
export { getAuthenticatedDocumentLoader, kvCache };
|
package/dist/utils/mod.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
import "../vocab-BCWe1Ih5.js";
|
|
4
4
|
import "../http-BbO0ejuk.js";
|
|
5
|
-
import "../kv-
|
|
6
|
-
import { getAuthenticatedDocumentLoader, kvCache } from "../mod-
|
|
5
|
+
import "../kv-BpJND1Hr.js";
|
|
6
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "../mod-CAdoBu0x.js";
|
|
7
7
|
export { getAuthenticatedDocumentLoader, kvCache };
|
package/dist/utils/mod.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import "../lookup-
|
|
6
|
-
import "../actor-
|
|
7
|
-
import "../http-
|
|
8
|
-
import { getAuthenticatedDocumentLoader, kvCache } from "../kv-cache-
|
|
5
|
+
import "../lookup-BUqdDUac.js";
|
|
6
|
+
import "../actor-D3v8T9kQ.js";
|
|
7
|
+
import "../http-Bz4YpW-D.js";
|
|
8
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "../kv-cache-4I_O-pli.js";
|
|
9
9
|
import "../utils-D-Va7aXC.js";
|
|
10
10
|
|
|
11
11
|
export { getAuthenticatedDocumentLoader, kvCache };
|
package/dist/vocab/actor.test.js
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Application, Group, Organization, Person, Service, __export } from "../lookup-
|
|
6
|
+
import { Application, Group, Organization, Person, Service, __export } from "../lookup-kl47RWf3.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import { getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-
|
|
11
|
-
import { test } from "../testing-
|
|
10
|
+
import { getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-DrvDW-tK.js";
|
|
11
|
+
import { test } from "../testing-fIO3Z258.js";
|
|
12
12
|
import { assertStrictEquals } from "../std__assert-DWivtrGR.js";
|
|
13
13
|
import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
14
14
|
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
|
15
15
|
import "../assert_not_equals-C80BG-_5.js";
|
|
16
|
-
import { esm_default } from "../esm-
|
|
16
|
+
import { esm_default } from "../esm-DQKBkSAc.js";
|
|
17
17
|
|
|
18
18
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/precondition/PreconditionFailure.js
|
|
19
19
|
var PreconditionFailure = class PreconditionFailure extends Error {
|
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Collection, Note, Object as Object$1, Person, lookupObject, traverseCollection } from "../lookup-
|
|
6
|
+
import { Collection, Note, Object as Object$1, Person, lookupObject, traverseCollection } from "../lookup-kl47RWf3.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
|
-
import "../assert-MZs1qjMx.js";
|
|
8
|
+
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import { mockDocumentLoader, test } from "../testing-fIO3Z258.js";
|
|
11
11
|
import "../std__assert-DWivtrGR.js";
|
|
12
12
|
import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
13
13
|
import "../assert_throws-BNXdRGWP.js";
|
|
14
14
|
import "../assert_not_equals-C80BG-_5.js";
|
|
15
|
-
import {
|
|
15
|
+
import { createTestTracerProvider } from "../otel-Bfe_BgOV.js";
|
|
16
|
+
import { esm_default } from "../esm-DQKBkSAc.js";
|
|
16
17
|
|
|
17
18
|
//#region src/vocab/lookup.test.ts
|
|
18
19
|
test("lookupObject()", {
|
|
@@ -450,5 +451,26 @@ test("FEP-fe34: lookupObject() cross-origin security", {
|
|
|
450
451
|
}), null);
|
|
451
452
|
});
|
|
452
453
|
});
|
|
454
|
+
test("lookupObject() records OpenTelemetry span events", async () => {
|
|
455
|
+
const [tracerProvider, exporter] = createTestTracerProvider();
|
|
456
|
+
const object = await lookupObject("https://example.com/object", {
|
|
457
|
+
documentLoader: mockDocumentLoader,
|
|
458
|
+
contextLoader: mockDocumentLoader,
|
|
459
|
+
tracerProvider
|
|
460
|
+
});
|
|
461
|
+
assertInstanceOf(object, Object$1);
|
|
462
|
+
const spans = exporter.getSpans("activitypub.lookup_object");
|
|
463
|
+
assertEquals(spans.length, 1);
|
|
464
|
+
const span = spans[0];
|
|
465
|
+
assertEquals(span.attributes["activitypub.object.id"], "https://example.com/object");
|
|
466
|
+
const events = exporter.getEvents("activitypub.lookup_object", "activitypub.object.fetched");
|
|
467
|
+
assertEquals(events.length, 1);
|
|
468
|
+
const event = events[0];
|
|
469
|
+
assert(event.attributes != null);
|
|
470
|
+
assert(typeof event.attributes["activitypub.object.type"] === "string");
|
|
471
|
+
assert(typeof event.attributes["activitypub.object.json"] === "string");
|
|
472
|
+
const recordedObject = JSON.parse(event.attributes["activitypub.object.json"]);
|
|
473
|
+
assertEquals(recordedObject.id, "https://example.com/object");
|
|
474
|
+
});
|
|
453
475
|
|
|
454
476
|
//#endregion
|
package/dist/vocab/mod.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
|
-
require('../lookup-
|
|
6
|
-
const require_actor = require('../actor-
|
|
7
|
-
const require_vocab = require('../vocab-
|
|
5
|
+
require('../lookup-UA4SKewV.cjs');
|
|
6
|
+
const require_actor = require('../actor-Bpgsv6Ii.cjs');
|
|
7
|
+
const require_vocab = require('../vocab-COVHviQ5.cjs');
|
|
8
8
|
|
|
9
9
|
exports.Accept = require_actor.Accept;
|
|
10
10
|
exports.Activity = require_actor.Activity;
|
package/dist/vocab/mod.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import "../lookup-
|
|
6
|
-
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, normalizeActorHandle } from "../actor-
|
|
7
|
-
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../vocab-
|
|
5
|
+
import "../lookup-BUqdDUac.js";
|
|
6
|
+
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, normalizeActorHandle } from "../actor-D3v8T9kQ.js";
|
|
7
|
+
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../vocab-BtqMcZvq.js";
|
|
8
8
|
|
|
9
9
|
export { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, PUBLIC_COLLECTION, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, isFediverseHandle, lookupObject, normalizeActorHandle, parseFediverseHandle, toAcctUrl, traverseCollection };
|
package/dist/vocab/type.test.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Person, getTypeId } from "../lookup-
|
|
6
|
+
import { Person, getTypeId } from "../lookup-kl47RWf3.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
|
-
import { test } from "../testing-
|
|
8
|
+
import { test } from "../testing-fIO3Z258.js";
|
|
9
9
|
|
|
10
10
|
//#region src/vocab/type.test.ts
|
|
11
11
|
test("getTypeId()", () => {
|
package/dist/vocab/vocab.test.js
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Activity, Announce, Collection, Create, CryptographicKey, Follow, Hashtag, Link, Note, Object as Object$1, OrderedCollectionPage, Person, Place, Question, Source, __commonJS, __require, __toESM, vocab_exports } from "../lookup-
|
|
6
|
+
import { Activity, Announce, Collection, Create, CryptographicKey, Follow, Hashtag, Link, Note, Object as Object$1, OrderedCollectionPage, Person, Place, Question, Source, __commonJS, __require, __toESM, vocab_exports } from "../lookup-kl47RWf3.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
10
|
+
import { mockDocumentLoader, test } from "../testing-fIO3Z258.js";
|
|
11
11
|
import "../std__assert-DWivtrGR.js";
|
|
12
12
|
import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
13
13
|
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
|
14
14
|
import { assertNotEquals } from "../assert_not_equals-C80BG-_5.js";
|
|
15
|
-
import { ed25519PublicKey, rsaPublicKey1 } from "../keys-
|
|
15
|
+
import { ed25519PublicKey, rsaPublicKey1 } from "../keys-C01rMN22.js";
|
|
16
16
|
import { pascalCase } from "es-toolkit";
|
|
17
17
|
import { LanguageString, decodeMultibase } from "@fedify/vocab-runtime";
|
|
18
18
|
import { fileURLToPath } from "node:url";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { deno_default, lookupWebFinger } from "./lookup-
|
|
6
|
-
import { Object as Object$1, getTypeId } from "./actor-
|
|
5
|
+
import { deno_default, lookupWebFinger } from "./lookup-BUqdDUac.js";
|
|
6
|
+
import { Object as Object$1, getTypeId } from "./actor-D3v8T9kQ.js";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
8
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
9
9
|
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
@@ -136,9 +136,14 @@ async function lookupObject(identifier, options = {}) {
|
|
|
136
136
|
if (result.id != null) span.setAttribute("activitypub.object.id", result.id.href);
|
|
137
137
|
span.setAttribute("activitypub.object.type", getTypeId(result).href);
|
|
138
138
|
if (result.replyTargetIds.length > 0) span.setAttribute("activitypub.object.in_reply_to", result.replyTargetIds.map((id) => id.href));
|
|
139
|
+
span.addEvent("activitypub.object.fetched", {
|
|
140
|
+
"activitypub.object.type": getTypeId(result).href,
|
|
141
|
+
"activitypub.object.json": JSON.stringify(await result.toJsonLd(options))
|
|
142
|
+
});
|
|
139
143
|
}
|
|
140
144
|
return result;
|
|
141
145
|
} catch (error) {
|
|
146
|
+
span.recordException(error);
|
|
142
147
|
span.setStatus({
|
|
143
148
|
code: SpanStatusCode.ERROR,
|
|
144
149
|
message: String(error)
|