@fedify/fedify 2.3.0-dev.1099 → 2.3.0-dev.1114
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/{assert_rejects-B-qJtC9Z.mjs → assert_rejects-DQP-q39h.mjs} +27 -2
- package/dist/{builder-BkRRjxzb.mjs → builder-YlEusQth.mjs} +3 -3
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/outgoing-jsonld.test.mjs +1 -1
- package/dist/compat/public-audience.test.mjs +1 -1
- package/dist/compat/transformers.test.mjs +2 -2
- package/dist/{context-C0C_sRha.d.cts → context-Ch-ZLyTQ.d.cts} +1 -1
- package/dist/{context-Dqgt8saU.d.ts → context-cSUMk2da.d.ts} +1 -1
- package/dist/{deno-DBabeupC.mjs → deno-CF3jMgip.mjs} +1 -1
- package/dist/{docloader-DA5FzJOR.mjs → docloader-BENj6vQ4.mjs} +2 -2
- package/dist/federation/builder.test.mjs +3 -3
- package/dist/federation/collection.test.mjs +2 -2
- package/dist/federation/handler.test.mjs +8 -7
- package/dist/federation/idempotency.test.mjs +5 -5
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/keycache.test.mjs +1 -1
- package/dist/federation/kv.test.mjs +2 -2
- package/dist/federation/middleware.test.mjs +10 -10
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +2 -2
- package/dist/federation/mod.d.ts +2 -2
- package/dist/federation/mod.js +1 -1
- package/dist/federation/mq.test.mjs +2 -2
- package/dist/federation/negotiation.test.mjs +2 -2
- package/dist/federation/router.test.mjs +2 -2
- package/dist/federation/send.test.mjs +11 -11
- package/dist/federation/webfinger.test.mjs +3 -3
- package/dist/{getMachineId-bsd-etIyxDet.mjs → getMachineId-bsd-BY01PL1n.mjs} +1 -1
- package/dist/{getMachineId-darwin-D23zTf4g.mjs → getMachineId-darwin-Dr1gkBkp.mjs} +1 -1
- package/dist/{getMachineId-win-Dpap6v5i.mjs → getMachineId-win-QEYwcJiy.mjs} +1 -1
- package/dist/{http-5G18W3NP.mjs → http-BmOZYc-8.mjs} +86 -37
- package/dist/{http-W2u_KBoQ.cjs → http-CKCgOPkX.cjs} +427 -35
- package/dist/{http-Dzy5c472.js → http-CpzZ9zsb.js} +393 -37
- package/dist/{http-BDZeS5om.d.ts → http-D6LP89UO.d.ts} +7 -1
- package/dist/{http-C87EWkO0.d.cts → http-D6aw3j2U.d.cts} +7 -1
- package/dist/{key-D9dUsyow.mjs → key-B4I8H5Lc.mjs} +1 -1
- package/dist/{kv-cache-BygrlQ1c.cjs → kv-cache-DY-XWOqM.cjs} +1 -1
- package/dist/{kv-cache-CBSgxEsZ.js → kv-cache-Wc5ezcVW.js} +1 -1
- package/dist/{ld-hbxDLO1k.mjs → ld-B5D5THhl.mjs} +60 -9
- package/dist/{send-BOwz4Hw5.mjs → metrics-ek3ilf6c.mjs} +53 -221
- package/dist/{middleware-vCF_cKAq.js → middleware-CuZbBw-N.js} +16 -269
- package/dist/{middleware-BXnhAGF9.mjs → middleware-DlcecZMq.mjs} +29 -23
- package/dist/{middleware-DZQsPMZb.mjs → middleware-EI7OU6BR.mjs} +1 -1
- package/dist/{middleware-Caj827xW.cjs → middleware-EqTYPG4F.cjs} +45 -298
- package/dist/{mod-DXY9JF28.d.cts → mod-B-Lin9Sy.d.ts} +25 -2
- package/dist/{mod-DHO9lk3D.d.ts → mod-BDhgfjP7.d.cts} +25 -2
- package/dist/{mod-B0rWmfW5.d.cts → mod-BR_BB0bh.d.cts} +1 -1
- package/dist/{mod-Dx3-hqyo.d.ts → mod-C6E8rkcz.d.ts} +1 -1
- package/dist/{mod-BhU_H1I_.d.ts → mod-DLrRb0dx.d.ts} +1 -1
- package/dist/{mod-CLPnQPsv.d.cts → mod-P9tE2WmM.d.cts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +5 -5
- package/dist/mod.d.ts +5 -5
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/client.test.mjs +2 -2
- package/dist/nodeinfo/handler.test.mjs +3 -3
- package/dist/nodeinfo/types.test.mjs +2 -2
- package/dist/otel/exporter.test.mjs +2 -2
- package/dist/{outgoing-jsonld-BgFLCJQ_.mjs → outgoing-jsonld-BNL8AC14.mjs} +1 -1
- package/dist/{owner-DwJe0BH9.mjs → owner-DO810N24.mjs} +2 -2
- package/dist/{proof-erpV_J_n.mjs → proof-BgfyWv7b.mjs} +25 -7
- package/dist/{proof-CZCaAURh.cjs → proof-DIoqrKnX.cjs} +78 -11
- package/dist/{proof-DMJJZnKd.js → proof-Vd8-1EWh.js} +78 -11
- package/dist/send-CAYXdUTk.mjs +225 -0
- package/dist/sig/accept.test.mjs +1 -1
- package/dist/sig/http.test.mjs +212 -6
- package/dist/sig/key.test.mjs +4 -4
- package/dist/sig/ld.test.mjs +138 -5
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.d.cts +2 -2
- package/dist/sig/mod.d.ts +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +4 -4
- package/dist/sig/proof.test.mjs +167 -6
- package/dist/{std__assert-CRDpx_HF.mjs → std__assert-BTEgfoJo.mjs} +2 -27
- package/dist/utils/docloader.test.mjs +5 -5
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +6 -6
- /package/dist/{accept-CceiKpCy.mjs → accept-CgDcxvjV.mjs} +0 -0
- /package/dist/{activity-listener-tztVvlNb.mjs → activity-listener-BeTGV3wc.mjs} +0 -0
- /package/dist/{client-B_A6mfn3.mjs → client-Bneh_DYR.mjs} +0 -0
- /package/dist/{collection-CA3V5zyK.mjs → collection-Cc3DVAhE.mjs} +0 -0
- /package/dist/{execAsync-DCBrgFiV.mjs → execAsync-Dxb7rNf3.mjs} +0 -0
- /package/dist/{getMachineId-linux-ObI47Hql.mjs → getMachineId-linux-Bbhofx-s.mjs} +0 -0
- /package/dist/{getMachineId-unsupported-Ddu-PFeh.mjs → getMachineId-unsupported-dIOte2Ct.mjs} +0 -0
- /package/dist/{keys-C3kae-6B.mjs → keys-CSYsOMFG.mjs} +0 -0
- /package/dist/{kv-x2IvBUyq.mjs → kv-QHE0oeM3.mjs} +0 -0
- /package/dist/{kv-cache-CiiNwT6W.mjs → kv-cache-DihufyAQ.mjs} +0 -0
- /package/dist/{public-audience-N3pyOx2p.mjs → public-audience-c9zmYKgA.mjs} +0 -0
- /package/dist/{types-BFowWFTT.mjs → types-D09GN0uZ.mjs} +0 -0
package/dist/sig/key.test.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
5
|
+
import "../std__assert-BTEgfoJo.mjs";
|
|
6
|
+
import { t as assertRejects } from "../assert_rejects-DQP-q39h.mjs";
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
8
|
-
import { a as importJwk, i as generateCryptoKeyPair, n as fetchKey, o as validateCryptoKey, r as fetchKeyDetailed, t as exportJwk } from "../key-
|
|
9
|
-
import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-
|
|
8
|
+
import { a as importJwk, i as generateCryptoKeyPair, n as fetchKey, o as validateCryptoKey, r as fetchKeyDetailed, t as exportJwk } from "../key-B4I8H5Lc.mjs";
|
|
9
|
+
import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CSYsOMFG.mjs";
|
|
10
10
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
11
11
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
import { FetchError } from "@fedify/vocab-runtime";
|
package/dist/sig/ld.test.mjs
CHANGED
|
@@ -2,14 +2,14 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
|
-
import { n as assertFalse, t as assertRejects } from "../assert_rejects-
|
|
5
|
+
import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-DQP-q39h.mjs";
|
|
6
6
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
7
7
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
8
|
-
import { i as generateCryptoKeyPair } from "../key-
|
|
9
|
-
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-
|
|
10
|
-
import { a as signJsonLd, i as hasSignatureLike, n as createSignature, o as verifyJsonLd, r as detachSignature, s as verifySignature, t as attachSignature } from "../ld-
|
|
8
|
+
import { i as generateCryptoKeyPair } from "../key-B4I8H5Lc.mjs";
|
|
9
|
+
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CSYsOMFG.mjs";
|
|
10
|
+
import { a as signJsonLd, i as hasSignatureLike, n as createSignature, o as verifyJsonLd, r as detachSignature, s as verifySignature, t as attachSignature } from "../ld-B5D5THhl.mjs";
|
|
11
11
|
import { CryptographicKey } from "@fedify/vocab";
|
|
12
|
-
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
|
+
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
13
13
|
import { encodeBase64 } from "byte-encodings/base64";
|
|
14
14
|
//#region src/sig/ld.test.ts
|
|
15
15
|
test("attachSignature()", () => {
|
|
@@ -249,5 +249,138 @@ test("verifyJsonLd()", async () => {
|
|
|
249
249
|
contextLoader: mockDocumentLoader
|
|
250
250
|
}));
|
|
251
251
|
});
|
|
252
|
+
test("verifyJsonLd() records verification duration metric", async (t) => {
|
|
253
|
+
await t.step("verified path records result=verified with bounded type", async () => {
|
|
254
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
255
|
+
assert(await verifyJsonLd(testVector, {
|
|
256
|
+
documentLoader: mockDocumentLoader,
|
|
257
|
+
contextLoader: mockDocumentLoader,
|
|
258
|
+
meterProvider
|
|
259
|
+
}));
|
|
260
|
+
const measurements = recorder.getMeasurements("activitypub.signature.verification.duration");
|
|
261
|
+
assertEquals(measurements.length, 1);
|
|
262
|
+
const m = measurements[0];
|
|
263
|
+
assertEquals(m.type, "histogram");
|
|
264
|
+
assertGreaterOrEqual(m.value, 0);
|
|
265
|
+
assertEquals(m.attributes["activitypub.signature.kind"], "linked_data");
|
|
266
|
+
assertEquals(m.attributes["activitypub.signature.result"], "verified");
|
|
267
|
+
assertEquals(m.attributes["ld_signatures.type"], "RsaSignature2017");
|
|
268
|
+
});
|
|
269
|
+
await t.step("missing signature records result=missing without type", async () => {
|
|
270
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
271
|
+
assertFalse(await verifyJsonLd(document, {
|
|
272
|
+
documentLoader: mockDocumentLoader,
|
|
273
|
+
contextLoader: mockDocumentLoader,
|
|
274
|
+
meterProvider
|
|
275
|
+
}));
|
|
276
|
+
const measurements = recorder.getMeasurements("activitypub.signature.verification.duration");
|
|
277
|
+
assertEquals(measurements.length, 1);
|
|
278
|
+
assertEquals(measurements[0].attributes["activitypub.signature.kind"], "linked_data");
|
|
279
|
+
assertEquals(measurements[0].attributes["activitypub.signature.result"], "missing");
|
|
280
|
+
assertFalse("ld_signatures.type" in measurements[0].attributes);
|
|
281
|
+
});
|
|
282
|
+
await t.step("invalid signature records result=rejected", async () => {
|
|
283
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
284
|
+
assertFalse(await verifyJsonLd({
|
|
285
|
+
...testVector,
|
|
286
|
+
signature: {
|
|
287
|
+
...testVector.signature,
|
|
288
|
+
signatureValue: encodeBase64(new Uint8Array([
|
|
289
|
+
1,
|
|
290
|
+
2,
|
|
291
|
+
3,
|
|
292
|
+
4
|
|
293
|
+
]))
|
|
294
|
+
}
|
|
295
|
+
}, {
|
|
296
|
+
documentLoader: mockDocumentLoader,
|
|
297
|
+
contextLoader: mockDocumentLoader,
|
|
298
|
+
meterProvider
|
|
299
|
+
}));
|
|
300
|
+
const measurements = recorder.getMeasurements("activitypub.signature.verification.duration");
|
|
301
|
+
assertEquals(measurements.length, 1);
|
|
302
|
+
assertEquals(measurements[0].attributes["activitypub.signature.result"], "rejected");
|
|
303
|
+
assertEquals(measurements[0].attributes["ld_signatures.type"], "RsaSignature2017");
|
|
304
|
+
});
|
|
305
|
+
await t.step("malformed (null) signature property records result=rejected, not missing", async () => {
|
|
306
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
307
|
+
assertFalse(await verifyJsonLd({
|
|
308
|
+
...document,
|
|
309
|
+
signature: null
|
|
310
|
+
}, {
|
|
311
|
+
documentLoader: mockDocumentLoader,
|
|
312
|
+
contextLoader: mockDocumentLoader,
|
|
313
|
+
meterProvider
|
|
314
|
+
}));
|
|
315
|
+
const measurements = recorder.getMeasurements("activitypub.signature.verification.duration");
|
|
316
|
+
assertEquals(measurements.length, 1);
|
|
317
|
+
assertEquals(measurements[0].attributes["activitypub.signature.result"], "rejected");
|
|
318
|
+
assertFalse("ld_signatures.type" in measurements[0].attributes);
|
|
319
|
+
});
|
|
320
|
+
await t.step("key fetch records result=fetched on a cold cache", async () => {
|
|
321
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
322
|
+
assert(await verifyJsonLd(testVector, {
|
|
323
|
+
documentLoader: mockDocumentLoader,
|
|
324
|
+
contextLoader: mockDocumentLoader,
|
|
325
|
+
meterProvider
|
|
326
|
+
}));
|
|
327
|
+
const measurements = recorder.getMeasurements("activitypub.signature.key_fetch.duration");
|
|
328
|
+
assertEquals(measurements.length, 1);
|
|
329
|
+
assertGreaterOrEqual(measurements[0].value, 0);
|
|
330
|
+
assertEquals(measurements[0].attributes["activitypub.signature.kind"], "linked_data");
|
|
331
|
+
assertEquals(measurements[0].attributes["activitypub.signature.key_fetch.result"], "fetched");
|
|
332
|
+
});
|
|
333
|
+
await t.step("missing signature emits no key_fetch measurement", async () => {
|
|
334
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
335
|
+
assertFalse(await verifyJsonLd(document, {
|
|
336
|
+
documentLoader: mockDocumentLoader,
|
|
337
|
+
contextLoader: mockDocumentLoader,
|
|
338
|
+
meterProvider
|
|
339
|
+
}));
|
|
340
|
+
assertEquals(recorder.getMeasurements("activitypub.signature.key_fetch.duration").length, 0);
|
|
341
|
+
});
|
|
342
|
+
await t.step("cached-key retry emits two key_fetch measurements: hit then fetched", async () => {
|
|
343
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
344
|
+
assert(await verifyJsonLd(testVector, {
|
|
345
|
+
documentLoader: mockDocumentLoader,
|
|
346
|
+
contextLoader: mockDocumentLoader,
|
|
347
|
+
meterProvider,
|
|
348
|
+
keyCache: {
|
|
349
|
+
async get(keyId) {
|
|
350
|
+
return new CryptographicKey({
|
|
351
|
+
id: keyId,
|
|
352
|
+
owner: new URL("https://activitypub.academy/users/brauca_darradiul"),
|
|
353
|
+
publicKey: (await generateCryptoKeyPair("RSASSA-PKCS1-v1_5")).publicKey
|
|
354
|
+
});
|
|
355
|
+
},
|
|
356
|
+
set(_keyId, _key) {
|
|
357
|
+
return Promise.resolve();
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}));
|
|
361
|
+
const measurements = recorder.getMeasurements("activitypub.signature.key_fetch.duration");
|
|
362
|
+
assertEquals(measurements.length, 2);
|
|
363
|
+
assertEquals(measurements[0].attributes["activitypub.signature.key_fetch.result"], "hit");
|
|
364
|
+
assertEquals(measurements[1].attributes["activitypub.signature.key_fetch.result"], "fetched");
|
|
365
|
+
});
|
|
366
|
+
await t.step("unknown signature type omits the ld_signatures.type metric attribute", async () => {
|
|
367
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
368
|
+
assertFalse(await verifyJsonLd({
|
|
369
|
+
...testVector,
|
|
370
|
+
signature: {
|
|
371
|
+
...testVector.signature,
|
|
372
|
+
type: "MadeUpSignature9999"
|
|
373
|
+
}
|
|
374
|
+
}, {
|
|
375
|
+
documentLoader: mockDocumentLoader,
|
|
376
|
+
contextLoader: mockDocumentLoader,
|
|
377
|
+
meterProvider
|
|
378
|
+
}));
|
|
379
|
+
const measurements = recorder.getMeasurements("activitypub.signature.verification.duration");
|
|
380
|
+
assertEquals(measurements.length, 1);
|
|
381
|
+
assertEquals(measurements[0].attributes["activitypub.signature.result"], "rejected");
|
|
382
|
+
assertFalse("ld_signatures.type" in measurements[0].attributes);
|
|
383
|
+
});
|
|
384
|
+
});
|
|
252
385
|
//#endregion
|
|
253
386
|
export {};
|
package/dist/sig/mod.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const require_http = require("../http-
|
|
5
|
-
const require_proof = require("../proof-
|
|
4
|
+
const require_http = require("../http-CKCgOPkX.cjs");
|
|
5
|
+
const require_proof = require("../proof-DIoqrKnX.cjs");
|
|
6
6
|
exports.attachSignature = require_proof.attachSignature;
|
|
7
7
|
exports.createProof = require_proof.createProof;
|
|
8
8
|
exports.createSignature = require_proof.createSignature;
|
package/dist/sig/mod.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "../http-
|
|
2
|
+
import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "../http-D6aw3j2U.cjs";
|
|
3
3
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-DEvZuyOE.cjs";
|
|
4
|
-
import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "../mod-
|
|
4
|
+
import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "../mod-BDhgfjP7.cjs";
|
|
5
5
|
export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
package/dist/sig/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "../http-
|
|
2
|
+
import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "../http-D6LP89UO.js";
|
|
3
3
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-CnngXDNJ.js";
|
|
4
|
-
import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "../mod-
|
|
4
|
+
import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "../mod-B-Lin9Sy.js";
|
|
5
5
|
export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
package/dist/sig/mod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { a as verifyRequestDetailed,
|
|
4
|
-
import { a as verifyProof, c as getKeyOwner, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyObject, l as attachSignature, m as verifyJsonLd, n as hasProofLike, p as signJsonLd, r as signObject, s as doesActorOwnKey, t as createProof, u as createSignature } from "../proof-
|
|
3
|
+
import { a as verifyRequestDetailed, b as parseAcceptSignature, c as fetchKeyDetailed, i as verifyRequest, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk, v as formatAcceptSignature, x as validateAcceptSignature, y as fulfillAcceptSignature } from "../http-CpzZ9zsb.js";
|
|
4
|
+
import { a as verifyProof, c as getKeyOwner, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyObject, l as attachSignature, m as verifyJsonLd, n as hasProofLike, p as signJsonLd, r as signObject, s as doesActorOwnKey, t as createProof, u as createSignature } from "../proof-Vd8-1EWh.js";
|
|
5
5
|
export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
package/dist/sig/owner.test.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import {
|
|
5
|
+
import "../std__assert-BTEgfoJo.mjs";
|
|
6
|
+
import { r as assertFalse } from "../assert_rejects-DQP-q39h.mjs";
|
|
7
7
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
8
|
-
import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-
|
|
9
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-
|
|
8
|
+
import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-CSYsOMFG.mjs";
|
|
9
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DO810N24.mjs";
|
|
10
10
|
import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
|
|
11
11
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
//#region src/sig/owner.test.ts
|
package/dist/sig/proof.test.mjs
CHANGED
|
@@ -2,15 +2,15 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { n as assertFalse, t as assertRejects } from "../assert_rejects-
|
|
5
|
+
import "../std__assert-BTEgfoJo.mjs";
|
|
6
|
+
import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-DQP-q39h.mjs";
|
|
7
7
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
8
8
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
9
|
-
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-
|
|
10
|
-
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-
|
|
11
|
-
import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-
|
|
9
|
+
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CSYsOMFG.mjs";
|
|
10
|
+
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-BNL8AC14.mjs";
|
|
11
|
+
import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-BgfyWv7b.mjs";
|
|
12
12
|
import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place } from "@fedify/vocab";
|
|
13
|
-
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
13
|
+
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
14
14
|
import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
|
|
15
15
|
import { decodeHex } from "byte-encodings/hex";
|
|
16
16
|
//#region src/sig/proof.test.ts
|
|
@@ -326,6 +326,167 @@ test("verifyProof()", async () => {
|
|
|
326
326
|
}), null);
|
|
327
327
|
assertFalse(contextLoaderCalls.includes("https://attacker.example/ctx"));
|
|
328
328
|
});
|
|
329
|
+
test("verifyProof() records verification duration metric", async (t) => {
|
|
330
|
+
const jsonLd = {
|
|
331
|
+
"@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
|
|
332
|
+
id: "https://server.example/activities/1",
|
|
333
|
+
type: "Create",
|
|
334
|
+
actor: "https://server.example/users/alice",
|
|
335
|
+
object: {
|
|
336
|
+
id: "https://server.example/objects/1",
|
|
337
|
+
type: "Note",
|
|
338
|
+
attributedTo: "https://server.example/users/alice",
|
|
339
|
+
content: "Hello world",
|
|
340
|
+
location: {
|
|
341
|
+
type: "Place",
|
|
342
|
+
longitude: -71.184902,
|
|
343
|
+
latitude: 25.273962
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
const proof = new DataIntegrityProof({
|
|
348
|
+
cryptosuite: "eddsa-jcs-2022",
|
|
349
|
+
verificationMethod: new URL("https://server.example/users/alice#ed25519-key"),
|
|
350
|
+
proofPurpose: "assertionMethod",
|
|
351
|
+
proofValue: decodeMultibase("zLaewdp4H9kqtwyrLatK4cjY5oRHwVcw4gibPSUDYDMhi4M49v8pcYk3ZB6D69dNpAPbUmY8ocuJ3m9KhKJEEg7z"),
|
|
352
|
+
created: Temporal.Instant.from("2023-02-24T23:36:38Z")
|
|
353
|
+
});
|
|
354
|
+
await t.step("verified path records result=verified with bounded cryptosuite", async () => {
|
|
355
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
356
|
+
assert(await verifyProof(jsonLd, proof, {
|
|
357
|
+
documentLoader: mockDocumentLoader,
|
|
358
|
+
contextLoader: mockDocumentLoader,
|
|
359
|
+
meterProvider
|
|
360
|
+
}) != null);
|
|
361
|
+
const measurements = recorder.getMeasurements("activitypub.signature.verification.duration");
|
|
362
|
+
assertEquals(measurements.length, 1);
|
|
363
|
+
const m = measurements[0];
|
|
364
|
+
assertEquals(m.type, "histogram");
|
|
365
|
+
assertGreaterOrEqual(m.value, 0);
|
|
366
|
+
assertEquals(m.attributes["activitypub.signature.kind"], "object_integrity");
|
|
367
|
+
assertEquals(m.attributes["activitypub.signature.result"], "verified");
|
|
368
|
+
assertEquals(m.attributes["object_integrity_proofs.cryptosuite"], "eddsa-jcs-2022");
|
|
369
|
+
});
|
|
370
|
+
await t.step("rejected path records result=rejected", async () => {
|
|
371
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
372
|
+
assertEquals(await verifyProof({
|
|
373
|
+
...jsonLd,
|
|
374
|
+
object: {
|
|
375
|
+
...jsonLd.object,
|
|
376
|
+
content: "bye"
|
|
377
|
+
}
|
|
378
|
+
}, proof, {
|
|
379
|
+
documentLoader: mockDocumentLoader,
|
|
380
|
+
contextLoader: mockDocumentLoader,
|
|
381
|
+
meterProvider
|
|
382
|
+
}), null);
|
|
383
|
+
const measurements = recorder.getMeasurements("activitypub.signature.verification.duration");
|
|
384
|
+
assertEquals(measurements.length, 1);
|
|
385
|
+
assertEquals(measurements[0].attributes["activitypub.signature.result"], "rejected");
|
|
386
|
+
assertEquals(measurements[0].attributes["object_integrity_proofs.cryptosuite"], "eddsa-jcs-2022");
|
|
387
|
+
});
|
|
388
|
+
await t.step("cached-key retry emits one measurement, not two", async () => {
|
|
389
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
390
|
+
const cache = { ["https://server.example/users/alice#ed25519-key"]: ed25519Multikey };
|
|
391
|
+
assert(await verifyProof(jsonLd, proof, {
|
|
392
|
+
documentLoader: mockDocumentLoader,
|
|
393
|
+
contextLoader: mockDocumentLoader,
|
|
394
|
+
meterProvider,
|
|
395
|
+
keyCache: {
|
|
396
|
+
get(id) {
|
|
397
|
+
return Promise.resolve(cache[id.href]);
|
|
398
|
+
},
|
|
399
|
+
set(id, k) {
|
|
400
|
+
cache[id.href] = k;
|
|
401
|
+
return Promise.resolve();
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}) != null);
|
|
405
|
+
assertEquals(recorder.getMeasurements("activitypub.signature.verification.duration").length, 1);
|
|
406
|
+
const keyFetches = recorder.getMeasurements("activitypub.signature.key_fetch.duration");
|
|
407
|
+
assertEquals(keyFetches.length, 2);
|
|
408
|
+
assertEquals(keyFetches[0].attributes["activitypub.signature.key_fetch.result"], "hit");
|
|
409
|
+
assertEquals(keyFetches[1].attributes["activitypub.signature.key_fetch.result"], "fetched");
|
|
410
|
+
});
|
|
411
|
+
await t.step("key fetch records result=fetched on a cold cache", async () => {
|
|
412
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
413
|
+
assert(await verifyProof(jsonLd, proof, {
|
|
414
|
+
documentLoader: mockDocumentLoader,
|
|
415
|
+
contextLoader: mockDocumentLoader,
|
|
416
|
+
meterProvider
|
|
417
|
+
}) != null);
|
|
418
|
+
const measurements = recorder.getMeasurements("activitypub.signature.key_fetch.duration");
|
|
419
|
+
assertEquals(measurements.length, 1);
|
|
420
|
+
assertGreaterOrEqual(measurements[0].value, 0);
|
|
421
|
+
assertEquals(measurements[0].attributes["activitypub.signature.kind"], "object_integrity");
|
|
422
|
+
assertEquals(measurements[0].attributes["activitypub.signature.key_fetch.result"], "fetched");
|
|
423
|
+
});
|
|
424
|
+
await t.step("key fetch records result=hit when served from the key cache", async () => {
|
|
425
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
426
|
+
const cache = { "https://server.example/users/alice#ed25519-key": new Multikey({
|
|
427
|
+
id: new URL("https://server.example/users/alice#ed25519-key"),
|
|
428
|
+
controller: new URL("https://server.example/users/alice"),
|
|
429
|
+
publicKey: await importMultibaseKey("z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2")
|
|
430
|
+
}) };
|
|
431
|
+
assert(await verifyProof(jsonLd, proof, {
|
|
432
|
+
documentLoader: mockDocumentLoader,
|
|
433
|
+
contextLoader: mockDocumentLoader,
|
|
434
|
+
meterProvider,
|
|
435
|
+
keyCache: {
|
|
436
|
+
get(id) {
|
|
437
|
+
return Promise.resolve(cache[id.href]);
|
|
438
|
+
},
|
|
439
|
+
set(id, k) {
|
|
440
|
+
cache[id.href] = k;
|
|
441
|
+
return Promise.resolve();
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}) != null);
|
|
445
|
+
const measurements = recorder.getMeasurements("activitypub.signature.key_fetch.duration");
|
|
446
|
+
assertEquals(measurements.length, 1);
|
|
447
|
+
assertEquals(measurements[0].attributes["activitypub.signature.key_fetch.result"], "hit");
|
|
448
|
+
});
|
|
449
|
+
await t.step("verifyObject() wrapper emits one measurement per inner verifyProof()", async () => {
|
|
450
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
451
|
+
assert(await verifyObject(Create, {
|
|
452
|
+
...jsonLd,
|
|
453
|
+
proof: await proof.toJsonLd({
|
|
454
|
+
format: "compact",
|
|
455
|
+
contextLoader: mockDocumentLoader
|
|
456
|
+
})
|
|
457
|
+
}, {
|
|
458
|
+
documentLoader: mockDocumentLoader,
|
|
459
|
+
contextLoader: mockDocumentLoader,
|
|
460
|
+
meterProvider
|
|
461
|
+
}) != null);
|
|
462
|
+
assertEquals(recorder.getMeasurements("activitypub.signature.verification.duration").length, 1);
|
|
463
|
+
});
|
|
464
|
+
await t.step("unknown cryptosuite omits the cryptosuite metric attribute", async () => {
|
|
465
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
466
|
+
const exoticProof = await DataIntegrityProof.fromJsonLd({
|
|
467
|
+
"@context": "https://w3id.org/security/data-integrity/v1",
|
|
468
|
+
type: "DataIntegrityProof",
|
|
469
|
+
cryptosuite: "made-up-suite-9999",
|
|
470
|
+
verificationMethod: "https://server.example/users/alice#ed25519-key",
|
|
471
|
+
proofPurpose: "assertionMethod",
|
|
472
|
+
proofValue: "zLaewdp4H9kqtwyrLatK4cjY5oRHwVcw4gibPSUDYDMhi4M49v8pcYk3ZB6D69dNpAPbUmY8ocuJ3m9KhKJEEg7z",
|
|
473
|
+
created: "2023-02-24T23:36:38Z"
|
|
474
|
+
}, {
|
|
475
|
+
documentLoader: mockDocumentLoader,
|
|
476
|
+
contextLoader: mockDocumentLoader
|
|
477
|
+
});
|
|
478
|
+
assertEquals(exoticProof.cryptosuite, "made-up-suite-9999");
|
|
479
|
+
assertEquals(await verifyProof(jsonLd, exoticProof, {
|
|
480
|
+
documentLoader: mockDocumentLoader,
|
|
481
|
+
contextLoader: mockDocumentLoader,
|
|
482
|
+
meterProvider
|
|
483
|
+
}), null);
|
|
484
|
+
const measurements = recorder.getMeasurements("activitypub.signature.verification.duration");
|
|
485
|
+
assertEquals(measurements.length, 1);
|
|
486
|
+
assertEquals(measurements[0].attributes["activitypub.signature.result"], "rejected");
|
|
487
|
+
assertFalse("object_integrity_proofs.cryptosuite" in measurements[0].attributes);
|
|
488
|
+
});
|
|
489
|
+
});
|
|
329
490
|
test("verifyObject()", async () => {
|
|
330
491
|
const options = {
|
|
331
492
|
documentLoader: mockDocumentLoader,
|
|
@@ -2,7 +2,7 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { l as AssertionError, s as format } from "./assert_equals-Ew3jOFa3.mjs";
|
|
5
|
-
import "./assert_rejects-
|
|
5
|
+
import "./assert_rejects-DQP-q39h.mjs";
|
|
6
6
|
import "./assert_throws-4NwKEy2q.mjs";
|
|
7
7
|
import "./assert_strict_equals-Dmjbg-bA.mjs";
|
|
8
8
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_exists.js
|
|
@@ -28,31 +28,6 @@ import "./assert_strict_equals-Dmjbg-bA.mjs";
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater_or_equal.js
|
|
32
|
-
/**
|
|
33
|
-
* Make an assertion that `actual` is greater than or equal to `expected`.
|
|
34
|
-
* If not then throw.
|
|
35
|
-
*
|
|
36
|
-
* @example Usage
|
|
37
|
-
* ```ts no-eval
|
|
38
|
-
* import { assertGreaterOrEqual } from "@std/assert/assert-greater-or-equal";
|
|
39
|
-
*
|
|
40
|
-
* assertGreaterOrEqual(2, 1); // Doesn't throw
|
|
41
|
-
* assertGreaterOrEqual(1, 1); // Doesn't throw
|
|
42
|
-
* assertGreaterOrEqual(0, 1); // Throws
|
|
43
|
-
* ```
|
|
44
|
-
*
|
|
45
|
-
* @typeParam T The type of the values to compare.
|
|
46
|
-
* @param actual The actual value to compare.
|
|
47
|
-
* @param expected The expected value to compare.
|
|
48
|
-
* @param msg The optional message to display if the assertion fails.
|
|
49
|
-
*/ function assertGreaterOrEqual(actual, expected, msg) {
|
|
50
|
-
if (actual >= expected) return;
|
|
51
|
-
const actualString = format(actual);
|
|
52
|
-
const expectedString = format(expected);
|
|
53
|
-
throw new AssertionError(msg ?? `Expect ${actualString} >= ${expectedString}`);
|
|
54
|
-
}
|
|
55
|
-
//#endregion
|
|
56
31
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater.js
|
|
57
32
|
/**
|
|
58
33
|
* Make an assertion that `actual` is greater than `expected`.
|
|
@@ -101,4 +76,4 @@ import "./assert_strict_equals-Dmjbg-bA.mjs";
|
|
|
101
76
|
}
|
|
102
77
|
}
|
|
103
78
|
//#endregion
|
|
104
|
-
export {
|
|
79
|
+
export { assertGreater as n, assertExists as r, assertStringIncludes as t };
|
|
@@ -2,12 +2,12 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
5
|
+
import "../std__assert-BTEgfoJo.mjs";
|
|
6
|
+
import { t as assertRejects } from "../assert_rejects-DQP-q39h.mjs";
|
|
7
7
|
import { t as esm_default } from "../esm-sdtqOUPu.mjs";
|
|
8
|
-
import { l as verifyRequest } from "../http-
|
|
9
|
-
import { i as rsaPrivateKey2 } from "../keys-
|
|
10
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
8
|
+
import { l as verifyRequest } from "../http-BmOZYc-8.mjs";
|
|
9
|
+
import { i as rsaPrivateKey2 } from "../keys-CSYsOMFG.mjs";
|
|
10
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-BENj6vQ4.mjs";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
import { UrlError } from "@fedify/vocab-runtime";
|
|
13
13
|
//#region src/utils/docloader.test.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as kvCache, t as MockKvStore } from "../kv-cache-
|
|
4
|
+
import { n as kvCache, t as MockKvStore } from "../kv-cache-DihufyAQ.mjs";
|
|
5
5
|
import { deepStrictEqual, throws } from "node:assert";
|
|
6
6
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
7
7
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
package/dist/utils/mod.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const require_kv_cache = require("../kv-cache-
|
|
4
|
+
const require_kv_cache = require("../kv-cache-DY-XWOqM.cjs");
|
|
5
5
|
exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
|
|
6
6
|
exports.kvCache = require_kv_cache.kvCache;
|
package/dist/utils/mod.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../mod-
|
|
2
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../mod-BR_BB0bh.cjs";
|
|
3
3
|
export { getAuthenticatedDocumentLoader, kvCache };
|
package/dist/utils/mod.d.ts
CHANGED
package/dist/utils/mod.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-
|
|
3
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-Wc5ezcVW.js";
|
|
4
4
|
export { getAuthenticatedDocumentLoader, kvCache };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/fedify",
|
|
3
|
-
"version": "2.3.0-dev.
|
|
3
|
+
"version": "2.3.0-dev.1114+15a3316d",
|
|
4
4
|
"description": "An ActivityPub server framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ActivityPub",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
},
|
|
141
141
|
"dependencies": {
|
|
142
142
|
"@js-temporal/polyfill": "^0.5.1",
|
|
143
|
-
"@logtape/logtape": "^2.0
|
|
143
|
+
"@logtape/logtape": "^2.1.0",
|
|
144
144
|
"@opentelemetry/api": "^1.9.1",
|
|
145
145
|
"@opentelemetry/core": "^2.7.1",
|
|
146
146
|
"@opentelemetry/sdk-trace-base": "^2.7.1",
|
|
@@ -153,9 +153,9 @@
|
|
|
153
153
|
"uri-template-router": "^1.0.0",
|
|
154
154
|
"url-template": "^3.1.1",
|
|
155
155
|
"urlpattern-polyfill": "^10.1.0",
|
|
156
|
-
"@fedify/vocab": "2.3.0-dev.
|
|
157
|
-
"@fedify/
|
|
158
|
-
"@fedify/
|
|
156
|
+
"@fedify/vocab": "2.3.0-dev.1114+15a3316d",
|
|
157
|
+
"@fedify/vocab-runtime": "2.3.0-dev.1114+15a3316d",
|
|
158
|
+
"@fedify/webfinger": "2.3.0-dev.1114+15a3316d"
|
|
159
159
|
},
|
|
160
160
|
"devDependencies": {
|
|
161
161
|
"@opentelemetry/sdk-metrics": "2.7.1",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"typescript": "^6.0.0",
|
|
170
170
|
"wrangler": "^4.17.0",
|
|
171
171
|
"@fedify/fixture": "2.0.0",
|
|
172
|
-
"@fedify/vocab-tools": "^2.3.0-dev.
|
|
172
|
+
"@fedify/vocab-tools": "^2.3.0-dev.1114+15a3316d"
|
|
173
173
|
},
|
|
174
174
|
"scripts": {
|
|
175
175
|
"build:self": "tsdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{getMachineId-unsupported-Ddu-PFeh.mjs → getMachineId-unsupported-dIOte2Ct.mjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|