@fedify/fedify 1.11.0-dev.92 → 2.0.0-dev.109
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/README.md +34 -20
- package/dist/{actor-BSf1RMUB.js → actor-BZTYJWzP.js} +1 -1
- package/dist/{actor-B6ovE-4c.js → actor-Cm25mX8I.js} +220 -705
- package/dist/{actor-eeONG_sv.d.ts → actor-DqFajh9s.d.ts} +2 -2
- package/dist/{actor-DMxe8a2S.cjs → actor-ZEAP42Ry.cjs} +952 -1479
- package/dist/{actor-D190nbTD.d.cts → actor-f2NtjyCg.d.cts} +2 -2
- package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-Ce45JcFg.js} +1 -1
- package/dist/{assert_is_error-BPGph1Jx.js → assert_throws-BNXdRGWP.js} +31 -1
- package/dist/{builder-CvMAl7DC.js → builder-CWMz7B2F.js} +3 -4
- package/dist/{client-n6L4GtQL.d.cts → client-94iWEfQa.d.cts} +3 -75
- package/dist/{client-B3mQJNO7.d.ts → client-BsGzbnV-.d.ts} +3 -75
- package/dist/{client-gwmljOpB.js → client-pY7-3icS.js} +3 -22
- package/dist/compat/mod.d.cts +10 -12
- package/dist/compat/mod.d.ts +10 -12
- package/dist/compat/transformers.test.js +20 -20
- package/dist/{context-WJoO0SQs.d.cts → context-DBQ7nMCw.d.cts} +152 -27
- package/dist/{context-Cr5DIxq_.d.ts → context-mM0Nu5yo.d.ts} +152 -27
- package/dist/{authdocloader-D-v1l7De.js → docloader-BeSgUTFj.js} +17 -8
- package/dist/{esm-D55VN1Km.js → esm-bEFTDE2Q.js} +32 -17
- package/dist/federation/builder.test.js +9 -12
- package/dist/federation/collection.test.js +7 -9
- package/dist/federation/handler.test.js +28 -149
- package/dist/federation/idempotency.test.js +26 -27
- package/dist/federation/inbox.test.js +4 -6
- package/dist/federation/keycache.test.js +3 -4
- package/dist/federation/kv.test.js +6 -8
- package/dist/federation/middleware.test.js +270 -93
- package/dist/federation/mod.cjs +9 -11
- package/dist/federation/mod.d.cts +10 -12
- package/dist/federation/mod.d.ts +10 -12
- package/dist/federation/mod.js +9 -11
- package/dist/federation/mq.test.js +10 -10
- package/dist/federation/negotiation.test.js +26 -0
- package/dist/federation/retry.test.js +4 -5
- package/dist/federation/router.test.js +6 -8
- package/dist/federation/send.test.js +14 -16
- package/dist/{http-C9J5l76C.js → http-B8aQ8cUK.js} +256 -6
- package/dist/{http-C2x6TpEb.js → http-BF8Z1B-J.js} +2 -2
- package/dist/{http-DS9z_HzB.d.ts → http-BbO0ejuk.d.ts} +2 -2
- package/dist/{http-DOST1wn2.cjs → http-Dy7ENa6t.cjs} +289 -9
- package/dist/{http-C_1RU1U_.d.cts → http-M8k5mKc0.d.cts} +2 -2
- package/dist/{inbox-CeWZnS6I.js → inbox-CReikedp.js} +2 -7
- package/dist/{key-w6smvEIf.js → key-C85if3Ia.js} +3 -2
- package/dist/{keycache-DIPsFeDQ.js → keycache-BjRr5pe2.js} +1 -1
- package/dist/{keys-Bkp2oOoh.js → keys-do4GUlRT.js} +2 -1
- package/dist/{kv-DipCBaw2.d.ts → kv-BpJND1Hr.d.ts} +2 -1
- package/dist/{kv-BqEOXcZv.d.cts → kv-cD_d4hg-.d.cts} +2 -1
- package/dist/kv-cache-B4Y86MKl.js +122 -0
- package/dist/kv-cache-D7LFlByV.js +107 -0
- package/dist/kv-cache-qW5Mv9rV.cjs +134 -0
- package/dist/{ld-Dk2eojF9.js → ld-0Wpf83DM.js} +3 -2
- package/dist/{lookup-BI5Omd9s.cjs → lookup-Br9_ufLS.cjs} +134 -5
- package/dist/{lookup-Fk5eyxDk.js → lookup-Cj543vD4.js} +125 -2
- package/dist/{type-DMwrwZj3.js → lookup-D6_9czrD.js} +547 -5409
- package/dist/middleware-BPmn8w0u.cjs +15 -0
- package/dist/middleware-BXodt-Uj.js +26 -0
- package/dist/{middleware-BgI9lQ4P.js → middleware-Bq8dxPN6.js} +43 -146
- package/dist/{middleware-YNYjpKML.cjs → middleware-CDzg72dQ.cjs} +58 -104
- package/dist/middleware-DvA6x8_h.js +15 -0
- package/dist/{middleware-CNMzY5iD.js → middleware-hM1Z5nWM.js} +38 -84
- package/dist/{mod-DS4kJskR.d.ts → mod-BlVovdcy.d.ts} +2 -2
- package/dist/{mod-D5rfgGFE.d.cts → mod-BxRCHTz-.d.cts} +2 -2
- package/dist/{mod-CxMBb_dd.d.cts → mod-C58MZ7Wx.d.cts} +1 -1
- package/dist/mod-CAdoBu0x.d.ts +109 -0
- package/dist/{mod-BZfdiPBo.d.ts → mod-D5Z2tISD.d.ts} +3 -3
- package/dist/{mod-Dz5Y15Uy.d.cts → mod-DgxG-byT.d.cts} +3 -3
- package/dist/{mod-ChbckRnC.d.ts → mod-Ds0mpFZU.d.ts} +1 -1
- package/dist/{mod-OQfb33eH.d.cts → mod-Dy2fJtmN.d.cts} +2 -2
- package/dist/{mod-CnULG6Aa.d.ts → mod-GetHzY6F.d.ts} +2 -2
- package/dist/mod-fxr25Gv7.d.cts +107 -0
- package/dist/mod.cjs +19 -34
- package/dist/mod.d.cts +15 -17
- package/dist/mod.d.ts +15 -17
- package/dist/mod.js +14 -16
- package/dist/negotiation-C4nFufNk.js +71 -0
- package/dist/nodeinfo/client.test.js +30 -111
- package/dist/nodeinfo/handler.test.js +25 -26
- package/dist/nodeinfo/mod.cjs +3 -6
- package/dist/nodeinfo/mod.d.cts +3 -5
- package/dist/nodeinfo/mod.d.ts +3 -5
- package/dist/nodeinfo/mod.js +3 -4
- package/dist/nodeinfo/types.test.js +8 -15
- package/dist/otel/exporter.test.js +44 -70
- package/dist/otel/mod.cjs +17 -34
- package/dist/otel/mod.d.cts +5 -6
- package/dist/otel/mod.d.ts +5 -6
- package/dist/otel/mod.js +17 -34
- package/dist/{otel-Chy5T2Xh.js → otel-Bfe_BgOV.js} +1 -2
- package/dist/{owner-C_e5oYyI.js → owner-B2ziOXAb.js} +3 -2
- package/dist/{owner-AcrG3Xz1.d.cts → owner-B4HbyP8s.d.cts} +3 -3
- package/dist/{owner-8NMhXwJd.d.ts → owner-kQRGVXG1.d.ts} +3 -3
- package/dist/{proof-GRfyDBRU.js → proof-CN_ohUto.js} +2 -2
- package/dist/{proof-C5COc2tW.cjs → proof-CWQ0o-yI.cjs} +18 -17
- package/dist/{proof-BWebFnAY.js → proof-CXrz_moF.js} +5 -4
- package/dist/{send-Dd4ncQqL.js → send-Bt_ukOqY.js} +2 -2
- package/dist/sig/http.test.js +12 -13
- package/dist/sig/key.test.js +9 -11
- package/dist/sig/ld.test.js +8 -10
- package/dist/sig/mod.cjs +9 -11
- package/dist/sig/mod.d.cts +5 -7
- package/dist/sig/mod.d.ts +5 -7
- package/dist/sig/mod.js +5 -7
- package/dist/sig/owner.test.js +11 -13
- package/dist/sig/proof.test.js +13 -14
- package/dist/src/vocab/accept.yaml +1 -1
- package/dist/src/vocab/activity.yaml +1 -1
- package/dist/src/vocab/add.yaml +1 -1
- package/dist/src/vocab/announce.yaml +1 -1
- package/dist/src/vocab/application.yaml +1 -1
- package/dist/src/vocab/arrive.yaml +1 -1
- package/dist/src/vocab/article.yaml +1 -1
- package/dist/src/vocab/audio.yaml +1 -1
- package/dist/src/vocab/block.yaml +1 -1
- package/dist/src/vocab/chatmessage.yaml +1 -1
- package/dist/src/vocab/collection.yaml +1 -1
- package/dist/src/vocab/collectionpage.yaml +1 -1
- package/dist/src/vocab/create.yaml +1 -1
- package/dist/src/vocab/dataintegrityproof.yaml +1 -1
- package/dist/src/vocab/delete.yaml +1 -1
- package/dist/src/vocab/didservice.yaml +1 -1
- package/dist/src/vocab/dislike.yaml +1 -1
- package/dist/src/vocab/document.yaml +1 -1
- package/dist/src/vocab/emoji.yaml +1 -1
- package/dist/src/vocab/emojireact.yaml +1 -1
- package/dist/src/vocab/endpoints.yaml +1 -1
- package/dist/src/vocab/event.yaml +1 -1
- package/dist/src/vocab/export.yaml +1 -1
- package/dist/src/vocab/flag.yaml +1 -1
- package/dist/src/vocab/follow.yaml +1 -1
- package/dist/src/vocab/group.yaml +1 -1
- package/dist/src/vocab/hashtag.yaml +1 -1
- package/dist/src/vocab/ignore.yaml +1 -1
- package/dist/src/vocab/image.yaml +1 -1
- package/dist/src/vocab/intransitiveactivity.yaml +1 -1
- package/dist/src/vocab/invite.yaml +1 -1
- package/dist/src/vocab/join.yaml +1 -1
- package/dist/src/vocab/key.yaml +1 -1
- package/dist/src/vocab/leave.yaml +1 -1
- package/dist/src/vocab/like.yaml +1 -1
- package/dist/src/vocab/link.yaml +1 -1
- package/dist/src/vocab/listen.yaml +1 -1
- package/dist/src/vocab/mention.yaml +1 -1
- package/dist/src/vocab/move.yaml +1 -1
- package/dist/src/vocab/multikey.yaml +1 -1
- package/dist/src/vocab/note.yaml +1 -1
- package/dist/src/vocab/object.yaml +1 -1
- package/dist/src/vocab/offer.yaml +1 -1
- package/dist/src/vocab/orderedcollection.yaml +1 -1
- package/dist/src/vocab/orderedcollectionpage.yaml +1 -1
- package/dist/src/vocab/organization.yaml +1 -1
- package/dist/src/vocab/page.yaml +1 -1
- package/dist/src/vocab/person.yaml +1 -1
- package/dist/src/vocab/place.yaml +1 -1
- package/dist/src/vocab/profile.yaml +1 -1
- package/dist/src/vocab/propertyvalue.yaml +1 -1
- package/dist/src/vocab/question.yaml +1 -1
- package/dist/src/vocab/read.yaml +1 -1
- package/dist/src/vocab/reject.yaml +1 -1
- package/dist/src/vocab/relationship.yaml +1 -1
- package/dist/src/vocab/remove.yaml +1 -1
- package/dist/src/vocab/service.yaml +1 -1
- package/dist/src/vocab/source.yaml +1 -1
- package/dist/src/vocab/tentativeaccept.yaml +1 -1
- package/dist/src/vocab/tentativereject.yaml +1 -1
- package/dist/src/vocab/tombstone.yaml +1 -1
- package/dist/src/vocab/travel.yaml +1 -1
- package/dist/src/vocab/undo.yaml +1 -1
- package/dist/src/vocab/update.yaml +1 -1
- package/dist/src/vocab/video.yaml +1 -1
- package/dist/src/vocab/view.yaml +1 -1
- package/dist/testing/docloader.test.js +6 -8
- package/dist/testing/mod.d.ts +10 -119
- package/dist/testing/mod.js +2 -3
- package/dist/{testing-Dl_uo19c.js → testing-DcJ3qTSi.js} +1 -2
- package/dist/{types-CPPQlW2w.js → types-BtUjyi5y.js} +5 -166
- package/dist/{types-BIgY6c-l.js → types-C2XVl6gj.js} +1 -3
- package/dist/{types-tmeoSVgM.cjs → types-CWgzGaqk.cjs} +6 -179
- package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +14 -15
- package/dist/utils/kv-cache.test.js +212 -0
- package/dist/utils/mod.cjs +12 -0
- package/dist/utils/mod.d.cts +5 -0
- package/dist/utils/mod.d.ts +7 -0
- package/dist/utils/mod.js +11 -0
- package/dist/vocab/actor.test.js +8 -10
- package/dist/vocab/lookup.test.js +8 -10
- package/dist/vocab/mod.cjs +3 -4
- package/dist/vocab/mod.d.cts +3 -5
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +3 -4
- package/dist/vocab/type.test.js +2 -3
- package/dist/vocab/vocab.test.js +7618 -1973
- package/dist/{vocab-BASuuzcJ.d.ts → vocab-BCWe1Ih5.d.ts} +9 -25
- package/dist/{vocab-DPMmFPJ1.d.cts → vocab-CeDBzu-f.d.cts} +9 -25
- package/dist/{vocab-kxSYUP1j.js → vocab-DZvBYZFH.js} +3 -3
- package/dist/{vocab-BnNSNBil.cjs → vocab-aeFsUPtk.cjs} +5 -5
- package/dist/webfinger/handler.test.js +24 -25
- package/dist/webfinger/lookup.test.js +7 -9
- package/dist/webfinger/mod.cjs +2 -3
- package/dist/webfinger/mod.d.cts +1 -3
- package/dist/webfinger/mod.d.ts +1 -3
- package/dist/webfinger/mod.js +2 -3
- package/package.json +33 -66
- package/dist/assert_throws-BOO88avQ.js +0 -39
- package/dist/authdocloader-Bn3Jg414.js +0 -52
- package/dist/authdocloader-DmTWTYA4.cjs +0 -58
- package/dist/denokv-D0nfNQ1x.js +0 -57
- package/dist/docloader-BucCRHZI.d.ts +0 -221
- package/dist/docloader-CgESja7v.js +0 -4835
- package/dist/docloader-ChxNLZAA.d.cts +0 -219
- package/dist/docloader-DJCmWQFv.cjs +0 -4901
- package/dist/key-BUDjxXee.js +0 -10
- package/dist/key-Bl-6W_Cx.cjs +0 -290
- package/dist/key-BluX4ryA.js +0 -260
- package/dist/key-DWZlSSOl.cjs +0 -10
- package/dist/key-zkx54yxw.js +0 -10
- package/dist/lookup-DFrFssJ8.js +0 -336
- package/dist/middleware-BmGndt7n.cjs +0 -17
- package/dist/middleware-CxG8rL1c.js +0 -26
- package/dist/middleware-etnOMaDs.js +0 -17
- package/dist/mod-CD7gfdq3.d.ts +0 -104
- package/dist/mod-JUhOKMHj.d.cts +0 -102
- package/dist/mq-B7R1Q-M5.d.cts +0 -140
- package/dist/mq-CRGm1e_F.d.ts +0 -143
- package/dist/nodeinfo/semver.test.js +0 -143
- package/dist/runtime/docloader.test.js +0 -599
- package/dist/runtime/key.test.d.ts +0 -3
- package/dist/runtime/key.test.js +0 -103
- package/dist/runtime/langstr.test.d.ts +0 -3
- package/dist/runtime/langstr.test.js +0 -40
- package/dist/runtime/link.test.d.ts +0 -3
- package/dist/runtime/link.test.js +0 -61
- package/dist/runtime/mod.cjs +0 -25
- package/dist/runtime/mod.d.cts +0 -6
- package/dist/runtime/mod.d.ts +0 -8
- package/dist/runtime/mod.js +0 -13
- package/dist/runtime/multibase/multibase.test.d.ts +0 -3
- package/dist/runtime/multibase/multibase.test.js +0 -358
- package/dist/runtime/url.test.d.ts +0 -3
- package/dist/runtime/url.test.js +0 -45
- package/dist/semver-dArNLkR9.js +0 -149
- package/dist/vocab/schema.yaml +0 -247
- package/dist/x/cfworkers.cjs +0 -100
- package/dist/x/cfworkers.d.cts +0 -59
- package/dist/x/cfworkers.d.ts +0 -61
- package/dist/x/cfworkers.js +0 -98
- package/dist/x/cfworkers.test.d.ts +0 -3
- package/dist/x/cfworkers.test.js +0 -179
- package/dist/x/hono.cjs +0 -61
- package/dist/x/hono.d.cts +0 -54
- package/dist/x/hono.d.ts +0 -56
- package/dist/x/hono.js +0 -60
- package/dist/x/sveltekit.cjs +0 -69
- package/dist/x/sveltekit.d.cts +0 -46
- package/dist/x/sveltekit.d.ts +0 -48
- package/dist/x/sveltekit.js +0 -68
- /package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals-C80BG-_5.js} +0 -0
- /package/dist/{collection-CSzG2j1P.js → collection-BzWsN9pB.js} +0 -0
- /package/dist/{nodeinfo/semver.test.d.ts → federation/negotiation.test.d.ts} +0 -0
- /package/dist/{federation-C15gGOh1.cjs → federation-CoW-KDKv.cjs} +0 -0
- /package/dist/{federation-K-xsO03l.js → federation-D0hkM4T7.js} +0 -0
- /package/dist/{mod-C2tOeRkN.d.cts → mod-B-hUPT2N.d.cts} +0 -0
- /package/dist/{mod-1pDWKvUL.d.ts → mod-CVgZgliM.d.ts} +0 -0
- /package/dist/{mod-FZd39qVq.d.cts → mod-CcDPcLJW.d.cts} +0 -0
- /package/dist/{mod-g0xFzAP9.d.ts → mod-bjzj5QIb.d.ts} +0 -0
- /package/dist/{nodeinfo-DfycQ8Wf.js → nodeinfo-BnthBobC.js} +0 -0
- /package/dist/{nodeinfo-Co9lJrWl.cjs → nodeinfo-CdN0rEnZ.cjs} +0 -0
- /package/dist/{retry-D4GJ670a.js → retry-CfF8Gn4d.js} +0 -0
- /package/dist/{runtime-DPYEDf-o.js → sig-C34-oHBl.js} +0 -0
- /package/dist/{runtime-C58AJWSv.cjs → sig-YYj5tCnr.cjs} +0 -0
- /package/dist/{std__assert-X-_kMxKM.js → std__assert-DWivtrGR.js} +0 -0
- /package/dist/{runtime → utils}/docloader.test.d.ts +0 -0
- /package/dist/{runtime/authdocloader.test.d.ts → utils/kv-cache.test.d.ts} +0 -0
- /package/dist/{sig-Cj3tk-ig.js → utils-D-Va7aXC.js} +0 -0
- /package/dist/{sig-ByHXzqUi.cjs → utils-DyRU1gdZ.cjs} +0 -0
- /package/dist/{webfinger-De_bU0iE.js → webfinger-C72Y8lrh.js} +0 -0
- /package/dist/{webfinger-BjOEdFPs.cjs → webfinger-vAtLmxOF.cjs} +0 -0
package/dist/otel/mod.js
CHANGED
|
@@ -29,8 +29,9 @@ import { ExportResultCode } from "@opentelemetry/core";
|
|
|
29
29
|
* ttl: Temporal.Duration.from({ hours: 1 }),
|
|
30
30
|
* });
|
|
31
31
|
*
|
|
32
|
-
* const provider = new BasicTracerProvider(
|
|
33
|
-
*
|
|
32
|
+
* const provider = new BasicTracerProvider({
|
|
33
|
+
* spanProcessors: [new SimpleSpanProcessor(exporter)],
|
|
34
|
+
* });
|
|
34
35
|
* ```
|
|
35
36
|
*
|
|
36
37
|
* @example Querying stored traces
|
|
@@ -55,21 +56,16 @@ var FedifySpanExporter = class {
|
|
|
55
56
|
#kv;
|
|
56
57
|
#ttl;
|
|
57
58
|
#keyPrefix;
|
|
58
|
-
#useList;
|
|
59
59
|
/**
|
|
60
60
|
* Creates a new FedifySpanExporter.
|
|
61
61
|
*
|
|
62
|
-
* @param kv The KvStore to persist trace data to.
|
|
63
|
-
* `list()` or `cas()` method.
|
|
62
|
+
* @param kv The KvStore to persist trace data to.
|
|
64
63
|
* @param options Configuration options.
|
|
65
|
-
* @throws {Error} If the KvStore supports neither `list()` nor `cas()`.
|
|
66
64
|
*/
|
|
67
65
|
constructor(kv, options) {
|
|
68
|
-
if (kv.list == null && kv.cas == null) throw new Error("KvStore must support either list() or cas() method to use FedifySpanExporter. Consider using a KvStore implementation that supports these operations, such as MemoryKvStore, RedisKvStore, PostgresKvStore, or SqliteKvStore.");
|
|
69
66
|
this.#kv = kv;
|
|
70
67
|
this.#ttl = options?.ttl;
|
|
71
68
|
this.#keyPrefix = options?.keyPrefix ?? ["fedify", "traces"];
|
|
72
|
-
this.#useList = kv.list != null;
|
|
73
69
|
}
|
|
74
70
|
/**
|
|
75
71
|
* Exports spans to the KvStore.
|
|
@@ -102,7 +98,7 @@ var FedifySpanExporter = class {
|
|
|
102
98
|
const spanContext = span.spanContext();
|
|
103
99
|
const traceId = spanContext.traceId;
|
|
104
100
|
const spanId = spanContext.spanId;
|
|
105
|
-
const parentSpanId = span.
|
|
101
|
+
const parentSpanId = span.parentSpanContext?.spanId;
|
|
106
102
|
for (const event of span.events) if (event.name === "activitypub.activity.received") {
|
|
107
103
|
const record = this.#extractInboundRecord(event, traceId, spanId, parentSpanId);
|
|
108
104
|
if (record != null) records.push(record);
|
|
@@ -183,15 +179,13 @@ var FedifySpanExporter = class {
|
|
|
183
179
|
}
|
|
184
180
|
async #storeRecord(record) {
|
|
185
181
|
const options = this.#ttl != null ? { ttl: this.#ttl } : void 0;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
await this.#updateTraceSummary(record, options);
|
|
194
|
-
} else await this.#storeWithCas(record, options);
|
|
182
|
+
const key = [
|
|
183
|
+
...this.#keyPrefix,
|
|
184
|
+
record.traceId,
|
|
185
|
+
record.spanId
|
|
186
|
+
];
|
|
187
|
+
await this.#kv.set(key, record, options);
|
|
188
|
+
await this.#updateTraceSummary(record, options);
|
|
195
189
|
}
|
|
196
190
|
async #setWithCasRetry(key, transform, options) {
|
|
197
191
|
if (this.#kv.cas != null) for (let attempt = 0; attempt < 3; attempt++) {
|
|
@@ -226,11 +220,6 @@ var FedifySpanExporter = class {
|
|
|
226
220
|
return summary;
|
|
227
221
|
}, options);
|
|
228
222
|
}
|
|
229
|
-
async #storeWithCas(record, options) {
|
|
230
|
-
const key = [...this.#keyPrefix, record.traceId];
|
|
231
|
-
await this.#setWithCasRetry(key, (existing) => existing ? [...existing, record] : [record], options);
|
|
232
|
-
await this.#updateTraceSummary(record, options);
|
|
233
|
-
}
|
|
234
223
|
/**
|
|
235
224
|
* Gets all activity records for a specific trace ID.
|
|
236
225
|
*
|
|
@@ -238,16 +227,10 @@ var FedifySpanExporter = class {
|
|
|
238
227
|
* @returns An array of activity records belonging to the trace.
|
|
239
228
|
*/
|
|
240
229
|
async getActivitiesByTraceId(traceId) {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
return records;
|
|
246
|
-
} else {
|
|
247
|
-
const key = [...this.#keyPrefix, traceId];
|
|
248
|
-
const records = await this.#kv.get(key);
|
|
249
|
-
return records ?? [];
|
|
250
|
-
}
|
|
230
|
+
const prefix = [...this.#keyPrefix, traceId];
|
|
231
|
+
const records = [];
|
|
232
|
+
for await (const entry of this.#kv.list(prefix)) records.push(entry.value);
|
|
233
|
+
return records;
|
|
251
234
|
}
|
|
252
235
|
/**
|
|
253
236
|
* Gets recent traces with summary information.
|
|
@@ -258,7 +241,7 @@ var FedifySpanExporter = class {
|
|
|
258
241
|
async getRecentTraces(options) {
|
|
259
242
|
const summaryPrefix = [...this.#keyPrefix, "_summaries"];
|
|
260
243
|
const summaries = [];
|
|
261
|
-
|
|
244
|
+
for await (const entry of this.#kv.list(summaryPrefix)) summaries.push(entry.value);
|
|
262
245
|
summaries.sort((a, b) => b.timestamp.localeCompare(a.timestamp));
|
|
263
246
|
if (options?.limit != null) return summaries.slice(0, options.limit);
|
|
264
247
|
return summaries;
|
|
@@ -55,8 +55,7 @@ var TestSpanExporter = class {
|
|
|
55
55
|
*/
|
|
56
56
|
function createTestTracerProvider() {
|
|
57
57
|
const exporter = new TestSpanExporter();
|
|
58
|
-
const provider = new BasicTracerProvider();
|
|
59
|
-
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
|
|
58
|
+
const provider = new BasicTracerProvider({ spanProcessors: [new SimpleSpanProcessor(exporter)] });
|
|
60
59
|
return [provider, exporter];
|
|
61
60
|
}
|
|
62
61
|
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { CryptographicKey, Object as Object$1, deno_default
|
|
7
|
-
import { isActor } from "./actor-
|
|
6
|
+
import { CryptographicKey, Object as Object$1, deno_default } from "./lookup-D6_9czrD.js";
|
|
7
|
+
import { isActor } from "./actor-BZTYJWzP.js";
|
|
8
|
+
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
8
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
9
10
|
|
|
10
11
|
//#region src/sig/owner.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Activity, CryptographicKey } from "./vocab-CeDBzu-f.cjs";
|
|
2
|
+
import { Actor } from "./actor-f2NtjyCg.cjs";
|
|
3
|
+
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
4
4
|
import { TracerProvider } from "@opentelemetry/api";
|
|
5
5
|
|
|
6
6
|
//#region src/sig/owner.d.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Actor } from "./actor-eeONG_sv.js";
|
|
3
|
+
import { Activity, CryptographicKey } from "./vocab-BCWe1Ih5.js";
|
|
4
|
+
import { Actor } from "./actor-DqFajh9s.js";
|
|
6
5
|
import { TracerProvider } from "@opentelemetry/api";
|
|
6
|
+
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
7
7
|
|
|
8
8
|
//#region src/sig/owner.d.ts
|
|
9
9
|
/**
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Activity, DataIntegrityProof, Multikey, deno_default, getTypeId } from "./
|
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
|
6
|
+
import { Activity, DataIntegrityProof, Multikey, deno_default, getTypeId } from "./lookup-D6_9czrD.js";
|
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-C85if3Ia.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import { encodeHex } from "byte-encodings/hex";
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
|
6
|
-
const
|
|
7
|
-
const require_actor = require('./actor-
|
|
8
|
-
const
|
|
6
|
+
const require_lookup = require('./lookup-Br9_ufLS.cjs');
|
|
7
|
+
const require_actor = require('./actor-ZEAP42Ry.cjs');
|
|
8
|
+
const require_http = require('./http-Dy7ENa6t.cjs');
|
|
9
9
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
10
10
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
|
11
11
|
const jsonld = require_chunk.__toESM(require("jsonld"));
|
|
12
|
-
const
|
|
12
|
+
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
|
13
13
|
const byte_encodings_hex = require_chunk.__toESM(require("byte-encodings/hex"));
|
|
14
|
+
const byte_encodings_base64 = require_chunk.__toESM(require("byte-encodings/base64"));
|
|
14
15
|
const json_canon = require_chunk.__toESM(require("json-canon"));
|
|
15
16
|
|
|
16
17
|
//#region src/sig/ld.ts
|
|
@@ -47,7 +48,7 @@ function attachSignature(jsonLd, signature) {
|
|
|
47
48
|
* @since 1.0.0
|
|
48
49
|
*/
|
|
49
50
|
async function createSignature(jsonLd, privateKey, keyId, { contextLoader, created } = {}) {
|
|
50
|
-
|
|
51
|
+
require_http.validateCryptoKey(privateKey, "private");
|
|
51
52
|
if (privateKey.algorithm.name !== "RSASSA-PKCS1-v1_5") throw new TypeError("Unsupported algorithm: " + privateKey.algorithm.name);
|
|
52
53
|
const options = {
|
|
53
54
|
"@context": "https://w3id.org/identity/v1",
|
|
@@ -81,7 +82,7 @@ async function createSignature(jsonLd, privateKey, keyId, { contextLoader, creat
|
|
|
81
82
|
*/
|
|
82
83
|
async function signJsonLd(jsonLd, privateKey, keyId, options) {
|
|
83
84
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
|
84
|
-
const tracer = tracerProvider.getTracer(
|
|
85
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
|
85
86
|
return await tracer.startActiveSpan("ld_signatures.sign", { attributes: { "ld_signatures.key_id": keyId.href } }, async (span) => {
|
|
86
87
|
try {
|
|
87
88
|
const signature = await createSignature(jsonLd, privateKey, keyId, options);
|
|
@@ -150,7 +151,7 @@ async function verifySignature(jsonLd, options = {}) {
|
|
|
150
151
|
});
|
|
151
152
|
return null;
|
|
152
153
|
}
|
|
153
|
-
const { key, cached } = await
|
|
154
|
+
const { key, cached } = await require_http.fetchKey(new URL(sig.creator), require_actor.CryptographicKey, options);
|
|
154
155
|
if (key == null) return null;
|
|
155
156
|
const sigOpts = {
|
|
156
157
|
...sig,
|
|
@@ -191,7 +192,7 @@ async function verifySignature(jsonLd, options = {}) {
|
|
|
191
192
|
keyId: sig.creator,
|
|
192
193
|
...sig
|
|
193
194
|
});
|
|
194
|
-
const { key: key$1 } = await
|
|
195
|
+
const { key: key$1 } = await require_http.fetchKey(new URL(sig.creator), require_actor.CryptographicKey, {
|
|
195
196
|
...options,
|
|
196
197
|
keyCache: {
|
|
197
198
|
get: () => Promise.resolve(void 0),
|
|
@@ -220,7 +221,7 @@ async function verifySignature(jsonLd, options = {}) {
|
|
|
220
221
|
*/
|
|
221
222
|
async function verifyJsonLd(jsonLd, options = {}) {
|
|
222
223
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
|
223
|
-
const tracer = tracerProvider.getTracer(
|
|
224
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
|
224
225
|
return await tracer.startActiveSpan("ld_signatures.verify", async (span) => {
|
|
225
226
|
try {
|
|
226
227
|
const object = await require_actor.Object.fromJsonLd(jsonLd, options);
|
|
@@ -259,7 +260,7 @@ async function verifyJsonLd(jsonLd, options = {}) {
|
|
|
259
260
|
async function hashJsonLd(jsonLd, contextLoader) {
|
|
260
261
|
const canon = await jsonld.default.canonize(jsonLd, {
|
|
261
262
|
format: "application/n-quads",
|
|
262
|
-
documentLoader: contextLoader ??
|
|
263
|
+
documentLoader: contextLoader ?? (0, __fedify_vocab_runtime.getDocumentLoader)()
|
|
263
264
|
});
|
|
264
265
|
const encoder = new TextEncoder();
|
|
265
266
|
const hash = await crypto.subtle.digest("SHA-256", encoder.encode(canon));
|
|
@@ -277,7 +278,7 @@ async function hashJsonLd(jsonLd, contextLoader) {
|
|
|
277
278
|
*/
|
|
278
279
|
async function doesActorOwnKey(activity, key, options) {
|
|
279
280
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
|
280
|
-
const tracer = tracerProvider.getTracer(
|
|
281
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
|
281
282
|
return await tracer.startActiveSpan("activitypub.verify_key_ownership", {
|
|
282
283
|
kind: __opentelemetry_api.SpanKind.INTERNAL,
|
|
283
284
|
attributes: {
|
|
@@ -330,8 +331,8 @@ async function doesActorOwnKey(activity, key, options) {
|
|
|
330
331
|
*/
|
|
331
332
|
async function getKeyOwner(keyId, options) {
|
|
332
333
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
|
333
|
-
const documentLoader = options.documentLoader ??
|
|
334
|
-
const contextLoader = options.contextLoader ??
|
|
334
|
+
const documentLoader = options.documentLoader ?? (0, __fedify_vocab_runtime.getDocumentLoader)();
|
|
335
|
+
const contextLoader = options.contextLoader ?? (0, __fedify_vocab_runtime.getDocumentLoader)();
|
|
335
336
|
let object;
|
|
336
337
|
if (keyId instanceof require_actor.CryptographicKey) {
|
|
337
338
|
object = keyId;
|
|
@@ -398,7 +399,7 @@ const logger = (0, __logtape_logtape.getLogger)([
|
|
|
398
399
|
* @since 0.10.0
|
|
399
400
|
*/
|
|
400
401
|
async function createProof(object, privateKey, keyId, { contextLoader, context, created } = {}) {
|
|
401
|
-
|
|
402
|
+
require_http.validateCryptoKey(privateKey, "private");
|
|
402
403
|
if (privateKey.algorithm.name !== "Ed25519") throw new TypeError("Unsupported algorithm: " + privateKey.algorithm.name);
|
|
403
404
|
const objectWithoutProofs = object.clone({ proofs: [] });
|
|
404
405
|
const compactMsg = await objectWithoutProofs.toJsonLd({
|
|
@@ -446,7 +447,7 @@ async function createProof(object, privateKey, keyId, { contextLoader, context,
|
|
|
446
447
|
*/
|
|
447
448
|
async function signObject(object, privateKey, keyId, options = {}) {
|
|
448
449
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
|
449
|
-
const tracer = tracerProvider.getTracer(
|
|
450
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
|
450
451
|
return await tracer.startActiveSpan("object_integrity_proofs.sign", { attributes: { "activitypub.object.type": require_actor.getTypeId(object).href } }, async (span) => {
|
|
451
452
|
try {
|
|
452
453
|
if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
|
|
@@ -482,7 +483,7 @@ async function signObject(object, privateKey, keyId, options = {}) {
|
|
|
482
483
|
*/
|
|
483
484
|
async function verifyProof(jsonLd, proof, options = {}) {
|
|
484
485
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
|
485
|
-
const tracer = tracerProvider.getTracer(
|
|
486
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
|
486
487
|
return await tracer.startActiveSpan("object_integrity_proofs.verify", async (span) => {
|
|
487
488
|
if (span.isRecording()) {
|
|
488
489
|
if (proof.cryptosuite != null) span.setAttribute("object_integrity_proofs.cryptosuite", proof.cryptosuite);
|
|
@@ -506,7 +507,7 @@ async function verifyProof(jsonLd, proof, options = {}) {
|
|
|
506
507
|
}
|
|
507
508
|
async function verifyProofInternal(jsonLd, proof, options) {
|
|
508
509
|
if (typeof jsonLd !== "object" || proof.cryptosuite !== "eddsa-jcs-2022" || proof.verificationMethodId == null || proof.proofPurpose !== "assertionMethod" || proof.proofValue == null || proof.created == null) return null;
|
|
509
|
-
const publicKeyPromise =
|
|
510
|
+
const publicKeyPromise = require_http.fetchKey(proof.verificationMethodId, require_actor.Multikey, options);
|
|
510
511
|
const proofConfig = {
|
|
511
512
|
"@context": jsonLd["@context"],
|
|
512
513
|
type: "DataIntegrityProof",
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { deno_default
|
|
6
|
-
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "./actor-
|
|
7
|
-
import { fetchKey, validateCryptoKey } from "./
|
|
5
|
+
import { deno_default } from "./lookup-Cj543vD4.js";
|
|
6
|
+
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "./actor-Cm25mX8I.js";
|
|
7
|
+
import { fetchKey, validateCryptoKey } from "./http-B8aQ8cUK.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import jsonld from "jsonld";
|
|
11
|
-
import {
|
|
11
|
+
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
12
12
|
import { encodeHex } from "byte-encodings/hex";
|
|
13
|
+
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
13
14
|
import serialize from "json-canon";
|
|
14
15
|
|
|
15
16
|
//#region src/sig/ld.ts
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./
|
|
7
|
-
import { doubleKnock } from "./http-
|
|
6
|
+
import { deno_default } from "./lookup-D6_9czrD.js";
|
|
7
|
+
import { doubleKnock } from "./http-BF8Z1B-J.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
|
package/dist/sig/http.test.js
CHANGED
|
@@ -3,22 +3,21 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import "../lookup-D6_9czrD.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import "../
|
|
18
|
-
import "../
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { esm_default } from "../esm-D55VN1Km.js";
|
|
10
|
+
import "../actor-BZTYJWzP.js";
|
|
11
|
+
import { exportJwk } from "../key-C85if3Ia.js";
|
|
12
|
+
import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-BF8Z1B-J.js";
|
|
13
|
+
import { mockDocumentLoader, test } from "../testing-DcJ3qTSi.js";
|
|
14
|
+
import { assertExists, assertStringIncludes } from "../std__assert-DWivtrGR.js";
|
|
15
|
+
import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
16
|
+
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
|
17
|
+
import "../assert_not_equals-C80BG-_5.js";
|
|
18
|
+
import { rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey5 } from "../keys-do4GUlRT.js";
|
|
19
|
+
import { esm_default } from "../esm-bEFTDE2Q.js";
|
|
20
|
+
import { exportSpki } from "@fedify/vocab-runtime";
|
|
22
21
|
import { encodeBase64 } from "byte-encodings/base64";
|
|
23
22
|
|
|
24
23
|
//#region src/sig/http.test.ts
|
package/dist/sig/key.test.js
CHANGED
|
@@ -3,20 +3,18 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { CryptographicKey, Multikey } from "../
|
|
6
|
+
import { CryptographicKey, Multikey } from "../lookup-D6_9czrD.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import "../
|
|
15
|
-
import {
|
|
16
|
-
import "../
|
|
17
|
-
import "../
|
|
18
|
-
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
|
19
|
-
import { ed25519Multikey, rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey3 } from "../keys-Bkp2oOoh.js";
|
|
10
|
+
import "../actor-BZTYJWzP.js";
|
|
11
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-C85if3Ia.js";
|
|
12
|
+
import { mockDocumentLoader, test } from "../testing-DcJ3qTSi.js";
|
|
13
|
+
import "../std__assert-DWivtrGR.js";
|
|
14
|
+
import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
15
|
+
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
|
16
|
+
import "../assert_not_equals-C80BG-_5.js";
|
|
17
|
+
import { ed25519Multikey, rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey3 } from "../keys-do4GUlRT.js";
|
|
20
18
|
|
|
21
19
|
//#region src/sig/key.test.ts
|
|
22
20
|
test("validateCryptoKey()", async () => {
|
package/dist/sig/ld.test.js
CHANGED
|
@@ -3,18 +3,16 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { CryptographicKey } from "../
|
|
6
|
+
import { CryptographicKey } from "../lookup-D6_9czrD.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import "../
|
|
16
|
-
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
|
17
|
-
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-Bkp2oOoh.js";
|
|
9
|
+
import "../actor-BZTYJWzP.js";
|
|
10
|
+
import { generateCryptoKeyPair } from "../key-C85if3Ia.js";
|
|
11
|
+
import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-0Wpf83DM.js";
|
|
12
|
+
import { mockDocumentLoader, test } from "../testing-DcJ3qTSi.js";
|
|
13
|
+
import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
14
|
+
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
|
15
|
+
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-do4GUlRT.js";
|
|
18
16
|
import { encodeBase64 } from "byte-encodings/base64";
|
|
19
17
|
|
|
20
18
|
//#region src/sig/ld.test.ts
|
package/dist/sig/mod.cjs
CHANGED
|
@@ -2,24 +2,22 @@
|
|
|
2
2
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
|
-
require('../
|
|
6
|
-
require('../actor-
|
|
7
|
-
require('../
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const require_proof = require('../proof-C5COc2tW.cjs');
|
|
11
|
-
require('../sig-ByHXzqUi.cjs');
|
|
5
|
+
require('../lookup-Br9_ufLS.cjs');
|
|
6
|
+
require('../actor-ZEAP42Ry.cjs');
|
|
7
|
+
const require_http = require('../http-Dy7ENa6t.cjs');
|
|
8
|
+
const require_proof = require('../proof-CWQ0o-yI.cjs');
|
|
9
|
+
require('../sig-YYj5tCnr.cjs');
|
|
12
10
|
|
|
13
11
|
exports.attachSignature = require_proof.attachSignature;
|
|
14
12
|
exports.createProof = require_proof.createProof;
|
|
15
13
|
exports.createSignature = require_proof.createSignature;
|
|
16
14
|
exports.detachSignature = require_proof.detachSignature;
|
|
17
15
|
exports.doesActorOwnKey = require_proof.doesActorOwnKey;
|
|
18
|
-
exports.exportJwk =
|
|
19
|
-
exports.fetchKey =
|
|
20
|
-
exports.generateCryptoKeyPair =
|
|
16
|
+
exports.exportJwk = require_http.exportJwk;
|
|
17
|
+
exports.fetchKey = require_http.fetchKey;
|
|
18
|
+
exports.generateCryptoKeyPair = require_http.generateCryptoKeyPair;
|
|
21
19
|
exports.getKeyOwner = require_proof.getKeyOwner;
|
|
22
|
-
exports.importJwk =
|
|
20
|
+
exports.importJwk = require_http.importJwk;
|
|
23
21
|
exports.signJsonLd = require_proof.signJsonLd;
|
|
24
22
|
exports.signObject = require_proof.signObject;
|
|
25
23
|
exports.signRequest = require_http.signRequest;
|
package/dist/sig/mod.d.cts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import {
|
|
6
|
-
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-AcrG3Xz1.cjs";
|
|
7
|
-
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-Dz5Y15Uy.cjs";
|
|
1
|
+
import "../vocab-CeDBzu-f.cjs";
|
|
2
|
+
import "../actor-f2NtjyCg.cjs";
|
|
3
|
+
import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-M8k5mKc0.cjs";
|
|
4
|
+
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-B4HbyP8s.cjs";
|
|
5
|
+
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-DgxG-byT.cjs";
|
|
8
6
|
export { CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyOptions, FetchKeyResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/sig/mod.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import "../
|
|
7
|
-
import {
|
|
8
|
-
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-8NMhXwJd.js";
|
|
9
|
-
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-BZfdiPBo.js";
|
|
3
|
+
import "../vocab-BCWe1Ih5.js";
|
|
4
|
+
import "../actor-DqFajh9s.js";
|
|
5
|
+
import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-BbO0ejuk.js";
|
|
6
|
+
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-kQRGVXG1.js";
|
|
7
|
+
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-D5Z2tISD.js";
|
|
10
8
|
export { CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyOptions, FetchKeyResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/sig/mod.js
CHANGED
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import "../
|
|
6
|
-
import "../actor-
|
|
7
|
-
import "../
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-BWebFnAY.js";
|
|
11
|
-
import "../sig-Cj3tk-ig.js";
|
|
5
|
+
import "../lookup-Cj543vD4.js";
|
|
6
|
+
import "../actor-Cm25mX8I.js";
|
|
7
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-B8aQ8cUK.js";
|
|
8
|
+
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-CXrz_moF.js";
|
|
9
|
+
import "../sig-C34-oHBl.js";
|
|
12
10
|
|
|
13
11
|
export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/sig/owner.test.js
CHANGED
|
@@ -3,22 +3,20 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Create, CryptographicKey } from "../
|
|
6
|
+
import { Create, CryptographicKey, lookupObject } from "../lookup-D6_9czrD.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import "../
|
|
16
|
-
import
|
|
17
|
-
import "../
|
|
18
|
-
import "../
|
|
19
|
-
import "../
|
|
20
|
-
import { rsaPublicKey1, rsaPublicKey2 } from "../keys-Bkp2oOoh.js";
|
|
21
|
-
import { createTestTracerProvider } from "../otel-Chy5T2Xh.js";
|
|
10
|
+
import "../actor-BZTYJWzP.js";
|
|
11
|
+
import "../key-C85if3Ia.js";
|
|
12
|
+
import { doesActorOwnKey, getKeyOwner } from "../owner-B2ziOXAb.js";
|
|
13
|
+
import { mockDocumentLoader, test } from "../testing-DcJ3qTSi.js";
|
|
14
|
+
import "../std__assert-DWivtrGR.js";
|
|
15
|
+
import { assertFalse } from "../assert_rejects-Ce45JcFg.js";
|
|
16
|
+
import "../assert_throws-BNXdRGWP.js";
|
|
17
|
+
import "../assert_not_equals-C80BG-_5.js";
|
|
18
|
+
import { rsaPublicKey1, rsaPublicKey2 } from "../keys-do4GUlRT.js";
|
|
19
|
+
import { createTestTracerProvider } from "../otel-Bfe_BgOV.js";
|
|
22
20
|
|
|
23
21
|
//#region src/sig/owner.test.ts
|
|
24
22
|
test("doesActorOwnKey()", async () => {
|
package/dist/sig/proof.test.js
CHANGED
|
@@ -3,21 +3,20 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Create, DataIntegrityProof, Multikey, Note, Place
|
|
6
|
+
import { Create, DataIntegrityProof, Multikey, Note, Place } from "../lookup-D6_9czrD.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import "../
|
|
16
|
-
import
|
|
17
|
-
import "../
|
|
18
|
-
import "../
|
|
19
|
-
import "
|
|
20
|
-
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-Bkp2oOoh.js";
|
|
10
|
+
import "../actor-BZTYJWzP.js";
|
|
11
|
+
import "../key-C85if3Ia.js";
|
|
12
|
+
import { createProof, signObject, verifyObject, verifyProof } from "../proof-CN_ohUto.js";
|
|
13
|
+
import { mockDocumentLoader, test } from "../testing-DcJ3qTSi.js";
|
|
14
|
+
import "../std__assert-DWivtrGR.js";
|
|
15
|
+
import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
16
|
+
import "../assert_throws-BNXdRGWP.js";
|
|
17
|
+
import "../assert_not_equals-C80BG-_5.js";
|
|
18
|
+
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-do4GUlRT.js";
|
|
19
|
+
import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
|
|
21
20
|
import { decodeHex, encodeHex } from "byte-encodings/hex";
|
|
22
21
|
|
|
23
22
|
//#region src/sig/proof.test.ts
|
|
@@ -74,7 +73,7 @@ test("createProof()", async () => {
|
|
|
74
73
|
assertEquals(proof2.cryptosuite, "eddsa-jcs-2022");
|
|
75
74
|
assertEquals(proof2.verificationMethodId, fep8b32TestVectorKeyId);
|
|
76
75
|
assertEquals(proof2.proofPurpose, "assertionMethod");
|
|
77
|
-
assertEquals(proof2.proofValue,
|
|
76
|
+
assertEquals(proof2.proofValue, decodeMultibase("zLaewdp4H9kqtwyrLatK4cjY5oRHwVcw4gibPSUDYDMhi4M49v8pcYk3ZB6D69dNpAPbUmY8ocuJ3m9KhKJEEg7z"));
|
|
78
77
|
assertEquals(proof2.created, created);
|
|
79
78
|
await assertRejects(() => createProof(create, rsaPrivateKey2, rsaPublicKey2.id, {
|
|
80
79
|
created,
|
|
@@ -198,7 +197,7 @@ test("verifyProof()", async () => {
|
|
|
198
197
|
cryptosuite: "eddsa-jcs-2022",
|
|
199
198
|
verificationMethod: new URL("https://server.example/users/alice#ed25519-key"),
|
|
200
199
|
proofPurpose: "assertionMethod",
|
|
201
|
-
proofValue:
|
|
200
|
+
proofValue: decodeMultibase("zLaewdp4H9kqtwyrLatK4cjY5oRHwVcw4gibPSUDYDMhi4M49v8pcYk3ZB6D69dNpAPbUmY8ocuJ3m9KhKJEEg7z"),
|
|
202
201
|
created: Temporal.Instant.from("2023-02-24T23:36:38Z")
|
|
203
202
|
});
|
|
204
203
|
const expectedKey = new Multikey({
|