@fedify/fedify 2.0.0-pr.451.1731 → 2.0.0-pr.457.1754
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-GwnlqPRv.js → actor--EIM8WJq.js} +1 -1
- package/dist/{actor-CRQwUlsr.js → actor-BkClSt23.js} +185 -186
- package/dist/{actor-Ci-5y3ml.cjs → actor-C1V-Vbaa.cjs} +186 -187
- package/dist/{actor-Cd2CREO0.d.ts → actor-DqFajh9s.d.ts} +2 -2
- package/dist/{actor-DDhZuMGl.d.cts → actor-f2NtjyCg.d.cts} +2 -2
- package/dist/{builder-BflZmL4k.js → builder-Drp8J0wC.js} +3 -3
- package/dist/{client-Cle5j1T1.d.cts → client-94iWEfQa.d.cts} +1 -1
- package/dist/{client-Bkaw0_PR.d.ts → client-BsGzbnV-.d.ts} +1 -1
- package/dist/{client-DylapB-t.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 +16 -16
- package/dist/{context-DqFifMwj.d.ts → context-DG0huGW-.d.ts} +26 -56
- package/dist/{context-BOYzcFSe.d.cts → context-DJ8aSy2Q.d.cts} +26 -56
- package/dist/{docloader-BpcE9hBI.js → docloader-BhDPeZk3.js} +4 -5
- package/dist/{esm-DjbC-dsH.js → esm-D2byLwNf.js} +1 -1
- package/dist/federation/builder.test.js +4 -4
- package/dist/federation/collection.test.js +2 -2
- package/dist/federation/handler.test.js +17 -17
- package/dist/federation/idempotency.test.js +17 -17
- package/dist/federation/inbox.test.js +3 -3
- package/dist/federation/keycache.test.js +3 -3
- package/dist/federation/kv.test.js +2 -2
- package/dist/federation/middleware.test.js +18 -18
- package/dist/federation/mod.cjs +9 -10
- package/dist/federation/mod.d.cts +11 -12
- package/dist/federation/mod.d.ts +11 -12
- package/dist/federation/mod.js +9 -10
- package/dist/federation/mq.test.js +2 -2
- package/dist/federation/negotiation.test.js +2 -2
- package/dist/federation/retry.test.js +2 -2
- package/dist/federation/router.test.js +2 -2
- package/dist/federation/send.test.js +9 -9
- package/dist/{http-BE7aFuqn.d.ts → http-BbO0ejuk.d.ts} +1 -1
- package/dist/{http-CCUJdi0H.js → http-CQraRgim.js} +2 -2
- package/dist/{http-BzsavjR2.js → http-ChVy_Zs1.js} +2 -2
- package/dist/{http-DtUGyvkU.cjs → http-Dc-3AhVQ.cjs} +5 -5
- package/dist/{http-B6SKO6NJ.d.cts → http-M8k5mKc0.d.cts} +1 -1
- package/dist/{inbox-DizLjfhC.js → inbox-c2HespXf.js} +1 -1
- package/dist/{key-De1MJH3k.js → key-DfjYEehd.js} +2 -2
- package/dist/{keycache-D2HiBv4F.js → keycache-Bqod49Je.js} +1 -1
- package/dist/{keys-B4ZjS1Ot.js → keys-DpfNqWw3.js} +1 -1
- package/dist/kv-cache--YUzf-BE.cjs +134 -0
- package/dist/kv-cache-BHyEN0Z7.js +122 -0
- package/dist/kv-cache-DN9pfMBe.js +94 -0
- package/dist/{ld-Dux3_Cw2.js → ld-DxH5pJEy.js} +2 -2
- package/dist/{lookup-Bep-EOgr.js → lookup-C5pO70ss.js} +188 -298
- package/dist/lookup-CHu82YNt.cjs +272 -0
- package/dist/{lookup-Bql--V-C.js → lookup-UlFMEz4S.js} +128 -60
- package/dist/middleware-BPWWS7Li.js +15 -0
- package/dist/middleware-BZRfF01Z.cjs +15 -0
- package/dist/{middleware-DrpnHeGO.cjs → middleware-BjvG3FSg.cjs} +18 -19
- package/dist/{middleware-D7tP9Tq6.js → middleware-CnVcyowb.js} +13 -13
- package/dist/middleware-d26uv3fL.js +26 -0
- package/dist/{middleware-BBTmHKGh.js → middleware-f2BqmeAn.js} +8 -9
- package/dist/{mod-CLKu6Uo_.d.cts → mod-0noXw66R.d.cts} +4 -4
- package/dist/{mod-DLIidI_j.d.ts → mod-B2iOw50L.d.ts} +2 -2
- package/dist/{mod-Cm97bAiT.d.ts → mod-B9M-8jm2.d.ts} +4 -4
- package/dist/{mod-CRENK2dd.d.ts → mod-BlVovdcy.d.ts} +2 -3
- package/dist/{mod-CaWbCg0N.d.ts → mod-BoHnwOCs.d.ts} +2 -2
- package/dist/{mod--K7l84wp.d.cts → mod-BxRCHTz-.d.cts} +2 -3
- package/dist/{mod-DuclhZjh.d.cts → mod-C58MZ7Wx.d.cts} +1 -1
- package/dist/{mod-D9XZsft2.d.cts → mod-DJcZDvjA.d.cts} +2 -2
- package/dist/{mod-COlOrmr9.d.cts → mod-DgdBYYa0.d.cts} +2 -2
- package/dist/{mod-CB80AlIA.d.ts → mod-Ds0mpFZU.d.ts} +1 -1
- package/dist/mod.cjs +13 -15
- package/dist/mod.d.cts +15 -16
- package/dist/mod.d.ts +16 -17
- package/dist/mod.js +14 -15
- package/dist/nodeinfo/client.test.js +4 -4
- package/dist/nodeinfo/handler.test.js +16 -16
- package/dist/nodeinfo/mod.cjs +2 -3
- package/dist/nodeinfo/mod.d.cts +2 -3
- package/dist/nodeinfo/mod.d.ts +2 -3
- package/dist/nodeinfo/mod.js +2 -3
- package/dist/nodeinfo/types.test.js +2 -2
- package/dist/{owner-dkg5OpSC.d.cts → owner-B4HbyP8s.d.cts} +2 -2
- package/dist/{owner-Zq8du9WO.js → owner-BqWkxhC_.js} +2 -2
- package/dist/{owner-CktUdA0h.d.ts → owner-kQRGVXG1.d.ts} +2 -2
- package/dist/{proof-0PY1LDZY.cjs → proof-DHEZDAfy.cjs} +7 -7
- package/dist/{proof-aIlK5BTc.js → proof-DKHqWkww.js} +3 -3
- package/dist/{proof-C5S_3hdJ.js → proof-DjnaYscE.js} +2 -2
- package/dist/{send-BbVnlsQO.js → send-DG2jH3Yb.js} +2 -2
- package/dist/sig/http.test.js +7 -7
- package/dist/sig/key.test.js +5 -5
- package/dist/sig/ld.test.js +6 -6
- package/dist/sig/mod.cjs +5 -6
- package/dist/sig/mod.d.cts +5 -6
- package/dist/sig/mod.d.ts +5 -6
- package/dist/sig/mod.js +5 -6
- package/dist/sig/owner.test.js +6 -6
- package/dist/sig/proof.test.js +6 -6
- package/dist/testing/docloader.test.js +2 -2
- package/dist/testing/mod.d.ts +16 -72
- package/dist/testing/mod.js +2 -2
- package/dist/{testing-BkidWE0N.js → testing-CUOkRXmb.js} +1 -1
- package/dist/{types-CXnyjUdK.js → types-BtUjyi5y.js} +1 -1
- package/dist/{types-BDNYgodm.cjs → types-CWgzGaqk.cjs} +3 -3
- package/dist/utils/docloader.test.js +9 -8
- package/dist/utils/kv-cache.test.js +4 -3
- package/dist/utils/mod.cjs +5 -7
- package/dist/utils/mod.d.cts +5 -6
- package/dist/utils/mod.d.ts +5 -6
- package/dist/utils/mod.js +6 -7
- package/dist/vocab/actor.test.js +4 -4
- package/dist/vocab/lookup.test.js +3 -3
- package/dist/vocab/mod.cjs +3 -4
- package/dist/vocab/mod.d.cts +3 -4
- package/dist/vocab/mod.d.ts +3 -4
- package/dist/vocab/mod.js +3 -4
- package/dist/vocab/type.test.js +2 -2
- package/dist/vocab/vocab.test.js +3 -3
- package/dist/{vocab-Dapemq3v.cjs → vocab-DWCgeSMU.cjs} +3 -4
- package/dist/{vocab-BiKK7m2H.js → vocab-HZjpFucb.js} +2 -3
- package/dist/webfinger/handler.test.js +16 -16
- package/dist/webfinger/lookup.test.js +3 -3
- package/dist/webfinger/mod.cjs +2 -3
- package/dist/webfinger/mod.d.cts +1 -2
- package/dist/webfinger/mod.d.ts +1 -2
- 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 +2 -2
- 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 +4 -5
- package/dist/kv-cache-3VK2-wq_.cjs +0 -4279
- package/dist/kv-cache-DNvS-egZ.js +0 -4236
- package/dist/kv-cache-rR-Cnl95.js +0 -4267
- package/dist/lookup-BmGuy-Ps.cjs +0 -210
- package/dist/middleware-BUZSGsQH.js +0 -16
- package/dist/middleware-BusTq7Js.cjs +0 -16
- package/dist/middleware-tZdLtCWz.js +0 -26
- package/dist/request-BbHkedIU.d.cts +0 -35
- package/dist/request-Bc5CHBqO.cjs +0 -208
- package/dist/request-C0Ags1gQ.js +0 -184
- package/dist/request-U1t6zZtk.d.ts +0 -39
- package/dist/utils/request.test.d.ts +0 -3
- package/dist/utils/request.test.js +0 -48
- package/dist/utils/url.test.d.ts +0 -3
- package/dist/utils/url.test.js +0 -41
- /package/dist/{federation-DOuZpcAw.cjs → federation-CRpdnOMS.cjs} +0 -0
- /package/dist/{federation-pZJsapBn.js → federation-jcR8-ZxP.js} +0 -0
- /package/dist/{kv-Dt06smFt.d.ts → kv-BKNZ-Tb-.d.ts} +0 -0
- /package/dist/{kv-BMKIFXNW.d.cts → kv-Bxr0Q87_.d.cts} +0 -0
- /package/dist/{mod-FZd39qVq.d.cts → mod-B-hUPT2N.d.cts} +0 -0
- /package/dist/{mod-B-ZQqbGe.d.ts → mod-CVgZgliM.d.ts} +0 -0
- /package/dist/{mod-CjsiSl7_.d.ts → mod-xIj-IT58.d.ts} +0 -0
- /package/dist/{mq-CPRJk4mZ.d.ts → mq-CUKlBw08.d.ts} +0 -0
- /package/dist/{mq-B7R1Q-M5.d.cts → mq-DcJPkXD5.d.cts} +0 -0
- /package/dist/{nodeinfo-B0UefMXO.js → nodeinfo-BnthBobC.js} +0 -0
- /package/dist/{nodeinfo-ByTd7HpT.cjs → nodeinfo-CdN0rEnZ.cjs} +0 -0
- /package/dist/{sig-Dx59zAgn.js → sig-C34-oHBl.js} +0 -0
- /package/dist/{sig-DE_NC_VQ.cjs → sig-YYj5tCnr.cjs} +0 -0
- /package/dist/{utils-BXMGcmqK.js → utils-D-Va7aXC.js} +0 -0
- /package/dist/{utils-B6yXfxAQ.cjs → utils-DyRU1gdZ.cjs} +0 -0
- /package/dist/{vocab-ivDKb439.d.ts → vocab-BCWe1Ih5.d.ts} +0 -0
- /package/dist/{vocab-DCBw44JZ.d.cts → vocab-CeDBzu-f.d.cts} +0 -0
- /package/dist/{webfinger-qG8R5jc3.js → webfinger-C72Y8lrh.js} +0 -0
- /package/dist/{webfinger-C949bxcD.cjs → webfinger-vAtLmxOF.cjs} +0 -0
@@ -0,0 +1,272 @@
|
|
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-pr.457.1754+e2ece3ba";
|
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
|
+
"es-toolkit": "jsr:@es-toolkit/es-toolkit@^1.39.5",
|
40
|
+
"fast-check": "npm:fast-check@^3.22.0",
|
41
|
+
"fetch-mock": "npm:fetch-mock@^12.5.2",
|
42
|
+
"json-canon": "npm:json-canon@^1.0.1",
|
43
|
+
"jsonld": "npm:jsonld@^8.3.2",
|
44
|
+
"multicodec": "npm:multicodec@^3.2.1",
|
45
|
+
"pkijs": "npm:pkijs@^3.2.4",
|
46
|
+
"structured-field-values": "npm:structured-field-values@^2.0.4",
|
47
|
+
"uri-template-router": "npm:uri-template-router@^0.0.17",
|
48
|
+
"url-template": "npm:url-template@^3.1.1"
|
49
|
+
};
|
50
|
+
var include = ["src/vocab/vocab.ts"];
|
51
|
+
var exclude = [
|
52
|
+
".test-report.xml",
|
53
|
+
"apidoc/",
|
54
|
+
"dist/",
|
55
|
+
"node_modules/",
|
56
|
+
"npm/",
|
57
|
+
"pnpm-lock.yaml",
|
58
|
+
"src/cfworkers/dist/",
|
59
|
+
"src/cfworkers/fixtures/",
|
60
|
+
"src/cfworkers/imports.ts",
|
61
|
+
"src/cfworkers/README.md",
|
62
|
+
"src/cfworkers/server.ts",
|
63
|
+
"src/cfworkers/server.js",
|
64
|
+
"src/cfworkers/server.js.map",
|
65
|
+
"src/codegen/schema.yaml",
|
66
|
+
"src/vocab/*.yaml",
|
67
|
+
"!src/vocab/vocab.ts"
|
68
|
+
];
|
69
|
+
var tasks = {
|
70
|
+
"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",
|
71
|
+
"cache": {
|
72
|
+
"command": "deno cache src/mod.ts",
|
73
|
+
"dependencies": ["codegen"]
|
74
|
+
},
|
75
|
+
"check": {
|
76
|
+
"command": "deno fmt --check && deno lint && deno check src/**/*.ts",
|
77
|
+
"dependencies": ["codegen"]
|
78
|
+
},
|
79
|
+
"test": {
|
80
|
+
"command": "deno test --check --doc --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel",
|
81
|
+
"dependencies": ["codegen"]
|
82
|
+
},
|
83
|
+
"coverage": "deno task test --clean --coverage && deno coverage --html coverage",
|
84
|
+
"bench": {
|
85
|
+
"command": "deno bench --allow-read --allow-write --allow-net --allow-env --allow-run --unstable-kv",
|
86
|
+
"dependencies": ["codegen"]
|
87
|
+
},
|
88
|
+
"apidoc": {
|
89
|
+
"command": "deno doc --html --name=Fedify --output=apidoc/ src/mod.ts",
|
90
|
+
"dependencies": ["codegen"]
|
91
|
+
},
|
92
|
+
"publish": {
|
93
|
+
"command": "deno publish",
|
94
|
+
"dependencies": ["codegen"]
|
95
|
+
},
|
96
|
+
"pnpm:install": "pnpm install --silent",
|
97
|
+
"pnpm:build": {
|
98
|
+
"command": "pnpm exec tsdown",
|
99
|
+
"dependencies": [
|
100
|
+
"codegen",
|
101
|
+
"pnpm:install",
|
102
|
+
"pnpm:build-vocab"
|
103
|
+
]
|
104
|
+
},
|
105
|
+
"pnpm:build-vocab-runtime": { "command": "cd ../vocab-runtime && pnpm build" },
|
106
|
+
"pnpm:build-vocab": { "dependencies": ["pnpm:build-vocab-runtime"] },
|
107
|
+
"test:node": {
|
108
|
+
"command": "cd dist/ && node --test",
|
109
|
+
"dependencies": ["pnpm:build"]
|
110
|
+
},
|
111
|
+
"test:bun": {
|
112
|
+
"command": "cd dist/ && bun test --timeout 60000",
|
113
|
+
"dependencies": ["pnpm:build-vocab", "pnpm:build"]
|
114
|
+
},
|
115
|
+
"test:cfworkers": {
|
116
|
+
"command": "pnpm exec wrangler deploy --dry-run --outdir src/cfworkers && node --import=tsx src/cfworkers/client.ts",
|
117
|
+
"dependencies": ["pnpm:build-vocab", "pnpm:build"]
|
118
|
+
},
|
119
|
+
"test-all": { "dependencies": [
|
120
|
+
"check",
|
121
|
+
"test",
|
122
|
+
"test:node",
|
123
|
+
"test:bun",
|
124
|
+
"test:cfworkers"
|
125
|
+
] }
|
126
|
+
};
|
127
|
+
var deno_default = {
|
128
|
+
name,
|
129
|
+
version,
|
130
|
+
license,
|
131
|
+
exports: exports$1,
|
132
|
+
imports,
|
133
|
+
include,
|
134
|
+
exclude,
|
135
|
+
tasks
|
136
|
+
};
|
137
|
+
|
138
|
+
//#endregion
|
139
|
+
//#region src/webfinger/lookup.ts
|
140
|
+
const logger = (0, __logtape_logtape.getLogger)([
|
141
|
+
"fedify",
|
142
|
+
"webfinger",
|
143
|
+
"lookup"
|
144
|
+
]);
|
145
|
+
const DEFAULT_MAX_REDIRECTION = 5;
|
146
|
+
/**
|
147
|
+
* Looks up a WebFinger resource.
|
148
|
+
* @param resource The resource URL to look up.
|
149
|
+
* @param options Extra options for looking up the resource.
|
150
|
+
* @returns The resource descriptor, or `null` if not found.
|
151
|
+
* @since 0.2.0
|
152
|
+
*/
|
153
|
+
async function lookupWebFinger(resource, options = {}) {
|
154
|
+
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
155
|
+
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
156
|
+
return await tracer.startActiveSpan("webfinger.lookup", {
|
157
|
+
kind: __opentelemetry_api.SpanKind.CLIENT,
|
158
|
+
attributes: {
|
159
|
+
"webfinger.resource": resource.toString(),
|
160
|
+
"webfinger.resource.scheme": typeof resource === "string" ? resource.replace(/:.*$/, "") : resource.protocol.replace(/:$/, "")
|
161
|
+
}
|
162
|
+
}, async (span) => {
|
163
|
+
try {
|
164
|
+
const result = await lookupWebFingerInternal(resource, options);
|
165
|
+
span.setStatus({ code: result === null ? __opentelemetry_api.SpanStatusCode.ERROR : __opentelemetry_api.SpanStatusCode.OK });
|
166
|
+
return result;
|
167
|
+
} catch (error) {
|
168
|
+
span.setStatus({
|
169
|
+
code: __opentelemetry_api.SpanStatusCode.ERROR,
|
170
|
+
message: String(error)
|
171
|
+
});
|
172
|
+
throw error;
|
173
|
+
} finally {
|
174
|
+
span.end();
|
175
|
+
}
|
176
|
+
});
|
177
|
+
}
|
178
|
+
async function lookupWebFingerInternal(resource, options = {}) {
|
179
|
+
if (typeof resource === "string") resource = new URL(resource);
|
180
|
+
let protocol = "https:";
|
181
|
+
let server;
|
182
|
+
if (resource.protocol === "acct:") {
|
183
|
+
const atPos = resource.pathname.lastIndexOf("@");
|
184
|
+
if (atPos < 0) return null;
|
185
|
+
server = resource.pathname.substring(atPos + 1);
|
186
|
+
if (server === "") return null;
|
187
|
+
} else {
|
188
|
+
protocol = resource.protocol;
|
189
|
+
server = resource.host;
|
190
|
+
}
|
191
|
+
let url = new URL(`${protocol}//${server}/.well-known/webfinger`);
|
192
|
+
url.searchParams.set("resource", resource.href);
|
193
|
+
let redirected = 0;
|
194
|
+
while (true) {
|
195
|
+
logger.debug("Fetching WebFinger resource descriptor from {url}...", { url: url.href });
|
196
|
+
let response;
|
197
|
+
if (options.allowPrivateAddress !== true) try {
|
198
|
+
await (0, __fedify_vocab_runtime.validatePublicUrl)(url.href);
|
199
|
+
} catch (e) {
|
200
|
+
if (e instanceof __fedify_vocab_runtime.UrlError) {
|
201
|
+
logger.error("Invalid URL for WebFinger resource descriptor: {error}", { error: e });
|
202
|
+
return null;
|
203
|
+
}
|
204
|
+
throw e;
|
205
|
+
}
|
206
|
+
try {
|
207
|
+
response = await fetch(url, {
|
208
|
+
headers: {
|
209
|
+
Accept: "application/jrd+json",
|
210
|
+
"User-Agent": typeof options.userAgent === "string" ? options.userAgent : (0, __fedify_vocab_runtime.getUserAgent)(options.userAgent)
|
211
|
+
},
|
212
|
+
redirect: "manual",
|
213
|
+
signal: options.signal
|
214
|
+
});
|
215
|
+
} catch (error) {
|
216
|
+
logger.debug("Failed to fetch WebFinger resource descriptor: {error}", {
|
217
|
+
url: url.href,
|
218
|
+
error
|
219
|
+
});
|
220
|
+
return null;
|
221
|
+
}
|
222
|
+
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
223
|
+
redirected++;
|
224
|
+
const maxRedirection = options.maxRedirection ?? DEFAULT_MAX_REDIRECTION;
|
225
|
+
if (redirected >= maxRedirection) {
|
226
|
+
logger.error("Too many redirections ({redirections}) while fetching WebFinger resource descriptor.", { redirections: redirected });
|
227
|
+
return null;
|
228
|
+
}
|
229
|
+
const redirectedUrl = new URL(response.headers.get("Location"), response.url == null || response.url === "" ? url : response.url);
|
230
|
+
if (redirectedUrl.protocol !== url.protocol) {
|
231
|
+
logger.error("Redirected to a different protocol ({protocol} to {redirectedProtocol}) while fetching WebFinger resource descriptor.", {
|
232
|
+
protocol: url.protocol,
|
233
|
+
redirectedProtocol: redirectedUrl.protocol
|
234
|
+
});
|
235
|
+
return null;
|
236
|
+
}
|
237
|
+
url = redirectedUrl;
|
238
|
+
continue;
|
239
|
+
}
|
240
|
+
if (!response.ok) {
|
241
|
+
logger.debug("Failed to fetch WebFinger resource descriptor: {status} {statusText}.", {
|
242
|
+
url: url.href,
|
243
|
+
status: response.status,
|
244
|
+
statusText: response.statusText
|
245
|
+
});
|
246
|
+
return null;
|
247
|
+
}
|
248
|
+
try {
|
249
|
+
return await response.json();
|
250
|
+
} catch (e) {
|
251
|
+
if (e instanceof SyntaxError) {
|
252
|
+
logger.debug("Failed to parse WebFinger resource descriptor as JSON: {error}", { error: e });
|
253
|
+
return null;
|
254
|
+
}
|
255
|
+
throw e;
|
256
|
+
}
|
257
|
+
}
|
258
|
+
}
|
259
|
+
|
260
|
+
//#endregion
|
261
|
+
Object.defineProperty(exports, 'deno_default', {
|
262
|
+
enumerable: true,
|
263
|
+
get: function () {
|
264
|
+
return deno_default;
|
265
|
+
}
|
266
|
+
});
|
267
|
+
Object.defineProperty(exports, 'lookupWebFinger', {
|
268
|
+
enumerable: true,
|
269
|
+
get: function () {
|
270
|
+
return lookupWebFinger;
|
271
|
+
}
|
272
|
+
});
|
@@ -2,69 +2,137 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { deno_default, getUserAgent } from "./request-C0Ags1gQ.js";
|
6
5
|
import { getLogger } from "@logtape/logtape";
|
7
6
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
8
|
-
import {
|
9
|
-
import { isIP } from "node:net";
|
7
|
+
import { UrlError, getUserAgent, validatePublicUrl } from "@fedify/vocab-runtime";
|
10
8
|
|
11
|
-
//#region
|
12
|
-
var
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
//#region deno.json
|
10
|
+
var name = "@fedify/fedify";
|
11
|
+
var version = "2.0.0-pr.457.1754+e2ece3ba";
|
12
|
+
var license = "MIT";
|
13
|
+
var exports = {
|
14
|
+
".": "./src/mod.ts",
|
15
|
+
"./compat": "./src/compat/mod.ts",
|
16
|
+
"./federation": "./src/federation/mod.ts",
|
17
|
+
"./nodeinfo": "./src/nodeinfo/mod.ts",
|
18
|
+
"./sig": "./src/sig/mod.ts",
|
19
|
+
"./testing": "./src/testing/mod.ts",
|
20
|
+
"./vocab": "./src/vocab/mod.ts",
|
21
|
+
"./utils": "./src/utils/mod.ts",
|
22
|
+
"./webfinger": "./src/webfinger/mod.ts",
|
23
|
+
"./x/cfworkers": "./src/x/cfworkers.ts",
|
24
|
+
"./x/denokv": "./src/x/denokv.ts",
|
25
|
+
"./x/fresh": "./src/x/fresh.ts",
|
26
|
+
"./x/hono": "./src/x/hono.ts",
|
27
|
+
"./x/sveltekit": "./src/x/sveltekit.ts"
|
28
|
+
};
|
29
|
+
var imports = {
|
30
|
+
"@cfworker/json-schema": "npm:@cfworker/json-schema@^4.1.1",
|
31
|
+
"@multiformats/base-x": "npm:@multiformats/base-x@^4.0.1",
|
32
|
+
"@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
|
33
|
+
"@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.27.0",
|
34
|
+
"@std/assert": "jsr:@std/assert@^0.226.0",
|
35
|
+
"@std/testing": "jsr:@std/testing@^0.224.0",
|
36
|
+
"@std/url": "jsr:@std/url@^0.225.1",
|
37
|
+
"asn1js": "npm:asn1js@^3.0.5",
|
38
|
+
"es-toolkit": "jsr:@es-toolkit/es-toolkit@^1.39.5",
|
39
|
+
"fast-check": "npm:fast-check@^3.22.0",
|
40
|
+
"fetch-mock": "npm:fetch-mock@^12.5.2",
|
41
|
+
"json-canon": "npm:json-canon@^1.0.1",
|
42
|
+
"jsonld": "npm:jsonld@^8.3.2",
|
43
|
+
"multicodec": "npm:multicodec@^3.2.1",
|
44
|
+
"pkijs": "npm:pkijs@^3.2.4",
|
45
|
+
"structured-field-values": "npm:structured-field-values@^2.0.4",
|
46
|
+
"uri-template-router": "npm:uri-template-router@^0.0.17",
|
47
|
+
"url-template": "npm:url-template@^3.1.1"
|
48
|
+
};
|
49
|
+
var include = ["src/vocab/vocab.ts"];
|
50
|
+
var exclude = [
|
51
|
+
".test-report.xml",
|
52
|
+
"apidoc/",
|
53
|
+
"dist/",
|
54
|
+
"node_modules/",
|
55
|
+
"npm/",
|
56
|
+
"pnpm-lock.yaml",
|
57
|
+
"src/cfworkers/dist/",
|
58
|
+
"src/cfworkers/fixtures/",
|
59
|
+
"src/cfworkers/imports.ts",
|
60
|
+
"src/cfworkers/README.md",
|
61
|
+
"src/cfworkers/server.ts",
|
62
|
+
"src/cfworkers/server.js",
|
63
|
+
"src/cfworkers/server.js.map",
|
64
|
+
"src/codegen/schema.yaml",
|
65
|
+
"src/vocab/*.yaml",
|
66
|
+
"!src/vocab/vocab.ts"
|
67
|
+
];
|
68
|
+
var tasks = {
|
69
|
+
"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",
|
70
|
+
"cache": {
|
71
|
+
"command": "deno cache src/mod.ts",
|
72
|
+
"dependencies": ["codegen"]
|
73
|
+
},
|
74
|
+
"check": {
|
75
|
+
"command": "deno fmt --check && deno lint && deno check src/**/*.ts",
|
76
|
+
"dependencies": ["codegen"]
|
77
|
+
},
|
78
|
+
"test": {
|
79
|
+
"command": "deno test --check --doc --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel",
|
80
|
+
"dependencies": ["codegen"]
|
81
|
+
},
|
82
|
+
"coverage": "deno task test --clean --coverage && deno coverage --html coverage",
|
83
|
+
"bench": {
|
84
|
+
"command": "deno bench --allow-read --allow-write --allow-net --allow-env --allow-run --unstable-kv",
|
85
|
+
"dependencies": ["codegen"]
|
86
|
+
},
|
87
|
+
"apidoc": {
|
88
|
+
"command": "deno doc --html --name=Fedify --output=apidoc/ src/mod.ts",
|
89
|
+
"dependencies": ["codegen"]
|
90
|
+
},
|
91
|
+
"publish": {
|
92
|
+
"command": "deno publish",
|
93
|
+
"dependencies": ["codegen"]
|
94
|
+
},
|
95
|
+
"pnpm:install": "pnpm install --silent",
|
96
|
+
"pnpm:build": {
|
97
|
+
"command": "pnpm exec tsdown",
|
98
|
+
"dependencies": [
|
99
|
+
"codegen",
|
100
|
+
"pnpm:install",
|
101
|
+
"pnpm:build-vocab"
|
102
|
+
]
|
103
|
+
},
|
104
|
+
"pnpm:build-vocab-runtime": { "command": "cd ../vocab-runtime && pnpm build" },
|
105
|
+
"pnpm:build-vocab": { "dependencies": ["pnpm:build-vocab-runtime"] },
|
106
|
+
"test:node": {
|
107
|
+
"command": "cd dist/ && node --test",
|
108
|
+
"dependencies": ["pnpm:build"]
|
109
|
+
},
|
110
|
+
"test:bun": {
|
111
|
+
"command": "cd dist/ && bun test --timeout 60000",
|
112
|
+
"dependencies": ["pnpm:build-vocab", "pnpm:build"]
|
113
|
+
},
|
114
|
+
"test:cfworkers": {
|
115
|
+
"command": "pnpm exec wrangler deploy --dry-run --outdir src/cfworkers && node --import=tsx src/cfworkers/client.ts",
|
116
|
+
"dependencies": ["pnpm:build-vocab", "pnpm:build"]
|
117
|
+
},
|
118
|
+
"test-all": { "dependencies": [
|
119
|
+
"check",
|
120
|
+
"test",
|
121
|
+
"test:node",
|
122
|
+
"test:bun",
|
123
|
+
"test:cfworkers"
|
124
|
+
] }
|
125
|
+
};
|
126
|
+
var deno_default = {
|
127
|
+
name,
|
128
|
+
version,
|
129
|
+
license,
|
130
|
+
exports,
|
131
|
+
imports,
|
132
|
+
include,
|
133
|
+
exclude,
|
134
|
+
tasks
|
17
135
|
};
|
18
|
-
/**
|
19
|
-
* Validates a URL to prevent SSRF attacks.
|
20
|
-
*/
|
21
|
-
async function validatePublicUrl(url) {
|
22
|
-
const parsed = new URL(url);
|
23
|
-
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") throw new UrlError(`Unsupported protocol: ${parsed.protocol}`);
|
24
|
-
let hostname = parsed.hostname;
|
25
|
-
if (hostname.startsWith("[") && hostname.endsWith("]")) hostname = hostname.substring(1, hostname.length - 2);
|
26
|
-
if (hostname === "localhost") throw new UrlError("Localhost is not allowed");
|
27
|
-
if ("Deno" in globalThis && !isIP(hostname)) {
|
28
|
-
const netPermission = await Deno.permissions.query({ name: "net" });
|
29
|
-
if (netPermission.state !== "granted") return;
|
30
|
-
}
|
31
|
-
if ("Bun" in globalThis) {
|
32
|
-
if (hostname === "example.com" || hostname.endsWith(".example.com")) return;
|
33
|
-
else if (hostname === "fedify-test.internal") throw new UrlError("Invalid or private address: fedify-test.internal");
|
34
|
-
}
|
35
|
-
let addresses;
|
36
|
-
try {
|
37
|
-
addresses = await lookup(hostname, { all: true });
|
38
|
-
} catch {
|
39
|
-
addresses = [];
|
40
|
-
}
|
41
|
-
for (const { address, family } of addresses) if (family === 4 && !isValidPublicIPv4Address(address) || family === 6 && !isValidPublicIPv6Address(address) || family < 4 || family === 5 || family > 6) throw new UrlError(`Invalid or private address: ${address}`);
|
42
|
-
}
|
43
|
-
function isValidPublicIPv4Address(address) {
|
44
|
-
const parts = address.split(".");
|
45
|
-
const first = parseInt(parts[0]);
|
46
|
-
if (first === 0 || first === 10 || first === 127) return false;
|
47
|
-
const second = parseInt(parts[1]);
|
48
|
-
if (first === 169 && second === 254) return false;
|
49
|
-
if (first === 172 && second >= 16 && second <= 31) return false;
|
50
|
-
if (first === 192 && second === 168) return false;
|
51
|
-
return true;
|
52
|
-
}
|
53
|
-
function isValidPublicIPv6Address(address) {
|
54
|
-
address = expandIPv6Address(address);
|
55
|
-
if (address.at(4) !== ":") return false;
|
56
|
-
const firstWord = parseInt(address.substring(0, 4), 16);
|
57
|
-
return !(firstWord >= 64512 && firstWord <= 65023 || firstWord >= 65152 && firstWord <= 65215 || firstWord === 0 || firstWord >= 65280);
|
58
|
-
}
|
59
|
-
function expandIPv6Address(address) {
|
60
|
-
address = address.toLowerCase();
|
61
|
-
if (address === "::") return "0000:0000:0000:0000:0000:0000:0000:0000";
|
62
|
-
if (address.startsWith("::")) address = "0000" + address;
|
63
|
-
if (address.endsWith("::")) address = address + "0000";
|
64
|
-
address = address.replace("::", ":0000".repeat(8 - (address.match(/:/g) || []).length) + ":");
|
65
|
-
const parts = address.split(":");
|
66
|
-
return parts.map((part) => part.padStart(4, "0")).join(":");
|
67
|
-
}
|
68
136
|
|
69
137
|
//#endregion
|
70
138
|
//#region src/webfinger/lookup.ts
|
@@ -189,4 +257,4 @@ async function lookupWebFingerInternal(resource, options = {}) {
|
|
189
257
|
}
|
190
258
|
|
191
259
|
//#endregion
|
192
|
-
export {
|
260
|
+
export { deno_default, lookupWebFinger };
|
@@ -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-UlFMEz4S.js";
|
7
|
+
import "./actor-BkClSt23.js";
|
8
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-f2BqmeAn.js";
|
9
|
+
import "./http-ChVy_Zs1.js";
|
10
|
+
import "./proof-DKHqWkww.js";
|
11
|
+
import "./types-BtUjyi5y.js";
|
12
|
+
import "./kv-cache-BHyEN0Z7.js";
|
13
|
+
import "./vocab-HZjpFucb.js";
|
14
|
+
|
15
|
+
export { FederationImpl };
|
@@ -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-CHu82YNt.cjs');
|
7
|
+
require('./actor-C1V-Vbaa.cjs');
|
8
|
+
const require_middleware = require('./middleware-BjvG3FSg.cjs');
|
9
|
+
require('./http-Dc-3AhVQ.cjs');
|
10
|
+
require('./proof-DHEZDAfy.cjs');
|
11
|
+
require('./types-CWgzGaqk.cjs');
|
12
|
+
require('./kv-cache--YUzf-BE.cjs');
|
13
|
+
require('./vocab-DWCgeSMU.cjs');
|
14
|
+
|
15
|
+
exports.FederationImpl = require_middleware.FederationImpl;
|
@@ -4,14 +4,13 @@
|
|
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_vocab = require('./vocab-Dapemq3v.cjs');
|
7
|
+
const require_lookup = require('./lookup-CHu82YNt.cjs');
|
8
|
+
const require_actor = require('./actor-C1V-Vbaa.cjs');
|
9
|
+
const require_http = require('./http-Dc-3AhVQ.cjs');
|
10
|
+
const require_proof = require('./proof-DHEZDAfy.cjs');
|
11
|
+
const require_types = require('./types-CWgzGaqk.cjs');
|
12
|
+
const require_kv_cache = require('./kv-cache--YUzf-BE.cjs');
|
13
|
+
const require_vocab = require('./vocab-DWCgeSMU.cjs');
|
15
14
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
16
15
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
17
16
|
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
@@ -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-BZRfF01Z.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 }
|
@@ -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;
|
@@ -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: {
|
@@ -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 }
|
@@ -3,23 +3,23 @@
|
|
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, RouterError, deno_default, getTypeId, lookupObject, lookupWebFinger, traverseCollection } from "./lookup-
|
7
|
-
import { getNodeInfo } from "./client-
|
6
|
+
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, RouterError, deno_default, getTypeId, lookupObject, lookupWebFinger, traverseCollection } from "./lookup-C5pO70ss.js";
|
7
|
+
import { getNodeInfo } from "./client-pY7-3icS.js";
|
8
8
|
import { nodeInfoToJson } from "./types-C2XVl6gj.js";
|
9
|
-
import { exportJwk, importJwk, validateCryptoKey } from "./key-
|
10
|
-
import { verifyRequest } from "./http-
|
11
|
-
import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-
|
12
|
-
import { doesActorOwnKey, getKeyOwner } from "./owner-
|
13
|
-
import { signObject, verifyObject } from "./proof-
|
14
|
-
import { getAuthenticatedDocumentLoader } from "./docloader-
|
15
|
-
import { kvCache } from "./kv-cache-
|
16
|
-
import { routeActivity } from "./inbox-
|
17
|
-
import { FederationBuilderImpl } from "./builder-
|
9
|
+
import { exportJwk, importJwk, validateCryptoKey } from "./key-DfjYEehd.js";
|
10
|
+
import { verifyRequest } from "./http-CQraRgim.js";
|
11
|
+
import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-DxH5pJEy.js";
|
12
|
+
import { doesActorOwnKey, getKeyOwner } from "./owner-BqWkxhC_.js";
|
13
|
+
import { signObject, verifyObject } from "./proof-DjnaYscE.js";
|
14
|
+
import { getAuthenticatedDocumentLoader } from "./docloader-BhDPeZk3.js";
|
15
|
+
import { kvCache } from "./kv-cache-DN9pfMBe.js";
|
16
|
+
import { routeActivity } from "./inbox-c2HespXf.js";
|
17
|
+
import { FederationBuilderImpl } from "./builder-Drp8J0wC.js";
|
18
18
|
import { buildCollectionSynchronizationHeader } from "./collection-BzWsN9pB.js";
|
19
|
-
import { KvKeyCache } from "./keycache-
|
19
|
+
import { KvKeyCache } from "./keycache-Bqod49Je.js";
|
20
20
|
import { acceptsJsonLd } from "./negotiation-C4nFufNk.js";
|
21
21
|
import { createExponentialBackoffPolicy } from "./retry-CfF8Gn4d.js";
|
22
|
-
import { extractInboxes, sendActivity } from "./send-
|
22
|
+
import { extractInboxes, sendActivity } from "./send-DG2jH3Yb.js";
|
23
23
|
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
24
24
|
import { getLogger, withContext } from "@logtape/logtape";
|
25
25
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|