@solongate/proxy 0.2.4 → 0.2.6
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/index.js +18 -14
- package/dist/init.js +18 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -529,22 +529,26 @@ process.stdin.on('end', async () => {
|
|
|
529
529
|
const ms = Date.now() - start;
|
|
530
530
|
|
|
531
531
|
if (threat) {
|
|
532
|
-
// Send DENY audit log
|
|
532
|
+
// Send DENY audit log \u2014 MUST await before exit or fetch dies
|
|
533
533
|
if (API_KEY && API_KEY.startsWith('sg_live_')) {
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
534
|
+
try {
|
|
535
|
+
await fetch(API_URL + '/api/v1/audit-logs', {
|
|
536
|
+
method: 'POST',
|
|
537
|
+
headers: { 'Authorization': 'Bearer ' + API_KEY, 'Content-Type': 'application/json' },
|
|
538
|
+
body: JSON.stringify({
|
|
539
|
+
tool, arguments: Object.fromEntries(Object.entries(args).map(([k,v]) =>
|
|
540
|
+
[k, typeof v === 'string' && v.length > 200 ? v.slice(0,200)+'...' : v])),
|
|
541
|
+
decision: 'DENY', reason: threat, source: 'claude-code-guard',
|
|
542
|
+
evaluationTimeMs: ms,
|
|
543
|
+
}),
|
|
544
|
+
signal: AbortSignal.timeout(3000),
|
|
545
|
+
});
|
|
546
|
+
} catch {}
|
|
545
547
|
}
|
|
546
|
-
// Exit 2 = BLOCK.
|
|
547
|
-
|
|
548
|
+
// Exit 2 = BLOCK. Write to both stdout and stderr for visibility.
|
|
549
|
+
const msg = 'SOLONGATE BLOCKED: ' + threat;
|
|
550
|
+
process.stdout.write(msg);
|
|
551
|
+
process.stderr.write(msg);
|
|
548
552
|
process.exit(2);
|
|
549
553
|
}
|
|
550
554
|
} catch {
|
package/dist/init.js
CHANGED
|
@@ -248,22 +248,26 @@ process.stdin.on('end', async () => {
|
|
|
248
248
|
const ms = Date.now() - start;
|
|
249
249
|
|
|
250
250
|
if (threat) {
|
|
251
|
-
// Send DENY audit log
|
|
251
|
+
// Send DENY audit log \u2014 MUST await before exit or fetch dies
|
|
252
252
|
if (API_KEY && API_KEY.startsWith('sg_live_')) {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
253
|
+
try {
|
|
254
|
+
await fetch(API_URL + '/api/v1/audit-logs', {
|
|
255
|
+
method: 'POST',
|
|
256
|
+
headers: { 'Authorization': 'Bearer ' + API_KEY, 'Content-Type': 'application/json' },
|
|
257
|
+
body: JSON.stringify({
|
|
258
|
+
tool, arguments: Object.fromEntries(Object.entries(args).map(([k,v]) =>
|
|
259
|
+
[k, typeof v === 'string' && v.length > 200 ? v.slice(0,200)+'...' : v])),
|
|
260
|
+
decision: 'DENY', reason: threat, source: 'claude-code-guard',
|
|
261
|
+
evaluationTimeMs: ms,
|
|
262
|
+
}),
|
|
263
|
+
signal: AbortSignal.timeout(3000),
|
|
264
|
+
});
|
|
265
|
+
} catch {}
|
|
264
266
|
}
|
|
265
|
-
// Exit 2 = BLOCK.
|
|
266
|
-
|
|
267
|
+
// Exit 2 = BLOCK. Write to both stdout and stderr for visibility.
|
|
268
|
+
const msg = 'SOLONGATE BLOCKED: ' + threat;
|
|
269
|
+
process.stdout.write(msg);
|
|
270
|
+
process.stderr.write(msg);
|
|
267
271
|
process.exit(2);
|
|
268
272
|
}
|
|
269
273
|
} catch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "MCP security proxy \u00e2\u20ac\u201d protect any MCP server with policies, input validation, rate limiting, and audit logging. Zero code changes required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|