@askalf/dario 3.7.1 → 3.7.2
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/cli.js +6 -4
- package/dist/openai-backend.js +6 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -274,10 +274,12 @@ async function backend() {
|
|
|
274
274
|
console.log(` ${all.length} backend${all.length === 1 ? '' : 's'} configured`);
|
|
275
275
|
console.log('');
|
|
276
276
|
for (const b of all) {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
277
|
+
// Never emit any substring of the key itself — even partial
|
|
278
|
+
// prefixes/suffixes (like "sk-proj-...a1b2") are leakage as
|
|
279
|
+
// far as CodeQL's js/clear-text-logging rule is concerned, and
|
|
280
|
+
// it's right: partial disclosure is still disclosure. Name and
|
|
281
|
+
// baseUrl together are enough to identify a backend.
|
|
282
|
+
console.log(` ${b.name.padEnd(16)} ${b.provider.padEnd(10)} ${b.baseUrl.padEnd(40)} ***`);
|
|
281
283
|
}
|
|
282
284
|
console.log('');
|
|
283
285
|
return;
|
package/dist/openai-backend.js
CHANGED
|
@@ -148,11 +148,16 @@ export async function forwardToOpenAI(req, res, body, backend, corsOrigin, secur
|
|
|
148
148
|
}
|
|
149
149
|
catch (err) {
|
|
150
150
|
clearTimeout(timeout);
|
|
151
|
+
// Log error details server-side only. Responding with err.message
|
|
152
|
+
// exposes internal stack / path / module information (CodeQL
|
|
153
|
+
// js/stack-trace-exposure). The client gets a generic 502.
|
|
154
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
155
|
+
if (verbose)
|
|
156
|
+
console.error(`[dario] openai backend (${backend.name}) error: ${detail}`);
|
|
151
157
|
if (!res.headersSent) {
|
|
152
158
|
res.writeHead(502, { 'Content-Type': 'application/json', ...securityHeaders });
|
|
153
159
|
res.end(JSON.stringify({
|
|
154
160
|
error: 'Upstream OpenAI-compat backend error',
|
|
155
|
-
message: err instanceof Error ? err.message : String(err),
|
|
156
161
|
backend: backend.name,
|
|
157
162
|
}));
|
|
158
163
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.2",
|
|
4
4
|
"description": "A local LLM router. One endpoint, every provider — Claude subscriptions, OpenAI, OpenRouter, Groq, local LiteLLM, any OpenAI-compat endpoint — your tools don't need to change.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|