@fedify/fedify 2.4.0-dev.1583 → 2.4.0-dev.1618
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/{accept-CgDcxvjV.mjs → accept-8PiolDP7.mjs} +1 -1
- package/dist/{activity-listener-BeTGV3wc.mjs → activity-listener-BtTSxZWA.mjs} +1 -1
- package/dist/{assert-DvVHoIZ0.mjs → assert-CJ1KXcvv.mjs} +2 -2
- package/dist/{assert_equals-PBVKNMJd.mjs → assert_equals-BV7oLMxm.mjs} +1 -1
- package/dist/{assert_instance_of-CxoC8bVq.mjs → assert_instance_of-Q9KTBnrf.mjs} +2 -2
- package/dist/{assert_not_equals-C8vcTTA3.mjs → assert_not_equals-EPJPoxuf.mjs} +2 -2
- package/dist/{assert_rejects-DAdaaIWM.mjs → assert_rejects-EgstcQy5.mjs} +3 -3
- package/dist/{assert_strict_equals-BzqyKuYL.mjs → assert_strict_equals-Ec20AUwa.mjs} +2 -2
- package/dist/{assert_throws-zN79lgIC.mjs → assert_throws-NiFfqbnH.mjs} +2 -2
- package/dist/{builder-Doj1FmsW.mjs → builder-C4a7TAvq.mjs} +26 -4
- package/dist/{chunk-DDcVe30Y.cjs → chunk-Czpeue4M.cjs} +0 -1
- package/dist/{chunk-CRNNMoPX.js → chunk-D5IdezsZ.js} +1 -1
- package/dist/{circuit-breaker-hJBB6jwA.mjs → circuit-breaker-CBGyz5F7.mjs} +1 -1
- package/dist/{client-B_A6mfn3.mjs → client-CjF5IYQS.mjs} +1 -1
- package/dist/{codec-nfBU4Up4.mjs → codec-BBga-FWI.mjs} +1 -1
- package/dist/{collection-Dp5ky45w.mjs → collection-BIhlldqK.mjs} +1 -1
- package/dist/compat/mod.cjs +1 -2
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/mod.js +2 -2
- package/dist/compat/outgoing-jsonld.test.d.mts +1 -1
- package/dist/compat/outgoing-jsonld.test.mjs +4 -4
- package/dist/compat/public-audience.test.d.mts +1 -1
- package/dist/compat/public-audience.test.mjs +4 -4
- package/dist/compat/transformers.test.d.mts +1 -1
- package/dist/compat/transformers.test.mjs +6 -6
- package/dist/{context-BBRTgkrs.mjs → context-BJXxPElm.mjs} +3 -2
- package/dist/{context-GfQA-CqB.d.ts → context-Zii1f5xS.d.ts} +97 -1
- package/dist/{context-BLe0NPtZ.d.cts → context-lxX6I7as.d.cts} +97 -1
- package/dist/{deno-Bkl9jNVs.mjs → deno-DepnPEgI.mjs} +2 -2
- package/dist/{docloader-f1XFaWWh.mjs → docloader-C_IefWRb.mjs} +3 -3
- package/dist/{esm-vrlUxr60.mjs → esm-yYQfPhIY.mjs} +1 -1
- package/dist/federation/builder.test.d.mts +1 -1
- package/dist/federation/builder.test.mjs +16 -6
- package/dist/federation/circuit-breaker.test.d.mts +1 -1
- package/dist/federation/circuit-breaker.test.mjs +6 -6
- package/dist/federation/collection.test.d.mts +1 -1
- package/dist/federation/collection.test.mjs +4 -4
- package/dist/federation/handler.test.d.mts +1 -1
- package/dist/federation/handler.test.mjs +14 -14
- package/dist/federation/idempotency.test.d.mts +1 -1
- package/dist/federation/idempotency.test.mjs +7 -7
- package/dist/federation/inbox.test.d.mts +1 -1
- package/dist/federation/inbox.test.mjs +4 -4
- package/dist/federation/keycache.test.d.mts +1 -1
- package/dist/federation/keycache.test.mjs +6 -6
- package/dist/federation/kv.test.d.mts +1 -1
- package/dist/federation/kv.test.mjs +4 -4
- package/dist/federation/metrics.test.d.mts +1 -1
- package/dist/federation/metrics.test.mjs +5 -5
- package/dist/federation/middleware.test.d.mts +1 -1
- package/dist/federation/middleware.test.mjs +470 -22
- package/dist/federation/mod.cjs +4 -3
- package/dist/federation/mod.d.cts +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +2 -2
- package/dist/federation/mq.test.d.mts +1 -1
- package/dist/federation/mq.test.mjs +6 -6
- package/dist/federation/negotiation.test.d.mts +1 -1
- package/dist/federation/negotiation.test.mjs +5 -5
- package/dist/federation/retry.test.d.mts +1 -1
- package/dist/federation/retry.test.mjs +4 -4
- package/dist/federation/router.test.d.mts +1 -1
- package/dist/federation/router.test.mjs +6 -6
- package/dist/federation/send.test.d.mts +1 -1
- package/dist/federation/send.test.mjs +12 -12
- package/dist/federation/tasks/codec.test.d.mts +1 -1
- package/dist/federation/tasks/codec.test.mjs +2 -2
- package/dist/federation/tasks/enqueue.test.d.mts +1 -1
- package/dist/federation/tasks/enqueue.test.mjs +5 -5
- package/dist/federation/tasks/tasks.test.d.mts +1 -1
- package/dist/federation/tasks/tasks.test.mjs +7 -7
- package/dist/federation/temporal.test.d.mts +1 -1
- package/dist/federation/temporal.test.mjs +5 -5
- package/dist/federation/webfinger.test.d.mts +1 -1
- package/dist/federation/webfinger.test.mjs +7 -7
- package/dist/{http-BBkdx4Kd.mjs → http-CT7tcVBN.mjs} +5 -5
- package/dist/{http-jCq51U37.cjs → http-D5ylizT7.cjs} +4 -3
- package/dist/{http-CphHLbTC.js → http-DD07Erm7.js} +2 -2
- package/dist/{key-BBKNHoB9.mjs → key-C3t-PS3M.mjs} +3 -3
- package/dist/{keycache-CaOR6NYg.mjs → keycache-_DHqz5z_.mjs} +1 -1
- package/dist/{keys-CSYsOMFG.mjs → keys-Dbyd7bhl.mjs} +1 -1
- package/dist/{kv-CIvR3Non.mjs → kv-CXBAok3k.mjs} +1 -1
- package/dist/{kv-cache-D3KdEZAg.js → kv-cache-Bvv7Wp8h.js} +2 -2
- package/dist/{kv-cache-SVUAUYIs.mjs → kv-cache-CK273Baz.mjs} +2 -2
- package/dist/{kv-cache-B9Zvq4xB.cjs → kv-cache-DbFdquuM.cjs} +4 -3
- package/dist/{ld-DLyXLPDS.mjs → ld-D8wAPjxC.mjs} +4 -4
- package/dist/{metrics-BVRrGEXj.mjs → metrics-D1NrDWq-.mjs} +2 -2
- package/dist/{middleware-1AyOpRqz.mjs → middleware-BRunoF2v.mjs} +244 -24
- package/dist/{middleware-CzWfDAQY.mjs → middleware-CaP0k3AD.mjs} +2 -2
- package/dist/{middleware-B1jZw4xB.js → middleware-kQ-qwTDh.js} +249 -7
- package/dist/{middleware-DszmUorL.cjs → middleware-nmfhGFtV.cjs} +290 -39
- package/dist/{mod-Cmr39iWq.d.ts → mod-DLc2Ot6f.d.ts} +1 -1
- package/dist/{mod-B8Efb9qp.d.cts → mod-gOlPDuT8.d.cts} +1 -1
- package/dist/mod.cjs +7 -8
- package/dist/mod.d.cts +4 -4
- package/dist/mod.d.ts +4 -4
- package/dist/mod.js +8 -8
- package/dist/{mq-03vS-C9P.mjs → mq-llHKivST.mjs} +1 -1
- package/dist/{negotiation-m_L2nyS3.mjs → negotiation-RuwrPFqi.mjs} +1 -1
- package/dist/nodeinfo/client.test.d.mts +1 -1
- package/dist/nodeinfo/client.test.mjs +5 -5
- package/dist/nodeinfo/handler.test.d.mts +1 -1
- package/dist/nodeinfo/handler.test.mjs +6 -6
- package/dist/nodeinfo/mod.cjs +1 -2
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/types.test.d.mts +1 -1
- package/dist/nodeinfo/types.test.mjs +5 -5
- package/dist/otel/exporter.test.d.mts +1 -1
- package/dist/otel/exporter.test.mjs +4 -4
- package/dist/otel/mod.cjs +1 -2
- package/dist/otel/mod.js +1 -1
- package/dist/{outgoing-jsonld-BNL8AC14.mjs → outgoing-jsonld-URuqsICz.mjs} +2 -2
- package/dist/{owner-BukzQW4T.mjs → owner-BjdNNmKF.mjs} +3 -3
- package/dist/{proof-IDHRILpm.js → proof--HiDnLAE.js} +15 -4
- package/dist/{proof-BVglyYRW.mjs → proof-1Xy5Ur-T.mjs} +19 -7
- package/dist/{proof-DkeR_Fsm.cjs → proof-DcOiiLDF.cjs} +16 -4
- package/dist/{public-audience-c9zmYKgA.mjs → public-audience-Cr5MsnMq.mjs} +1 -1
- package/dist/{retry-DI4O-zYl.mjs → retry-DgFqeS5k.mjs} +1 -1
- package/dist/runtime/mod.cjs +1 -2
- package/dist/runtime/mod.js +2 -2
- package/dist/{send-D04Hz77b.mjs → send-ClJ4UcZL.mjs} +4 -4
- package/dist/sig/accept.test.d.mts +1 -1
- package/dist/sig/accept.test.mjs +2 -2
- package/dist/sig/http.test.d.mts +1 -1
- package/dist/sig/http.test.mjs +10 -10
- package/dist/sig/key.test.d.mts +1 -1
- package/dist/sig/key.test.mjs +7 -7
- package/dist/sig/ld.test.d.mts +1 -1
- package/dist/sig/ld.test.mjs +8 -8
- package/dist/sig/mod.cjs +2 -3
- package/dist/sig/mod.js +3 -3
- package/dist/sig/owner.test.d.mts +1 -1
- package/dist/sig/owner.test.mjs +7 -7
- package/dist/sig/proof.test.d.mts +1 -1
- package/dist/sig/proof.test.mjs +146 -9
- package/dist/{std__assert-Dh6uLf_q.mjs → std__assert-B2NnY9bq.mjs} +5 -5
- package/dist/temporal-polyfill-BCdTHexd.cjs +3565 -0
- package/dist/{temporal-xcPM9mxe.mjs → temporal-wA-b1IAz.mjs} +2 -2
- package/dist/testing/mod.d.mts +97 -1
- package/dist/testing/mod.mjs +3 -3
- package/dist/{testing-Dy-WhqpN.mjs → testing-CO7ftO8A.mjs} +3 -3
- package/dist/{transformers-NeAONrAq.cjs → transformers-DGwl-hD1.cjs} +1 -2
- package/dist/{transformers-BGMIq1cs.js → transformers-DXze6FUB.js} +1 -1
- package/dist/{types-KC4QAoxe.cjs → types-CPym83zc.cjs} +1 -2
- package/dist/{types-BFowWFTT.mjs → types-CrtdVuDP.mjs} +1 -1
- package/dist/{types-CAY3OdLq.js → types-DC1pNgJA.js} +1 -1
- package/dist/utils/docloader.test.d.mts +1 -1
- package/dist/utils/docloader.test.mjs +8 -8
- package/dist/utils/kv-cache.test.d.mts +1 -1
- package/dist/utils/kv-cache.test.mjs +2 -2
- package/dist/utils/mod.cjs +1 -2
- package/dist/utils/mod.js +2 -2
- package/dist/vocab/cjs.test.d.mts +1 -1
- package/dist/vocab/cjs.test.mjs +14 -1
- package/dist/vocab/mod.cjs +0 -1
- package/dist/vocab/mod.js +1 -1
- package/package.json +8 -8
package/dist/sig/key.test.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
7
|
-
import { t as assertThrows } from "../assert_throws-
|
|
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, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-BV7oLMxm.mjs";
|
|
5
|
+
import "../std__assert-B2NnY9bq.mjs";
|
|
6
|
+
import { t as assertRejects } from "../assert_rejects-EgstcQy5.mjs";
|
|
7
|
+
import { t as assertThrows } from "../assert_throws-NiFfqbnH.mjs";
|
|
8
|
+
import { a as importJwk, i as generateCryptoKeyPair, n as fetchKey, o as validateCryptoKey, r as fetchKeyDetailed, t as exportJwk } from "../key-C3t-PS3M.mjs";
|
|
9
|
+
import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-Dbyd7bhl.mjs";
|
|
10
10
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
11
11
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
import { FetchError, exportDidKey } from "@fedify/vocab-runtime";
|
package/dist/sig/ld.test.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Temporal } from "
|
|
1
|
+
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
package/dist/sig/ld.test.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-
|
|
6
|
-
import { t as assertThrows } from "../assert_throws-
|
|
7
|
-
import { t as assert } from "../assert-
|
|
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 compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-BV7oLMxm.mjs";
|
|
5
|
+
import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-EgstcQy5.mjs";
|
|
6
|
+
import { t as assertThrows } from "../assert_throws-NiFfqbnH.mjs";
|
|
7
|
+
import { t as assert } from "../assert-CJ1KXcvv.mjs";
|
|
8
|
+
import { i as generateCryptoKeyPair } from "../key-C3t-PS3M.mjs";
|
|
9
|
+
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-Dbyd7bhl.mjs";
|
|
10
|
+
import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-D8wAPjxC.mjs";
|
|
11
11
|
import { CryptographicKey } from "@fedify/vocab";
|
|
12
12
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
13
13
|
import { encodeBase64 } from "byte-encodings/base64";
|
package/dist/sig/mod.cjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const require_http = require("../http-
|
|
5
|
-
const require_proof = require("../proof-
|
|
3
|
+
const require_http = require("../http-D5ylizT7.cjs");
|
|
4
|
+
const require_proof = require("../proof-DcOiiLDF.cjs");
|
|
6
5
|
exports.attachSignature = require_proof.attachSignature;
|
|
7
6
|
exports.createProof = require_proof.createProof;
|
|
8
7
|
exports.createSignature = require_proof.createSignature;
|
package/dist/sig/mod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Temporal } from "
|
|
1
|
+
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { A as formatAcceptSignature, M as parseAcceptSignature, N as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, j as fulfillAcceptSignature, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk } from "../http-
|
|
4
|
-
import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "../proof
|
|
3
|
+
import { A as formatAcceptSignature, M as parseAcceptSignature, N as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, j as fulfillAcceptSignature, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk } from "../http-DD07Erm7.js";
|
|
4
|
+
import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "../proof--HiDnLAE.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 };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Temporal } from "
|
|
1
|
+
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
package/dist/sig/owner.test.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { r as assertFalse } from "../assert_rejects-
|
|
7
|
-
import { t as assert } from "../assert-
|
|
8
|
-
import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-
|
|
9
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-BV7oLMxm.mjs";
|
|
5
|
+
import "../std__assert-B2NnY9bq.mjs";
|
|
6
|
+
import { r as assertFalse } from "../assert_rejects-EgstcQy5.mjs";
|
|
7
|
+
import { t as assert } from "../assert-CJ1KXcvv.mjs";
|
|
8
|
+
import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-Dbyd7bhl.mjs";
|
|
9
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-BjdNNmKF.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
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Temporal } from "
|
|
1
|
+
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
package/dist/sig/proof.test.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Temporal } from "
|
|
1
|
+
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-
|
|
7
|
-
import { t as assertInstanceOf } from "../assert_instance_of-
|
|
8
|
-
import { t as assert } from "../assert-
|
|
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-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-BV7oLMxm.mjs";
|
|
5
|
+
import "../std__assert-B2NnY9bq.mjs";
|
|
6
|
+
import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-EgstcQy5.mjs";
|
|
7
|
+
import { t as assertInstanceOf } from "../assert_instance_of-Q9KTBnrf.mjs";
|
|
8
|
+
import { t as assert } from "../assert-CJ1KXcvv.mjs";
|
|
9
|
+
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-Dbyd7bhl.mjs";
|
|
10
|
+
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-URuqsICz.mjs";
|
|
11
|
+
import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-1Xy5Ur-T.mjs";
|
|
12
12
|
import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place } from "@fedify/vocab";
|
|
13
13
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
14
14
|
import { decodeMultibase, exportDidKey, exportMultibaseKey, importMultibaseKey, parseIri } from "@fedify/vocab-runtime";
|
|
@@ -590,5 +590,142 @@ test("verifyObject()", async () => {
|
|
|
590
590
|
assertInstanceOf(note, Note);
|
|
591
591
|
assertEquals(note.content, "Hello world");
|
|
592
592
|
});
|
|
593
|
+
test("verifyObject() accepts did:key proofs for matching portable attribution origin", async () => {
|
|
594
|
+
const did = await exportDidKey(ed25519PublicKey.publicKey);
|
|
595
|
+
const keyId = new URL(`${did}#${did.substring(8)}`);
|
|
596
|
+
const verified = await verifyObject(Note, await (await signObject(new Note({
|
|
597
|
+
id: parseIri(`ap://did:key:${did.substring(8)}/objects/1`),
|
|
598
|
+
attribution: parseIri(`ap://did:key:${did.substring(8)}/actor`),
|
|
599
|
+
content: "Portable note"
|
|
600
|
+
}), ed25519PrivateKey, keyId, {
|
|
601
|
+
contextLoader: mockDocumentLoader,
|
|
602
|
+
context: ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"]
|
|
603
|
+
})).toJsonLd({
|
|
604
|
+
format: "compact",
|
|
605
|
+
contextLoader: mockDocumentLoader,
|
|
606
|
+
context: ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"]
|
|
607
|
+
}), {
|
|
608
|
+
documentLoader() {
|
|
609
|
+
throw new TypeError("did:key must not use the document loader");
|
|
610
|
+
},
|
|
611
|
+
contextLoader: mockDocumentLoader
|
|
612
|
+
});
|
|
613
|
+
assertInstanceOf(verified, Note);
|
|
614
|
+
assertEquals(verified.content, "Portable note");
|
|
615
|
+
});
|
|
616
|
+
test("verifyObject() accepts multiple portable attributions from the same did:key origin", async () => {
|
|
617
|
+
const did = await exportDidKey(ed25519PublicKey.publicKey);
|
|
618
|
+
const method = did.substring(8);
|
|
619
|
+
const keyId = new URL(`${did}#${method}`);
|
|
620
|
+
const verified = await verifyObject(Create, await (await signObject(new Create({
|
|
621
|
+
id: parseIri(`ap://did:key:${method}/activities/1`),
|
|
622
|
+
actor: parseIri(`ap://did:key:${method}/actor`),
|
|
623
|
+
attribution: parseIri(`ap://did:key:${method}/profile`),
|
|
624
|
+
object: new Note({
|
|
625
|
+
id: parseIri(`ap://did:key:${method}/objects/1`),
|
|
626
|
+
content: "Portable note"
|
|
627
|
+
})
|
|
628
|
+
}), ed25519PrivateKey, keyId, {
|
|
629
|
+
contextLoader: mockDocumentLoader,
|
|
630
|
+
context: ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"]
|
|
631
|
+
})).toJsonLd({
|
|
632
|
+
format: "compact",
|
|
633
|
+
contextLoader: mockDocumentLoader,
|
|
634
|
+
context: ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"]
|
|
635
|
+
}), {
|
|
636
|
+
documentLoader() {
|
|
637
|
+
throw new TypeError("did:key must not use the document loader");
|
|
638
|
+
},
|
|
639
|
+
contextLoader: mockDocumentLoader
|
|
640
|
+
});
|
|
641
|
+
assertInstanceOf(verified, Create);
|
|
642
|
+
assertEquals(verified.actorId, parseIri(`ap://did:key:${method}/actor`));
|
|
643
|
+
assertEquals(verified.attributionId, parseIri(`ap://did:key:${method}/profile`));
|
|
644
|
+
});
|
|
645
|
+
test("verifyObject() rejects HTTPS keys claiming a portable DID controller", async () => {
|
|
646
|
+
const victimDid = "did:key:z6MkVictim";
|
|
647
|
+
const keyId = new URL("https://attacker.example/keys/ed25519");
|
|
648
|
+
assertEquals(await verifyObject(Note, await (await signObject(new Note({
|
|
649
|
+
id: parseIri("ap://did:key:z6MkVictim/objects/1"),
|
|
650
|
+
attribution: parseIri("ap://did:key:z6MkVictim/actor"),
|
|
651
|
+
content: "Spoofed portable note"
|
|
652
|
+
}), ed25519PrivateKey, keyId, {
|
|
653
|
+
contextLoader: mockDocumentLoader,
|
|
654
|
+
context: ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"]
|
|
655
|
+
})).toJsonLd({
|
|
656
|
+
format: "compact",
|
|
657
|
+
contextLoader: mockDocumentLoader,
|
|
658
|
+
context: ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"]
|
|
659
|
+
}), {
|
|
660
|
+
documentLoader: async (url) => {
|
|
661
|
+
if (url === keyId.href) return {
|
|
662
|
+
documentUrl: url,
|
|
663
|
+
contextUrl: null,
|
|
664
|
+
document: {
|
|
665
|
+
"@context": "https://w3id.org/security/multikey/v1",
|
|
666
|
+
id: keyId.href,
|
|
667
|
+
type: "Multikey",
|
|
668
|
+
controller: victimDid,
|
|
669
|
+
publicKeyMultibase: await exportMultibaseKey(ed25519PublicKey.publicKey)
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
throw new TypeError(`Unexpected fetch: ${url}`);
|
|
673
|
+
},
|
|
674
|
+
contextLoader: mockDocumentLoader
|
|
675
|
+
}), null);
|
|
676
|
+
});
|
|
677
|
+
test("verifyObject() rejects HTTPS keys claiming an exact DID attribution", async () => {
|
|
678
|
+
const victimDid = "did:key:z6MkVictim";
|
|
679
|
+
const keyId = new URL("https://attacker.example/keys/ed25519");
|
|
680
|
+
assertEquals(await verifyObject(Note, await (await signObject(new Note({
|
|
681
|
+
id: parseIri("ap://did:key:z6MkVictim/objects/1"),
|
|
682
|
+
attribution: new URL(victimDid),
|
|
683
|
+
content: "Spoofed DID-attributed note"
|
|
684
|
+
}), ed25519PrivateKey, keyId, {
|
|
685
|
+
contextLoader: mockDocumentLoader,
|
|
686
|
+
context: ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"]
|
|
687
|
+
})).toJsonLd({
|
|
688
|
+
format: "compact",
|
|
689
|
+
contextLoader: mockDocumentLoader,
|
|
690
|
+
context: ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"]
|
|
691
|
+
}), {
|
|
692
|
+
documentLoader: async (url) => {
|
|
693
|
+
if (url === keyId.href) return {
|
|
694
|
+
documentUrl: url,
|
|
695
|
+
contextUrl: null,
|
|
696
|
+
document: {
|
|
697
|
+
"@context": "https://w3id.org/security/multikey/v1",
|
|
698
|
+
id: keyId.href,
|
|
699
|
+
type: "Multikey",
|
|
700
|
+
controller: victimDid,
|
|
701
|
+
publicKeyMultibase: await exportMultibaseKey(ed25519PublicKey.publicKey)
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
throw new TypeError(`Unexpected fetch: ${url}`);
|
|
705
|
+
},
|
|
706
|
+
contextLoader: mockDocumentLoader
|
|
707
|
+
}), null);
|
|
708
|
+
});
|
|
709
|
+
test("verifyObject() rejects did:key proofs from another portable attribution origin", async () => {
|
|
710
|
+
const did = await exportDidKey(ed25519PublicKey.publicKey);
|
|
711
|
+
const keyId = new URL(`${did}#${did.substring(8)}`);
|
|
712
|
+
assertEquals(await verifyObject(Note, await (await signObject(new Note({
|
|
713
|
+
id: parseIri(`ap://did:key:${did.substring(8)}/objects/1`),
|
|
714
|
+
attribution: parseIri("ap://did:key:z6MkOther/actor"),
|
|
715
|
+
content: "Portable note"
|
|
716
|
+
}), ed25519PrivateKey, keyId, {
|
|
717
|
+
contextLoader: mockDocumentLoader,
|
|
718
|
+
context: ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"]
|
|
719
|
+
})).toJsonLd({
|
|
720
|
+
format: "compact",
|
|
721
|
+
contextLoader: mockDocumentLoader,
|
|
722
|
+
context: ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"]
|
|
723
|
+
}), {
|
|
724
|
+
documentLoader() {
|
|
725
|
+
throw new TypeError("did:key must not use the document loader");
|
|
726
|
+
},
|
|
727
|
+
contextLoader: mockDocumentLoader
|
|
728
|
+
}), null);
|
|
729
|
+
});
|
|
593
730
|
//#endregion
|
|
594
731
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { l as AssertionError, s as format } from "./assert_equals-
|
|
5
|
-
import "./assert_rejects-
|
|
6
|
-
import "./assert_throws-
|
|
7
|
-
import "./assert_strict_equals-
|
|
4
|
+
import { l as AssertionError, s as format } from "./assert_equals-BV7oLMxm.mjs";
|
|
5
|
+
import "./assert_rejects-EgstcQy5.mjs";
|
|
6
|
+
import "./assert_throws-NiFfqbnH.mjs";
|
|
7
|
+
import "./assert_strict_equals-Ec20AUwa.mjs";
|
|
8
8
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_exists.js
|
|
9
9
|
/**
|
|
10
10
|
* Make an assertion that actual is not null or undefined.
|