@solongate/proxy 0.6.0 → 0.6.1
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 +13 -0
- package/dist/init.js +13 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1125,6 +1125,19 @@ process.stdin.on('end', async () => {
|
|
|
1125
1125
|
const data = JSON.parse(input);
|
|
1126
1126
|
const args = data.tool_input || {};
|
|
1127
1127
|
|
|
1128
|
+
// \u2500\u2500 Self-protection: block access to hook files and settings \u2500\u2500
|
|
1129
|
+
const allStrings = scanStrings(args).map(s => s.replace(/\\\\\\\\/g, '/').toLowerCase());
|
|
1130
|
+
const protectedPaths = ['.solongate', '.claude/settings.json', 'policy.json'];
|
|
1131
|
+
for (const s of allStrings) {
|
|
1132
|
+
for (const p of protectedPaths) {
|
|
1133
|
+
if (s.includes(p)) {
|
|
1134
|
+
const msg = 'SOLONGATE: Access to protected file "' + p + '" is blocked';
|
|
1135
|
+
process.stderr.write(msg);
|
|
1136
|
+
process.exit(2);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1128
1141
|
// Load policy
|
|
1129
1142
|
let policy;
|
|
1130
1143
|
try {
|
package/dist/init.js
CHANGED
|
@@ -320,6 +320,19 @@ process.stdin.on('end', async () => {
|
|
|
320
320
|
const data = JSON.parse(input);
|
|
321
321
|
const args = data.tool_input || {};
|
|
322
322
|
|
|
323
|
+
// \u2500\u2500 Self-protection: block access to hook files and settings \u2500\u2500
|
|
324
|
+
const allStrings = scanStrings(args).map(s => s.replace(/\\\\\\\\/g, '/').toLowerCase());
|
|
325
|
+
const protectedPaths = ['.solongate', '.claude/settings.json', 'policy.json'];
|
|
326
|
+
for (const s of allStrings) {
|
|
327
|
+
for (const p of protectedPaths) {
|
|
328
|
+
if (s.includes(p)) {
|
|
329
|
+
const msg = 'SOLONGATE: Access to protected file "' + p + '" is blocked';
|
|
330
|
+
process.stderr.write(msg);
|
|
331
|
+
process.exit(2);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
323
336
|
// Load policy
|
|
324
337
|
let policy;
|
|
325
338
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "MCP security proxy — protect any MCP server with customizable policies, path/command constraints, rate limiting, and audit logging. Zero code changes required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|