@fedify/fedify 2.4.0-dev.2157 → 2.4.0-dev.2164
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/{builder-CLaS4-yA.mjs → builder-BqRmnx7p.mjs} +2 -2
- 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-D7K94KPz.mjs → compound-proof-CxDBdtNz.mjs} +2 -2
- package/dist/{context-exYu7gDU.d.ts → context-BykNUf04.d.ts} +120 -3
- package/dist/{context-BMggDR-l.d.cts → context-L0Fnib9j.d.cts} +120 -3
- package/dist/{deno-D1gcWWqB.mjs → deno-CizGaYeG.mjs} +1 -1
- package/dist/{docloader-BMqr3hji.mjs → docloader-BBFAItNB.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 +3 -3
- package/dist/federation/handler.test.mjs +5 -5
- package/dist/federation/hashlink-media.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/keycache.test.mjs +67 -1
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +7 -7
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +1 -1
- package/dist/federation/outgoing-proof.test.mjs +5 -5
- 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-gateway-keys.test.mjs +180 -6
- package/dist/federation/portable-inbox.test.mjs +4 -4
- package/dist/federation/portable-parse-uri.test.d.mts +2 -0
- package/dist/federation/portable-parse-uri.test.mjs +348 -0
- package/dist/federation/portable.test.mjs +3 -3
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/tasks/enqueue.test.mjs +1 -1
- package/dist/federation/tasks/tasks.test.mjs +2 -2
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{federation-2e8XrN7q.cjs → federation-DFCnp94y.cjs} +103 -29
- package/dist/{http-Dgtt45-K.js → http-Baovr6xq.js} +161 -7
- package/dist/{http-CjezPjFX.d.cts → http-Cok5-vIC.d.ts} +6 -1
- package/dist/{http-C-x_OLSp.d.ts → http-DC1cqAQ2.d.cts} +6 -1
- package/dist/{http-CGcLv8rh.mjs → http-DRH0n8TD.mjs} +7 -5
- package/dist/{http-BObQoB0j.cjs → http-R4g1McwE.cjs} +185 -11
- package/dist/{key-CPM4r6tP.mjs → key-D5awqp7u.mjs} +58 -7
- package/dist/key-owner-evidence-Bo3yaeL5.mjs +108 -0
- package/dist/{keycache-BInaECGj.mjs → keycache-PiOM9pM0.mjs} +46 -21
- package/dist/{kv-cache-bdPqTR1k.mjs → kv-cache-C7RWL7hz.mjs} +1 -1
- package/dist/{kv-cache-BweyIZTb.js → kv-cache-CZiBDLPi.js} +1 -1
- package/dist/{kv-cache-D2fnB8qu.cjs → kv-cache-Ct-KWRta.cjs} +1 -1
- package/dist/{ld-lU_ZqzsQ.mjs → ld-CyliEU48.mjs} +3 -3
- package/dist/{metrics-B41pRPfd.mjs → metrics-CFBEehTc.mjs} +1 -1
- package/dist/{middleware-xdukzV3x.mjs → middleware-B99JjvFn.mjs} +70 -20
- package/dist/{middleware-TrCVULgs.mjs → middleware-BmqEWsWP.mjs} +1 -1
- package/dist/{middleware-BYWyYjmX.js → middleware-CdpTFsa2.js} +103 -29
- package/dist/{mod-Bz9tFXI2.d.ts → mod--jv6vyrP.d.ts} +1 -1
- package/dist/{mod-DaiBrWDW.d.ts → mod-B5z_q9TH.d.ts} +1 -1
- package/dist/{mod-Mt4aO3DX.d.cts → mod-BA_F2x53.d.cts} +1 -1
- package/dist/{mod-Decmur1U.d.cts → mod-BLOXGs6m.d.cts} +1 -1
- package/dist/{mod-S--JxYjo.d.cts → mod-CPPqkyV_.d.cts} +1 -1
- package/dist/{mod-CnGtADvO.d.ts → mod-DK0y9fd-.d.ts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +7 -7
- package/dist/mod.d.ts +7 -7
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/{owner-D63yPo_i.mjs → owner-DKdtsrEq.mjs} +18 -3
- package/dist/{portable-collection-_lZg-osX.mjs → portable-collection-Cb5cdPIU.mjs} +2 -2
- package/dist/{portable-collection-B8ojoQ50.cjs → portable-collection-UajqDrSL.cjs} +15 -1
- package/dist/{portable-collection-C3xEzYri.js → portable-collection-uv4CuQXm.js} +15 -1
- package/dist/{portable-key-D8uWZF7b.mjs → portable-key-Bv1RdQ0n.mjs} +2 -1
- package/dist/{proof-C2YwD8a_.mjs → proof-CRTPWbVh.mjs} +4 -4
- package/dist/{send-D9SGhxTB.mjs → send-2dULlZc8.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-owner-evidence.test.d.mts +2 -0
- package/dist/sig/key-owner-evidence.test.mjs +100 -0
- package/dist/sig/key.test.mjs +1 -1
- package/dist/sig/ld.test.mjs +2 -2
- 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-key.test.mjs +6 -6
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/{temporal-q6FSekcN.mjs → temporal-Dhsk6aUT.mjs} +1 -1
- package/dist/testing/kv.test.mjs +1 -1
- package/dist/testing/mod.d.mts +118 -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.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +6 -6
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-
|
|
4
|
+
import { n as version, t as name } from "./deno-CizGaYeG.mjs";
|
|
5
|
+
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-CFBEehTc.mjs";
|
|
6
6
|
import { c as isPortableId, r as getPortableDid } from "./portable-key-id-Bg259c4Z.mjs";
|
|
7
|
-
import { c as validateCryptoKey, i as fetchKey, t as bypassKeyCacheReads } from "./key-
|
|
7
|
+
import { c as validateCryptoKey, i as fetchKey, t as bypassKeyCacheReads } from "./key-D5awqp7u.mjs";
|
|
8
8
|
import { n as preloadedOnlyDocumentLoader } from "./public-audience--klBIOk1.mjs";
|
|
9
9
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
|
|
10
|
-
import { c as getNormalizationContextLoader } from "./ld-
|
|
10
|
+
import { c as getNormalizationContextLoader } from "./ld-CyliEU48.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";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { n as getDurationMs, r as getFederationMetrics } from "./metrics-
|
|
6
|
-
import { n as doubleKnock } from "./http-
|
|
4
|
+
import { n as version, t as name } from "./deno-CizGaYeG.mjs";
|
|
5
|
+
import { n as getDurationMs, r as getFederationMetrics } from "./metrics-CFBEehTc.mjs";
|
|
6
|
+
import { n as doubleKnock } from "./http-DRH0n8TD.mjs";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
8
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
9
9
|
import { FetchError, UrlError, 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 { i as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-
|
|
6
|
+
import { i as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-CxDBdtNz.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 { i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-
|
|
6
|
+
import { i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-CxDBdtNz.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 { l as verifyPortableObjectProofPolicy, o as verifyMapLocalProof } from "../proof-
|
|
7
|
+
import { l as verifyPortableObjectProofPolicy, o as verifyMapLocalProof } from "../proof-CRTPWbVh.mjs";
|
|
8
8
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
9
|
-
import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, o as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-
|
|
9
|
+
import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, o as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-CxDBdtNz.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 { a as signObject, d as verifyProof } from "../proof-
|
|
9
|
+
import { a as signObject, d as verifyProof } from "../proof-CRTPWbVh.mjs";
|
|
10
10
|
import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
11
|
-
import { o as verifyCompoundProofDocuments } from "../compound-proof-
|
|
11
|
+
import { o as verifyCompoundProofDocuments } from "../compound-proof-CxDBdtNz.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
|
@@ -11,8 +11,8 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
|
11
11
|
import "../std__assert-DvMDRPes.mjs";
|
|
12
12
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
13
13
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
14
|
-
import { n as exportJwk } from "../key-
|
|
15
|
-
import { a as listRequestSignatures, c as selectRequestSignature, d as verifyRequest, f as verifyRequestDetailed, i as formatRfc9421SignatureParameters, l as signRequest, n as doubleKnock, o as parseRfc9421Signature, r as formatRfc9421Signature, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as timingSafeEqual } from "../http-
|
|
14
|
+
import { n as exportJwk } from "../key-D5awqp7u.mjs";
|
|
15
|
+
import { a as listRequestSignatures, c as selectRequestSignature, d as verifyRequest, f as verifyRequestDetailed, i as formatRfc9421SignatureParameters, l as signRequest, n as doubleKnock, o as parseRfc9421Signature, r as formatRfc9421Signature, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as timingSafeEqual } from "../http-DRH0n8TD.mjs";
|
|
16
16
|
import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
17
17
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
18
18
|
import { FetchError, exportSpki } from "@fedify/vocab-runtime";
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Temporal } from "temporal-polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
|
+
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
6
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
7
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
8
|
+
import { t as getCanonicalPortableId } from "../portable-key-id-Bg259c4Z.mjs";
|
|
9
|
+
import { a as promoteKeyOwnerEvidence, i as parseKeyOwnerEvidence, n as attachKeyOwnerEvidence, r as getVerifiedKeyOwnerEvidence } from "../key-owner-evidence-Bo3yaeL5.mjs";
|
|
10
|
+
import { r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
11
|
+
import { CryptographicKey, Person } from "@fedify/vocab";
|
|
12
|
+
import { test } from "@fedify/fixture";
|
|
13
|
+
import { exportDidKey, parseIri } from "@fedify/vocab-runtime";
|
|
14
|
+
//#region src/sig/key-owner-evidence.test.ts
|
|
15
|
+
const did = await exportDidKey(ed25519PublicKey.publicKey);
|
|
16
|
+
const rawActorId = `ap://${did}/actors/alice`;
|
|
17
|
+
const actorId = parseIri(rawActorId);
|
|
18
|
+
const keyId = new URL(`https://gw.example/.well-known/apgateway/${did}/actors/alice#main-key`);
|
|
19
|
+
const document = {
|
|
20
|
+
"@id": rawActorId,
|
|
21
|
+
"@type": ["https://www.w3.org/ns/activitystreams#Person"],
|
|
22
|
+
"https://www.w3.org/ns/activitystreams#name": [{ "@value": "Alice" }]
|
|
23
|
+
};
|
|
24
|
+
const expires = Temporal.Now.instant().add({ hours: 1 });
|
|
25
|
+
function createKey(owner = actorId) {
|
|
26
|
+
return new CryptographicKey({
|
|
27
|
+
id: new URL(keyId.href),
|
|
28
|
+
owner: parseIri(owner.href),
|
|
29
|
+
publicKey: rsaPublicKey2.publicKey
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
test("getVerifiedKeyOwnerEvidence() only returns promoted evidence", () => {
|
|
33
|
+
const key = createKey();
|
|
34
|
+
assert(attachKeyOwnerEvidence(key, document, expires));
|
|
35
|
+
assertEquals(getVerifiedKeyOwnerEvidence(key), void 0);
|
|
36
|
+
promoteKeyOwnerEvidence(key);
|
|
37
|
+
const evidence = getVerifiedKeyOwnerEvidence(key);
|
|
38
|
+
assertEquals(evidence?.ownerId, getCanonicalPortableId(actorId));
|
|
39
|
+
assertEquals(evidence?.keyId, keyId.href);
|
|
40
|
+
assertEquals(evidence?.expires, expires);
|
|
41
|
+
const other = createKey();
|
|
42
|
+
promoteKeyOwnerEvidence(other);
|
|
43
|
+
assertEquals(getVerifiedKeyOwnerEvidence(other), void 0);
|
|
44
|
+
});
|
|
45
|
+
test("attachKeyOwnerEvidence() refuses evidence about other actors", () => {
|
|
46
|
+
const otherActorId = parseIri(`ap://${did}/actors/bob`);
|
|
47
|
+
assertFalse(attachKeyOwnerEvidence(createKey(otherActorId), {
|
|
48
|
+
...document,
|
|
49
|
+
"@id": otherActorId.href
|
|
50
|
+
}, expires));
|
|
51
|
+
assertFalse(attachKeyOwnerEvidence(createKey(), {
|
|
52
|
+
...document,
|
|
53
|
+
"@id": `ap://${did}/actors/bob`
|
|
54
|
+
}, expires));
|
|
55
|
+
assertFalse(attachKeyOwnerEvidence(createKey(), {
|
|
56
|
+
...document,
|
|
57
|
+
"@id": `ap://${did}/x/../actors/alice`
|
|
58
|
+
}, expires));
|
|
59
|
+
assertFalse(attachKeyOwnerEvidence(createKey(), {}, expires));
|
|
60
|
+
assertFalse(attachKeyOwnerEvidence(createKey(), [document], expires));
|
|
61
|
+
});
|
|
62
|
+
test("getVerifiedKeyOwnerEvidence() ignores expired evidence", () => {
|
|
63
|
+
const key = createKey();
|
|
64
|
+
attachKeyOwnerEvidence(key, document, expires);
|
|
65
|
+
promoteKeyOwnerEvidence(key);
|
|
66
|
+
assert(getVerifiedKeyOwnerEvidence(key, expires.subtract({ seconds: 1 })));
|
|
67
|
+
assertEquals(getVerifiedKeyOwnerEvidence(key, expires), void 0);
|
|
68
|
+
});
|
|
69
|
+
test("getVerifiedKeyOwnerEvidence() ignores keys changed since", () => {
|
|
70
|
+
const key = createKey();
|
|
71
|
+
attachKeyOwnerEvidence(key, document, expires);
|
|
72
|
+
promoteKeyOwnerEvidence(key);
|
|
73
|
+
key.clone({}).ownerId.href = parseIri(`ap://${did}/actors/bob`).href;
|
|
74
|
+
assertEquals(getVerifiedKeyOwnerEvidence(key), void 0);
|
|
75
|
+
const moved = createKey();
|
|
76
|
+
attachKeyOwnerEvidence(moved, document, expires);
|
|
77
|
+
promoteKeyOwnerEvidence(moved);
|
|
78
|
+
moved.ownerId.href = `https://other.example/.well-known/apgateway/${did}/actors/alice`;
|
|
79
|
+
assertEquals(getVerifiedKeyOwnerEvidence(moved), void 0);
|
|
80
|
+
const verified = createKey();
|
|
81
|
+
attachKeyOwnerEvidence(verified, document, expires);
|
|
82
|
+
promoteKeyOwnerEvidence(verified);
|
|
83
|
+
assertEquals(getVerifiedKeyOwnerEvidence(verified.clone({})), void 0);
|
|
84
|
+
});
|
|
85
|
+
test("parseKeyOwnerEvidence() parses a new actor every time", async () => {
|
|
86
|
+
const key = createKey();
|
|
87
|
+
const doc = structuredClone(document);
|
|
88
|
+
attachKeyOwnerEvidence(key, doc, expires);
|
|
89
|
+
promoteKeyOwnerEvidence(key);
|
|
90
|
+
doc["@id"] = `ap://${did}/actors/bob`;
|
|
91
|
+
const evidence = getVerifiedKeyOwnerEvidence(key);
|
|
92
|
+
const actor = await parseKeyOwnerEvidence(evidence);
|
|
93
|
+
assert(actor instanceof Person);
|
|
94
|
+
assertEquals(actor.id?.href, actorId.href);
|
|
95
|
+
assertEquals(actor.name?.toString(), "Alice");
|
|
96
|
+
actor.id.href = parseIri(`ap://${did}/actors/bob`).href;
|
|
97
|
+
assertEquals((await parseKeyOwnerEvidence(evidence))?.id?.href, actorId.href);
|
|
98
|
+
});
|
|
99
|
+
//#endregion
|
|
100
|
+
export {};
|
package/dist/sig/key.test.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
|
6
6
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
7
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
8
8
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
9
|
-
import { a as fetchKeyDetailed, c as validateCryptoKey, i as fetchKey, n as exportJwk, o as generateCryptoKeyPair, s as importJwk } from "../key-
|
|
9
|
+
import { a as fetchKeyDetailed, c as validateCryptoKey, i as fetchKey, n as exportJwk, o as generateCryptoKeyPair, s as importJwk } from "../key-D5awqp7u.mjs";
|
|
10
10
|
import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
11
11
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
12
12
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
package/dist/sig/ld.test.mjs
CHANGED
|
@@ -8,8 +8,8 @@ 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 { o as generateCryptoKeyPair } from "../key-
|
|
12
|
-
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-
|
|
11
|
+
import { o as generateCryptoKeyPair } from "../key-D5awqp7u.mjs";
|
|
12
|
+
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-CyliEU48.mjs";
|
|
13
13
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
14
14
|
import { CryptographicKey } from "@fedify/vocab";
|
|
15
15
|
import { createTestMeterProvider, 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-R4g1McwE.cjs");
|
|
4
|
+
const require_portable_collection = require("../portable-collection-UajqDrSL.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
|
-
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-DC1cqAQ2.cjs";
|
|
3
3
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BF0L9cMt.cjs";
|
|
4
|
-
import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "../mod-
|
|
4
|
+
import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "../mod-CPPqkyV_.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
|
-
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-Cok5-vIC.js";
|
|
3
3
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BSzr5-I8.js";
|
|
4
|
-
import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "../mod
|
|
4
|
+
import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "../mod--jv6vyrP.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 { A as hasSignatureLike, B as fetchKey, D as detachSignature, E as createSignature, F as verifyJsonLd, H as generateCryptoKeyPair, I as verifySignature, N as signJsonLd, R as exportJwk, U as importJwk, V as fetchKeyDetailed, _ as verifyPortableObjectProof, a as signRequest, b as verifyProof,
|
|
4
|
-
import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-
|
|
3
|
+
import { A as hasSignatureLike, B as fetchKey, D as detachSignature, E as createSignature, F as verifyJsonLd, H as generateCryptoKeyPair, I as verifySignature, N as signJsonLd, R as exportJwk, U as importJwk, V as fetchKeyDetailed, _ as verifyPortableObjectProof, a as signRequest, b as verifyProof, f as createProof, g as verifyObject, gt as validateAcceptSignature, ht as parseAcceptSignature, m as signObject, mt as fulfillAcceptSignature, o as verifyRequest, p as hasProofLike, pt as formatAcceptSignature, s as verifyRequestDetailed, w as attachSignature } from "../http-Baovr6xq.js";
|
|
4
|
+
import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-uv4CuQXm.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-DKdtsrEq.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-Cb5cdPIU.mjs";
|
|
6
6
|
import { Collection, CollectionPage, Note, OrderedCollection, Person, traverseCollection } from "@fedify/vocab";
|
|
7
7
|
import { test } from "@fedify/fixture";
|
|
8
8
|
import { FetchError, encodeMultibase, exportDidKey, preloadedContexts } from "@fedify/vocab-runtime";
|
|
@@ -2,13 +2,13 @@ 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 { i as fetchKey } from "../key-
|
|
6
|
-
import { h as verifyJsonLd, p as signJsonLd } from "../ld-
|
|
7
|
-
import { d as verifyProof, r as createProof } from "../proof-
|
|
8
|
-
import { d as verifyRequest, f as verifyRequestDetailed, l as signRequest } from "../http-
|
|
5
|
+
import { i as fetchKey } from "../key-D5awqp7u.mjs";
|
|
6
|
+
import { h as verifyJsonLd, p as signJsonLd } from "../ld-CyliEU48.mjs";
|
|
7
|
+
import { d as verifyProof, r as createProof } from "../proof-CRTPWbVh.mjs";
|
|
8
|
+
import { d as verifyRequest, f as verifyRequestDetailed, l as signRequest } from "../http-DRH0n8TD.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-
|
|
11
|
-
import { t as KvKeyCache } from "../keycache-
|
|
10
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DKdtsrEq.mjs";
|
|
11
|
+
import { t as KvKeyCache } from "../keycache-PiOM9pM0.mjs";
|
|
12
12
|
import { Create, CryptographicKey, Multikey, Note, Person } from "@fedify/vocab";
|
|
13
13
|
import { test } from "@fedify/fixture";
|
|
14
14
|
import { FetchError, encodeMultibase, exportDidKey, exportSpki, parseIri, preloadedContexts } from "@fedify/vocab-runtime";
|
package/dist/sig/proof.test.mjs
CHANGED
|
@@ -10,10 +10,10 @@ import "../std__assert-DvMDRPes.mjs";
|
|
|
10
10
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
11
11
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
12
12
|
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
|
|
13
|
-
import { a as signObject, c as verifyPortableObjectProof, d as verifyProof, i as hasProofLike, r as createProof, s as verifyObject } from "../proof-
|
|
14
|
-
import { d as verifyRequest } from "../http-
|
|
13
|
+
import { a as signObject, c as verifyPortableObjectProof, d as verifyProof, i as hasProofLike, r as createProof, s as verifyObject } from "../proof-CRTPWbVh.mjs";
|
|
14
|
+
import { d as verifyRequest } from "../http-DRH0n8TD.mjs";
|
|
15
15
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
16
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
16
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-BBFAItNB.mjs";
|
|
17
17
|
import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place, Translation } from "@fedify/vocab";
|
|
18
18
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
19
19
|
import { decodeMultibase, encodeMultibase, exportDidKey, exportMultibaseKey, formatIri, importMultibaseKey, parseIri } 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-CyliEU48.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-B99JjvFn.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();
|
package/dist/testing/mod.d.mts
CHANGED
|
@@ -3317,12 +3317,38 @@ interface Context<TContextData> {
|
|
|
3317
3317
|
getPortableFeaturedTagsUri(identifier: string, authority: string): URL;
|
|
3318
3318
|
/**
|
|
3319
3319
|
* Determines the type of the URI and extracts the associated data.
|
|
3320
|
+
*
|
|
3321
|
+
* By default, only URIs on this server's origin are recognized. With
|
|
3322
|
+
* the `portable` option, [FEP-ef61] portable IDs, e.g.,
|
|
3323
|
+
* `ap+ef61://did:key:z6Mk.../users/alice`, and their compatible
|
|
3324
|
+
* identifiers on any gateway, e.g.,
|
|
3325
|
+
* `https://example.com/.well-known/apgateway/did:key:z6Mk.../users/alice`,
|
|
3326
|
+
* are also recognized by the same paths that the gateway endpoint routes
|
|
3327
|
+
* to the dispatchers, and the result has the DID in its `authority`
|
|
3328
|
+
* property.
|
|
3329
|
+
*
|
|
3330
|
+
* The DID of a portable ID is anyone's to choose, so recognizing it does
|
|
3331
|
+
* not mean that this server hosts anything for the DID. Check that
|
|
3332
|
+
* `authority` is the DID that the application stores for the actor or
|
|
3333
|
+
* object before acting on it:
|
|
3334
|
+
*
|
|
3335
|
+
* ~~~~ typescript
|
|
3336
|
+
* const parsed = ctx.parseUri(follow.objectId, { portable: true });
|
|
3337
|
+
* if (parsed?.type !== "actor") return;
|
|
3338
|
+
* const user = await getUser(parsed.identifier);
|
|
3339
|
+
* if (user == null) return;
|
|
3340
|
+
* if (parsed.authority != null && parsed.authority !== user.did) return;
|
|
3341
|
+
* ~~~~
|
|
3342
|
+
*
|
|
3343
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
3344
|
+
*
|
|
3320
3345
|
* @param uri The URI to parse.
|
|
3346
|
+
* @param options Options for parsing the URI. Since 2.4.0.
|
|
3321
3347
|
* @returns The result of parsing the URI. If `null` is given or
|
|
3322
3348
|
* the URI is not recognized, `null` is returned.
|
|
3323
3349
|
* @since 0.9.0
|
|
3324
3350
|
*/
|
|
3325
|
-
parseUri(uri: URL | null): ParseUriResult | null;
|
|
3351
|
+
parseUri(uri: URL | null, options?: ParseUriOptions): ParseUriResult | null;
|
|
3326
3352
|
/**
|
|
3327
3353
|
* Gets the key pairs for an actor.
|
|
3328
3354
|
* @param identifier The actor's identifier.
|
|
@@ -4220,6 +4246,30 @@ interface OutboxContext<TContextData> extends Context<TContextData> {
|
|
|
4220
4246
|
*/
|
|
4221
4247
|
clone(data: TContextData): OutboxContext<TContextData>;
|
|
4222
4248
|
}
|
|
4249
|
+
/**
|
|
4250
|
+
* Options for {@link Context.parseUri}.
|
|
4251
|
+
* @since 2.4.0
|
|
4252
|
+
*/
|
|
4253
|
+
interface ParseUriOptions {
|
|
4254
|
+
/**
|
|
4255
|
+
* Whether to also recognize [FEP-ef61] portable IDs, i.e., `ap:` and
|
|
4256
|
+
* `ap+ef61:` URIs, and their compatible identifiers on any gateway.
|
|
4257
|
+
* The result of a portable ID has its DID, without percent-encoding, in
|
|
4258
|
+
* the `authority` property, which the caller has to compare with the DID
|
|
4259
|
+
* that it stores for the actor or object, since anyone can make a portable
|
|
4260
|
+
* ID with the same path under another DID.
|
|
4261
|
+
*
|
|
4262
|
+
* Like URIs on this server's origin, a portable ID is recognized by its
|
|
4263
|
+
* path, and its query, e.g., location hints, and fragment are ignored.
|
|
4264
|
+
* A shared inbox is never recognized in a portable ID, and a portable ID
|
|
4265
|
+
* with a malformed DID, or with a `did:key` DID that is not encoded in
|
|
4266
|
+
* base58-btc, is not recognized either.
|
|
4267
|
+
*
|
|
4268
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
4269
|
+
* @default `false`
|
|
4270
|
+
*/
|
|
4271
|
+
readonly portable?: boolean;
|
|
4272
|
+
}
|
|
4223
4273
|
/**
|
|
4224
4274
|
* A result of parsing an URI.
|
|
4225
4275
|
*/
|
|
@@ -4230,6 +4280,12 @@ type ParseUriResult =
|
|
|
4230
4280
|
{
|
|
4231
4281
|
readonly type: "actor";
|
|
4232
4282
|
readonly identifier: string;
|
|
4283
|
+
/**
|
|
4284
|
+
* The DID of the portable ID, e.g., `did:key:z6Mk...`, or `undefined`
|
|
4285
|
+
* for a URI on this server's origin. See {@link ParseUriOptions.portable}.
|
|
4286
|
+
* @since 2.4.0
|
|
4287
|
+
*/
|
|
4288
|
+
readonly authority?: string;
|
|
4233
4289
|
}
|
|
4234
4290
|
/**
|
|
4235
4291
|
* The case of an object URI.
|
|
@@ -4239,6 +4295,12 @@ type ParseUriResult =
|
|
|
4239
4295
|
readonly class: ConstructorWithTypeId<Object$1>;
|
|
4240
4296
|
readonly typeId: URL;
|
|
4241
4297
|
readonly values: Record<string, string>;
|
|
4298
|
+
/**
|
|
4299
|
+
* The DID of the portable ID, e.g., `did:key:z6Mk...`, or `undefined`
|
|
4300
|
+
* for a URI on this server's origin. See {@link ParseUriOptions.portable}.
|
|
4301
|
+
* @since 2.4.0
|
|
4302
|
+
*/
|
|
4303
|
+
readonly authority?: string;
|
|
4242
4304
|
}
|
|
4243
4305
|
/**
|
|
4244
4306
|
* The case of an shared inbox URI.
|
|
@@ -4246,6 +4308,7 @@ type ParseUriResult =
|
|
|
4246
4308
|
| {
|
|
4247
4309
|
readonly type: "inbox";
|
|
4248
4310
|
readonly identifier: undefined;
|
|
4311
|
+
readonly authority?: undefined;
|
|
4249
4312
|
}
|
|
4250
4313
|
/**
|
|
4251
4314
|
* The case of an personal inbox URI.
|
|
@@ -4253,6 +4316,12 @@ type ParseUriResult =
|
|
|
4253
4316
|
| {
|
|
4254
4317
|
readonly type: "inbox";
|
|
4255
4318
|
readonly identifier: string;
|
|
4319
|
+
/**
|
|
4320
|
+
* The DID of the portable ID, e.g., `did:key:z6Mk...`, or `undefined`
|
|
4321
|
+
* for a URI on this server's origin. See {@link ParseUriOptions.portable}.
|
|
4322
|
+
* @since 2.4.0
|
|
4323
|
+
*/
|
|
4324
|
+
readonly authority?: string;
|
|
4256
4325
|
}
|
|
4257
4326
|
/**
|
|
4258
4327
|
* The case of an outbox collection URI.
|
|
@@ -4260,6 +4329,12 @@ type ParseUriResult =
|
|
|
4260
4329
|
| {
|
|
4261
4330
|
readonly type: "outbox";
|
|
4262
4331
|
readonly identifier: string;
|
|
4332
|
+
/**
|
|
4333
|
+
* The DID of the portable ID, e.g., `did:key:z6Mk...`, or `undefined`
|
|
4334
|
+
* for a URI on this server's origin. See {@link ParseUriOptions.portable}.
|
|
4335
|
+
* @since 2.4.0
|
|
4336
|
+
*/
|
|
4337
|
+
readonly authority?: string;
|
|
4263
4338
|
}
|
|
4264
4339
|
/**
|
|
4265
4340
|
* The case of a following collection URI.
|
|
@@ -4267,6 +4342,12 @@ type ParseUriResult =
|
|
|
4267
4342
|
| {
|
|
4268
4343
|
readonly type: "following";
|
|
4269
4344
|
readonly identifier: string;
|
|
4345
|
+
/**
|
|
4346
|
+
* The DID of the portable ID, e.g., `did:key:z6Mk...`, or `undefined`
|
|
4347
|
+
* for a URI on this server's origin. See {@link ParseUriOptions.portable}.
|
|
4348
|
+
* @since 2.4.0
|
|
4349
|
+
*/
|
|
4350
|
+
readonly authority?: string;
|
|
4270
4351
|
}
|
|
4271
4352
|
/**
|
|
4272
4353
|
* The case of a followers collection URI.
|
|
@@ -4274,6 +4355,12 @@ type ParseUriResult =
|
|
|
4274
4355
|
| {
|
|
4275
4356
|
readonly type: "followers";
|
|
4276
4357
|
readonly identifier: string;
|
|
4358
|
+
/**
|
|
4359
|
+
* The DID of the portable ID, e.g., `did:key:z6Mk...`, or `undefined`
|
|
4360
|
+
* for a URI on this server's origin. See {@link ParseUriOptions.portable}.
|
|
4361
|
+
* @since 2.4.0
|
|
4362
|
+
*/
|
|
4363
|
+
readonly authority?: string;
|
|
4277
4364
|
}
|
|
4278
4365
|
/**
|
|
4279
4366
|
* The case of a liked collection URI.
|
|
@@ -4282,6 +4369,12 @@ type ParseUriResult =
|
|
|
4282
4369
|
| {
|
|
4283
4370
|
readonly type: "liked";
|
|
4284
4371
|
readonly identifier: string;
|
|
4372
|
+
/**
|
|
4373
|
+
* The DID of the portable ID, e.g., `did:key:z6Mk...`, or `undefined`
|
|
4374
|
+
* for a URI on this server's origin. See {@link ParseUriOptions.portable}.
|
|
4375
|
+
* @since 2.4.0
|
|
4376
|
+
*/
|
|
4377
|
+
readonly authority?: string;
|
|
4285
4378
|
}
|
|
4286
4379
|
/**
|
|
4287
4380
|
* The case of a featured collection URI.
|
|
@@ -4290,6 +4383,12 @@ type ParseUriResult =
|
|
|
4290
4383
|
| {
|
|
4291
4384
|
readonly type: "featured";
|
|
4292
4385
|
readonly identifier: string;
|
|
4386
|
+
/**
|
|
4387
|
+
* The DID of the portable ID, e.g., `did:key:z6Mk...`, or `undefined`
|
|
4388
|
+
* for a URI on this server's origin. See {@link ParseUriOptions.portable}.
|
|
4389
|
+
* @since 2.4.0
|
|
4390
|
+
*/
|
|
4391
|
+
readonly authority?: string;
|
|
4293
4392
|
}
|
|
4294
4393
|
/**
|
|
4295
4394
|
* The case of a featured tags collection URI.
|
|
@@ -4298,6 +4397,12 @@ type ParseUriResult =
|
|
|
4298
4397
|
| {
|
|
4299
4398
|
readonly type: "featuredTags";
|
|
4300
4399
|
readonly identifier: string;
|
|
4400
|
+
/**
|
|
4401
|
+
* The DID of the portable ID, e.g., `did:key:z6Mk...`, or `undefined`
|
|
4402
|
+
* for a URI on this server's origin. See {@link ParseUriOptions.portable}.
|
|
4403
|
+
* @since 2.4.0
|
|
4404
|
+
*/
|
|
4405
|
+
readonly authority?: string;
|
|
4301
4406
|
}
|
|
4302
4407
|
/**
|
|
4303
4408
|
* The case of a custom collection URI.
|
|
@@ -4309,6 +4414,12 @@ type ParseUriResult =
|
|
|
4309
4414
|
readonly class: ConstructorWithTypeId<Object$1>;
|
|
4310
4415
|
readonly typeId: URL;
|
|
4311
4416
|
readonly values: Record<string, string>;
|
|
4417
|
+
/**
|
|
4418
|
+
* The DID of the portable ID, e.g., `did:key:z6Mk...`, or `undefined`
|
|
4419
|
+
* for a URI on this server's origin. See {@link ParseUriOptions.portable}.
|
|
4420
|
+
* @since 2.4.0
|
|
4421
|
+
*/
|
|
4422
|
+
readonly authority?: string;
|
|
4312
4423
|
}
|
|
4313
4424
|
/**
|
|
4314
4425
|
* The case of a custom ordered collection URI.
|
|
@@ -4320,6 +4431,12 @@ type ParseUriResult =
|
|
|
4320
4431
|
readonly class: ConstructorWithTypeId<Object$1>;
|
|
4321
4432
|
readonly typeId: URL;
|
|
4322
4433
|
readonly values: Record<string, string>;
|
|
4434
|
+
/**
|
|
4435
|
+
* The DID of the portable ID, e.g., `did:key:z6Mk...`, or `undefined`
|
|
4436
|
+
* for a URI on this server's origin. See {@link ParseUriOptions.portable}.
|
|
4437
|
+
* @since 2.4.0
|
|
4438
|
+
*/
|
|
4439
|
+
readonly authority?: string;
|
|
4323
4440
|
};
|
|
4324
4441
|
/**
|
|
4325
4442
|
* Options for {@link Context.sendActivity} method.
|
|
@@ -5,9 +5,9 @@ import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
6
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
7
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
8
|
-
import { d as verifyRequest } from "../http-
|
|
8
|
+
import { d as verifyRequest } from "../http-DRH0n8TD.mjs";
|
|
9
9
|
import { i as rsaPrivateKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
10
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
10
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-BBFAItNB.mjs";
|
|
11
11
|
import { configure, reset } from "@logtape/logtape";
|
|
12
12
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
13
13
|
import { FetchError, UrlError } from "@fedify/vocab-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "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-C7RWL7hz.mjs";
|
|
5
5
|
import { deepStrictEqual, throws } from "node:assert";
|
|
6
6
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
7
7
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
package/dist/utils/mod.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_kv_cache = require("../kv-cache-
|
|
3
|
+
const require_kv_cache = require("../kv-cache-Ct-KWRta.cjs");
|
|
4
4
|
exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
|
|
5
5
|
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-BA_F2x53.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 "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-CZiBDLPi.js";
|
|
4
4
|
export { getAuthenticatedDocumentLoader, kvCache };
|