@fedify/fedify 2.0.0-pr.479.1919 → 2.0.0-pr.490.2
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 +6 -0
- package/dist/{actor-CTcfCF-e.js → actor-BT-e5fn9.js} +1 -1
- package/dist/{actor-aoIDzHM-.js → actor-B_gRMloq.js} +185 -185
- package/dist/{actor-eSbSJCyv.cjs → actor-CBfPjuWj.cjs} +185 -185
- package/dist/{builder-CKCsO0nM.js → builder-4syLV1-z.js} +3 -3
- package/dist/compat/transformers.test.js +14 -14
- package/dist/{docloader-COSFvh5S.js → docloader-DndkGj0O.js} +2 -2
- package/dist/{esm-D5OetL8h.js → esm-VlKMJQqV.js} +32 -17
- package/dist/federation/builder.test.js +4 -4
- package/dist/federation/collection.test.js +2 -2
- package/dist/federation/handler.test.js +102 -15
- package/dist/federation/idempotency.test.js +15 -15
- package/dist/federation/inbox.test.js +3 -3
- package/dist/federation/keycache.test.js +3 -3
- package/dist/federation/kv.test.js +2 -2
- package/dist/federation/middleware.test.js +16 -16
- package/dist/federation/mod.cjs +7 -7
- package/dist/federation/mod.js +7 -7
- 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/{http-aoeFmy2i.js → http-DH47B-h3.js} +2 -2
- package/dist/{http-BNMiToHH.cjs → http-Dxpqz4hE.cjs} +2 -2
- package/dist/{http-DbWw9vtS.js → http-YhR_TMMQ.js} +2 -2
- package/dist/{inbox-BeP4imwe.js → inbox-CEyHvxOo.js} +1 -1
- package/dist/{key-D2WGU6SD.js → key-x7E5PYI0.js} +2 -2
- package/dist/{keycache-0LcBz2yy.js → keycache-BRXuBDuy.js} +1 -1
- package/dist/{keys-AHG-wt-J.js → keys-DLk_8H-l.js} +1 -1
- package/dist/{kv-cache-CfUWFmLz.cjs → kv-cache-BMpfJFTx.cjs} +1 -1
- package/dist/{kv-cache-CcQpkali.js → kv-cache-HFnFIjSD.js} +1 -1
- package/dist/{ld-DphsGJfY.js → ld-CRPaU6c8.js} +2 -2
- package/dist/{lookup-DNfkdH2x.cjs → lookup-BTqtVATt.cjs} +4 -3
- package/dist/{lookup-Cg1nNCOj.js → lookup-DOSnR912.js} +4 -3
- package/dist/{lookup-rb-YQy27.js → lookup-Dj9-mgOn.js} +193 -187
- package/dist/{middleware-Bfc-TPm2.js → middleware-BIqFwRwI.js} +18 -11
- package/dist/{middleware-Brv2gzXG.cjs → middleware-Ck7O6mb0.cjs} +21 -9
- package/dist/middleware-CxswDtQn.js +15 -0
- package/dist/middleware-CyITsnX0.js +26 -0
- package/dist/{middleware-D_oWwl2e.js → middleware-DfLpMu7C.js} +21 -9
- package/dist/middleware-Z8lc_drL.cjs +15 -0
- package/dist/mod.cjs +7 -7
- package/dist/mod.js +7 -7
- package/dist/nodeinfo/client.test.js +3 -3
- package/dist/nodeinfo/handler.test.js +14 -14
- package/dist/nodeinfo/types.test.js +2 -2
- package/dist/otel-1BmGPuZc.js +64 -0
- package/dist/{owner-BK0A2Bj5.js → owner-CIWnopkT.js} +44 -8
- package/dist/{proof-nZk-m5gi.js → proof-C8-2l0zH.js} +45 -9
- package/dist/{proof-iTdPd6ob.js → proof-D-5ri6rf.js} +2 -2
- package/dist/{proof-CBjhU6M6.cjs → proof-fEwcA7LA.cjs} +44 -8
- package/dist/{send-C-Bq89Nu.js → send-CPGk9QKZ.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-W17blAnV.js → testing-BslrM_9E.js} +1 -1
- package/dist/utils/docloader.test.js +8 -8
- package/dist/utils/kv-cache.test.js +2 -2
- package/dist/utils/mod.cjs +4 -4
- 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 +157 -157
- package/dist/{vocab-Rb_a6qW2.js → vocab-ByUp-A2_.js} +7 -2
- package/dist/{vocab-Dhp1MW3o.cjs → vocab-X_X5T8D3.cjs} +7 -2
- package/dist/webfinger/handler.test.js +14 -14
- 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 +9 -5
- package/dist/middleware-B0_G1lxv.js +0 -26
- package/dist/middleware-BFamiqxv.js +0 -15
- package/dist/middleware-zpuco1qg.cjs +0 -15
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
|
6
|
-
const require_lookup = require('./lookup-
|
|
7
|
-
const require_actor = require('./actor-
|
|
8
|
-
const require_http = require('./http-
|
|
6
|
+
const require_lookup = require('./lookup-BTqtVATt.cjs');
|
|
7
|
+
const require_actor = require('./actor-CBfPjuWj.cjs');
|
|
8
|
+
const require_http = require('./http-Dxpqz4hE.cjs');
|
|
9
9
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
10
10
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
|
11
11
|
const jsonld = require_chunk.__toESM(require("jsonld"));
|
|
@@ -277,11 +277,47 @@ async function hashJsonLd(jsonLd, contextLoader) {
|
|
|
277
277
|
* @returns Whether the actor is the owner of the key.
|
|
278
278
|
*/
|
|
279
279
|
async function doesActorOwnKey(activity, key, options) {
|
|
280
|
-
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
280
|
+
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
|
281
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
|
282
|
+
return await tracer.startActiveSpan("activitypub.verify_key_ownership", {
|
|
283
|
+
kind: __opentelemetry_api.SpanKind.INTERNAL,
|
|
284
|
+
attributes: {
|
|
285
|
+
"activitypub.actor.id": activity.actorId?.href ?? "",
|
|
286
|
+
"activitypub.key.id": key.id?.href ?? ""
|
|
287
|
+
}
|
|
288
|
+
}, async (span) => {
|
|
289
|
+
try {
|
|
290
|
+
if (key.ownerId != null) {
|
|
291
|
+
const owns = key.ownerId.href === activity.actorId?.href;
|
|
292
|
+
span.setAttribute("activitypub.key_ownership.verified", owns);
|
|
293
|
+
span.setAttribute("activitypub.key_ownership.method", "owner_id");
|
|
294
|
+
return owns;
|
|
295
|
+
}
|
|
296
|
+
const actor = await activity.getActor(options);
|
|
297
|
+
if (actor == null || !require_actor.isActor(actor)) {
|
|
298
|
+
span.setAttribute("activitypub.key_ownership.verified", false);
|
|
299
|
+
span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
for (const publicKeyId of actor.publicKeyIds) if (key.id != null && publicKeyId.href === key.id.href) {
|
|
303
|
+
span.setAttribute("activitypub.key_ownership.verified", true);
|
|
304
|
+
span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
span.setAttribute("activitypub.key_ownership.verified", false);
|
|
308
|
+
span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
|
|
309
|
+
return false;
|
|
310
|
+
} catch (error) {
|
|
311
|
+
span.recordException(error);
|
|
312
|
+
span.setStatus({
|
|
313
|
+
code: __opentelemetry_api.SpanStatusCode.ERROR,
|
|
314
|
+
message: String(error)
|
|
315
|
+
});
|
|
316
|
+
throw error;
|
|
317
|
+
} finally {
|
|
318
|
+
span.end();
|
|
319
|
+
}
|
|
320
|
+
});
|
|
285
321
|
}
|
|
286
322
|
/**
|
|
287
323
|
* 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 { deno_default } from "./lookup-
|
|
7
|
-
import { doubleKnock } from "./http-
|
|
6
|
+
import { deno_default } from "./lookup-Dj9-mgOn.js";
|
|
7
|
+
import { doubleKnock } from "./http-DH47B-h3.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-Dj9-mgOn.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-BT-e5fn9.js";
|
|
11
|
+
import { exportJwk } from "../key-x7E5PYI0.js";
|
|
12
|
+
import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-DH47B-h3.js";
|
|
13
|
+
import { mockDocumentLoader, test } from "../testing-BslrM_9E.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-DLk_8H-l.js";
|
|
19
|
+
import { esm_default } from "../esm-VlKMJQqV.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-Dj9-mgOn.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-BT-e5fn9.js";
|
|
11
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-x7E5PYI0.js";
|
|
12
|
+
import { mockDocumentLoader, test } from "../testing-BslrM_9E.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-DLk_8H-l.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-Dj9-mgOn.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-BT-e5fn9.js";
|
|
10
|
+
import { generateCryptoKeyPair } from "../key-x7E5PYI0.js";
|
|
11
|
+
import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-CRPaU6c8.js";
|
|
12
|
+
import { mockDocumentLoader, test } from "../testing-BslrM_9E.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-DLk_8H-l.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-BTqtVATt.cjs');
|
|
6
|
+
require('../actor-CBfPjuWj.cjs');
|
|
7
|
+
const require_http = require('../http-Dxpqz4hE.cjs');
|
|
8
|
+
const require_proof = require('../proof-fEwcA7LA.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-DOSnR912.js";
|
|
6
|
+
import "../actor-B_gRMloq.js";
|
|
7
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-YhR_TMMQ.js";
|
|
8
|
+
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-C8-2l0zH.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-Dj9-mgOn.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-BT-e5fn9.js";
|
|
11
|
+
import "../key-x7E5PYI0.js";
|
|
12
|
+
import { doesActorOwnKey, getKeyOwner } from "../owner-CIWnopkT.js";
|
|
13
|
+
import { mockDocumentLoader, test } from "../testing-BslrM_9E.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-DLk_8H-l.js";
|
|
19
|
+
import { createTestTracerProvider } from "../otel-1BmGPuZc.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-Dj9-mgOn.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-BT-e5fn9.js";
|
|
11
|
+
import "../key-x7E5PYI0.js";
|
|
12
|
+
import { createProof, signObject, verifyObject, verifyProof } from "../proof-D-5ri6rf.js";
|
|
13
|
+
import { mockDocumentLoader, test } from "../testing-BslrM_9E.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-DLk_8H-l.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-Dj9-mgOn.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-BslrM_9E.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-Dj9-mgOn.js";
|
|
7
|
+
import { createInboxContext, createRequestContext, test, testDefinitions } from "../testing-BslrM_9E.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-Dj9-mgOn.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-Dj9-mgOn.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-BT-e5fn9.js";
|
|
11
|
+
import "../key-x7E5PYI0.js";
|
|
12
|
+
import { verifyRequest } from "../http-DH47B-h3.js";
|
|
13
|
+
import { getAuthenticatedDocumentLoader } from "../docloader-DndkGj0O.js";
|
|
14
|
+
import { mockDocumentLoader, test } from "../testing-BslrM_9E.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-DLk_8H-l.js";
|
|
20
|
+
import { esm_default } from "../esm-VlKMJQqV.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-
|
|
6
|
+
import "../lookup-Dj9-mgOn.js";
|
|
7
7
|
import { MockKvStore, kvCache } from "../kv-cache-DN9pfMBe.js";
|
|
8
|
-
import { mockDocumentLoader, test } from "../testing-
|
|
8
|
+
import { mockDocumentLoader, test } from "../testing-BslrM_9E.js";
|
|
9
9
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
10
10
|
import { deepStrictEqual, throws } from "node:assert";
|
|
11
11
|
|
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-BTqtVATt.cjs');
|
|
6
|
+
require('../actor-CBfPjuWj.cjs');
|
|
7
|
+
require('../http-Dxpqz4hE.cjs');
|
|
8
|
+
const require_kv_cache = require('../kv-cache-BMpfJFTx.cjs');
|
|
9
9
|
require('../utils-DyRU1gdZ.cjs');
|
|
10
10
|
|
|
11
11
|
exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
|
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-DOSnR912.js";
|
|
6
|
+
import "../actor-B_gRMloq.js";
|
|
7
|
+
import "../http-YhR_TMMQ.js";
|
|
8
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "../kv-cache-HFnFIjSD.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-Dj9-mgOn.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-BT-e5fn9.js";
|
|
11
|
+
import { test } from "../testing-BslrM_9E.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-VlKMJQqV.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-Dj9-mgOn.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-BslrM_9E.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-1BmGPuZc.js";
|
|
16
|
+
import { esm_default } from "../esm-VlKMJQqV.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-BTqtVATt.cjs');
|
|
6
|
+
const require_actor = require('../actor-CBfPjuWj.cjs');
|
|
7
|
+
const require_vocab = require('../vocab-X_X5T8D3.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-DOSnR912.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-B_gRMloq.js";
|
|
7
|
+
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../vocab-ByUp-A2_.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-Dj9-mgOn.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
|
-
import { test } from "../testing-
|
|
8
|
+
import { test } from "../testing-BslrM_9E.js";
|
|
9
9
|
|
|
10
10
|
//#region src/vocab/type.test.ts
|
|
11
11
|
test("getTypeId()", () => {
|