@fedify/fedify 2.2.0-dev.613 → 2.2.0-dev.622
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{accept-D7sAxyNa.js → accept-Dd__NiUL.mjs} +10 -8
- package/dist/{assert-MZs1qjMx.js → assert-ddO5KLpe.mjs} +5 -9
- package/dist/{assert_equals-DSbWqCm3.js → assert_equals-Ew3jOFa3.mjs} +55 -69
- package/dist/{assert_instance_of-DHz7EHNU.js → assert_instance_of-C4Ri6VuN.mjs} +5 -9
- package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals--wG9hV7u.mjs} +6 -13
- package/dist/{assert_rejects-0h7I2Esa.js → assert_rejects-B-qJtC9Z.mjs} +6 -11
- package/dist/{assert_throws-rjdMBf31.js → assert_throws-4NwKEy2q.mjs} +5 -10
- package/dist/{builder-OscY92PK.js → builder-DcSpny3g.mjs} +32 -41
- package/dist/{chunk-CGaQZ11T.cjs → chunk-DDcVe30Y.cjs} +23 -24
- package/dist/{chunk-DJNbSFdH.js → chunk-nlSIicah.js} +8 -8
- package/dist/{client-BxMZiQaD.d.ts → client-AtlibPOU.d.ts} +1 -1
- package/dist/{client-CoCIaTNO.js → client-DEpOVgY1.mjs} +9 -13
- package/dist/{client-C97KOq3x.d.cts → client-z-8dc-e1.d.cts} +1 -1
- package/dist/{collection-CSzG2j1P.js → collection-BD6-SZ6O.mjs} +7 -12
- package/dist/compat/mod.cjs +5 -8
- package/dist/compat/mod.d.cts +78 -6
- package/dist/compat/mod.d.ts +78 -6
- package/dist/compat/mod.js +4 -8
- package/dist/compat/transformers.test.mjs +62 -0
- package/dist/{context-DyJjQQ_H.d.ts → context-BOiMZBu5.d.ts} +9 -18
- package/dist/{context-BcqA-0BL.d.cts → context-BhZVy7RB.d.cts} +9 -18
- package/dist/{context-Aqenou7c.js → context-Juj6bdHC.mjs} +7 -11
- package/dist/deno-D682wzlW.mjs +8 -0
- package/dist/{docloader-JiZmL7BP.js → docloader-CCWf4tNV.mjs} +8 -14
- package/dist/{esm-nLm00z9V.js → esm-DVILvP5e.mjs} +50 -89
- package/dist/federation/builder.test.d.mts +2 -0
- package/dist/federation/{builder.test.js → builder.test.mjs} +21 -44
- package/dist/federation/collection.test.d.mts +2 -0
- package/dist/federation/collection.test.mjs +21 -0
- package/dist/federation/handler.test.d.mts +2 -0
- package/dist/federation/{handler.test.js → handler.test.mjs} +69 -131
- package/dist/federation/idempotency.test.d.mts +2 -0
- package/dist/federation/{idempotency.test.js → idempotency.test.mjs} +31 -63
- package/dist/federation/inbox.test.d.mts +2 -0
- package/dist/federation/{inbox.test.js → inbox.test.mjs} +8 -12
- package/dist/federation/keycache.test.d.mts +2 -0
- package/dist/federation/{keycache.test.js → keycache.test.mjs} +13 -19
- package/dist/federation/kv.test.d.mts +2 -0
- package/dist/federation/{kv.test.js → kv.test.mjs} +11 -22
- package/dist/federation/middleware.test.d.mts +2 -0
- package/dist/federation/{middleware.test.js → middleware.test.mjs} +173 -262
- package/dist/federation/mod.cjs +327 -16
- package/dist/federation/mod.d.cts +3 -6
- package/dist/federation/mod.d.ts +3 -6
- package/dist/federation/mod.js +322 -13
- package/dist/federation/mq.test.d.mts +2 -0
- package/dist/federation/{mq.test.js → mq.test.mjs} +21 -35
- package/dist/federation/negotiation.test.d.mts +2 -0
- package/dist/federation/{negotiation.test.js → negotiation.test.mjs} +9 -16
- package/dist/federation/retry.test.d.mts +2 -0
- package/dist/federation/{retry.test.js → retry.test.mjs} +8 -11
- package/dist/federation/router.test.d.mts +2 -0
- package/dist/federation/{router.test.js → router.test.mjs} +11 -16
- package/dist/federation/send.test.d.mts +2 -0
- package/dist/federation/{send.test.js → send.test.mjs} +22 -30
- package/dist/federation/webfinger.test.d.mts +2 -0
- package/dist/federation/{webfinger.test.js → webfinger.test.mjs} +22 -56
- package/dist/{http-BnsR906R.cjs → http-BQccxQlj.cjs} +177 -302
- package/dist/{http-CKaqhjvP.js → http-CNsnyqrO.mjs} +23 -43
- package/dist/{http-BudnHZE2.d.cts → http-CrGuipxe.d.cts} +1 -6
- package/dist/{http-IFqEftoZ.js → http-DhwEMhtv.js} +53 -184
- package/dist/{http-Dax_FIBo.d.ts → http-aQzN9Ayi.d.ts} +1 -6
- package/dist/{inbox-Bd91CVJP.js → inbox-DegXbbbS.mjs} +18 -26
- package/dist/{key-DFLFXKER.js → key-vL60OvqM.mjs} +29 -37
- package/dist/{keycache-CpGWAUbj.js → keycache-CCSwkQcY.mjs} +5 -10
- package/dist/{keys-BFve7QQv.js → keys-BAK-tUlf.mjs} +5 -9
- package/dist/{kv-BL4nlICN.d.cts → kv-CbLNp3zQ.d.cts} +1 -1
- package/dist/{kv-DXEUEP6z.d.ts → kv-GFYnFoOl.d.ts} +1 -1
- package/dist/{kv-cache-Bw2F2ABq.js → kv-cache-B01V7s3h.mjs} +4 -8
- package/dist/{kv-cache-Drlz6O_Y.js → kv-cache-CTj3iCix.js} +6 -13
- package/dist/{kv-cache-BLXcQvyb.cjs → kv-cache-DxdXJNbj.cjs} +27 -34
- package/dist/{kv-QzKcOQgP.js → kv-tL2TOE9X.mjs} +6 -10
- package/dist/{ld-CGGXZJK0.js → ld-C3CO00YY.mjs} +17 -31
- package/dist/{middleware-DcpBikad.js → middleware-BmsVSOeS.js} +335 -382
- package/dist/middleware-C7shNcsp.cjs +4 -0
- package/dist/{middleware-B51dB75z.cjs → middleware-Cx0Ny6_7.cjs} +532 -587
- package/dist/middleware-DqVGYk56.mjs +5 -0
- package/dist/{middleware-B53r4pdM.js → middleware-Du-vh7I_.mjs} +282 -317
- package/dist/{mod-em2Il1eD.d.cts → mod-Bp_CzKd4.d.cts} +2 -2
- package/dist/{mod-DCbh1JQ5.d.ts → mod-CLgIXe9w.d.ts} +3 -3
- package/dist/{mod-jfnweK2w.d.cts → mod-CMEbIaNh.d.cts} +3 -3
- package/dist/{mod-D6MdymW7.d.ts → mod-DKOAow7a.d.ts} +2 -2
- package/dist/{mod-Coe7KEgX.d.cts → mod-DoJBjjnO.d.cts} +2 -2
- package/dist/{mod-D6dOd--H.d.ts → mod-DvxszxXC.d.ts} +2 -2
- package/dist/mod.cjs +29 -74
- package/dist/mod.d.cts +11 -14
- package/dist/mod.d.ts +11 -15
- package/dist/mod.js +17 -71
- package/dist/{negotiation-BlAuS_nr.js → negotiation-DnsfFF8I.mjs} +7 -11
- package/dist/nodeinfo/client.test.d.mts +2 -0
- package/dist/nodeinfo/{client.test.js → client.test.mjs} +22 -40
- package/dist/nodeinfo/handler.test.d.mts +2 -0
- package/dist/nodeinfo/{handler.test.js → handler.test.mjs} +13 -43
- package/dist/nodeinfo/mod.cjs +5 -8
- package/dist/nodeinfo/mod.d.cts +2 -3
- package/dist/nodeinfo/mod.d.ts +2 -3
- package/dist/nodeinfo/mod.js +4 -8
- package/dist/nodeinfo/types.test.d.mts +2 -0
- package/dist/nodeinfo/{types.test.js → types.test.mjs} +9 -16
- package/dist/otel/exporter.test.d.mts +2 -0
- package/dist/otel/{exporter.test.js → exporter.test.mjs} +124 -178
- package/dist/otel/mod.cjs +15 -20
- package/dist/otel/mod.d.cts +2 -2
- package/dist/otel/mod.d.ts +2 -2
- package/dist/otel/mod.js +8 -14
- package/dist/{owner-gd0Q9FuU.d.ts → owner-74ARJ5TL.d.ts} +1 -1
- package/dist/{owner-1AbPBOOZ.d.cts → owner-CptqhsOy.d.cts} +1 -1
- package/dist/{owner-Cye0yQB_.js → owner-DF320w6K.mjs} +11 -16
- package/dist/{proof-DdGGXVWM.js → proof-BCWk5oas.js} +32 -58
- package/dist/{proof-DV5lC_Bw.js → proof-IyDwwmzL.mjs} +21 -33
- package/dist/{proof-CN5iR1tW.cjs → proof-WhNxSv_N.cjs} +133 -157
- package/dist/{retry-mqLf4b-R.js → retry-B_E3V_Dx.mjs} +4 -7
- package/dist/{router-D9eI0s4b.js → router-CrMLXoOr.mjs} +4 -8
- package/dist/runtime/mod.cjs +11 -13
- package/dist/runtime/mod.d.cts +6 -2
- package/dist/runtime/mod.d.ts +0 -1
- package/dist/runtime/mod.js +4 -7
- package/dist/{send-C2a_3YAF.js → send-CJQubr5t.mjs} +8 -13
- package/dist/sig/accept.test.d.mts +2 -0
- package/dist/sig/{accept.test.js → accept.test.mjs} +35 -70
- package/dist/sig/http.test.d.mts +2 -0
- package/dist/sig/{http.test.js → http.test.mjs} +166 -280
- package/dist/sig/key.test.d.mts +2 -0
- package/dist/sig/{key.test.js → key.test.mjs} +11 -18
- package/dist/sig/ld.test.d.mts +2 -0
- package/dist/sig/{ld.test.js → ld.test.mjs} +22 -35
- package/dist/sig/mod.cjs +6 -9
- package/dist/sig/mod.d.cts +3 -3
- package/dist/sig/mod.d.ts +3 -3
- package/dist/sig/mod.js +5 -9
- package/dist/sig/owner.test.d.mts +2 -0
- package/dist/sig/{owner.test.js → owner.test.mjs} +19 -34
- package/dist/sig/proof.test.d.mts +2 -0
- package/dist/sig/{proof.test.js → proof.test.mjs} +16 -27
- package/dist/{std__assert-X-_kMxKM.js → std__assert-Duiq_YC9.mjs} +12 -24
- package/dist/testing/{mod.d.ts → mod.d.mts} +26 -90
- package/dist/testing/mod.mjs +6 -0
- package/dist/{transformers-3g8GZwkZ.cjs → transformers-NeAONrAq.cjs} +20 -25
- package/dist/{transformers-C3FLHUd6.js → transformers-ve6e2xcg.js} +3 -7
- package/dist/{types-CPz01LGH.js → types-DCP0WLdt.mjs} +4 -7
- package/dist/{types-Cd_hszr_.cjs → types-KC4QAoxe.cjs} +29 -34
- package/dist/{types-C93Ob9cU.js → types-hvL8ElAs.js} +8 -13
- package/dist/utils/docloader.test.d.mts +2 -0
- package/dist/utils/{docloader.test.js → docloader.test.mjs} +14 -25
- package/dist/utils/kv-cache.test.d.mts +2 -0
- package/dist/utils/{kv-cache.test.js → kv-cache.test.mjs} +25 -40
- package/dist/utils/mod.cjs +5 -9
- package/dist/utils/mod.d.cts +1 -3
- package/dist/utils/mod.d.ts +1 -3
- package/dist/utils/mod.js +4 -9
- package/dist/vocab/cjs.test.d.mts +2 -0
- package/dist/vocab/cjs.test.mjs +14 -0
- package/dist/vocab/mod.cjs +10 -12
- package/dist/vocab/mod.js +3 -5
- package/package.json +8 -8
- package/dist/compat/transformers.test.d.ts +0 -3
- package/dist/compat/transformers.test.js +0 -88
- package/dist/compat-Bb4NuTUO.js +0 -4
- package/dist/compat-DmDDELst.cjs +0 -4
- package/dist/deno-CnMqla6T.js +0 -121
- package/dist/federation/builder.test.d.ts +0 -3
- package/dist/federation/collection.test.d.ts +0 -3
- package/dist/federation/collection.test.js +0 -32
- package/dist/federation/handler.test.d.ts +0 -3
- package/dist/federation/idempotency.test.d.ts +0 -3
- package/dist/federation/inbox.test.d.ts +0 -3
- package/dist/federation/keycache.test.d.ts +0 -3
- package/dist/federation/kv.test.d.ts +0 -3
- package/dist/federation/middleware.test.d.ts +0 -3
- package/dist/federation/mq.test.d.ts +0 -3
- package/dist/federation/negotiation.test.d.ts +0 -3
- package/dist/federation/retry.test.d.ts +0 -3
- package/dist/federation/router.test.d.ts +0 -3
- package/dist/federation/send.test.d.ts +0 -3
- package/dist/federation/webfinger.test.d.ts +0 -3
- package/dist/federation-Bp3HI26G.cjs +0 -350
- package/dist/federation-DaMfqRm4.js +0 -332
- package/dist/middleware-B0kNQMO0.js +0 -27
- package/dist/middleware-BYQL9cdV.js +0 -12
- package/dist/middleware-DfNqksSs.cjs +0 -12
- package/dist/mod-B7QkWzrL.d.cts +0 -80
- package/dist/mod-Bh8mqlYw.d.cts +0 -9
- package/dist/mod-D6HodEq7.d.ts +0 -7
- package/dist/mod-SMHOMNpZ.d.ts +0 -82
- package/dist/mod-gq_Xfdz8.d.cts +0 -1
- package/dist/nodeinfo/client.test.d.ts +0 -3
- package/dist/nodeinfo/handler.test.d.ts +0 -3
- package/dist/nodeinfo/types.test.d.ts +0 -3
- package/dist/nodeinfo-DoESQxq5.js +0 -4
- package/dist/nodeinfo-DuMYTpbZ.cjs +0 -4
- package/dist/otel/exporter.test.d.ts +0 -3
- package/dist/runtime-c2Njxsry.cjs +0 -17
- package/dist/runtime-poamPCMb.js +0 -13
- package/dist/sig/accept.test.d.ts +0 -3
- package/dist/sig/http.test.d.ts +0 -3
- package/dist/sig/key.test.d.ts +0 -3
- package/dist/sig/ld.test.d.ts +0 -3
- package/dist/sig/owner.test.d.ts +0 -3
- package/dist/sig/proof.test.d.ts +0 -3
- package/dist/sig-BNhspNOf.js +0 -4
- package/dist/sig-vX39WyWI.cjs +0 -4
- package/dist/testing/mod.js +0 -10
- package/dist/utils/docloader.test.d.ts +0 -3
- package/dist/utils/kv-cache.test.d.ts +0 -3
- package/dist/utils-BQ9KqEK9.cjs +0 -4
- package/dist/utils-Dn5OPdSW.js +0 -4
- /package/dist/{mod-AGjRfPjT.d.ts → compat/transformers.test.d.mts} +0 -0
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
+
const require_chunk = require("./chunk-DDcVe30Y.cjs");
|
|
4
|
+
const require_http = require("./http-BQccxQlj.cjs");
|
|
5
|
+
let _logtape_logtape = require("@logtape/logtape");
|
|
6
|
+
let _fedify_vocab = require("@fedify/vocab");
|
|
7
|
+
let _opentelemetry_api = require("@opentelemetry/api");
|
|
8
|
+
let byte_encodings_hex = require("byte-encodings/hex");
|
|
9
|
+
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
10
|
+
let byte_encodings_base64 = require("byte-encodings/base64");
|
|
11
|
+
let _fedify_vocab_runtime_jsonld = require("@fedify/vocab-runtime/jsonld");
|
|
12
|
+
_fedify_vocab_runtime_jsonld = require_chunk.__toESM(_fedify_vocab_runtime_jsonld);
|
|
13
|
+
let json_canon = require("json-canon");
|
|
14
|
+
json_canon = require_chunk.__toESM(json_canon);
|
|
16
15
|
//#region src/sig/ld.ts
|
|
17
|
-
const logger$1 = (0,
|
|
16
|
+
const logger$1 = (0, _logtape_logtape.getLogger)([
|
|
18
17
|
"fedify",
|
|
19
18
|
"sig",
|
|
20
19
|
"ld"
|
|
@@ -54,11 +53,8 @@ async function createSignature(jsonLd, privateKey, keyId, { contextLoader, creat
|
|
|
54
53
|
creator: keyId.href,
|
|
55
54
|
created: created?.toString() ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
56
55
|
};
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
const message = optionsHash + docHash;
|
|
60
|
-
const encoder = new TextEncoder();
|
|
61
|
-
const messageBytes = encoder.encode(message);
|
|
56
|
+
const message = await hashJsonLd(options, contextLoader) + await hashJsonLd(jsonLd, contextLoader);
|
|
57
|
+
const messageBytes = new TextEncoder().encode(message);
|
|
62
58
|
const signature = await crypto.subtle.sign("RSASSA-PKCS1-v1_5", privateKey, messageBytes);
|
|
63
59
|
return {
|
|
64
60
|
...options,
|
|
@@ -80,9 +76,7 @@ async function createSignature(jsonLd, privateKey, keyId, { contextLoader, creat
|
|
|
80
76
|
* @since 1.0.0
|
|
81
77
|
*/
|
|
82
78
|
async function signJsonLd(jsonLd, privateKey, keyId, options) {
|
|
83
|
-
|
|
84
|
-
const tracer = tracerProvider.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
85
|
-
return await tracer.startActiveSpan("ld_signatures.sign", { attributes: { "ld_signatures.key_id": keyId.href } }, async (span) => {
|
|
79
|
+
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(require_http.name, require_http.version).startActiveSpan("ld_signatures.sign", { attributes: { "ld_signatures.key_id": keyId.href } }, async (span) => {
|
|
86
80
|
try {
|
|
87
81
|
const signature = await createSignature(jsonLd, privateKey, keyId, options);
|
|
88
82
|
if (span.isRecording()) {
|
|
@@ -92,7 +86,7 @@ async function signJsonLd(jsonLd, privateKey, keyId, options) {
|
|
|
92
86
|
return attachSignature(jsonLd, signature);
|
|
93
87
|
} catch (error) {
|
|
94
88
|
span.setStatus({
|
|
95
|
-
code:
|
|
89
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
96
90
|
message: String(error)
|
|
97
91
|
});
|
|
98
92
|
throw error;
|
|
@@ -150,7 +144,7 @@ async function verifySignature(jsonLd, options = {}) {
|
|
|
150
144
|
});
|
|
151
145
|
return null;
|
|
152
146
|
}
|
|
153
|
-
const { key, cached } = await require_http.fetchKey(new URL(sig.creator),
|
|
147
|
+
const { key, cached } = await require_http.fetchKey(new URL(sig.creator), _fedify_vocab.CryptographicKey, options);
|
|
154
148
|
if (key == null) return null;
|
|
155
149
|
const sigOpts = {
|
|
156
150
|
...sig,
|
|
@@ -184,23 +178,21 @@ async function verifySignature(jsonLd, options = {}) {
|
|
|
184
178
|
const encoder = new TextEncoder();
|
|
185
179
|
const message = sigOptsHash + docHash;
|
|
186
180
|
const messageBytes = encoder.encode(message);
|
|
187
|
-
|
|
188
|
-
if (verified) return key;
|
|
181
|
+
if (await crypto.subtle.verify("RSASSA-PKCS1-v1_5", key.publicKey, signature.slice(), messageBytes)) return key;
|
|
189
182
|
if (cached) {
|
|
190
183
|
logger$1.debug("Failed to verify with the cached key {keyId}; signature {signatureValue} is invalid. Retrying with the freshly fetched key...", {
|
|
191
184
|
keyId: sig.creator,
|
|
192
185
|
...sig
|
|
193
186
|
});
|
|
194
|
-
const { key
|
|
187
|
+
const { key } = await require_http.fetchKey(new URL(sig.creator), _fedify_vocab.CryptographicKey, {
|
|
195
188
|
...options,
|
|
196
189
|
keyCache: {
|
|
197
190
|
get: () => Promise.resolve(void 0),
|
|
198
|
-
set: async (keyId, key
|
|
191
|
+
set: async (keyId, key) => await options.keyCache?.set(keyId, key)
|
|
199
192
|
}
|
|
200
193
|
});
|
|
201
|
-
if (key
|
|
202
|
-
|
|
203
|
-
return verified$1 ? key$1 : null;
|
|
194
|
+
if (key == null) return null;
|
|
195
|
+
return await crypto.subtle.verify("RSASSA-PKCS1-v1_5", key.publicKey, signature.slice(), messageBytes) ? key : null;
|
|
204
196
|
}
|
|
205
197
|
logger$1.debug("Failed to verify with the fetched key {keyId}; signature {signatureValue} is invalid. Check if the key is correct or if the signed message is correct. The message to sign is:\n{message}", {
|
|
206
198
|
keyId: sig.creator,
|
|
@@ -219,20 +211,18 @@ async function verifySignature(jsonLd, options = {}) {
|
|
|
219
211
|
* @returns `true` if the document is authentic; `false` otherwise.
|
|
220
212
|
*/
|
|
221
213
|
async function verifyJsonLd(jsonLd, options = {}) {
|
|
222
|
-
|
|
223
|
-
const tracer = tracerProvider.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
224
|
-
return await tracer.startActiveSpan("ld_signatures.verify", async (span) => {
|
|
214
|
+
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(require_http.name, require_http.version).startActiveSpan("ld_signatures.verify", async (span) => {
|
|
225
215
|
try {
|
|
226
|
-
const object = await
|
|
216
|
+
const object = await _fedify_vocab.Object.fromJsonLd(jsonLd, options);
|
|
227
217
|
if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
|
|
228
|
-
span.setAttribute("activitypub.object.type", (0,
|
|
218
|
+
span.setAttribute("activitypub.object.type", (0, _fedify_vocab.getTypeId)(object).href);
|
|
229
219
|
if (typeof jsonLd === "object" && jsonLd != null && "signature" in jsonLd && typeof jsonLd.signature === "object" && jsonLd.signature != null) {
|
|
230
220
|
if ("creator" in jsonLd.signature && typeof jsonLd.signature.creator === "string") span.setAttribute("ld_signatures.key_id", jsonLd.signature.creator);
|
|
231
221
|
if ("signatureValue" in jsonLd.signature && typeof jsonLd.signature.signatureValue === "string") span.setAttribute("ld_signatures.signature", jsonLd.signature.signatureValue);
|
|
232
222
|
if ("type" in jsonLd.signature && typeof jsonLd.signature.type === "string") span.setAttribute("ld_signatures.type", jsonLd.signature.type);
|
|
233
223
|
}
|
|
234
224
|
const attributions = new Set(object.attributionIds.map((uri) => uri.href));
|
|
235
|
-
if (object instanceof
|
|
225
|
+
if (object instanceof _fedify_vocab.Activity) for (const uri of object.actorIds) attributions.add(uri.href);
|
|
236
226
|
const key = await verifySignature(jsonLd, options);
|
|
237
227
|
if (key == null) return false;
|
|
238
228
|
if (key.ownerId == null) {
|
|
@@ -247,7 +237,7 @@ async function verifyJsonLd(jsonLd, options = {}) {
|
|
|
247
237
|
return true;
|
|
248
238
|
} catch (error) {
|
|
249
239
|
span.setStatus({
|
|
250
|
-
code:
|
|
240
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
251
241
|
message: String(error)
|
|
252
242
|
});
|
|
253
243
|
throw error;
|
|
@@ -257,15 +247,13 @@ async function verifyJsonLd(jsonLd, options = {}) {
|
|
|
257
247
|
});
|
|
258
248
|
}
|
|
259
249
|
async function hashJsonLd(jsonLd, contextLoader) {
|
|
260
|
-
const canon = await
|
|
250
|
+
const canon = await _fedify_vocab_runtime_jsonld.default.canonize(jsonLd, {
|
|
261
251
|
format: "application/n-quads",
|
|
262
|
-
documentLoader: contextLoader ?? (0,
|
|
252
|
+
documentLoader: contextLoader ?? (0, _fedify_vocab_runtime.getDocumentLoader)()
|
|
263
253
|
});
|
|
264
254
|
const encoder = new TextEncoder();
|
|
265
|
-
|
|
266
|
-
return (0, byte_encodings_hex.encodeHex)(hash);
|
|
255
|
+
return (0, byte_encodings_hex.encodeHex)(await crypto.subtle.digest("SHA-256", encoder.encode(canon)));
|
|
267
256
|
}
|
|
268
|
-
|
|
269
257
|
//#endregion
|
|
270
258
|
//#region src/sig/owner.ts
|
|
271
259
|
/**
|
|
@@ -276,10 +264,8 @@ async function hashJsonLd(jsonLd, contextLoader) {
|
|
|
276
264
|
* @returns Whether the actor is the owner of the key.
|
|
277
265
|
*/
|
|
278
266
|
async function doesActorOwnKey(activity, key, options) {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
return await tracer.startActiveSpan("activitypub.verify_key_ownership", {
|
|
282
|
-
kind: __opentelemetry_api.SpanKind.INTERNAL,
|
|
267
|
+
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(require_http.name, require_http.version).startActiveSpan("activitypub.verify_key_ownership", {
|
|
268
|
+
kind: _opentelemetry_api.SpanKind.INTERNAL,
|
|
283
269
|
attributes: {
|
|
284
270
|
"activitypub.actor.id": activity.actorId?.href ?? "",
|
|
285
271
|
"activitypub.key.id": key.id?.href ?? ""
|
|
@@ -293,7 +279,7 @@ async function doesActorOwnKey(activity, key, options) {
|
|
|
293
279
|
return owns;
|
|
294
280
|
}
|
|
295
281
|
const actor = await activity.getActor(options);
|
|
296
|
-
if (actor == null || !(0,
|
|
282
|
+
if (actor == null || !(0, _fedify_vocab.isActor)(actor)) {
|
|
297
283
|
span.setAttribute("activitypub.key_ownership.verified", false);
|
|
298
284
|
span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
|
|
299
285
|
return false;
|
|
@@ -309,7 +295,7 @@ async function doesActorOwnKey(activity, key, options) {
|
|
|
309
295
|
} catch (error) {
|
|
310
296
|
span.recordException(error);
|
|
311
297
|
span.setStatus({
|
|
312
|
-
code:
|
|
298
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
313
299
|
message: String(error)
|
|
314
300
|
});
|
|
315
301
|
throw error;
|
|
@@ -329,11 +315,11 @@ async function doesActorOwnKey(activity, key, options) {
|
|
|
329
315
|
* @since 0.7.0
|
|
330
316
|
*/
|
|
331
317
|
async function getKeyOwner(keyId, options) {
|
|
332
|
-
const tracerProvider = options.tracerProvider ??
|
|
333
|
-
const documentLoader = options.documentLoader ?? (0,
|
|
334
|
-
const contextLoader = options.contextLoader ?? (0,
|
|
318
|
+
const tracerProvider = options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider();
|
|
319
|
+
const documentLoader = options.documentLoader ?? (0, _fedify_vocab_runtime.getDocumentLoader)();
|
|
320
|
+
const contextLoader = options.contextLoader ?? (0, _fedify_vocab_runtime.getDocumentLoader)();
|
|
335
321
|
let object;
|
|
336
|
-
if (keyId instanceof
|
|
322
|
+
if (keyId instanceof _fedify_vocab.CryptographicKey) {
|
|
337
323
|
object = keyId;
|
|
338
324
|
if (object.id == null) return null;
|
|
339
325
|
keyId = object.id;
|
|
@@ -346,7 +332,7 @@ async function getKeyOwner(keyId, options) {
|
|
|
346
332
|
return null;
|
|
347
333
|
}
|
|
348
334
|
try {
|
|
349
|
-
object = await
|
|
335
|
+
object = await _fedify_vocab.Object.fromJsonLd(keyDoc, {
|
|
350
336
|
documentLoader,
|
|
351
337
|
contextLoader,
|
|
352
338
|
tracerProvider
|
|
@@ -354,35 +340,34 @@ async function getKeyOwner(keyId, options) {
|
|
|
354
340
|
} catch (e) {
|
|
355
341
|
if (!(e instanceof TypeError)) throw e;
|
|
356
342
|
try {
|
|
357
|
-
object = await
|
|
343
|
+
object = await _fedify_vocab.CryptographicKey.fromJsonLd(keyDoc, {
|
|
358
344
|
documentLoader,
|
|
359
345
|
contextLoader,
|
|
360
346
|
tracerProvider
|
|
361
347
|
});
|
|
362
|
-
} catch (e
|
|
363
|
-
if (e
|
|
364
|
-
throw e
|
|
348
|
+
} catch (e) {
|
|
349
|
+
if (e instanceof TypeError) return null;
|
|
350
|
+
throw e;
|
|
365
351
|
}
|
|
366
352
|
}
|
|
367
353
|
}
|
|
368
354
|
let owner = null;
|
|
369
|
-
if (object instanceof
|
|
355
|
+
if (object instanceof _fedify_vocab.CryptographicKey) {
|
|
370
356
|
if (object.ownerId == null) return null;
|
|
371
357
|
owner = await object.getOwner({
|
|
372
358
|
documentLoader,
|
|
373
359
|
contextLoader,
|
|
374
360
|
tracerProvider
|
|
375
361
|
});
|
|
376
|
-
} else if ((0,
|
|
362
|
+
} else if ((0, _fedify_vocab.isActor)(object)) owner = object;
|
|
377
363
|
else return null;
|
|
378
364
|
if (owner == null) return null;
|
|
379
365
|
for (const kid of owner.publicKeyIds) if (kid.href === keyId.href) return owner;
|
|
380
366
|
return null;
|
|
381
367
|
}
|
|
382
|
-
|
|
383
368
|
//#endregion
|
|
384
369
|
//#region src/sig/proof.ts
|
|
385
|
-
const logger = (0,
|
|
370
|
+
const logger = (0, _logtape_logtape.getLogger)([
|
|
386
371
|
"fedify",
|
|
387
372
|
"sig",
|
|
388
373
|
"proof"
|
|
@@ -400,8 +385,7 @@ const logger = (0, __logtape_logtape.getLogger)([
|
|
|
400
385
|
async function createProof(object, privateKey, keyId, { contextLoader, context, created } = {}) {
|
|
401
386
|
require_http.validateCryptoKey(privateKey, "private");
|
|
402
387
|
if (privateKey.algorithm.name !== "Ed25519") throw new TypeError("Unsupported algorithm: " + privateKey.algorithm.name);
|
|
403
|
-
const
|
|
404
|
-
const compactMsg = await objectWithoutProofs.toJsonLd({
|
|
388
|
+
const compactMsg = await object.clone({ proofs: [] }).toJsonLd({
|
|
405
389
|
format: "compact",
|
|
406
390
|
contextLoader,
|
|
407
391
|
context
|
|
@@ -411,22 +395,21 @@ async function createProof(object, privateKey, keyId, { contextLoader, context,
|
|
|
411
395
|
const msgBytes = encoder.encode(msgCanon);
|
|
412
396
|
const msgDigest = await crypto.subtle.digest("SHA-256", msgBytes);
|
|
413
397
|
created ??= Temporal.Now.instant();
|
|
414
|
-
const
|
|
398
|
+
const proofCanon = (0, json_canon.default)({
|
|
415
399
|
"@context": compactMsg["@context"],
|
|
416
400
|
type: "DataIntegrityProof",
|
|
417
401
|
cryptosuite: "eddsa-jcs-2022",
|
|
418
402
|
verificationMethod: keyId.href,
|
|
419
403
|
proofPurpose: "assertionMethod",
|
|
420
404
|
created: created.toString()
|
|
421
|
-
};
|
|
422
|
-
const proofCanon = (0, json_canon.default)(proofConfig);
|
|
405
|
+
});
|
|
423
406
|
const proofBytes = encoder.encode(proofCanon);
|
|
424
407
|
const proofDigest = await crypto.subtle.digest("SHA-256", proofBytes);
|
|
425
408
|
const digest = new Uint8Array(proofDigest.byteLength + msgDigest.byteLength);
|
|
426
409
|
digest.set(new Uint8Array(proofDigest), 0);
|
|
427
410
|
digest.set(new Uint8Array(msgDigest), proofDigest.byteLength);
|
|
428
411
|
const sig = await crypto.subtle.sign("Ed25519", privateKey, digest);
|
|
429
|
-
return new
|
|
412
|
+
return new _fedify_vocab.DataIntegrityProof({
|
|
430
413
|
cryptosuite: "eddsa-jcs-2022",
|
|
431
414
|
verificationMethod: keyId,
|
|
432
415
|
proofPurpose: "assertionMethod",
|
|
@@ -445,13 +428,11 @@ async function createProof(object, privateKey, keyId, { contextLoader, context,
|
|
|
445
428
|
* @since 0.10.0
|
|
446
429
|
*/
|
|
447
430
|
async function signObject(object, privateKey, keyId, options = {}) {
|
|
448
|
-
|
|
449
|
-
const tracer = tracerProvider.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
450
|
-
return await tracer.startActiveSpan("object_integrity_proofs.sign", { attributes: { "activitypub.object.type": (0, __fedify_vocab.getTypeId)(object).href } }, async (span) => {
|
|
431
|
+
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(require_http.name, require_http.version).startActiveSpan("object_integrity_proofs.sign", { attributes: { "activitypub.object.type": (0, _fedify_vocab.getTypeId)(object).href } }, async (span) => {
|
|
451
432
|
try {
|
|
452
433
|
if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
|
|
453
434
|
const existingProofs = [];
|
|
454
|
-
for await (const proof
|
|
435
|
+
for await (const proof of object.getProofs(options)) existingProofs.push(proof);
|
|
455
436
|
const proof = await createProof(object, privateKey, keyId, options);
|
|
456
437
|
if (span.isRecording()) {
|
|
457
438
|
if (proof.cryptosuite != null) span.setAttribute("object_integrity_proofs.cryptosuite", proof.cryptosuite);
|
|
@@ -461,7 +442,7 @@ async function signObject(object, privateKey, keyId, options = {}) {
|
|
|
461
442
|
return object.clone({ proofs: [...existingProofs, proof] });
|
|
462
443
|
} catch (error) {
|
|
463
444
|
span.setStatus({
|
|
464
|
-
code:
|
|
445
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
465
446
|
message: String(error)
|
|
466
447
|
});
|
|
467
448
|
throw error;
|
|
@@ -481,9 +462,7 @@ async function signObject(object, privateKey, keyId, options = {}) {
|
|
|
481
462
|
* @since 0.10.0
|
|
482
463
|
*/
|
|
483
464
|
async function verifyProof(jsonLd, proof, options = {}) {
|
|
484
|
-
|
|
485
|
-
const tracer = tracerProvider.getTracer(require_http.deno_default.name, require_http.deno_default.version);
|
|
486
|
-
return await tracer.startActiveSpan("object_integrity_proofs.verify", async (span) => {
|
|
465
|
+
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(require_http.name, require_http.version).startActiveSpan("object_integrity_proofs.verify", async (span) => {
|
|
487
466
|
if (span.isRecording()) {
|
|
488
467
|
if (proof.cryptosuite != null) span.setAttribute("object_integrity_proofs.cryptosuite", proof.cryptosuite);
|
|
489
468
|
if (proof.verificationMethodId != null) span.setAttribute("object_integrity_proofs.key_id", proof.verificationMethodId.href);
|
|
@@ -491,11 +470,11 @@ async function verifyProof(jsonLd, proof, options = {}) {
|
|
|
491
470
|
}
|
|
492
471
|
try {
|
|
493
472
|
const key = await verifyProofInternal(jsonLd, proof, options);
|
|
494
|
-
if (key == null) span.setStatus({ code:
|
|
473
|
+
if (key == null) span.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
|
|
495
474
|
return key;
|
|
496
475
|
} catch (error) {
|
|
497
476
|
span.setStatus({
|
|
498
|
-
code:
|
|
477
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
499
478
|
message: String(error)
|
|
500
479
|
});
|
|
501
480
|
throw error;
|
|
@@ -506,16 +485,15 @@ async function verifyProof(jsonLd, proof, options = {}) {
|
|
|
506
485
|
}
|
|
507
486
|
async function verifyProofInternal(jsonLd, proof, options) {
|
|
508
487
|
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 = require_http.fetchKey(proof.verificationMethodId,
|
|
510
|
-
const
|
|
488
|
+
const publicKeyPromise = require_http.fetchKey(proof.verificationMethodId, _fedify_vocab.Multikey, options);
|
|
489
|
+
const proofCanon = (0, json_canon.default)({
|
|
511
490
|
"@context": jsonLd["@context"],
|
|
512
491
|
type: "DataIntegrityProof",
|
|
513
492
|
cryptosuite: proof.cryptosuite,
|
|
514
493
|
verificationMethod: proof.verificationMethodId.href,
|
|
515
494
|
proofPurpose: proof.proofPurpose,
|
|
516
495
|
created: proof.created.toString()
|
|
517
|
-
};
|
|
518
|
-
const proofCanon = (0, json_canon.default)(proofConfig);
|
|
496
|
+
});
|
|
519
497
|
const encoder = new TextEncoder();
|
|
520
498
|
const proofBytes = encoder.encode(proofCanon);
|
|
521
499
|
const proofDigest = await crypto.subtle.digest("SHA-256", proofBytes);
|
|
@@ -566,8 +544,7 @@ async function verifyProofInternal(jsonLd, proof, options) {
|
|
|
566
544
|
});
|
|
567
545
|
return null;
|
|
568
546
|
}
|
|
569
|
-
|
|
570
|
-
if (!verified) {
|
|
547
|
+
if (!await crypto.subtle.verify("Ed25519", publicKey.publicKey, proof.proofValue.slice(), digest)) {
|
|
571
548
|
if (fetchedKey.cached) {
|
|
572
549
|
logger.debug("Failed to verify the proof with the cached key {keyId}; retrying with the freshly fetched key...", {
|
|
573
550
|
keyId: proof.verificationMethodId.href,
|
|
@@ -604,106 +581,105 @@ async function verifyProofInternal(jsonLd, proof, options) {
|
|
|
604
581
|
* @since 0.10.0
|
|
605
582
|
*/
|
|
606
583
|
async function verifyObject(cls, jsonLd, options = {}) {
|
|
607
|
-
const logger
|
|
584
|
+
const logger = (0, _logtape_logtape.getLogger)([
|
|
608
585
|
"fedify",
|
|
609
586
|
"sig",
|
|
610
587
|
"proof"
|
|
611
588
|
]);
|
|
612
589
|
const object = await cls.fromJsonLd(jsonLd, options);
|
|
613
590
|
const attributions = new Set(object.attributionIds.map((uri) => uri.href));
|
|
614
|
-
if (object instanceof
|
|
591
|
+
if (object instanceof _fedify_vocab.Activity) for (const uri of object.actorIds) attributions.add(uri.href);
|
|
615
592
|
for await (const proof of object.getProofs(options)) {
|
|
616
593
|
const key = await verifyProof(jsonLd, proof, options);
|
|
617
594
|
if (key === null) return null;
|
|
618
595
|
if (key.controllerId == null) {
|
|
619
|
-
logger
|
|
596
|
+
logger.debug("Key {keyId} does not have a controller.", { keyId: key.id?.href });
|
|
620
597
|
continue;
|
|
621
598
|
}
|
|
622
599
|
attributions.delete(key.controllerId.href);
|
|
623
600
|
}
|
|
624
601
|
if (attributions.size > 0) {
|
|
625
|
-
logger
|
|
602
|
+
logger.debug("Some attributions are not authenticated by the proofs: {attributions}.", { attributions: [...attributions] });
|
|
626
603
|
return null;
|
|
627
604
|
}
|
|
628
605
|
return object;
|
|
629
606
|
}
|
|
630
|
-
|
|
631
607
|
//#endregion
|
|
632
|
-
Object.defineProperty(exports,
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
608
|
+
Object.defineProperty(exports, "attachSignature", {
|
|
609
|
+
enumerable: true,
|
|
610
|
+
get: function() {
|
|
611
|
+
return attachSignature;
|
|
612
|
+
}
|
|
637
613
|
});
|
|
638
|
-
Object.defineProperty(exports,
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
614
|
+
Object.defineProperty(exports, "createProof", {
|
|
615
|
+
enumerable: true,
|
|
616
|
+
get: function() {
|
|
617
|
+
return createProof;
|
|
618
|
+
}
|
|
619
|
+
});
|
|
620
|
+
Object.defineProperty(exports, "createSignature", {
|
|
621
|
+
enumerable: true,
|
|
622
|
+
get: function() {
|
|
623
|
+
return createSignature;
|
|
624
|
+
}
|
|
643
625
|
});
|
|
644
|
-
Object.defineProperty(exports,
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
626
|
+
Object.defineProperty(exports, "detachSignature", {
|
|
627
|
+
enumerable: true,
|
|
628
|
+
get: function() {
|
|
629
|
+
return detachSignature;
|
|
630
|
+
}
|
|
649
631
|
});
|
|
650
|
-
Object.defineProperty(exports,
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
632
|
+
Object.defineProperty(exports, "doesActorOwnKey", {
|
|
633
|
+
enumerable: true,
|
|
634
|
+
get: function() {
|
|
635
|
+
return doesActorOwnKey;
|
|
636
|
+
}
|
|
655
637
|
});
|
|
656
|
-
Object.defineProperty(exports,
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
638
|
+
Object.defineProperty(exports, "getKeyOwner", {
|
|
639
|
+
enumerable: true,
|
|
640
|
+
get: function() {
|
|
641
|
+
return getKeyOwner;
|
|
642
|
+
}
|
|
661
643
|
});
|
|
662
|
-
Object.defineProperty(exports,
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
644
|
+
Object.defineProperty(exports, "hasSignature", {
|
|
645
|
+
enumerable: true,
|
|
646
|
+
get: function() {
|
|
647
|
+
return hasSignature;
|
|
648
|
+
}
|
|
667
649
|
});
|
|
668
|
-
Object.defineProperty(exports,
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
650
|
+
Object.defineProperty(exports, "signJsonLd", {
|
|
651
|
+
enumerable: true,
|
|
652
|
+
get: function() {
|
|
653
|
+
return signJsonLd;
|
|
654
|
+
}
|
|
673
655
|
});
|
|
674
|
-
Object.defineProperty(exports,
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
656
|
+
Object.defineProperty(exports, "signObject", {
|
|
657
|
+
enumerable: true,
|
|
658
|
+
get: function() {
|
|
659
|
+
return signObject;
|
|
660
|
+
}
|
|
679
661
|
});
|
|
680
|
-
Object.defineProperty(exports,
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
662
|
+
Object.defineProperty(exports, "verifyJsonLd", {
|
|
663
|
+
enumerable: true,
|
|
664
|
+
get: function() {
|
|
665
|
+
return verifyJsonLd;
|
|
666
|
+
}
|
|
685
667
|
});
|
|
686
|
-
Object.defineProperty(exports,
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
668
|
+
Object.defineProperty(exports, "verifyObject", {
|
|
669
|
+
enumerable: true,
|
|
670
|
+
get: function() {
|
|
671
|
+
return verifyObject;
|
|
672
|
+
}
|
|
691
673
|
});
|
|
692
|
-
Object.defineProperty(exports,
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
674
|
+
Object.defineProperty(exports, "verifyProof", {
|
|
675
|
+
enumerable: true,
|
|
676
|
+
get: function() {
|
|
677
|
+
return verifyProof;
|
|
678
|
+
}
|
|
697
679
|
});
|
|
698
|
-
Object.defineProperty(exports,
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
680
|
+
Object.defineProperty(exports, "verifySignature", {
|
|
681
|
+
enumerable: true,
|
|
682
|
+
get: function() {
|
|
683
|
+
return verifySignature;
|
|
684
|
+
}
|
|
703
685
|
});
|
|
704
|
-
Object.defineProperty(exports, 'verifySignature', {
|
|
705
|
-
enumerable: true,
|
|
706
|
-
get: function () {
|
|
707
|
-
return verifySignature;
|
|
708
|
-
}
|
|
709
|
-
});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
6
4
|
//#region src/federation/retry.ts
|
|
7
5
|
/**
|
|
8
6
|
* Creates an exponential backoff retry policy. The delay between retries
|
|
@@ -32,6 +30,5 @@ function createExponentialBackoffPolicy(options = {}) {
|
|
|
32
30
|
return Temporal.Duration.compare(delay, maxDelay) > 0 ? maxDelay : delay;
|
|
33
31
|
};
|
|
34
32
|
}
|
|
35
|
-
|
|
36
33
|
//#endregion
|
|
37
|
-
export { createExponentialBackoffPolicy };
|
|
34
|
+
export { createExponentialBackoffPolicy as t };
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
6
4
|
import { cloneDeep } from "es-toolkit";
|
|
7
5
|
import { Router } from "uri-template-router";
|
|
8
6
|
import { parseTemplate } from "url-template";
|
|
9
|
-
|
|
10
7
|
//#region src/federation/router.ts
|
|
11
8
|
function cloneInnerRouter(router) {
|
|
12
9
|
const clone = new Router();
|
|
@@ -113,6 +110,5 @@ var RouterError = class extends Error {
|
|
|
113
110
|
this.name = "RouterError";
|
|
114
111
|
}
|
|
115
112
|
};
|
|
116
|
-
|
|
117
113
|
//#endregion
|
|
118
|
-
export { Router$1 as
|
|
114
|
+
export { RouterError as n, Router$1 as t };
|
package/dist/runtime/mod.cjs
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
get: function () { return __fedify_vocab_runtime[k]; }
|
|
13
|
-
});
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
+
require("../chunk-DDcVe30Y.cjs");
|
|
4
|
+
var _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
5
|
+
Object.keys(_fedify_vocab_runtime).forEach(function(k) {
|
|
6
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return _fedify_vocab_runtime[k];
|
|
10
|
+
}
|
|
11
|
+
});
|
|
14
12
|
});
|
package/dist/runtime/mod.d.cts
CHANGED
package/dist/runtime/mod.d.ts
CHANGED
package/dist/runtime/mod.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import "../runtime-poamPCMb.js";
|
|
6
|
-
|
|
7
|
-
export * from "@fedify/vocab-runtime"
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
import "../chunk-nlSIicah.js";
|
|
4
|
+
export * from "@fedify/vocab-runtime";
|