@fedify/fedify 1.7.10 → 1.7.12
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/dist/{actor-m_MgQ1Da.js → actor-GZRoTRqg.js} +1059 -2276
- package/dist/{actor-C9RnX-Fl.js → actor-TYqJGdVq.js} +6 -9
- package/dist/{assert-DmFG7ppO.js → assert-LOEeCUK5.js} +1 -1
- package/dist/{assert_equals-CTYbeopb.js → assert_equals-B44MxcIj.js} +2 -4
- package/dist/{assert_instance_of-CF09JHYM.js → assert_instance_of-XtuFevV_.js} +1 -1
- package/dist/{assert_is_error-nrwA1GeT.js → assert_is_error-BTlryvT0.js} +1 -1
- package/dist/{assert_not_equals-Dc7y-V5Q.js → assert_not_equals-C685gKx6.js} +1 -1
- package/dist/{assert_rejects-C-sxEMM5.js → assert_rejects-DWQ4jaf9.js} +2 -2
- package/dist/{assert_throws-Cn9C6Jur.js → assert_throws-YetpVSc-.js} +2 -2
- package/dist/{authdocloader-cdK4XSRT.js → authdocloader-BopfyipD.js} +3 -3
- package/dist/{authdocloader-7OXAs5XI.js → authdocloader-hiFSyM7V.js} +4 -4
- package/dist/{builder-C7nJE1zO.js → builder-mi6RdzNE.js} +7 -10
- package/dist/{chunk-HsBuZ-b2.js → chunk-Cx8LTkjm.js} +3 -1
- package/dist/{client-DXIsEekV.js → client-DuUKk4pk.js} +6 -6
- package/dist/compat/transformers.test.js +27 -28
- package/dist/{context-Bts52fbz.js → context-RMU32mk4.js} +2 -2
- package/dist/{docloader-BK2Fp3AJ.js → docloader-DJxET2fN.js} +5 -9
- package/dist/{docloader-CgkbWVNz.js → docloader-bgBm1Hd1.js} +4 -6
- package/dist/{esm-Db4De7AS.js → esm-DO9PrujO.js} +23 -34
- package/dist/federation/builder.test.js +23 -29
- package/dist/federation/collection.test.js +9 -9
- package/dist/federation/handler.test.js +33 -33
- package/dist/federation/inbox.test.js +10 -10
- package/dist/federation/keycache.test.js +9 -9
- package/dist/federation/kv.test.js +10 -9
- package/dist/federation/middleware.test.js +76 -99
- package/dist/federation/mod.js +11 -11
- package/dist/federation/mq.test.js +10 -11
- package/dist/federation/retry.test.js +3 -3
- package/dist/federation/router.test.js +9 -9
- package/dist/federation/send.test.js +22 -22
- package/dist/{federation-BRIQn-GV.js → federation-B0aljx0V.js} +1 -2
- package/dist/fixtures/oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd.json +24 -0
- package/dist/{http-D1IBucdD.js → http-D2DkwsjA.js} +56 -17
- package/dist/{http-CwQqD0nE.js → http-vqMAvOVs.js} +56 -17
- package/dist/{inbox-BrMkm2b5.js → inbox-DAAZZl2k.js} +5 -7
- package/dist/key-5ssHQ67E.js +16 -0
- package/dist/{key-Do-Pud3s.js → key-DSJGnD10.js} +4 -4
- package/dist/{key-C6phFgFq.js → key-DmqJj57e.js} +5 -8
- package/dist/{key-DtQ4rLnr.js → key-KVhaUM92.js} +6 -9
- package/dist/{keycache-B_99o7Nj.js → keycache-C1pEuRyQ.js} +2 -2
- package/dist/{keys-BgLpfFXK.js → keys-C4XQHW5_.js} +1 -1
- package/dist/{ld-AzOj4-js.js → ld-DzlJ_IpT.js} +9 -16
- package/dist/{lookup-DJgGrigh.js → lookup-CSngxuWm.js} +2 -4
- package/dist/{lookup-CBbanOdu.js → lookup-D0je8AqR.js} +7 -11
- package/dist/{lookup-ChtUDlB-.js → lookup-DL62q3Xh.js} +3 -5
- package/dist/{middleware-BS_et69x.js → middleware-3wVT6S9E.js} +34 -52
- package/dist/middleware-CxFoFBD8.js +33 -0
- package/dist/{middleware-R0UobiAQ.js → middleware-DlDXugwZ.js} +34 -58
- package/dist/middleware-w7_U3fFi.js +17 -0
- package/dist/mod.js +11 -11
- package/dist/{multibase-DeCHcK8L.js → multibase-CnLHszip.js} +1 -2
- package/dist/nodeinfo/client.test.js +20 -23
- package/dist/nodeinfo/handler.test.js +32 -32
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/semver.test.js +23 -30
- package/dist/nodeinfo/types.test.js +11 -11
- package/dist/{owner-Ces3Cs3s.js → owner-81ey_76X.js} +3 -3
- package/dist/{proof-BOQF8Trx.js → proof-BlULDH4H.js} +8 -14
- package/dist/{proof-BKV4HiE8.js → proof-DlI7QNdn.js} +12 -25
- package/dist/runtime/authdocloader.test.js +21 -21
- package/dist/runtime/docloader.test.js +16 -18
- package/dist/runtime/key.test.js +17 -17
- package/dist/runtime/langstr.test.js +9 -9
- package/dist/runtime/mod.js +6 -6
- package/dist/runtime/multibase/multibase.test.js +11 -12
- package/dist/runtime/url.test.js +6 -6
- package/dist/{semver-DWClQt_5.js → semver-BNrOOAs9.js} +1 -3
- package/dist/{send-aAmnTqe8.js → send-DdxfTHo6.js} +3 -4
- package/dist/sig/http.test.js +56 -54
- package/dist/sig/key.test.js +18 -18
- package/dist/sig/ld.test.js +20 -22
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +20 -20
- package/dist/sig/proof.test.js +19 -19
- package/dist/{std__assert-vp0TKMS1.js → std__assert-o_r9vqm1.js} +1 -1
- package/dist/testing/docloader.test.js +9 -9
- package/dist/testing/mod.js +1 -1
- package/dist/{testing-BZ0dJ4qn.js → testing-DLyvtiiW.js} +3 -5
- package/dist/{type-D2s5lmbZ.js → type-CFuiGLz9.js} +1 -2
- package/dist/{types-C7C_l-jz.js → types-CJHS5pXl.js} +1 -1
- package/dist/{types-DBIKpLqH.js → types-CmVV9LT1.js} +6 -8
- package/dist/{url-kTAI6_KP.js → url-C2xuoQD1.js} +2 -4
- package/dist/vocab/actor.test.js +104 -156
- package/dist/vocab/lookup.test.js +17 -17
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +11 -15
- package/dist/vocab/vocab.test.js +45 -49
- package/dist/{vocab-F6vbRsQh.js → vocab-BebR0kAy.js} +6 -10
- package/dist/{vocab-BOerhowX.js → vocab-DFlq4Wa6.js} +1057 -2270
- package/dist/webfinger/handler.test.js +33 -34
- package/dist/webfinger/lookup.test.js +13 -13
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/cfworkers.test.js +9 -9
- package/package.json +1 -1
- package/dist/key-ZtjFeVO8.js +0 -16
- package/dist/middleware-BVMzYv1x.js +0 -33
- package/dist/middleware-CnpuCK_K.js +0 -17
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
|
7
|
-
import "../assert-
|
|
8
|
-
import "../assert_instance_of-
|
|
9
|
-
import "../semver-
|
|
10
|
-
import { nodeInfoToJson } from "../types-
|
|
11
|
-
import { test } from "../testing-
|
|
12
|
-
import "../std__assert-
|
|
13
|
-
import "../assert_rejects-
|
|
14
|
-
import "../assert_is_error-
|
|
15
|
-
import "../assert_not_equals-
|
|
16
|
-
import { assertThrows } from "../assert_throws-
|
|
6
|
+
import { assertEquals } from "../assert_equals-B44MxcIj.js";
|
|
7
|
+
import "../assert-LOEeCUK5.js";
|
|
8
|
+
import "../assert_instance_of-XtuFevV_.js";
|
|
9
|
+
import "../semver-BNrOOAs9.js";
|
|
10
|
+
import { nodeInfoToJson } from "../types-CJHS5pXl.js";
|
|
11
|
+
import { test } from "../testing-DLyvtiiW.js";
|
|
12
|
+
import "../std__assert-o_r9vqm1.js";
|
|
13
|
+
import "../assert_rejects-DWQ4jaf9.js";
|
|
14
|
+
import "../assert_is_error-BTlryvT0.js";
|
|
15
|
+
import "../assert_not_equals-C685gKx6.js";
|
|
16
|
+
import { assertThrows } from "../assert_throws-YetpVSc-.js";
|
|
17
17
|
|
|
18
18
|
//#region nodeinfo/types.test.ts
|
|
19
19
|
test("nodeInfoToJson()", () => {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { getDocumentLoader } from "./docloader-
|
|
7
|
-
import { CryptographicKey, Object as Object$1 } from "./vocab-
|
|
8
|
-
import { isActor } from "./actor-
|
|
6
|
+
import { getDocumentLoader } from "./docloader-bgBm1Hd1.js";
|
|
7
|
+
import { CryptographicKey, Object as Object$1 } from "./vocab-DFlq4Wa6.js";
|
|
8
|
+
import { isActor } from "./actor-TYqJGdVq.js";
|
|
9
9
|
import { trace } from "@opentelemetry/api";
|
|
10
10
|
|
|
11
11
|
//#region sig/owner.ts
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./docloader-
|
|
7
|
-
import { Activity, DataIntegrityProof, Multikey } from "./vocab-
|
|
8
|
-
import { getTypeId } from "./type-
|
|
9
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
|
6
|
+
import { deno_default } from "./docloader-bgBm1Hd1.js";
|
|
7
|
+
import { Activity, DataIntegrityProof, Multikey } from "./vocab-DFlq4Wa6.js";
|
|
8
|
+
import { getTypeId } from "./type-CFuiGLz9.js";
|
|
9
|
+
import { fetchKey, validateCryptoKey } from "./key-KVhaUM92.js";
|
|
10
10
|
import { getLogger } from "@logtape/logtape";
|
|
11
11
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
12
12
|
import { encodeHex } from "byte-encodings/hex";
|
|
@@ -31,8 +31,7 @@ const logger = getLogger([
|
|
|
31
31
|
async function createProof(object, privateKey, keyId, { contextLoader, context: context$1, created } = {}) {
|
|
32
32
|
validateCryptoKey(privateKey, "private");
|
|
33
33
|
if (privateKey.algorithm.name !== "Ed25519") throw new TypeError("Unsupported algorithm: " + privateKey.algorithm.name);
|
|
34
|
-
const
|
|
35
|
-
const compactMsg = await objectWithoutProofs.toJsonLd({
|
|
34
|
+
const compactMsg = await object.clone({ proofs: [] }).toJsonLd({
|
|
36
35
|
format: "compact",
|
|
37
36
|
contextLoader,
|
|
38
37
|
context: context$1
|
|
@@ -76,9 +75,7 @@ async function createProof(object, privateKey, keyId, { contextLoader, context:
|
|
|
76
75
|
* @since 0.10.0
|
|
77
76
|
*/
|
|
78
77
|
async function signObject(object, privateKey, keyId, options = {}) {
|
|
79
|
-
|
|
80
|
-
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
|
81
|
-
return await tracer.startActiveSpan("object_integrity_proofs.sign", { attributes: { "activitypub.object.type": getTypeId(object).href } }, async (span) => {
|
|
78
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(deno_default.name, deno_default.version).startActiveSpan("object_integrity_proofs.sign", { attributes: { "activitypub.object.type": getTypeId(object).href } }, async (span) => {
|
|
82
79
|
try {
|
|
83
80
|
if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
|
|
84
81
|
const existingProofs = [];
|
|
@@ -112,9 +109,7 @@ async function signObject(object, privateKey, keyId, options = {}) {
|
|
|
112
109
|
* @since 0.10.0
|
|
113
110
|
*/
|
|
114
111
|
async function verifyProof(jsonLd, proof, options = {}) {
|
|
115
|
-
|
|
116
|
-
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
|
117
|
-
return await tracer.startActiveSpan("object_integrity_proofs.verify", async (span) => {
|
|
112
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(deno_default.name, deno_default.version).startActiveSpan("object_integrity_proofs.verify", async (span) => {
|
|
118
113
|
if (span.isRecording()) {
|
|
119
114
|
if (proof.cryptosuite != null) span.setAttribute("object_integrity_proofs.cryptosuite", proof.cryptosuite);
|
|
120
115
|
if (proof.verificationMethodId != null) span.setAttribute("object_integrity_proofs.key_id", proof.verificationMethodId.href);
|
|
@@ -197,8 +192,7 @@ async function verifyProofInternal(jsonLd, proof, options) {
|
|
|
197
192
|
});
|
|
198
193
|
return null;
|
|
199
194
|
}
|
|
200
|
-
|
|
201
|
-
if (!verified) {
|
|
195
|
+
if (!await crypto.subtle.verify("Ed25519", publicKey.publicKey, proof.proofValue.slice(), digest)) {
|
|
202
196
|
if (fetchedKey.cached) {
|
|
203
197
|
logger.debug("Failed to verify the proof with the cached key {keyId}; retrying with the freshly fetched key...", {
|
|
204
198
|
keyId: proof.verificationMethodId.href,
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { deno_default, getDocumentLoader } from "./docloader-
|
|
6
|
-
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "./actor-
|
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
|
5
|
+
import { deno_default, getDocumentLoader } from "./docloader-DJxET2fN.js";
|
|
6
|
+
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "./actor-GZRoTRqg.js";
|
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-DmqJj57e.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import jsonld from "jsonld";
|
|
@@ -56,8 +56,7 @@ async function createSignature(jsonLd, privateKey, keyId, { contextLoader, creat
|
|
|
56
56
|
const optionsHash = await hashJsonLd(options, contextLoader);
|
|
57
57
|
const docHash = await hashJsonLd(jsonLd, contextLoader);
|
|
58
58
|
const message = optionsHash + docHash;
|
|
59
|
-
const
|
|
60
|
-
const messageBytes = encoder.encode(message);
|
|
59
|
+
const messageBytes = new TextEncoder().encode(message);
|
|
61
60
|
const signature = await crypto.subtle.sign("RSASSA-PKCS1-v1_5", privateKey, messageBytes);
|
|
62
61
|
return {
|
|
63
62
|
...options,
|
|
@@ -79,9 +78,7 @@ async function createSignature(jsonLd, privateKey, keyId, { contextLoader, creat
|
|
|
79
78
|
* @since 1.0.0
|
|
80
79
|
*/
|
|
81
80
|
async function signJsonLd(jsonLd, privateKey, keyId, options) {
|
|
82
|
-
|
|
83
|
-
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
|
84
|
-
return await tracer.startActiveSpan("ld_signatures.sign", { attributes: { "ld_signatures.key_id": keyId.href } }, async (span) => {
|
|
81
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(deno_default.name, deno_default.version).startActiveSpan("ld_signatures.sign", { attributes: { "ld_signatures.key_id": keyId.href } }, async (span) => {
|
|
85
82
|
try {
|
|
86
83
|
const signature = await createSignature(jsonLd, privateKey, keyId, options);
|
|
87
84
|
if (span.isRecording()) {
|
|
@@ -183,8 +180,7 @@ async function verifySignature(jsonLd, options = {}) {
|
|
|
183
180
|
const encoder = new TextEncoder();
|
|
184
181
|
const message = sigOptsHash + docHash;
|
|
185
182
|
const messageBytes = encoder.encode(message);
|
|
186
|
-
|
|
187
|
-
if (verified) return key;
|
|
183
|
+
if (await crypto.subtle.verify("RSASSA-PKCS1-v1_5", key.publicKey, signature.slice(), messageBytes)) return key;
|
|
188
184
|
if (cached) {
|
|
189
185
|
logger$1.debug("Failed to verify with the cached key {keyId}; signature {signatureValue} is invalid. Retrying with the freshly fetched key...", {
|
|
190
186
|
keyId: sig.creator,
|
|
@@ -198,8 +194,7 @@ async function verifySignature(jsonLd, options = {}) {
|
|
|
198
194
|
}
|
|
199
195
|
});
|
|
200
196
|
if (key$1 == null) return null;
|
|
201
|
-
|
|
202
|
-
return verified$1 ? key$1 : null;
|
|
197
|
+
return await crypto.subtle.verify("RSASSA-PKCS1-v1_5", key$1.publicKey, signature.slice(), messageBytes) ? key$1 : null;
|
|
203
198
|
}
|
|
204
199
|
logger$1.debug("Failed to verify with the fetched key {keyId}; signature {signatureValue} is invalid. Check if the key is correct or if the signed message is correct. The message to sign is:\n{message}", {
|
|
205
200
|
keyId: sig.creator,
|
|
@@ -218,9 +213,7 @@ async function verifySignature(jsonLd, options = {}) {
|
|
|
218
213
|
* @returns `true` if the document is authentic; `false` otherwise.
|
|
219
214
|
*/
|
|
220
215
|
async function verifyJsonLd(jsonLd, options = {}) {
|
|
221
|
-
|
|
222
|
-
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
|
223
|
-
return await tracer.startActiveSpan("ld_signatures.verify", async (span) => {
|
|
216
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(deno_default.name, deno_default.version).startActiveSpan("ld_signatures.verify", async (span) => {
|
|
224
217
|
try {
|
|
225
218
|
const object = await Object$1.fromJsonLd(jsonLd, options);
|
|
226
219
|
if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
|
|
@@ -363,8 +356,7 @@ const logger = getLogger([
|
|
|
363
356
|
async function createProof(object, privateKey, keyId, { contextLoader, context: context$1, created } = {}) {
|
|
364
357
|
validateCryptoKey(privateKey, "private");
|
|
365
358
|
if (privateKey.algorithm.name !== "Ed25519") throw new TypeError("Unsupported algorithm: " + privateKey.algorithm.name);
|
|
366
|
-
const
|
|
367
|
-
const compactMsg = await objectWithoutProofs.toJsonLd({
|
|
359
|
+
const compactMsg = await object.clone({ proofs: [] }).toJsonLd({
|
|
368
360
|
format: "compact",
|
|
369
361
|
contextLoader,
|
|
370
362
|
context: context$1
|
|
@@ -408,9 +400,7 @@ async function createProof(object, privateKey, keyId, { contextLoader, context:
|
|
|
408
400
|
* @since 0.10.0
|
|
409
401
|
*/
|
|
410
402
|
async function signObject(object, privateKey, keyId, options = {}) {
|
|
411
|
-
|
|
412
|
-
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
|
413
|
-
return await tracer.startActiveSpan("object_integrity_proofs.sign", { attributes: { "activitypub.object.type": getTypeId(object).href } }, async (span) => {
|
|
403
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(deno_default.name, deno_default.version).startActiveSpan("object_integrity_proofs.sign", { attributes: { "activitypub.object.type": getTypeId(object).href } }, async (span) => {
|
|
414
404
|
try {
|
|
415
405
|
if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
|
|
416
406
|
const existingProofs = [];
|
|
@@ -444,9 +434,7 @@ async function signObject(object, privateKey, keyId, options = {}) {
|
|
|
444
434
|
* @since 0.10.0
|
|
445
435
|
*/
|
|
446
436
|
async function verifyProof(jsonLd, proof, options = {}) {
|
|
447
|
-
|
|
448
|
-
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
|
449
|
-
return await tracer.startActiveSpan("object_integrity_proofs.verify", async (span) => {
|
|
437
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(deno_default.name, deno_default.version).startActiveSpan("object_integrity_proofs.verify", async (span) => {
|
|
450
438
|
if (span.isRecording()) {
|
|
451
439
|
if (proof.cryptosuite != null) span.setAttribute("object_integrity_proofs.cryptosuite", proof.cryptosuite);
|
|
452
440
|
if (proof.verificationMethodId != null) span.setAttribute("object_integrity_proofs.key_id", proof.verificationMethodId.href);
|
|
@@ -529,8 +517,7 @@ async function verifyProofInternal(jsonLd, proof, options) {
|
|
|
529
517
|
});
|
|
530
518
|
return null;
|
|
531
519
|
}
|
|
532
|
-
|
|
533
|
-
if (!verified) {
|
|
520
|
+
if (!await crypto.subtle.verify("Ed25519", publicKey.publicKey, proof.proofValue.slice(), digest)) {
|
|
534
521
|
if (fetchedKey.cached) {
|
|
535
522
|
logger.debug("Failed to verify the proof with the cached key {keyId}; retrying with the freshly fetched key...", {
|
|
536
523
|
keyId: proof.verificationMethodId.href,
|
|
@@ -3,29 +3,29 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
|
7
|
-
import "../assert-
|
|
8
|
-
import "../assert_instance_of-
|
|
9
|
-
import "../docloader-
|
|
10
|
-
import { UrlError } from "../url-
|
|
11
|
-
import "../multibase-
|
|
12
|
-
import "../vocab-
|
|
6
|
+
import { assertEquals } from "../assert_equals-B44MxcIj.js";
|
|
7
|
+
import "../assert-LOEeCUK5.js";
|
|
8
|
+
import "../assert_instance_of-XtuFevV_.js";
|
|
9
|
+
import "../docloader-bgBm1Hd1.js";
|
|
10
|
+
import { UrlError } from "../url-C2xuoQD1.js";
|
|
11
|
+
import "../multibase-CnLHszip.js";
|
|
12
|
+
import "../vocab-DFlq4Wa6.js";
|
|
13
13
|
import "../langstr-DbWheeIS.js";
|
|
14
|
-
import "../lookup-
|
|
15
|
-
import "../type-
|
|
16
|
-
import "../actor-
|
|
17
|
-
import "../key-
|
|
18
|
-
import { verifyRequest } from "../http-
|
|
19
|
-
import { getAuthenticatedDocumentLoader } from "../authdocloader-
|
|
20
|
-
import { test } from "../testing-
|
|
21
|
-
import "../std__assert-
|
|
22
|
-
import { assertRejects } from "../assert_rejects-
|
|
23
|
-
import "../assert_is_error-
|
|
24
|
-
import "../assert_not_equals-
|
|
25
|
-
import "../assert_throws-
|
|
14
|
+
import "../lookup-DL62q3Xh.js";
|
|
15
|
+
import "../type-CFuiGLz9.js";
|
|
16
|
+
import "../actor-TYqJGdVq.js";
|
|
17
|
+
import "../key-KVhaUM92.js";
|
|
18
|
+
import { verifyRequest } from "../http-D2DkwsjA.js";
|
|
19
|
+
import { getAuthenticatedDocumentLoader } from "../authdocloader-hiFSyM7V.js";
|
|
20
|
+
import { test } from "../testing-DLyvtiiW.js";
|
|
21
|
+
import "../std__assert-o_r9vqm1.js";
|
|
22
|
+
import { assertRejects } from "../assert_rejects-DWQ4jaf9.js";
|
|
23
|
+
import "../assert_is_error-BTlryvT0.js";
|
|
24
|
+
import "../assert_not_equals-C685gKx6.js";
|
|
25
|
+
import "../assert_throws-YetpVSc-.js";
|
|
26
26
|
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
|
27
|
-
import { rsaPrivateKey2 } from "../keys-
|
|
28
|
-
import { esm_default } from "../esm-
|
|
27
|
+
import { rsaPrivateKey2 } from "../keys-C4XQHW5_.js";
|
|
28
|
+
import { esm_default } from "../esm-DO9PrujO.js";
|
|
29
29
|
|
|
30
30
|
//#region runtime/authdocloader.test.ts
|
|
31
31
|
test("getAuthenticatedDocumentLoader()", async (t) => {
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
|
7
|
-
import "../assert-
|
|
8
|
-
import "../assert_instance_of-
|
|
6
|
+
import { assertEquals } from "../assert_equals-B44MxcIj.js";
|
|
7
|
+
import "../assert-LOEeCUK5.js";
|
|
8
|
+
import "../assert_instance_of-XtuFevV_.js";
|
|
9
9
|
import { MemoryKvStore } from "../kv-BMY6Qf_A.js";
|
|
10
|
-
import { FetchError, contexts_default, deno_default, getDocumentLoader, getUserAgent, kvCache } from "../docloader-
|
|
11
|
-
import { UrlError } from "../url-
|
|
12
|
-
import { test } from "../testing-
|
|
13
|
-
import "../std__assert-
|
|
14
|
-
import { assertRejects } from "../assert_rejects-
|
|
15
|
-
import "../assert_is_error-
|
|
16
|
-
import "../assert_not_equals-
|
|
17
|
-
import { assertThrows } from "../assert_throws-
|
|
10
|
+
import { FetchError, contexts_default, deno_default, getDocumentLoader, getUserAgent, kvCache } from "../docloader-bgBm1Hd1.js";
|
|
11
|
+
import { UrlError } from "../url-C2xuoQD1.js";
|
|
12
|
+
import { test } from "../testing-DLyvtiiW.js";
|
|
13
|
+
import "../std__assert-o_r9vqm1.js";
|
|
14
|
+
import { assertRejects } from "../assert_rejects-DWQ4jaf9.js";
|
|
15
|
+
import "../assert_is_error-BTlryvT0.js";
|
|
16
|
+
import "../assert_not_equals-C685gKx6.js";
|
|
17
|
+
import { assertThrows } from "../assert_throws-YetpVSc-.js";
|
|
18
18
|
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
|
19
|
-
import { esm_default } from "../esm-
|
|
19
|
+
import { esm_default } from "../esm-DO9PrujO.js";
|
|
20
20
|
import process from "node:process";
|
|
21
21
|
|
|
22
22
|
//#region runtime/docloader.test.ts
|
|
@@ -351,13 +351,12 @@ test("kvCache()", async (t) => {
|
|
|
351
351
|
});
|
|
352
352
|
});
|
|
353
353
|
await t.step("not cached", async () => {
|
|
354
|
-
const
|
|
354
|
+
const result = await kvCache({
|
|
355
355
|
kv,
|
|
356
356
|
loader: mockDocumentLoader,
|
|
357
357
|
rules: [],
|
|
358
358
|
prefix: ["_test", "not cached"]
|
|
359
|
-
});
|
|
360
|
-
const result = await loader("https://example.com/object");
|
|
359
|
+
})("https://example.com/object");
|
|
361
360
|
assertEquals(result, {
|
|
362
361
|
contextUrl: null,
|
|
363
362
|
documentUrl: "https://example.com/object",
|
|
@@ -405,7 +404,7 @@ test("kvCache()", async (t) => {
|
|
|
405
404
|
throw new Error("Failed to delete key");
|
|
406
405
|
}
|
|
407
406
|
}
|
|
408
|
-
const
|
|
407
|
+
const result = await kvCache({
|
|
409
408
|
kv: new KvStoreThrowsException(),
|
|
410
409
|
loader: mockDocumentLoader,
|
|
411
410
|
rules: [
|
|
@@ -414,8 +413,7 @@ test("kvCache()", async (t) => {
|
|
|
414
413
|
[new URLPattern("https://example.com/*"), Temporal.Duration.from({ days: 30 })]
|
|
415
414
|
],
|
|
416
415
|
prefix: ["_test", "not cached"]
|
|
417
|
-
});
|
|
418
|
-
const result = await loader("https://example.com/object");
|
|
416
|
+
})("https://example.com/object");
|
|
419
417
|
assertEquals(result, {
|
|
420
418
|
contextUrl: null,
|
|
421
419
|
documentUrl: "https://example.com/object",
|
package/dist/runtime/key.test.js
CHANGED
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
|
7
|
-
import "../assert-
|
|
8
|
-
import "../assert_instance_of-
|
|
9
|
-
import "../docloader-
|
|
10
|
-
import "../url-
|
|
11
|
-
import "../multibase-
|
|
12
|
-
import { exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../vocab-
|
|
6
|
+
import { assertEquals } from "../assert_equals-B44MxcIj.js";
|
|
7
|
+
import "../assert-LOEeCUK5.js";
|
|
8
|
+
import "../assert_instance_of-XtuFevV_.js";
|
|
9
|
+
import "../docloader-bgBm1Hd1.js";
|
|
10
|
+
import "../url-C2xuoQD1.js";
|
|
11
|
+
import "../multibase-CnLHszip.js";
|
|
12
|
+
import { exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../vocab-DFlq4Wa6.js";
|
|
13
13
|
import "../langstr-DbWheeIS.js";
|
|
14
|
-
import "../lookup-
|
|
15
|
-
import "../type-
|
|
16
|
-
import "../actor-
|
|
17
|
-
import { exportJwk, importJwk } from "../key-
|
|
18
|
-
import { test } from "../testing-
|
|
19
|
-
import "../std__assert-
|
|
20
|
-
import "../assert_rejects-
|
|
21
|
-
import "../assert_is_error-
|
|
22
|
-
import "../assert_not_equals-
|
|
23
|
-
import "../assert_throws-
|
|
14
|
+
import "../lookup-DL62q3Xh.js";
|
|
15
|
+
import "../type-CFuiGLz9.js";
|
|
16
|
+
import "../actor-TYqJGdVq.js";
|
|
17
|
+
import { exportJwk, importJwk } from "../key-KVhaUM92.js";
|
|
18
|
+
import { test } from "../testing-DLyvtiiW.js";
|
|
19
|
+
import "../std__assert-o_r9vqm1.js";
|
|
20
|
+
import "../assert_rejects-DWQ4jaf9.js";
|
|
21
|
+
import "../assert_is_error-BTlryvT0.js";
|
|
22
|
+
import "../assert_not_equals-C685gKx6.js";
|
|
23
|
+
import "../assert_throws-YetpVSc-.js";
|
|
24
24
|
|
|
25
25
|
//#region runtime/key.test.ts
|
|
26
26
|
const rsaSpki = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxsRuvCkgJtflBTl4OVsm\nnt/J1mQfZasfJtN33dcZ3d1lJroxmgmMu69zjGEAwkNbMQaWNLqC4eogkJaeJ4RR\n5MHYXkL9nNilVoTkjX5BVit3puzs7XJ7WQnKQgQMI+ezn24GHsZ/v1JIo77lerX5\nk4HNwTNVt+yaZVQWaOMR3+6FwziQR6kd0VuG9/a9dgAnz2cEoORRC1i4W7IZaB1s\nZnh1WbHbevlGd72HSXll5rocPIHn8gq6xpBgpHwRphlRsgn4KHaJ6brXDIJjrnQh\nIe/YUBOGj/ImSEXhRwlFerKsoAVnZ0Hwbfa46qk44TAt8CyoPMWmpK6pt0ng4pQ2\nuwIDAQAB\n-----END PUBLIC KEY-----\n";
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
|
7
|
-
import "../assert-
|
|
8
|
-
import "../assert_instance_of-
|
|
6
|
+
import { assertEquals } from "../assert_equals-B44MxcIj.js";
|
|
7
|
+
import "../assert-LOEeCUK5.js";
|
|
8
|
+
import "../assert_instance_of-XtuFevV_.js";
|
|
9
9
|
import { LanguageString } from "../langstr-DbWheeIS.js";
|
|
10
|
-
import { test } from "../testing-
|
|
11
|
-
import "../std__assert-
|
|
12
|
-
import "../assert_rejects-
|
|
13
|
-
import "../assert_is_error-
|
|
14
|
-
import "../assert_not_equals-
|
|
15
|
-
import "../assert_throws-
|
|
10
|
+
import { test } from "../testing-DLyvtiiW.js";
|
|
11
|
+
import "../std__assert-o_r9vqm1.js";
|
|
12
|
+
import "../assert_rejects-DWQ4jaf9.js";
|
|
13
|
+
import "../assert_is_error-BTlryvT0.js";
|
|
14
|
+
import "../assert_not_equals-C685gKx6.js";
|
|
15
|
+
import "../assert_throws-YetpVSc-.js";
|
|
16
16
|
import { parseLanguageTag } from "@phensley/language-tag";
|
|
17
17
|
import util from "node:util";
|
|
18
18
|
|
package/dist/runtime/mod.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "../docloader-
|
|
6
|
-
import { LanguageString, exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../actor-
|
|
7
|
-
import "../lookup-
|
|
8
|
-
import "../key-
|
|
9
|
-
import "../http-
|
|
10
|
-
import { getAuthenticatedDocumentLoader } from "../authdocloader-
|
|
5
|
+
import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "../docloader-DJxET2fN.js";
|
|
6
|
+
import { LanguageString, exportMultibaseKey, exportSpki, importMultibaseKey, importPem, importPkcs1, importSpki } from "../actor-GZRoTRqg.js";
|
|
7
|
+
import "../lookup-CSngxuWm.js";
|
|
8
|
+
import "../key-DmqJj57e.js";
|
|
9
|
+
import "../http-vqMAvOVs.js";
|
|
10
|
+
import { getAuthenticatedDocumentLoader } from "../authdocloader-BopfyipD.js";
|
|
11
11
|
import "../runtime-BSkOVUWM.js";
|
|
12
12
|
|
|
13
13
|
export { FetchError, LanguageString, exportMultibaseKey, exportSpki, fetchDocumentLoader, getAuthenticatedDocumentLoader, getDocumentLoader, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, kvCache };
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { assertEquals } from "../../assert_equals-
|
|
7
|
-
import "../../assert-
|
|
8
|
-
import "../../assert_instance_of-
|
|
9
|
-
import { codes, decode, decodeText, encode, encodeText, names } from "../../multibase-
|
|
10
|
-
import { test } from "../../testing-
|
|
11
|
-
import "../../std__assert-
|
|
12
|
-
import "../../assert_rejects-
|
|
13
|
-
import "../../assert_is_error-
|
|
14
|
-
import "../../assert_not_equals-
|
|
15
|
-
import "../../assert_throws-
|
|
6
|
+
import { assertEquals } from "../../assert_equals-B44MxcIj.js";
|
|
7
|
+
import "../../assert-LOEeCUK5.js";
|
|
8
|
+
import "../../assert_instance_of-XtuFevV_.js";
|
|
9
|
+
import { codes, decode, decodeText, encode, encodeText, names } from "../../multibase-CnLHszip.js";
|
|
10
|
+
import { test } from "../../testing-DLyvtiiW.js";
|
|
11
|
+
import "../../std__assert-o_r9vqm1.js";
|
|
12
|
+
import "../../assert_rejects-DWQ4jaf9.js";
|
|
13
|
+
import "../../assert_is_error-BTlryvT0.js";
|
|
14
|
+
import "../../assert_not_equals-C685gKx6.js";
|
|
15
|
+
import "../../assert_throws-YetpVSc-.js";
|
|
16
16
|
|
|
17
17
|
//#region runtime/multibase/multibase.test.ts
|
|
18
18
|
test("multibase.encode and decode", async (t) => {
|
|
@@ -337,8 +337,7 @@ test("multibase.encode and decode", async (t) => {
|
|
|
337
337
|
assertEquals(decodedFromBuffer, encodeText(input), `Decoding buffer of ${name} failed`);
|
|
338
338
|
});
|
|
339
339
|
await t.step("should allow base32pad full alphabet", () => {
|
|
340
|
-
const
|
|
341
|
-
const decoded = decode(encodedStr);
|
|
340
|
+
const decoded = decode("ctimaq4ygg2iegci7");
|
|
342
341
|
const encoded = encode("c", decoded);
|
|
343
342
|
assertEquals(decode(encoded), decoded);
|
|
344
343
|
});
|
package/dist/runtime/url.test.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
|
7
|
-
import { assert } from "../assert-
|
|
8
|
-
import { UrlError, expandIPv6Address, isValidPublicIPv4Address, isValidPublicIPv6Address, validatePublicUrl } from "../url-
|
|
9
|
-
import { test } from "../testing-
|
|
10
|
-
import { assertFalse, assertRejects } from "../assert_rejects-
|
|
11
|
-
import "../assert_is_error-
|
|
6
|
+
import { assertEquals } from "../assert_equals-B44MxcIj.js";
|
|
7
|
+
import { assert } from "../assert-LOEeCUK5.js";
|
|
8
|
+
import { UrlError, expandIPv6Address, isValidPublicIPv4Address, isValidPublicIPv6Address, validatePublicUrl } from "../url-C2xuoQD1.js";
|
|
9
|
+
import { test } from "../testing-DLyvtiiW.js";
|
|
10
|
+
import { assertFalse, assertRejects } from "../assert_rejects-DWQ4jaf9.js";
|
|
11
|
+
import "../assert_is_error-BTlryvT0.js";
|
|
12
12
|
|
|
13
13
|
//#region runtime/url.test.ts
|
|
14
14
|
test("validatePublicUrl()", async () => {
|
|
@@ -140,9 +140,7 @@ function formatSemVer(version) {
|
|
|
140
140
|
const patch = formatNumber(version.patch);
|
|
141
141
|
const pre = version.prerelease?.join(".") ?? "";
|
|
142
142
|
const build = version.build?.join(".") ?? "";
|
|
143
|
-
|
|
144
|
-
const release = [primary, pre].filter((v) => v).join("-");
|
|
145
|
-
return [release, build].filter((v) => v).join("+");
|
|
143
|
+
return [[`${major}.${minor}.${patch}`, pre].filter((v) => v).join("-"), build].filter((v) => v).join("+");
|
|
146
144
|
}
|
|
147
145
|
|
|
148
146
|
//#endregion
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./docloader-
|
|
7
|
-
import { doubleKnock } from "./http-
|
|
6
|
+
import { deno_default } from "./docloader-bgBm1Hd1.js";
|
|
7
|
+
import { doubleKnock } from "./http-D2DkwsjA.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
|
|
@@ -44,8 +44,7 @@ function extractInboxes({ recipients, preferSharedInbox, excludeBaseUris }) {
|
|
|
44
44
|
*/
|
|
45
45
|
function sendActivity(options) {
|
|
46
46
|
const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
|
|
47
|
-
|
|
48
|
-
return tracer.startActiveSpan("activitypub.send_activity", {
|
|
47
|
+
return tracerProvider.getTracer(deno_default.name, deno_default.version).startActiveSpan("activitypub.send_activity", {
|
|
49
48
|
kind: SpanKind.CLIENT,
|
|
50
49
|
attributes: { "activitypub.shared_inbox": options.sharedInbox ?? false }
|
|
51
50
|
}, async (span) => {
|