@fedify/fedify 2.5.0-dev.2446 → 2.5.0-dev.2448
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/{activity-listener-C-BSbKI7.mjs → activity-listener-CELFAodc.mjs} +8 -4
- package/dist/{builder-Da8b9O6v.mjs → builder-DbC8bn6k.mjs} +5 -5
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{compound-proof-D1djO5fa.mjs → compound-proof-heeXW2_A.mjs} +2 -2
- package/dist/{context-CQ9H8vNW.d.cts → context-BazwQrHn.d.cts} +304 -4
- package/dist/{context-8Tu9kea0.mjs → context-COHd1Rsh.mjs} +2 -0
- package/dist/{context-BdB54V-A.d.ts → context-GlHrzdSP.d.ts} +304 -4
- package/dist/{deno-eNpfj4oR.mjs → deno-Dpewt_jJ.mjs} +1 -1
- package/dist/{docloader-B-0nqOB1.mjs → docloader-CpsDyqVN.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/compound-fanout.test.mjs +3 -3
- package/dist/federation/handler-compound-proof.test.mjs +5 -5
- package/dist/federation/handler.test.mjs +21 -6
- package/dist/federation/hashlink-media.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox-actorless.test.d.mts +2 -0
- package/dist/federation/inbox-actorless.test.mjs +487 -0
- package/dist/federation/inbox-authentication.test.d.mts +2 -0
- package/dist/federation/inbox-authentication.test.mjs +116 -0
- package/dist/federation/inbox-report.test.mjs +5 -5
- package/dist/federation/inbox-view.test.d.mts +2 -0
- package/dist/federation/inbox-view.test.mjs +369 -0
- package/dist/federation/inbox.test.mjs +22 -12
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +9 -9
- package/dist/federation/mod.cjs +2 -1
- package/dist/federation/mod.d.cts +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +8 -2
- package/dist/federation/mq.test.mjs +36 -1
- package/dist/federation/outgoing-proof.test.mjs +4 -4
- package/dist/federation/portable-actor.test.mjs +3 -3
- package/dist/federation/portable-chain.test.mjs +3 -3
- package/dist/federation/portable-collection.test.mjs +4 -4
- package/dist/federation/portable-delivery.test.mjs +2 -2
- package/dist/federation/portable-gateway-keys.test.mjs +6 -6
- package/dist/federation/portable-inbox.test.mjs +4 -4
- package/dist/federation/portable-parse-uri.test.mjs +1 -1
- package/dist/federation/portable-route-activity.test.mjs +2 -2
- package/dist/federation/portable.test.mjs +3 -3
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/tasks/enqueue.test.mjs +3 -3
- package/dist/federation/tasks/tasks.test.mjs +4 -4
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +2 -2
- package/dist/{federation-BVH7drJA.cjs → federation-D8YexkP1.cjs} +1172 -131
- package/dist/{http-DlNxxW_5.js → http-BBr-VLil.js} +143 -16
- package/dist/{http-BUJ5SFh6.mjs → http-BZkyQIkb.mjs} +4 -4
- package/dist/{http-BfW3wyQ4.cjs → http-CAl7Num5.cjs} +161 -16
- package/dist/inbox-authentication-DflPYlLL.mjs +171 -0
- package/dist/inbox-view-NE9wXdLo.mjs +385 -0
- package/dist/inbox-wDuMKaFW.mjs +312 -0
- package/dist/{kv-cache-D_m3A241.mjs → kv-cache-CTQSfkmp.mjs} +1 -1
- package/dist/{kv-cache-kkBB0vbI.cjs → kv-cache-CjgCOz3i.cjs} +1 -1
- package/dist/{kv-cache-7015lbrx.js → kv-cache-U7uz5nx4.js} +1 -1
- package/dist/{ld-CD2CsPxq.mjs → ld-CQFuiah9.mjs} +52 -9
- package/dist/ld-CcuZ4NZa.d.ts +250 -0
- package/dist/ld-Cel1RRZ5.d.cts +250 -0
- package/dist/{metrics-D3LHk6Z4.mjs → metrics-B-QxRSSR.mjs} +1 -1
- package/dist/{middleware-CCDXvXOG.mjs → middleware-BdlNa8BD.mjs} +1 -1
- package/dist/{middleware-CzoWvrdZ.mjs → middleware-CuVa0UuS.mjs} +459 -98
- package/dist/{middleware-N9eM16XE.js → middleware-P-AZEQMn.js} +1169 -141
- package/dist/mod-B2783_3v.d.cts +154 -0
- package/dist/mod-BHQE-7WQ.d.ts +154 -0
- package/dist/{mod-D0bxB8jS.d.ts → mod-DjZfJj9R.d.ts} +1 -1
- package/dist/{mod-B0dGgQsg.d.cts → mod-DvWOv2Ho.d.cts} +1 -1
- package/dist/mod.cjs +5 -4
- package/dist/mod.d.cts +6 -6
- package/dist/mod.d.ts +6 -6
- package/dist/mod.js +5 -5
- package/dist/{mq-Dm1Wmtm-.mjs → mq-eF96QxUT.mjs} +6 -0
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/{owner-C5-FVX6t.mjs → owner-ccKkQOAf.mjs} +3 -3
- package/dist/{portable-collection-Cony3_LC.mjs → portable-collection-CndnpXfo.mjs} +2 -2
- package/dist/{portable-collection-CC2zNAje.js → portable-collection-DUlQ3s2M.js} +1 -1
- package/dist/{portable-collection-C-Z1SKDy.cjs → portable-collection-TC-kvkVI.cjs} +1 -1
- package/dist/{portable-key-DNc_flH-.mjs → portable-key-D5tFOoV-.mjs} +1 -1
- package/dist/{proof-Cryb1c70.mjs → proof-DPoF06nz.mjs} +98 -10
- package/dist/{send-AF25pWaJ.mjs → send-CF44O1Df.mjs} +3 -3
- package/dist/sig/compound-proof-discovery.test.mjs +1 -1
- package/dist/sig/compound-proof-producer.test.mjs +1 -1
- package/dist/sig/compound-proof-verification.test.mjs +2 -2
- package/dist/sig/compound-proof.test.mjs +2 -2
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key.test.mjs +1 -1
- package/dist/sig/ld.test.mjs +1 -1
- package/dist/sig/mitra-receive-interop.test.mjs +4 -4
- package/dist/sig/mitra-send-interop.test.mjs +3 -3
- 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 +1 -1
- package/dist/sig/portable-collection.test.mjs +1 -1
- package/dist/sig/portable-interop.test.mjs +3 -3
- package/dist/sig/portable-key.test.mjs +5 -5
- package/dist/sig/proof.test.mjs +44 -4
- package/dist/sig/tootik-request-interop.test.mjs +4 -4
- package/dist/sig/tootik-send-interop.test.mjs +3 -3
- package/dist/sig/verification.test.mjs +3 -3
- package/dist/{temporal-BsAeuUJj.mjs → temporal-XlZ4Wb94.mjs} +1 -1
- package/dist/testing/kv.test.mjs +1 -1
- package/dist/testing/mod.d.mts +262 -2
- package/dist/testing/mod.mjs +2 -2
- package/dist/{testing-t8xDeJZ5.mjs → testing-Dbr21vZk.mjs} +1 -1
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +7 -7
- package/dist/inbox-CHvMaIFX.mjs +0 -188
- package/dist/mod-BRpER-B0.d.ts +0 -320
- package/dist/mod-xAfaLS4T.d.cts +0 -320
- package/dist/owner-BF0L9cMt.d.cts +0 -78
- package/dist/owner-BSzr5-I8.d.ts +0 -78
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
|
-
const require_http = require("./http-
|
|
2
|
+
const require_http = require("./http-CAl7Num5.cjs");
|
|
3
3
|
let _logtape_logtape = require("@logtape/logtape");
|
|
4
4
|
let _fedify_vocab = require("@fedify/vocab");
|
|
5
5
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
@@ -2,7 +2,7 @@ import "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { a as getRawCanonicalPortableId, c as isPortableActorDocument, d as isPortableUri, n as getCanonicalPortableId, p as isSamePublicKey } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { p as verifyPortableObjectProofWithRoot } from "./proof-DPoF06nz.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { CryptographicKey, Multikey, Object as Object$1 } from "@fedify/vocab";
|
|
8
8
|
import { FetchError, formatIri, getDocumentLoader, isGatewayUrl, parseIri, toCompatibleEf61Id } from "@fedify/vocab-runtime";
|
|
@@ -3,15 +3,15 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { i as getPortableDid, l as isPortableId } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
5
|
import { a as verificationObservation, i as triedKey, n as observeCheck, t as observeAttempt } from "./verification-Dpfcw8ml.mjs";
|
|
6
|
-
import { n as version, t as name } from "./deno-
|
|
7
|
-
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-
|
|
8
|
-
import {
|
|
6
|
+
import { n as version, t as name } from "./deno-Dpewt_jJ.mjs";
|
|
7
|
+
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-B-QxRSSR.mjs";
|
|
8
|
+
import { C as fetchKey, D as validateCryptoKey, b as bypassKeyCacheReads, c as getNormalizationContextLoader } from "./ld-CQFuiah9.mjs";
|
|
9
9
|
import { n as preloadedOnlyDocumentLoader } from "./public-audience--klBIOk1.mjs";
|
|
10
10
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
|
|
11
11
|
import { getLogger } from "@logtape/logtape";
|
|
12
12
|
import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
|
|
13
13
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
14
|
-
import { encodeMultibase, formatIri, fromCompatibleEf61Id, getDocumentLoader, getFe34Origin, parseGatewayUrl, parseIri } from "@fedify/vocab-runtime";
|
|
14
|
+
import { encodeMultibase, formatIri, fromCompatibleEf61Id, getDocumentLoader, getFe34Origin, isTransientFetchError, parseGatewayUrl, parseIri } from "@fedify/vocab-runtime";
|
|
15
15
|
import { encodeHex } from "byte-encodings/hex";
|
|
16
16
|
import { getPortableActorGateways } from "@fedify/vocab-runtime/internal/jsonld-cache";
|
|
17
17
|
import { isPlainJsonTree, retainSignedRepresentation } from "@fedify/vocab-runtime/internal/signed-representation";
|
|
@@ -671,6 +671,12 @@ async function verifyProofInternal(jsonLd, proof, options, messageDigestCache, r
|
|
|
671
671
|
keyId: proof.verificationMethodId.href,
|
|
672
672
|
error
|
|
673
673
|
});
|
|
674
|
+
const check = options[verificationObservation]?.check;
|
|
675
|
+
if (check != null && check.reason == null) check.reason = {
|
|
676
|
+
type: "keyFetchError",
|
|
677
|
+
keyId: new URL(proof.verificationMethodId.href),
|
|
678
|
+
result: { error: error instanceof Error ? error : new Error(String(error)) }
|
|
679
|
+
};
|
|
674
680
|
return null;
|
|
675
681
|
}
|
|
676
682
|
const publicKey = fetchedKey.key;
|
|
@@ -1199,6 +1205,39 @@ async function verifyPreparedPortableObjectProof(jsonLd, prepared, options, mess
|
|
|
1199
1205
|
* @since 0.10.0
|
|
1200
1206
|
*/
|
|
1201
1207
|
async function verifyObject(cls, jsonLd, options = {}) {
|
|
1208
|
+
const result = await verifyObjectDetailed(cls, jsonLd, options);
|
|
1209
|
+
return result.status === "verified" ? result.object : null;
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Same as {@link verifyObject}, but also tells who signed the verified proofs,
|
|
1213
|
+
* and whether a failure was caused by a key that could not be obtained for
|
|
1214
|
+
* a retryable reason.
|
|
1215
|
+
* @param cls The class of the object to verify.
|
|
1216
|
+
* @param jsonLd The JSON-LD object to verify.
|
|
1217
|
+
* @param options Additional options.
|
|
1218
|
+
* @returns The result.
|
|
1219
|
+
* @throws {TypeError} If the object is invalid or unsupported.
|
|
1220
|
+
* @internal
|
|
1221
|
+
*/
|
|
1222
|
+
async function verifyObjectDetailed(cls, jsonLd, options = {}) {
|
|
1223
|
+
const classify = (result, checks) => {
|
|
1224
|
+
if (result != null) return {
|
|
1225
|
+
status: "verified",
|
|
1226
|
+
object: result.object,
|
|
1227
|
+
signers: result.signers
|
|
1228
|
+
};
|
|
1229
|
+
for (const check of checks) {
|
|
1230
|
+
if (check.status === "error" && isTransientFetchError(check.error)) return {
|
|
1231
|
+
status: "unavailable",
|
|
1232
|
+
error: check.error
|
|
1233
|
+
};
|
|
1234
|
+
if (check.status === "rejected" && check.reason.type === "keyFetchError" && isRetryableKeyFetchError(check.reason.result)) return {
|
|
1235
|
+
status: "unavailable",
|
|
1236
|
+
error: "error" in check.reason.result ? check.reason.result.error : /* @__PURE__ */ new Error(`Fetching key ${check.reason.keyId.href} failed with ${check.reason.result.status}.`)
|
|
1237
|
+
};
|
|
1238
|
+
}
|
|
1239
|
+
return { status: "invalid" };
|
|
1240
|
+
};
|
|
1202
1241
|
if (options[verificationObservation]?.attempt == null) {
|
|
1203
1242
|
const observedOptions = {
|
|
1204
1243
|
...options,
|
|
@@ -1210,16 +1249,16 @@ async function verifyObject(cls, jsonLd, options = {}) {
|
|
|
1210
1249
|
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("object_integrity_proofs.verify_object", async (span) => {
|
|
1211
1250
|
try {
|
|
1212
1251
|
return await observeAttempt(observedOptions, "objectIntegrity", async (observation) => {
|
|
1213
|
-
const
|
|
1252
|
+
const result = await verifyObjectCore(cls, jsonLd, {
|
|
1214
1253
|
...options,
|
|
1215
1254
|
[verificationObservation]: observation
|
|
1216
1255
|
});
|
|
1217
|
-
if (
|
|
1256
|
+
if (result == null) {
|
|
1218
1257
|
span.setStatus({ code: SpanStatusCode.ERROR });
|
|
1219
1258
|
span.setAttribute("activitypub.verification.failure_reason", observation.attempt?.reason?.type ?? "signatureVerificationFailed");
|
|
1220
1259
|
}
|
|
1221
|
-
return
|
|
1222
|
-
}, (value) => value
|
|
1260
|
+
return classify(result, observation.attempt?.checks ?? []);
|
|
1261
|
+
}, (value) => value.status === "verified");
|
|
1223
1262
|
} catch (error) {
|
|
1224
1263
|
span.setStatus({
|
|
1225
1264
|
code: SpanStatusCode.ERROR,
|
|
@@ -1231,6 +1270,15 @@ async function verifyObject(cls, jsonLd, options = {}) {
|
|
|
1231
1270
|
}
|
|
1232
1271
|
});
|
|
1233
1272
|
}
|
|
1273
|
+
const checks = options[verificationObservation].attempt.checks;
|
|
1274
|
+
const before = checks.length;
|
|
1275
|
+
return classify(await verifyObjectCore(cls, jsonLd, options), checks.slice(before));
|
|
1276
|
+
}
|
|
1277
|
+
function isRetryableKeyFetchError(result) {
|
|
1278
|
+
if ("error" in result) return isTransientFetchError(result.error);
|
|
1279
|
+
return result.status >= 500 || result.status === 408 || result.status === 429;
|
|
1280
|
+
}
|
|
1281
|
+
async function verifyObjectCore(cls, jsonLd, options) {
|
|
1234
1282
|
const observation = options[verificationObservation];
|
|
1235
1283
|
const logger = getLogger([
|
|
1236
1284
|
"fedify",
|
|
@@ -1243,6 +1291,7 @@ async function verifyObject(cls, jsonLd, options = {}) {
|
|
|
1243
1291
|
const defaultDocumentLoader = getDocumentLoader();
|
|
1244
1292
|
const proofContextLoader = options.contextLoader ?? defaultDocumentLoader;
|
|
1245
1293
|
const attributions = new Set(object.attributionIds.map((uri) => uri.href));
|
|
1294
|
+
const signers = [];
|
|
1246
1295
|
if (object instanceof Activity) for (const uri of object.actorIds) attributions.add(uri.href);
|
|
1247
1296
|
const rawProofValues = isJsonLdNode(jsonLd) ? await getRawProofValues(jsonLd, proofContextLoader) : [];
|
|
1248
1297
|
const rawProofCandidates = isJsonLdNode(jsonLd) ? await parseRawProofCandidates(jsonLd, rawProofValues, options, proofContextLoader) : [];
|
|
@@ -1301,6 +1350,11 @@ async function verifyObject(cls, jsonLd, options = {}) {
|
|
|
1301
1350
|
continue;
|
|
1302
1351
|
}
|
|
1303
1352
|
deleteAuthenticatedAttribution(attributions, key.controllerId, proof.verificationMethodId);
|
|
1353
|
+
const signer = getAuthenticatedController(key.controllerId, proof.verificationMethodId);
|
|
1354
|
+
if (signer != null && !signers.some((s) => s.kind === signer.kind && s.id.href === signer.id.href && s.keyId.href === proof.verificationMethodId.href)) signers.push({
|
|
1355
|
+
...signer,
|
|
1356
|
+
keyId: proof.verificationMethodId
|
|
1357
|
+
});
|
|
1304
1358
|
}
|
|
1305
1359
|
if (acceptedPortableProofs < loadedPortableProofs) {
|
|
1306
1360
|
logger.debug("Some portable proof references could not be dereferenced.");
|
|
@@ -1314,7 +1368,41 @@ async function verifyObject(cls, jsonLd, options = {}) {
|
|
|
1314
1368
|
logger.debug("Some attributions are not authenticated by the proofs: {attributions}.", { attributions: [...attributions] });
|
|
1315
1369
|
return null;
|
|
1316
1370
|
}
|
|
1317
|
-
return
|
|
1371
|
+
return {
|
|
1372
|
+
object,
|
|
1373
|
+
signers
|
|
1374
|
+
};
|
|
1375
|
+
}
|
|
1376
|
+
/**
|
|
1377
|
+
* Tells whom a key that verified an Object Integrity Proof authenticates.
|
|
1378
|
+
* @param key The key, i.e., the proof's verification method.
|
|
1379
|
+
* @returns The signer, or `null` if the key authenticates nobody.
|
|
1380
|
+
* @internal
|
|
1381
|
+
*/
|
|
1382
|
+
function getProofSigner(key) {
|
|
1383
|
+
if (key.id == null || key.controllerId == null) return null;
|
|
1384
|
+
const signer = getAuthenticatedController(key.controllerId, key.id);
|
|
1385
|
+
return signer == null ? null : {
|
|
1386
|
+
...signer,
|
|
1387
|
+
keyId: key.id
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
/**
|
|
1391
|
+
* Tells whom a verified proof authenticates: the key's controller if it is an
|
|
1392
|
+
* ordinary actor, or the DID of a portable controller if the verification
|
|
1393
|
+
* method belongs to the same DID.
|
|
1394
|
+
*/
|
|
1395
|
+
function getAuthenticatedController(controllerId, verificationMethodId) {
|
|
1396
|
+
if (!hasCryptographicOrigin(controllerId.href) && !isPortableId(controllerId)) return {
|
|
1397
|
+
kind: "actor",
|
|
1398
|
+
id: controllerId
|
|
1399
|
+
};
|
|
1400
|
+
const did = getPortableDid(controllerId);
|
|
1401
|
+
if (did == null || !hasCryptographicOrigin(verificationMethodId.href) || getPortableDid(verificationMethodId) !== did || !URL.canParse(did)) return null;
|
|
1402
|
+
return {
|
|
1403
|
+
kind: "portableAuthority",
|
|
1404
|
+
id: new URL(did)
|
|
1405
|
+
};
|
|
1318
1406
|
}
|
|
1319
1407
|
function deleteAuthenticatedAttribution(attributions, controllerId, verificationMethodId) {
|
|
1320
1408
|
if (!hasCryptographicOrigin(controllerId.href) && !isPortableId(controllerId)) {
|
|
@@ -1329,4 +1417,4 @@ function hasCryptographicOrigin(iri) {
|
|
|
1329
1417
|
return /^did:/i.test(iri) || /^ap(?:\+ef61)?:\/\//i.test(iri);
|
|
1330
1418
|
}
|
|
1331
1419
|
//#endregion
|
|
1332
|
-
export {
|
|
1420
|
+
export { hasProofLike as a, verifyMapLocalProof as c, verifyPortableObjectProof as d, verifyPortableObjectProofPolicy as f, verifyProof as h, getProofSigner as i, verifyObject as l, verifyPreparedPortableObjectProofPolicy as m, classifyFep2277CoreType as n, preparePortableObjectProofPolicy as o, verifyPortableObjectProofWithRoot as p, createProof as r, signObject as s, InvalidPortableObjectIdError as t, verifyObjectDetailed as u };
|
|
@@ -2,9 +2,9 @@ import "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { d as isPortableUri } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
|
-
import { n as version, t as name } from "./deno-
|
|
6
|
-
import { n as getDurationMs, r as getFederationMetrics } from "./metrics-
|
|
7
|
-
import { n as doubleKnock } from "./http-
|
|
5
|
+
import { n as version, t as name } from "./deno-Dpewt_jJ.mjs";
|
|
6
|
+
import { n as getDurationMs, r as getFederationMetrics } from "./metrics-B-QxRSSR.mjs";
|
|
7
|
+
import { n as doubleKnock } from "./http-BZkyQIkb.mjs";
|
|
8
8
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
9
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import { FetchError, UrlError, canonicalizePortableUri, getFe34Origin, isGatewayUrl, toCompatibleEf61Id, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
|
-
import { a as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-
|
|
6
|
+
import { a as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-heeXW2_A.mjs";
|
|
7
7
|
import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/sig/compound-proof-discovery.test.ts
|
|
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
|
-
import { a as inspectCompoundPortableObjectApplicability, i as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-
|
|
6
|
+
import { a as inspectCompoundPortableObjectApplicability, i as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-heeXW2_A.mjs";
|
|
7
7
|
import { test } from "@fedify/fixture";
|
|
8
8
|
//#region src/sig/compound-proof-producer.test.ts
|
|
9
9
|
const portableId = "ap+ef61://did:key:z6MkAlice/objects/1";
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
6
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { c as verifyMapLocalProof, f as verifyPortableObjectProofPolicy } from "../proof-DPoF06nz.mjs";
|
|
8
8
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
9
|
-
import { a as inspectCompoundPortableObjectApplicability, o as verifyCompoundPortableObjectProofs, s as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-
|
|
9
|
+
import { a as inspectCompoundPortableObjectApplicability, o as verifyCompoundPortableObjectProofs, s as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-heeXW2_A.mjs";
|
|
10
10
|
import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
|
|
11
11
|
import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
|
|
12
12
|
import { CryptographicKey, Multikey, Person } from "@fedify/vocab";
|
|
@@ -6,9 +6,9 @@ import "../std__assert-DvMDRPes.mjs";
|
|
|
6
6
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
7
7
|
import { n as preloadedOnlyDocumentLoader } from "../public-audience--klBIOk1.mjs";
|
|
8
8
|
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { h as verifyProof, s as signObject } from "../proof-DPoF06nz.mjs";
|
|
10
10
|
import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
11
|
-
import { s as verifyCompoundProofDocuments } from "../compound-proof-
|
|
11
|
+
import { s as verifyCompoundProofDocuments } from "../compound-proof-heeXW2_A.mjs";
|
|
12
12
|
import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
|
|
13
13
|
import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
|
|
14
14
|
import { Create, DataIntegrityProof, Note, Question } from "@fedify/vocab";
|
package/dist/sig/http.test.mjs
CHANGED
|
@@ -12,8 +12,8 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
|
12
12
|
import "../std__assert-DvMDRPes.mjs";
|
|
13
13
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
14
14
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
15
|
-
import {
|
|
16
|
-
import { a as listRequestSignatures, c as selectRequestSignature, f as verifyRequest, i as formatRfc9421SignatureParameters, l as signRequest, n as doubleKnock, o as parseRfc9421Signature, p as verifyRequestDetailed, r as formatRfc9421Signature, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as timingSafeEqual } from "../http-
|
|
15
|
+
import { x as exportJwk } from "../ld-CQFuiah9.mjs";
|
|
16
|
+
import { a as listRequestSignatures, c as selectRequestSignature, f as verifyRequest, i as formatRfc9421SignatureParameters, l as signRequest, n as doubleKnock, o as parseRfc9421Signature, p as verifyRequestDetailed, r as formatRfc9421Signature, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as timingSafeEqual } from "../http-BZkyQIkb.mjs";
|
|
17
17
|
import { a as rsaPrivateKey3, i as rsaPrivateKey2, l as rsaPublicKey5, n as ed25519PrivateKey, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
18
18
|
import { t as KvKeyCache } from "../keycache-N2opu4-3.mjs";
|
|
19
19
|
import { FetchError, UrlError, exportSpki, getDocumentLoader } from "@fedify/vocab-runtime";
|
package/dist/sig/key.test.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import "../std__assert-DvMDRPes.mjs";
|
|
|
8
8
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
9
9
|
import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
|
|
10
10
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
11
|
-
import { C as
|
|
11
|
+
import { C as fetchKey, D as validateCryptoKey, E as importJwk, T as generateCryptoKeyPair, w as fetchKeyDetailed, x as exportJwk, y as wrapContextLoaderForJsonLd } from "../ld-CQFuiah9.mjs";
|
|
12
12
|
import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
13
13
|
import { CryptographicKey, Multikey, Person } from "@fedify/vocab";
|
|
14
14
|
import { FetchError, UrlError, exportDidKey, getDocumentLoader } from "@fedify/vocab-runtime";
|
package/dist/sig/ld.test.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
|
8
8
|
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
9
9
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
10
10
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
11
|
-
import {
|
|
11
|
+
import { T as generateCryptoKeyPair, _ as verifyJsonLd, a as compactJsonLd, f as isInvalidUrlTypeError, i as attachSignature, m as signJsonLd, n as UnsafeJsonLdError, o as createSignature, s as detachSignature, u as hasSignatureLike, v as verifySignature } from "../ld-CQFuiah9.mjs";
|
|
12
12
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
13
13
|
import { CryptographicKey } from "@fedify/vocab";
|
|
14
14
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -5,10 +5,10 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
6
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
7
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import { p as verifyRequestDetailed } from "../http-
|
|
10
|
-
import { o as createFederation } from "../middleware-
|
|
11
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
8
|
+
import { d as verifyPortableObjectProof } from "../proof-DPoF06nz.mjs";
|
|
9
|
+
import { p as verifyRequestDetailed } from "../http-BZkyQIkb.mjs";
|
|
10
|
+
import { o as createFederation } from "../middleware-CuVa0UuS.mjs";
|
|
11
|
+
import { t as doesActorOwnKey } from "../owner-ccKkQOAf.mjs";
|
|
12
12
|
import { Create, Person } from "@fedify/vocab";
|
|
13
13
|
import { canonicalizePortableUri, decodeMultibase, importDidKey } from "@fedify/vocab-runtime";
|
|
14
14
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
6
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { p as verifyRequestDetailed } from "../http-
|
|
9
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
7
|
+
import { d as verifyPortableObjectProof } from "../proof-DPoF06nz.mjs";
|
|
8
|
+
import { p as verifyRequestDetailed } from "../http-BZkyQIkb.mjs";
|
|
9
|
+
import { t as doesActorOwnKey } from "../owner-ccKkQOAf.mjs";
|
|
10
10
|
import { Create } from "@fedify/vocab";
|
|
11
11
|
import { canonicalizePortableUri, decodeMultibase, fromCompatibleEf61Id, importDidKey } from "@fedify/vocab-runtime";
|
|
12
12
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
package/dist/sig/mod.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_http = require("../http-
|
|
4
|
-
const require_portable_collection = require("../portable-collection-
|
|
3
|
+
const require_http = require("../http-CAl7Num5.cjs");
|
|
4
|
+
const require_portable_collection = require("../portable-collection-TC-kvkVI.cjs");
|
|
5
5
|
exports.attachSignature = require_http.attachSignature;
|
|
6
6
|
exports.createProof = require_http.createProof;
|
|
7
7
|
exports.createSignature = require_http.createSignature;
|
package/dist/sig/mod.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { A as AcceptSignatureParameters, B as VerifyPortableObjectProofOptions, C as VerifyRequestDetailedResult, D as verifyRequest, E as signRequest, F as validateAcceptSignature, G as signObject, H as VerifyProofOptions, I as CreateProofOptions, J as verifyProof, K as verifyObject, L as SignObjectOptions, M as formatAcceptSignature, N as fulfillAcceptSignature, O as verifyRequestDetailed, P as parseAcceptSignature, R as VerifyObjectOptions, S as SignRequestOptions, T as VerifyRequestOptions, U as createProof, V as VerifyPortableObjectProofResult, W as hasProofLike, a as KeyCache, b as HttpMessageSignaturesSpecDeterminer, c as fetchKeyDetailed, i as FetchKeyResult, j as FulfillAcceptSignatureResult, k as AcceptSignatureMember, l as generateCryptoKeyPair, n as FetchKeyErrorResult, o as exportJwk, q as verifyPortableObjectProof, r as FetchKeyOptions, s as fetchKey, t as FetchKeyDetailedResult, u as importJwk, w as VerifyRequestFailureReason, x as Rfc9421SignRequestOptions, y as HttpMessageSignaturesSpec, z as VerifyPortableObjectProofFailureReason } from "../key-nYGY4QB9.cjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { a as VerifySignatureOptions, c as detachSignature, d as verifyJsonLd, f as verifySignature, g as getKeyOwner, h as doesActorOwnKey, i as VerifyJsonLdOptions, l as hasSignatureLike, m as GetKeyOwnerOptions, o as attachSignature, p as DoesActorOwnKeyOptions, r as SignJsonLdOptions, s as createSignature, t as CreateSignatureOptions, u as signJsonLd } from "../ld-Cel1RRZ5.cjs";
|
|
4
|
+
import { i as verifyPortableObject, n as VerifyPortableObjectOptions, r as VerifyPortableObjectResult, t as VerifyPortableObjectFailureReason } from "../mod-B2783_3v.cjs";
|
|
5
5
|
export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectFailureReason, VerifyPortableObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyPortableObjectResult, 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, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
package/dist/sig/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { A as AcceptSignatureParameters, B as VerifyPortableObjectProofOptions, C as VerifyRequestDetailedResult, D as verifyRequest, E as signRequest, F as validateAcceptSignature, G as signObject, H as VerifyProofOptions, I as CreateProofOptions, J as verifyProof, K as verifyObject, L as SignObjectOptions, M as formatAcceptSignature, N as fulfillAcceptSignature, O as verifyRequestDetailed, P as parseAcceptSignature, R as VerifyObjectOptions, S as SignRequestOptions, T as VerifyRequestOptions, U as createProof, V as VerifyPortableObjectProofResult, W as hasProofLike, a as KeyCache, b as HttpMessageSignaturesSpecDeterminer, c as fetchKeyDetailed, i as FetchKeyResult, j as FulfillAcceptSignatureResult, k as AcceptSignatureMember, l as generateCryptoKeyPair, n as FetchKeyErrorResult, o as exportJwk, q as verifyPortableObjectProof, r as FetchKeyOptions, s as fetchKey, t as FetchKeyDetailedResult, u as importJwk, w as VerifyRequestFailureReason, x as Rfc9421SignRequestOptions, y as HttpMessageSignaturesSpec, z as VerifyPortableObjectProofFailureReason } from "../key-DhsBxxZN.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { a as VerifySignatureOptions, c as detachSignature, d as verifyJsonLd, f as verifySignature, g as getKeyOwner, h as doesActorOwnKey, i as VerifyJsonLdOptions, l as hasSignatureLike, m as GetKeyOwnerOptions, o as attachSignature, p as DoesActorOwnKeyOptions, r as SignJsonLdOptions, s as createSignature, t as CreateSignatureOptions, u as signJsonLd } from "../ld-CcuZ4NZa.js";
|
|
4
|
+
import { i as verifyPortableObject, n as VerifyPortableObjectOptions, r as VerifyPortableObjectResult, t as VerifyPortableObjectFailureReason } from "../mod-BHQE-7WQ.js";
|
|
5
5
|
export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectFailureReason, VerifyPortableObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyPortableObjectResult, 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, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
package/dist/sig/mod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import {
|
|
4
|
-
import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-
|
|
3
|
+
import { F as hasSignatureLike, H as verifySignature, J as generateCryptoKeyPair, K as fetchKey, M as detachSignature, St as validateAcceptSignature, T as verifyProof, V as verifyJsonLd, W as exportJwk, Y as importJwk, _ as signObject, a as signRequest, bt as fulfillAcceptSignature, c as verifyRequestDetailed, h as hasProofLike, j as createSignature, k as attachSignature, p as createProof, q as fetchKeyDetailed, s as verifyRequest, x as verifyPortableObjectProof, xt as parseAcceptSignature, y as verifyObject, yt as formatAcceptSignature, z as signJsonLd } from "../http-BBr-VLil.js";
|
|
4
|
+
import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-DUlQ3s2M.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, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
package/dist/sig/owner.test.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
|
6
6
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
7
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
8
8
|
import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
9
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-
|
|
9
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-ccKkQOAf.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
|
|
@@ -2,7 +2,7 @@ import "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
5
|
-
import { t as verifyPortableObject } from "../portable-collection-
|
|
5
|
+
import { t as verifyPortableObject } from "../portable-collection-CndnpXfo.mjs";
|
|
6
6
|
import { Collection, CollectionPage, Note, OrderedCollection, Person, traverseCollection } from "@fedify/vocab";
|
|
7
7
|
import { FetchError, encodeMultibase, exportDidKey, preloadedContexts } from "@fedify/vocab-runtime";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
6
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { n as getKeyOwner } from "../owner-
|
|
9
|
-
import { t as verifyPortableObject } from "../portable-collection-
|
|
7
|
+
import { d as verifyPortableObjectProof, h as verifyProof } from "../proof-DPoF06nz.mjs";
|
|
8
|
+
import { n as getKeyOwner } from "../owner-ccKkQOAf.mjs";
|
|
9
|
+
import { t as verifyPortableObject } from "../portable-collection-CndnpXfo.mjs";
|
|
10
10
|
import { Application, DataIntegrityProof, lookupObject } from "@fedify/vocab";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
//#region test-vectors/fep-ef61/tootik-v0.25.4/actor.json
|
|
@@ -2,12 +2,12 @@ import { Temporal } from "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { n as resolvePortableActorKey } from "../portable-key-
|
|
8
|
-
import { f as verifyRequest, l as signRequest, p as verifyRequestDetailed } from "../http-
|
|
5
|
+
import { C as fetchKey, _ as verifyJsonLd, m as signJsonLd, w as fetchKeyDetailed } from "../ld-CQFuiah9.mjs";
|
|
6
|
+
import { h as verifyProof, r as createProof } from "../proof-DPoF06nz.mjs";
|
|
7
|
+
import { n as resolvePortableActorKey } from "../portable-key-D5tFOoV-.mjs";
|
|
8
|
+
import { f as verifyRequest, l as signRequest, p as verifyRequestDetailed } from "../http-BZkyQIkb.mjs";
|
|
9
9
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
10
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-
|
|
10
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-ccKkQOAf.mjs";
|
|
11
11
|
import { t as KvKeyCache } from "../keycache-N2opu4-3.mjs";
|
|
12
12
|
import { Create, CryptographicKey, Multikey, Note, Person } from "@fedify/vocab";
|
|
13
13
|
import { FetchError, encodeMultibase, exportDidKey, exportSpki, parseIri, preloadedContexts } from "@fedify/vocab-runtime";
|
package/dist/sig/proof.test.mjs
CHANGED
|
@@ -11,12 +11,12 @@ import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
|
11
11
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
12
12
|
import { a as verificationObservation } from "../verification-Dpfcw8ml.mjs";
|
|
13
13
|
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
|
|
14
|
-
import {
|
|
15
|
-
import { f as verifyRequest } from "../http-
|
|
14
|
+
import { a as hasProofLike, c as verifyMapLocalProof, d as verifyPortableObjectProof, h as verifyProof, l as verifyObject, r as createProof, s as signObject, u as verifyObjectDetailed } from "../proof-DPoF06nz.mjs";
|
|
15
|
+
import { f as verifyRequest } from "../http-BZkyQIkb.mjs";
|
|
16
16
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
17
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
17
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-CpsDyqVN.mjs";
|
|
18
18
|
import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place, Translation } from "@fedify/vocab";
|
|
19
|
-
import { decodeMultibase, encodeMultibase, exportDidKey, exportMultibaseKey, formatIri, importMultibaseKey, parseIri } from "@fedify/vocab-runtime";
|
|
19
|
+
import { FetchError, decodeMultibase, encodeMultibase, exportDidKey, exportMultibaseKey, formatIri, importMultibaseKey, parseIri } from "@fedify/vocab-runtime";
|
|
20
20
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
21
21
|
import { decodeHex } from "byte-encodings/hex";
|
|
22
22
|
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
@@ -2594,5 +2594,45 @@ test("verifyObject() rejects a key whose controller redirects to another actor",
|
|
|
2594
2594
|
contextLoader: mockDocumentLoader
|
|
2595
2595
|
}), null);
|
|
2596
2596
|
});
|
|
2597
|
+
test("verifyObjectDetailed() tells who signed the proofs", async () => {
|
|
2598
|
+
const keyId = new URL("https://example.com/person2#key4");
|
|
2599
|
+
const actor = new URL("https://example.com/person2");
|
|
2600
|
+
const json = await (await signObject(new Create({
|
|
2601
|
+
id: new URL("https://example.com/activities/detailed"),
|
|
2602
|
+
actor,
|
|
2603
|
+
object: new Note({ content: "Hello" })
|
|
2604
|
+
}), ed25519PrivateKey, keyId, { contextLoader: mockDocumentLoader })).toJsonLd({ contextLoader: mockDocumentLoader });
|
|
2605
|
+
const options = {
|
|
2606
|
+
documentLoader: mockDocumentLoader,
|
|
2607
|
+
contextLoader: mockDocumentLoader
|
|
2608
|
+
};
|
|
2609
|
+
const result = await verifyObjectDetailed(Create, json, options);
|
|
2610
|
+
assertEquals(result.status, "verified");
|
|
2611
|
+
assertEquals(result.status === "verified" ? result.signers.map((s) => [
|
|
2612
|
+
s.kind,
|
|
2613
|
+
s.id.href,
|
|
2614
|
+
s.keyId.href
|
|
2615
|
+
]) : [], [[
|
|
2616
|
+
"actor",
|
|
2617
|
+
actor.href,
|
|
2618
|
+
keyId.href
|
|
2619
|
+
]]);
|
|
2620
|
+
const unsigned = await verifyObjectDetailed(Note, {
|
|
2621
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
2622
|
+
id: "https://example.com/notes/unsigned",
|
|
2623
|
+
type: "Note"
|
|
2624
|
+
}, options);
|
|
2625
|
+
assertEquals(unsigned.status, "verified");
|
|
2626
|
+
assertEquals(unsigned.status === "verified" ? unsigned.signers : null, []);
|
|
2627
|
+
assertEquals((await verifyObjectDetailed(Create, json, {
|
|
2628
|
+
...options,
|
|
2629
|
+
documentLoader: (url) => url.startsWith("https://example.com/person2") ? Promise.reject(new FetchError(url, "Unavailable", new Response(null, { status: 503 }))) : mockDocumentLoader(url)
|
|
2630
|
+
})).status, "unavailable");
|
|
2631
|
+
assertEquals((await verifyObjectDetailed(Create, json, {
|
|
2632
|
+
...options,
|
|
2633
|
+
documentLoader: (url) => url.startsWith("https://example.com/person2") ? Promise.reject(new FetchError(url, "Gone", new Response(null, { status: 410 }))) : mockDocumentLoader(url)
|
|
2634
|
+
})).status, "invalid");
|
|
2635
|
+
assertEquals(await verifyObject(Create, json, options) != null, true);
|
|
2636
|
+
});
|
|
2597
2637
|
//#endregion
|
|
2598
2638
|
export {};
|
|
@@ -5,10 +5,10 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
6
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
7
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import { p as verifyRequestDetailed } from "../http-
|
|
10
|
-
import { o as createFederation } from "../middleware-
|
|
11
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
8
|
+
import { d as verifyPortableObjectProof } from "../proof-DPoF06nz.mjs";
|
|
9
|
+
import { p as verifyRequestDetailed } from "../http-BZkyQIkb.mjs";
|
|
10
|
+
import { o as createFederation } from "../middleware-CuVa0UuS.mjs";
|
|
11
|
+
import { t as doesActorOwnKey } from "../owner-ccKkQOAf.mjs";
|
|
12
12
|
import { Follow, Person } from "@fedify/vocab";
|
|
13
13
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
14
14
|
import { encodeHex } from "byte-encodings/hex";
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
6
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { p as verifyRequestDetailed } from "../http-
|
|
9
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
7
|
+
import { d as verifyPortableObjectProof } from "../proof-DPoF06nz.mjs";
|
|
8
|
+
import { p as verifyRequestDetailed } from "../http-BZkyQIkb.mjs";
|
|
9
|
+
import { t as doesActorOwnKey } from "../owner-ccKkQOAf.mjs";
|
|
10
10
|
import { Create } from "@fedify/vocab";
|
|
11
11
|
import { decodeMultibase, importDidKey } from "@fedify/vocab-runtime";
|
|
12
12
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -2,9 +2,9 @@ import "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { a as verificationObservation } from "../verification-Dpfcw8ml.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { l as signRequest, p as verifyRequestDetailed } from "../http-
|
|
5
|
+
import { _ as verifyJsonLd, m as signJsonLd } from "../ld-CQFuiah9.mjs";
|
|
6
|
+
import { l as verifyObject, s as signObject } from "../proof-DPoF06nz.mjs";
|
|
7
|
+
import { l as signRequest, p as verifyRequestDetailed } from "../http-BZkyQIkb.mjs";
|
|
8
8
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
9
9
|
import { Activity, Create, CryptographicKey, Multikey } from "@fedify/vocab";
|
|
10
10
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { c as getNormalizationContextLoader } from "./ld-
|
|
4
|
+
import { c as getNormalizationContextLoader } from "./ld-CQFuiah9.mjs";
|
|
5
5
|
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
6
6
|
//#region src/federation/temporal.ts
|
|
7
7
|
function isPlainObject(value) {
|
package/dist/testing/kv.test.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
6
6
|
import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
|
|
7
7
|
import { n as baseOptions, o as stringSchema, t as MockQueue } from "../tasks-IG3pHfvZ.mjs";
|
|
8
8
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
9
|
-
import { o as createFederation } from "../middleware-
|
|
9
|
+
import { o as createFederation } from "../middleware-CuVa0UuS.mjs";
|
|
10
10
|
//#region src/testing/kv.test.ts
|
|
11
11
|
test("ManualClockKvStore keeps an entry at its exact expiration instant", async () => {
|
|
12
12
|
const kv = new ManualClockKvStore();
|