@fedify/fedify 2.0.0-dev.1726 → 2.0.0-dev.1750
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 +3 -0
- package/dist/{actor-menZmmiI.js → actor-CMgHXjhs.js} +189 -677
- package/dist/{actor-dO7jHa6A.js → actor-CRS7Dbo1.js} +1 -1
- package/dist/{actor-T6RyhRgk.d.ts → actor-DqFajh9s.d.ts} +2 -2
- package/dist/{actor-Bn2RCpws.cjs → actor-JG822JBi.cjs} +921 -1451
- package/dist/{actor-D6K058Tb.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-CGF1vv7G.js → builder-D44QzfuD.js} +3 -4
- package/dist/{client-CegPX0Rn.d.cts → client-94iWEfQa.d.cts} +1 -1
- package/dist/{client-bgSdkFa2.d.ts → client-BsGzbnV-.d.ts} +1 -1
- package/dist/{client-BfzV3u96.js → client-pY7-3icS.js} +1 -1
- package/dist/compat/mod.d.cts +11 -12
- package/dist/compat/mod.d.ts +11 -12
- package/dist/compat/transformers.test.js +20 -20
- package/dist/{context-B1X8-X33.d.ts → context-DG0huGW-.d.ts} +25 -55
- package/dist/{context-DYCJXr7J.d.cts → context-DJ8aSy2Q.d.cts} +25 -55
- package/dist/{authdocloader-DevmXsTo.js → docloader-BvlqkI1M.js} +17 -8
- package/dist/{esm-BODOj_Oi.js → esm-BZMLn6gu.js} +11 -11
- package/dist/federation/builder.test.js +8 -10
- package/dist/federation/collection.test.js +7 -9
- package/dist/federation/handler.test.js +25 -26
- package/dist/federation/idempotency.test.js +25 -26
- 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 +26 -27
- package/dist/federation/mod.cjs +9 -11
- package/dist/federation/mod.d.cts +11 -12
- package/dist/federation/mod.d.ts +11 -12
- package/dist/federation/mod.js +9 -11
- package/dist/federation/mq.test.js +8 -10
- package/dist/federation/negotiation.test.js +7 -9
- package/dist/federation/retry.test.js +4 -5
- package/dist/federation/router.test.js +6 -8
- package/dist/federation/send.test.js +13 -15
- package/dist/{http-gHyCrTrX.js → http-BPsXiq3Y.js} +256 -6
- package/dist/{http-D6Uj2x2y.d.ts → http-BbO0ejuk.d.ts} +2 -2
- package/dist/{http-BmbMWfmh.cjs → http-CPqfuthT.cjs} +289 -9
- package/dist/{http-Danw_xTY.js → http-DIsJckI7.js} +2 -2
- package/dist/{http-D-e6AFwR.d.cts → http-M8k5mKc0.d.cts} +2 -2
- package/dist/{inbox-Blp5F74G.js → inbox-24__vIeD.js} +1 -1
- package/dist/{key-CIIkeide.js → key-CcqQC_vj.js} +3 -2
- package/dist/{keycache-Covv8lvK.js → keycache-BUF-P0-V.js} +1 -1
- package/dist/{keys-DZ1bqhJz.js → keys-DSikT9wk.js} +2 -1
- package/dist/kv-cache-CBOkGH5t.js +121 -0
- package/dist/kv-cache-gyMh96Y-.cjs +133 -0
- package/dist/kv-cache-z0lgwFi_.js +93 -0
- package/dist/{ld-C7KL1MK2.js → ld-C5wht8V2.js} +3 -2
- package/dist/lookup-BE8ZMmug.js +261 -0
- package/dist/{type-D_8QzkEn.js → lookup-CxJLpHHf.js} +503 -5327
- package/dist/lookup-Doq5XdGY.cjs +273 -0
- package/dist/{middleware-HKKY6sAX.js → middleware-BImvTjdU.js} +18 -17
- package/dist/middleware-BsLmqSNx.cjs +15 -0
- package/dist/middleware-CdFqipch.js +15 -0
- package/dist/{middleware-C60xXvWx.cjs → middleware-ClcQM1de.cjs} +30 -31
- package/dist/{middleware-DXOZ6_ST.js → middleware-D5NFjhOL.js} +10 -11
- package/dist/middleware-ZZJaIUDZ.js +26 -0
- package/dist/{mod-BhUKmBJD.d.ts → mod-B2iOw50L.d.ts} +3 -3
- package/dist/mod-BYynOiJG.d.ts +109 -0
- package/dist/{mod-DlU8ISoa.d.ts → mod-BlVovdcy.d.ts} +2 -2
- package/dist/{mod-DcKxhFQ8.d.ts → mod-BoHnwOCs.d.ts} +2 -2
- package/dist/{mod-CxkWO3Mg.d.cts → mod-BxRCHTz-.d.cts} +2 -2
- package/dist/{mod-jQ4OODsl.d.cts → mod-C58MZ7Wx.d.cts} +1 -1
- package/dist/{mod-twdvV2hR.d.cts → mod-DJcZDvjA.d.cts} +2 -2
- package/dist/{mod-Djzcw2ry.d.cts → mod-DgdBYYa0.d.cts} +3 -3
- package/dist/{mod-DBzN0aCM.d.ts → mod-Ds0mpFZU.d.ts} +1 -1
- package/dist/mod-VastcQsk.d.cts +107 -0
- package/dist/mod.cjs +19 -32
- package/dist/mod.d.cts +15 -16
- package/dist/mod.d.ts +16 -17
- package/dist/mod.js +14 -16
- package/dist/nodeinfo/client.test.js +8 -10
- package/dist/nodeinfo/handler.test.js +24 -25
- package/dist/nodeinfo/mod.cjs +2 -3
- package/dist/nodeinfo/mod.d.cts +2 -4
- package/dist/nodeinfo/mod.d.ts +2 -4
- package/dist/nodeinfo/mod.js +2 -3
- package/dist/nodeinfo/types.test.js +7 -9
- package/dist/{owner-BN_tO3cY.d.cts → owner-B4HbyP8s.d.cts} +3 -3
- package/dist/{owner-COcyel6J.js → owner-DIa5WpbP.js} +3 -2
- package/dist/{owner-hd9lvQcP.d.ts → owner-kQRGVXG1.d.ts} +3 -3
- package/dist/{proof-Cpk853lc.js → proof-CCzhKDDB.js} +2 -2
- package/dist/{proof-D6pbnNx2.js → proof-D0ak0hhc.js} +5 -4
- package/dist/{proof-CMJcrQoM.cjs → proof-DTKtjEh_.cjs} +17 -16
- package/dist/{send-C7A7_big.js → send-BWfkS2zO.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 +10 -12
- package/dist/sig/proof.test.js +13 -14
- package/dist/testing/docloader.test.js +6 -8
- package/dist/testing/mod.d.ts +16 -131
- package/dist/testing/mod.js +2 -3
- package/dist/{testing-e8Kpb1uV.js → testing-BHLtJbQx.js} +1 -2
- package/dist/{types-Db4ukgX8.js → types-BtUjyi5y.js} +1 -1
- package/dist/{types-LjTL4QMx.cjs → types-CWgzGaqk.cjs} +3 -3
- package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +14 -15
- package/dist/utils/kv-cache.test.js +209 -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 +7 -9
- 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 +9 -10
- package/dist/{vocab-BI0Ak5lL.d.ts → vocab-BCWe1Ih5.d.ts} +2 -21
- package/dist/{vocab-DLHpZwOW.cjs → vocab-C3ZbIV8S.cjs} +5 -5
- package/dist/{vocab-Dw1-yVGg.d.cts → vocab-CeDBzu-f.d.cts} +2 -21
- package/dist/{vocab-CJHF7Q71.js → vocab-CjheaIIe.js} +3 -3
- 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/dist/x/cfworkers.d.cts +2 -2
- package/dist/x/cfworkers.d.ts +2 -2
- package/dist/x/cfworkers.test.js +6 -8
- package/dist/x/hono.d.cts +10 -11
- package/dist/x/hono.d.ts +10 -11
- package/dist/x/sveltekit.d.cts +10 -11
- package/dist/x/sveltekit.d.ts +10 -11
- package/package.json +15 -14
- package/dist/assert_throws-BOO88avQ.js +0 -39
- package/dist/authdocloader-CEqdZdT7.cjs +0 -58
- package/dist/authdocloader-CZsCIRLV.js +0 -52
- package/dist/docloader-Buh0Ah9G.cjs +0 -4861
- package/dist/docloader-CxWcuWqQ.d.ts +0 -221
- package/dist/docloader-D-MrRyHl.d.cts +0 -219
- package/dist/docloader-DOmINJ1U.js +0 -4795
- package/dist/key-B2cp5-JF.js +0 -10
- package/dist/key-BR1W25rw.cjs +0 -290
- package/dist/key-BnjofJ4e.js +0 -260
- package/dist/key-DhflzsBJ.cjs +0 -10
- package/dist/key-WES6wszI.js +0 -10
- package/dist/lookup-CDOxr8vw.cjs +0 -137
- package/dist/lookup-D8tCnUj2.js +0 -131
- package/dist/lookup-VSVPBU3J.js +0 -331
- package/dist/middleware-9KSLASn7.js +0 -17
- package/dist/middleware-CH0PNtaj.cjs +0 -17
- package/dist/middleware-CrzCnpdt.js +0 -26
- package/dist/mod-CerN_Sza.d.ts +0 -104
- package/dist/mod-Cj1tHXBR.d.cts +0 -102
- package/dist/runtime/docloader.test.js +0 -522
- 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 -39
- 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/{assert_not_equals-f3m3epl3.js → assert_not_equals-C80BG-_5.js} +0 -0
- /package/dist/{collection-CcnIw1qY.js → collection-BzWsN9pB.js} +0 -0
- /package/dist/{denokv-Bv33Xxea.js → denokv-CCssOzMJ.js} +0 -0
- /package/dist/{federation-H2_En3j5.cjs → federation-CRpdnOMS.cjs} +0 -0
- /package/dist/{federation-D1U8YY9t.js → federation-jcR8-ZxP.js} +0 -0
- /package/dist/{kv-C7sopW2E.d.ts → kv-BKNZ-Tb-.d.ts} +0 -0
- /package/dist/{kv-63Cil1MD.d.cts → kv-Bxr0Q87_.d.cts} +0 -0
- /package/dist/{mod-FZd39qVq.d.cts → mod-B-hUPT2N.d.cts} +0 -0
- /package/dist/{mod-1pDWKvUL.d.ts → mod-CVgZgliM.d.ts} +0 -0
- /package/dist/{mod-g0xFzAP9.d.ts → mod-xIj-IT58.d.ts} +0 -0
- /package/dist/{mq-CRGm1e_F.d.ts → mq-CUKlBw08.d.ts} +0 -0
- /package/dist/{mq-B7R1Q-M5.d.cts → mq-DcJPkXD5.d.cts} +0 -0
- /package/dist/{negotiation-5NPJL6zp.js → negotiation-C4nFufNk.js} +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/{types-BSuWJsOm.js → types-C2XVl6gj.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
@@ -0,0 +1,273 @@
|
|
1
|
+
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
4
|
+
|
5
|
+
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
6
|
+
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
7
|
+
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
8
|
+
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
9
|
+
|
10
|
+
//#region deno.json
|
11
|
+
var name = "@fedify/fedify";
|
12
|
+
var version = "2.0.0-dev.1750+6dbfd010";
|
13
|
+
var license = "MIT";
|
14
|
+
var exports$1 = {
|
15
|
+
".": "./src/mod.ts",
|
16
|
+
"./compat": "./src/compat/mod.ts",
|
17
|
+
"./federation": "./src/federation/mod.ts",
|
18
|
+
"./nodeinfo": "./src/nodeinfo/mod.ts",
|
19
|
+
"./sig": "./src/sig/mod.ts",
|
20
|
+
"./testing": "./src/testing/mod.ts",
|
21
|
+
"./vocab": "./src/vocab/mod.ts",
|
22
|
+
"./utils": "./src/utils/mod.ts",
|
23
|
+
"./webfinger": "./src/webfinger/mod.ts",
|
24
|
+
"./x/cfworkers": "./src/x/cfworkers.ts",
|
25
|
+
"./x/denokv": "./src/x/denokv.ts",
|
26
|
+
"./x/fresh": "./src/x/fresh.ts",
|
27
|
+
"./x/hono": "./src/x/hono.ts",
|
28
|
+
"./x/sveltekit": "./src/x/sveltekit.ts"
|
29
|
+
};
|
30
|
+
var imports = {
|
31
|
+
"@cfworker/json-schema": "npm:@cfworker/json-schema@^4.1.1",
|
32
|
+
"@multiformats/base-x": "npm:@multiformats/base-x@^4.0.1",
|
33
|
+
"@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
|
34
|
+
"@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.27.0",
|
35
|
+
"@std/assert": "jsr:@std/assert@^0.226.0",
|
36
|
+
"@std/testing": "jsr:@std/testing@^0.224.0",
|
37
|
+
"@std/url": "jsr:@std/url@^0.225.1",
|
38
|
+
"asn1js": "npm:asn1js@^3.0.5",
|
39
|
+
"byte-encodings": "npm:byte-encodings@^1.0.11",
|
40
|
+
"es-toolkit": "jsr:@es-toolkit/es-toolkit@^1.39.5",
|
41
|
+
"fast-check": "npm:fast-check@^3.22.0",
|
42
|
+
"fetch-mock": "npm:fetch-mock@^12.5.2",
|
43
|
+
"json-canon": "npm:json-canon@^1.0.1",
|
44
|
+
"jsonld": "npm:jsonld@^8.3.2",
|
45
|
+
"multicodec": "npm:multicodec@^3.2.1",
|
46
|
+
"pkijs": "npm:pkijs@^3.2.4",
|
47
|
+
"structured-field-values": "npm:structured-field-values@^2.0.4",
|
48
|
+
"uri-template-router": "npm:uri-template-router@^0.0.17",
|
49
|
+
"url-template": "npm:url-template@^3.1.1"
|
50
|
+
};
|
51
|
+
var include = ["src/vocab/vocab.ts"];
|
52
|
+
var exclude = [
|
53
|
+
".test-report.xml",
|
54
|
+
"apidoc/",
|
55
|
+
"dist/",
|
56
|
+
"node_modules/",
|
57
|
+
"npm/",
|
58
|
+
"pnpm-lock.yaml",
|
59
|
+
"src/cfworkers/dist/",
|
60
|
+
"src/cfworkers/fixtures/",
|
61
|
+
"src/cfworkers/imports.ts",
|
62
|
+
"src/cfworkers/README.md",
|
63
|
+
"src/cfworkers/server.ts",
|
64
|
+
"src/cfworkers/server.js",
|
65
|
+
"src/cfworkers/server.js.map",
|
66
|
+
"src/codegen/schema.yaml",
|
67
|
+
"src/vocab/*.yaml",
|
68
|
+
"!src/vocab/vocab.ts"
|
69
|
+
];
|
70
|
+
var tasks = {
|
71
|
+
"codegen": "GENPATH=vocab-$(deno eval \"console.log(crypto.randomUUID());\").ts && deno run --allow-read --allow-write --check src/codegen/main.ts src/vocab/ src/vocab/$GENPATH && deno fmt src/vocab/$GENPATH && mv src/vocab/$GENPATH src/vocab/vocab.ts && deno cache src/vocab/vocab.ts && deno check src/vocab/vocab.ts",
|
72
|
+
"cache": {
|
73
|
+
"command": "deno cache src/mod.ts",
|
74
|
+
"dependencies": ["codegen"]
|
75
|
+
},
|
76
|
+
"check": {
|
77
|
+
"command": "deno fmt --check && deno lint && deno check src/**/*.ts",
|
78
|
+
"dependencies": ["codegen"]
|
79
|
+
},
|
80
|
+
"test": {
|
81
|
+
"command": "deno test --check --doc --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel",
|
82
|
+
"dependencies": ["codegen"]
|
83
|
+
},
|
84
|
+
"coverage": "deno task test --clean --coverage && deno coverage --html coverage",
|
85
|
+
"bench": {
|
86
|
+
"command": "deno bench --allow-read --allow-write --allow-net --allow-env --allow-run --unstable-kv",
|
87
|
+
"dependencies": ["codegen"]
|
88
|
+
},
|
89
|
+
"apidoc": {
|
90
|
+
"command": "deno doc --html --name=Fedify --output=apidoc/ src/mod.ts",
|
91
|
+
"dependencies": ["codegen"]
|
92
|
+
},
|
93
|
+
"publish": {
|
94
|
+
"command": "deno publish",
|
95
|
+
"dependencies": ["codegen"]
|
96
|
+
},
|
97
|
+
"pnpm:install": "pnpm install --silent",
|
98
|
+
"pnpm:build": {
|
99
|
+
"command": "pnpm exec tsdown",
|
100
|
+
"dependencies": [
|
101
|
+
"codegen",
|
102
|
+
"pnpm:install",
|
103
|
+
"pnpm:build-vocab"
|
104
|
+
]
|
105
|
+
},
|
106
|
+
"pnpm:build-vocab-runtime": { "command": "cd ../vocab-runtime && pnpm build" },
|
107
|
+
"pnpm:build-vocab": { "dependencies": ["pnpm:build-vocab-runtime"] },
|
108
|
+
"test:node": {
|
109
|
+
"command": "cd dist/ && node --test",
|
110
|
+
"dependencies": ["pnpm:build"]
|
111
|
+
},
|
112
|
+
"test:bun": {
|
113
|
+
"command": "cd dist/ && bun test --timeout 60000",
|
114
|
+
"dependencies": ["pnpm:build-vocab", "pnpm:build"]
|
115
|
+
},
|
116
|
+
"test:cfworkers": {
|
117
|
+
"command": "pnpm exec wrangler deploy --dry-run --outdir src/cfworkers && node --import=tsx src/cfworkers/client.ts",
|
118
|
+
"dependencies": ["pnpm:build-vocab", "pnpm:build"]
|
119
|
+
},
|
120
|
+
"test-all": { "dependencies": [
|
121
|
+
"check",
|
122
|
+
"test",
|
123
|
+
"test:node",
|
124
|
+
"test:bun",
|
125
|
+
"test:cfworkers"
|
126
|
+
] }
|
127
|
+
};
|
128
|
+
var deno_default = {
|
129
|
+
name,
|
130
|
+
version,
|
131
|
+
license,
|
132
|
+
exports: exports$1,
|
133
|
+
imports,
|
134
|
+
include,
|
135
|
+
exclude,
|
136
|
+
tasks
|
137
|
+
};
|
138
|
+
|
139
|
+
//#endregion
|
140
|
+
//#region src/webfinger/lookup.ts
|
141
|
+
const logger = (0, __logtape_logtape.getLogger)([
|
142
|
+
"fedify",
|
143
|
+
"webfinger",
|
144
|
+
"lookup"
|
145
|
+
]);
|
146
|
+
const DEFAULT_MAX_REDIRECTION = 5;
|
147
|
+
/**
|
148
|
+
* Looks up a WebFinger resource.
|
149
|
+
* @param resource The resource URL to look up.
|
150
|
+
* @param options Extra options for looking up the resource.
|
151
|
+
* @returns The resource descriptor, or `null` if not found.
|
152
|
+
* @since 0.2.0
|
153
|
+
*/
|
154
|
+
async function lookupWebFinger(resource, options = {}) {
|
155
|
+
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
156
|
+
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
157
|
+
return await tracer.startActiveSpan("webfinger.lookup", {
|
158
|
+
kind: __opentelemetry_api.SpanKind.CLIENT,
|
159
|
+
attributes: {
|
160
|
+
"webfinger.resource": resource.toString(),
|
161
|
+
"webfinger.resource.scheme": typeof resource === "string" ? resource.replace(/:.*$/, "") : resource.protocol.replace(/:$/, "")
|
162
|
+
}
|
163
|
+
}, async (span) => {
|
164
|
+
try {
|
165
|
+
const result = await lookupWebFingerInternal(resource, options);
|
166
|
+
span.setStatus({ code: result === null ? __opentelemetry_api.SpanStatusCode.ERROR : __opentelemetry_api.SpanStatusCode.OK });
|
167
|
+
return result;
|
168
|
+
} catch (error) {
|
169
|
+
span.setStatus({
|
170
|
+
code: __opentelemetry_api.SpanStatusCode.ERROR,
|
171
|
+
message: String(error)
|
172
|
+
});
|
173
|
+
throw error;
|
174
|
+
} finally {
|
175
|
+
span.end();
|
176
|
+
}
|
177
|
+
});
|
178
|
+
}
|
179
|
+
async function lookupWebFingerInternal(resource, options = {}) {
|
180
|
+
if (typeof resource === "string") resource = new URL(resource);
|
181
|
+
let protocol = "https:";
|
182
|
+
let server;
|
183
|
+
if (resource.protocol === "acct:") {
|
184
|
+
const atPos = resource.pathname.lastIndexOf("@");
|
185
|
+
if (atPos < 0) return null;
|
186
|
+
server = resource.pathname.substring(atPos + 1);
|
187
|
+
if (server === "") return null;
|
188
|
+
} else {
|
189
|
+
protocol = resource.protocol;
|
190
|
+
server = resource.host;
|
191
|
+
}
|
192
|
+
let url = new URL(`${protocol}//${server}/.well-known/webfinger`);
|
193
|
+
url.searchParams.set("resource", resource.href);
|
194
|
+
let redirected = 0;
|
195
|
+
while (true) {
|
196
|
+
logger.debug("Fetching WebFinger resource descriptor from {url}...", { url: url.href });
|
197
|
+
let response;
|
198
|
+
if (options.allowPrivateAddress !== true) try {
|
199
|
+
await (0, __fedify_vocab_runtime.validatePublicUrl)(url.href);
|
200
|
+
} catch (e) {
|
201
|
+
if (e instanceof __fedify_vocab_runtime.UrlError) {
|
202
|
+
logger.error("Invalid URL for WebFinger resource descriptor: {error}", { error: e });
|
203
|
+
return null;
|
204
|
+
}
|
205
|
+
throw e;
|
206
|
+
}
|
207
|
+
try {
|
208
|
+
response = await fetch(url, {
|
209
|
+
headers: {
|
210
|
+
Accept: "application/jrd+json",
|
211
|
+
"User-Agent": typeof options.userAgent === "string" ? options.userAgent : (0, __fedify_vocab_runtime.getUserAgent)(options.userAgent)
|
212
|
+
},
|
213
|
+
redirect: "manual",
|
214
|
+
signal: options.signal
|
215
|
+
});
|
216
|
+
} catch (error) {
|
217
|
+
logger.debug("Failed to fetch WebFinger resource descriptor: {error}", {
|
218
|
+
url: url.href,
|
219
|
+
error
|
220
|
+
});
|
221
|
+
return null;
|
222
|
+
}
|
223
|
+
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
224
|
+
redirected++;
|
225
|
+
const maxRedirection = options.maxRedirection ?? DEFAULT_MAX_REDIRECTION;
|
226
|
+
if (redirected >= maxRedirection) {
|
227
|
+
logger.error("Too many redirections ({redirections}) while fetching WebFinger resource descriptor.", { redirections: redirected });
|
228
|
+
return null;
|
229
|
+
}
|
230
|
+
const redirectedUrl = new URL(response.headers.get("Location"), response.url == null || response.url === "" ? url : response.url);
|
231
|
+
if (redirectedUrl.protocol !== url.protocol) {
|
232
|
+
logger.error("Redirected to a different protocol ({protocol} to {redirectedProtocol}) while fetching WebFinger resource descriptor.", {
|
233
|
+
protocol: url.protocol,
|
234
|
+
redirectedProtocol: redirectedUrl.protocol
|
235
|
+
});
|
236
|
+
return null;
|
237
|
+
}
|
238
|
+
url = redirectedUrl;
|
239
|
+
continue;
|
240
|
+
}
|
241
|
+
if (!response.ok) {
|
242
|
+
logger.debug("Failed to fetch WebFinger resource descriptor: {status} {statusText}.", {
|
243
|
+
url: url.href,
|
244
|
+
status: response.status,
|
245
|
+
statusText: response.statusText
|
246
|
+
});
|
247
|
+
return null;
|
248
|
+
}
|
249
|
+
try {
|
250
|
+
return await response.json();
|
251
|
+
} catch (e) {
|
252
|
+
if (e instanceof SyntaxError) {
|
253
|
+
logger.debug("Failed to parse WebFinger resource descriptor as JSON: {error}", { error: e });
|
254
|
+
return null;
|
255
|
+
}
|
256
|
+
throw e;
|
257
|
+
}
|
258
|
+
}
|
259
|
+
}
|
260
|
+
|
261
|
+
//#endregion
|
262
|
+
Object.defineProperty(exports, 'deno_default', {
|
263
|
+
enumerable: true,
|
264
|
+
get: function () {
|
265
|
+
return deno_default;
|
266
|
+
}
|
267
|
+
});
|
268
|
+
Object.defineProperty(exports, 'lookupWebFinger', {
|
269
|
+
enumerable: true,
|
270
|
+
get: function () {
|
271
|
+
return lookupWebFinger;
|
272
|
+
}
|
273
|
+
});
|
@@ -3,23 +3,24 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage,
|
7
|
-
import { getNodeInfo } from "./client-
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
import {
|
16
|
-
import { routeActivity } from "./inbox-
|
17
|
-
import { FederationBuilderImpl } from "./builder-
|
18
|
-
import { buildCollectionSynchronizationHeader } from "./collection-
|
19
|
-
import { KvKeyCache } from "./keycache-
|
20
|
-
import { acceptsJsonLd } from "./negotiation-
|
21
|
-
import { createExponentialBackoffPolicy } from "./retry-
|
22
|
-
import { extractInboxes, sendActivity } from "./send-
|
6
|
+
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, RouterError, deno_default, getTypeId, lookupObject, lookupWebFinger, traverseCollection } from "./lookup-CxJLpHHf.js";
|
7
|
+
import { getNodeInfo } from "./client-pY7-3icS.js";
|
8
|
+
import { nodeInfoToJson } from "./types-C2XVl6gj.js";
|
9
|
+
import { exportJwk, importJwk, validateCryptoKey } from "./key-CcqQC_vj.js";
|
10
|
+
import { verifyRequest } from "./http-DIsJckI7.js";
|
11
|
+
import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-C5wht8V2.js";
|
12
|
+
import { doesActorOwnKey, getKeyOwner } from "./owner-DIa5WpbP.js";
|
13
|
+
import { signObject, verifyObject } from "./proof-CCzhKDDB.js";
|
14
|
+
import { getAuthenticatedDocumentLoader } from "./docloader-BvlqkI1M.js";
|
15
|
+
import { kvCache } from "./kv-cache-z0lgwFi_.js";
|
16
|
+
import { routeActivity } from "./inbox-24__vIeD.js";
|
17
|
+
import { FederationBuilderImpl } from "./builder-D44QzfuD.js";
|
18
|
+
import { buildCollectionSynchronizationHeader } from "./collection-BzWsN9pB.js";
|
19
|
+
import { KvKeyCache } from "./keycache-BUF-P0-V.js";
|
20
|
+
import { acceptsJsonLd } from "./negotiation-C4nFufNk.js";
|
21
|
+
import { createExponentialBackoffPolicy } from "./retry-CfF8Gn4d.js";
|
22
|
+
import { extractInboxes, sendActivity } from "./send-BWfkS2zO.js";
|
23
|
+
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
23
24
|
import { getLogger, withContext } from "@logtape/logtape";
|
24
25
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
25
26
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
4
|
+
|
5
|
+
require('./transformers-CoBS-oFG.cjs');
|
6
|
+
require('./lookup-Doq5XdGY.cjs');
|
7
|
+
require('./actor-JG822JBi.cjs');
|
8
|
+
const require_middleware = require('./middleware-ClcQM1de.cjs');
|
9
|
+
require('./http-CPqfuthT.cjs');
|
10
|
+
require('./proof-DTKtjEh_.cjs');
|
11
|
+
require('./types-CWgzGaqk.cjs');
|
12
|
+
require('./kv-cache-gyMh96Y-.cjs');
|
13
|
+
require('./vocab-C3ZbIV8S.cjs');
|
14
|
+
|
15
|
+
exports.FederationImpl = require_middleware.FederationImpl;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
|
5
|
+
import "./transformers-BFT6d7J5.js";
|
6
|
+
import "./lookup-BE8ZMmug.js";
|
7
|
+
import "./actor-CMgHXjhs.js";
|
8
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-D5NFjhOL.js";
|
9
|
+
import "./http-BPsXiq3Y.js";
|
10
|
+
import "./proof-D0ak0hhc.js";
|
11
|
+
import "./types-BtUjyi5y.js";
|
12
|
+
import "./kv-cache-CBOkGH5t.js";
|
13
|
+
import "./vocab-CjheaIIe.js";
|
14
|
+
|
15
|
+
export { FederationImpl };
|
@@ -4,21 +4,20 @@
|
|
4
4
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
6
6
|
const require_transformers = require('./transformers-CoBS-oFG.cjs');
|
7
|
-
const
|
8
|
-
const require_actor = require('./actor-
|
9
|
-
const
|
10
|
-
const
|
11
|
-
const
|
12
|
-
const
|
13
|
-
const
|
14
|
-
const require_authdocloader = require('./authdocloader-CEqdZdT7.cjs');
|
15
|
-
const require_vocab = require('./vocab-DLHpZwOW.cjs');
|
7
|
+
const require_lookup = require('./lookup-Doq5XdGY.cjs');
|
8
|
+
const require_actor = require('./actor-JG822JBi.cjs');
|
9
|
+
const require_http = require('./http-CPqfuthT.cjs');
|
10
|
+
const require_proof = require('./proof-DTKtjEh_.cjs');
|
11
|
+
const require_types = require('./types-CWgzGaqk.cjs');
|
12
|
+
const require_kv_cache = require('./kv-cache-gyMh96Y-.cjs');
|
13
|
+
const require_vocab = require('./vocab-C3ZbIV8S.cjs');
|
16
14
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
17
15
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
18
|
-
const
|
16
|
+
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
19
17
|
const es_toolkit = require_chunk.__toESM(require("es-toolkit"));
|
20
18
|
const uri_template_router = require_chunk.__toESM(require("uri-template-router"));
|
21
19
|
const url_template = require_chunk.__toESM(require("url-template"));
|
20
|
+
const byte_encodings_hex = require_chunk.__toESM(require("byte-encodings/hex"));
|
22
21
|
const __opentelemetry_semantic_conventions = require_chunk.__toESM(require("@opentelemetry/semantic-conventions"));
|
23
22
|
const node_url = require_chunk.__toESM(require("node:url"));
|
24
23
|
|
@@ -143,7 +142,7 @@ async function routeActivity({ context: ctx, json, activity, recipient, inboxLis
|
|
143
142
|
return "enqueued";
|
144
143
|
}
|
145
144
|
tracerProvider = tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
146
|
-
const tracer = tracerProvider.getTracer(
|
145
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
147
146
|
return await tracer.startActiveSpan("activitypub.dispatch_inbox_listener", { kind: __opentelemetry_api.SpanKind.INTERNAL }, async (span$1) => {
|
148
147
|
const dispatched = inboxListeners?.dispatchWithClass(activity);
|
149
148
|
if (dispatched == null) {
|
@@ -340,7 +339,7 @@ var FederationBuilderImpl = class {
|
|
340
339
|
this.collectionTypeIds = {};
|
341
340
|
}
|
342
341
|
async build(options) {
|
343
|
-
const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-
|
342
|
+
const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-BsLmqSNx.cjs"));
|
344
343
|
const f = new FederationImpl$1(options);
|
345
344
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
346
345
|
f.router = this.router.clone();
|
@@ -366,7 +365,7 @@ var FederationBuilderImpl = class {
|
|
366
365
|
return f;
|
367
366
|
}
|
368
367
|
_getTracer() {
|
369
|
-
return __opentelemetry_api.trace.getTracer(
|
368
|
+
return __opentelemetry_api.trace.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
370
369
|
}
|
371
370
|
setActorDispatcher(path, dispatcher) {
|
372
371
|
if (this.router.has("actor")) throw new RouterError("Actor dispatcher already set.");
|
@@ -1113,7 +1112,7 @@ async function handleObject(request, { values, context: context$2, objectDispatc
|
|
1113
1112
|
async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$2, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound }) {
|
1114
1113
|
const spanName = name.trim().replace(/\s+/g, "_");
|
1115
1114
|
tracerProvider = tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
1116
|
-
const tracer = tracerProvider.getTracer(
|
1115
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
1117
1116
|
const url = new URL(request.url);
|
1118
1117
|
const cursor = url.searchParams.get("cursor");
|
1119
1118
|
if (collectionCallbacks == null) return await onNotFound(request);
|
@@ -1290,7 +1289,7 @@ function filterCollectionItems(items, collectionName, filterPredicate) {
|
|
1290
1289
|
*/
|
1291
1290
|
async function handleInbox(request, options) {
|
1292
1291
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
1293
|
-
const tracer = tracerProvider.getTracer(
|
1292
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
1294
1293
|
return await tracer.startActiveSpan("activitypub.inbox", {
|
1295
1294
|
kind: options.queue == null ? __opentelemetry_api.SpanKind.SERVER : __opentelemetry_api.SpanKind.PRODUCER,
|
1296
1295
|
attributes: { "activitypub.shared_inbox": options.recipient == null }
|
@@ -1642,7 +1641,7 @@ var CustomCollectionHandler = class {
|
|
1642
1641
|
this.CollectionPage = CollectionPage$1;
|
1643
1642
|
this.filterPredicate = filterPredicate;
|
1644
1643
|
this.name = this.name.trim().replace(/\s+/g, "_");
|
1645
|
-
this.#tracer = this.tracerProvider.getTracer(
|
1644
|
+
this.#tracer = this.tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
1646
1645
|
this.#id = new URL(this.context.url);
|
1647
1646
|
this.#dispatcher = callbacks.dispatcher.bind(callbacks);
|
1648
1647
|
}
|
@@ -2233,7 +2232,7 @@ function extractInboxes({ recipients, preferSharedInbox, excludeBaseUris }) {
|
|
2233
2232
|
*/
|
2234
2233
|
function sendActivity(options) {
|
2235
2234
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
2236
|
-
const tracer = tracerProvider.getTracer(
|
2235
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
2237
2236
|
return tracer.startActiveSpan("activitypub.send_activity", {
|
2238
2237
|
kind: __opentelemetry_api.SpanKind.CLIENT,
|
2239
2238
|
attributes: { "activitypub.shared_inbox": options.sharedInbox ?? false }
|
@@ -2404,8 +2403,8 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2404
2403
|
const { allowPrivateAddress, userAgent } = options;
|
2405
2404
|
this.allowPrivateAddress = allowPrivateAddress ?? false;
|
2406
2405
|
this.documentLoaderFactory = options.documentLoaderFactory ?? ((opts) => {
|
2407
|
-
return
|
2408
|
-
loader:
|
2406
|
+
return require_kv_cache.kvCache({
|
2407
|
+
loader: (0, __fedify_vocab_runtime.getDocumentLoader)({
|
2409
2408
|
allowPrivateAddress: opts?.allowPrivateAddress ?? allowPrivateAddress,
|
2410
2409
|
userAgent: opts?.userAgent ?? userAgent
|
2411
2410
|
}),
|
@@ -2414,7 +2413,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2414
2413
|
});
|
2415
2414
|
});
|
2416
2415
|
this.contextLoaderFactory = options.contextLoaderFactory ?? this.documentLoaderFactory;
|
2417
|
-
this.authenticatedDocumentLoaderFactory = options.authenticatedDocumentLoaderFactory ?? ((identity) =>
|
2416
|
+
this.authenticatedDocumentLoaderFactory = options.authenticatedDocumentLoaderFactory ?? ((identity) => require_kv_cache.getAuthenticatedDocumentLoader(identity, {
|
2418
2417
|
allowPrivateAddress,
|
2419
2418
|
userAgent,
|
2420
2419
|
specDeterminer: new KvSpecDeterminer(this.kv, this.kvPrefixes.httpMessageSignaturesSpec, options.firstKnock),
|
@@ -2435,7 +2434,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2435
2434
|
this.router.add("/.well-known/nodeinfo", "nodeInfoJrd");
|
2436
2435
|
}
|
2437
2436
|
_getTracer() {
|
2438
|
-
return this.tracerProvider.getTracer(
|
2437
|
+
return this.tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
2439
2438
|
}
|
2440
2439
|
async _startQueueInternal(ctxData, signal, queue) {
|
2441
2440
|
if (this.inboxQueue == null && this.outboxQueue == null) return;
|
@@ -2533,7 +2532,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2533
2532
|
});
|
2534
2533
|
const keys = await Promise.all(message.keys.map(async ({ keyId, privateKey }) => ({
|
2535
2534
|
keyId: new URL(keyId),
|
2536
|
-
privateKey: await
|
2535
|
+
privateKey: await require_http.importJwk(privateKey, "private")
|
2537
2536
|
})));
|
2538
2537
|
const activity = await require_actor.Activity.fromJsonLd(message.activity, {
|
2539
2538
|
contextLoader: this.contextLoaderFactory({
|
@@ -2574,7 +2573,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2574
2573
|
for (const { keyId, privateKey } of message.keys) {
|
2575
2574
|
const pair = {
|
2576
2575
|
keyId: new URL(keyId),
|
2577
|
-
privateKey: await
|
2576
|
+
privateKey: await require_http.importJwk(privateKey, "private")
|
2578
2577
|
};
|
2579
2578
|
if (rsaKeyPair == null && pair.privateKey.algorithm.name === "RSASSA-PKCS1-v1_5") rsaKeyPair = pair;
|
2580
2579
|
keys.push(pair);
|
@@ -2809,7 +2808,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2809
2808
|
let proofCreated = false;
|
2810
2809
|
let rsaKey = null;
|
2811
2810
|
for (const { keyId, privateKey } of keys) {
|
2812
|
-
|
2811
|
+
require_http.validateCryptoKey(privateKey, "private");
|
2813
2812
|
if (rsaKey == null && privateKey.algorithm.name === "RSASSA-PKCS1-v1_5") {
|
2814
2813
|
rsaKey = {
|
2815
2814
|
keyId,
|
@@ -2877,7 +2876,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2877
2876
|
});
|
2878
2877
|
const keyJwkPairs = [];
|
2879
2878
|
for (const { keyId, privateKey } of keys) {
|
2880
|
-
const privateKeyJwk = await
|
2879
|
+
const privateKeyJwk = await require_http.exportJwk(privateKey);
|
2881
2880
|
keyJwkPairs.push({
|
2882
2881
|
keyId: keyId.href,
|
2883
2882
|
privateKey: privateKeyJwk
|
@@ -3577,7 +3576,7 @@ var ContextImpl = class ContextImpl {
|
|
3577
3576
|
});
|
3578
3577
|
}
|
3579
3578
|
sendActivity(sender, recipients, activity, options = {}) {
|
3580
|
-
const tracer = this.tracerProvider.getTracer(
|
3579
|
+
const tracer = this.tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
3581
3580
|
return tracer.startActiveSpan(this.federation.outboxQueue == null || options.immediate ? "activitypub.outbox" : "activitypub.fanout", {
|
3582
3581
|
kind: this.federation.outboxQueue == null || options.immediate ? __opentelemetry_api.SpanKind.CLIENT : __opentelemetry_api.SpanKind.PRODUCER,
|
3583
3582
|
attributes: {
|
@@ -3634,7 +3633,7 @@ var ContextImpl = class ContextImpl {
|
|
3634
3633
|
keys = sender;
|
3635
3634
|
} else keys = [sender];
|
3636
3635
|
if (keys.length < 1) throw new TypeError("The sender's keys must not be empty.");
|
3637
|
-
for (const { privateKey } of keys)
|
3636
|
+
for (const { privateKey } of keys) require_http.validateCryptoKey(privateKey, "private");
|
3638
3637
|
const opts = { context: this };
|
3639
3638
|
let expandedRecipients;
|
3640
3639
|
if (Array.isArray(recipients)) expandedRecipients = recipients;
|
@@ -3675,7 +3674,7 @@ var ContextImpl = class ContextImpl {
|
|
3675
3674
|
}
|
3676
3675
|
const keyJwkPairs = await Promise.all(keys.map(async ({ keyId, privateKey }) => ({
|
3677
3676
|
keyId: keyId.href,
|
3678
|
-
privateKey: await
|
3677
|
+
privateKey: await require_http.exportJwk(privateKey)
|
3679
3678
|
})));
|
3680
3679
|
const carrier = {};
|
3681
3680
|
__opentelemetry_api.propagation.inject(__opentelemetry_api.context.active(), carrier);
|
@@ -3723,7 +3722,7 @@ var ContextImpl = class ContextImpl {
|
|
3723
3722
|
}
|
3724
3723
|
routeActivity(recipient, activity, options = {}) {
|
3725
3724
|
const tracerProvider = this.tracerProvider ?? this.tracerProvider;
|
3726
|
-
const tracer = tracerProvider.getTracer(
|
3725
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
3727
3726
|
return tracer.startActiveSpan("activitypub.inbox", {
|
3728
3727
|
kind: this.federation.inboxQueue == null || options.immediate ? __opentelemetry_api.SpanKind.INTERNAL : __opentelemetry_api.SpanKind.PRODUCER,
|
3729
3728
|
attributes: { "activitypub.activity.type": require_actor.getTypeId(activity).href }
|
@@ -3941,7 +3940,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
3941
3940
|
});
|
3942
3941
|
}
|
3943
3942
|
forwardActivity(forwarder, recipients, options) {
|
3944
|
-
const tracer = this.tracerProvider.getTracer(
|
3943
|
+
const tracer = this.tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
3945
3944
|
return tracer.startActiveSpan("activitypub.outbox", {
|
3946
3945
|
kind: this.federation.outboxQueue == null || options?.immediate ? __opentelemetry_api.SpanKind.CLIENT : __opentelemetry_api.SpanKind.PRODUCER,
|
3947
3946
|
attributes: { "activitypub.activity.type": this.activityType }
|
@@ -4042,7 +4041,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
4042
4041
|
});
|
4043
4042
|
const keyJwkPairs = [];
|
4044
4043
|
for (const { keyId, privateKey } of keys) {
|
4045
|
-
const privateKeyJwk = await
|
4044
|
+
const privateKeyJwk = await require_http.exportJwk(privateKey);
|
4046
4045
|
keyJwkPairs.push({
|
4047
4046
|
keyId: keyId.href,
|
4048
4047
|
privateKey: privateKeyJwk
|
@@ -3,21 +3,20 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
5
|
import { getDefaultActivityTransformers } from "./transformers-BFT6d7J5.js";
|
6
|
-
import { deno_default,
|
7
|
-
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader-CZsCIRLV.js";
|
14
|
-
import { lookupObject, traverseCollection } from "./vocab-CJHF7Q71.js";
|
6
|
+
import { deno_default, lookupWebFinger } from "./lookup-BE8ZMmug.js";
|
7
|
+
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-CMgHXjhs.js";
|
8
|
+
import { doubleKnock, exportJwk, importJwk, validateCryptoKey, verifyRequest } from "./http-BPsXiq3Y.js";
|
9
|
+
import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-D0ak0hhc.js";
|
10
|
+
import { getNodeInfo, nodeInfoToJson } from "./types-BtUjyi5y.js";
|
11
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "./kv-cache-CBOkGH5t.js";
|
12
|
+
import { lookupObject, traverseCollection } from "./vocab-CjheaIIe.js";
|
15
13
|
import { getLogger, withContext } from "@logtape/logtape";
|
16
14
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
17
|
-
import {
|
15
|
+
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
18
16
|
import { cloneDeep } from "es-toolkit";
|
19
17
|
import { Router } from "uri-template-router";
|
20
18
|
import { parseTemplate } from "url-template";
|
19
|
+
import { encodeHex } from "byte-encodings/hex";
|
21
20
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
22
21
|
import { domainToASCII } from "node:url";
|
23
22
|
|
@@ -339,7 +338,7 @@ var FederationBuilderImpl = class {
|
|
339
338
|
this.collectionTypeIds = {};
|
340
339
|
}
|
341
340
|
async build(options) {
|
342
|
-
const { FederationImpl: FederationImpl$1 } = await import("./middleware-
|
341
|
+
const { FederationImpl: FederationImpl$1 } = await import("./middleware-CdFqipch.js");
|
343
342
|
const f = new FederationImpl$1(options);
|
344
343
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
345
344
|
f.router = this.router.clone();
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
globalThis.addEventListener = () => {};
|
5
|
+
|
6
|
+
import "./lookup-CxJLpHHf.js";
|
7
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-BImvTjdU.js";
|
8
|
+
import "./client-pY7-3icS.js";
|
9
|
+
import "./types-C2XVl6gj.js";
|
10
|
+
import "./actor-CRS7Dbo1.js";
|
11
|
+
import "./key-CcqQC_vj.js";
|
12
|
+
import "./http-DIsJckI7.js";
|
13
|
+
import "./ld-C5wht8V2.js";
|
14
|
+
import "./owner-DIa5WpbP.js";
|
15
|
+
import "./proof-CCzhKDDB.js";
|
16
|
+
import "./docloader-BvlqkI1M.js";
|
17
|
+
import "./kv-cache-z0lgwFi_.js";
|
18
|
+
import "./inbox-24__vIeD.js";
|
19
|
+
import "./builder-D44QzfuD.js";
|
20
|
+
import "./collection-BzWsN9pB.js";
|
21
|
+
import "./keycache-BUF-P0-V.js";
|
22
|
+
import "./negotiation-C4nFufNk.js";
|
23
|
+
import "./retry-CfF8Gn4d.js";
|
24
|
+
import "./send-BWfkS2zO.js";
|
25
|
+
|
26
|
+
export { FederationImpl };
|
@@ -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 { KeyCache } from "./http-D6Uj2x2y.js";
|
3
|
+
import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "./vocab-BCWe1Ih5.js";
|
4
|
+
import { KeyCache } from "./http-BbO0ejuk.js";
|
6
5
|
import { TracerProvider } from "@opentelemetry/api";
|
6
|
+
import { DocumentLoader } from "@fedify/vocab-runtime";
|
7
7
|
|
8
8
|
//#region src/sig/ld.d.ts
|
9
9
|
/**
|