@solongate/proxy 0.28.0 → 0.28.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 +10 -24
- package/dist/init.js +0 -1
- package/dist/lib.js +10 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -521,7 +521,6 @@ function wrapServer(serverName, server, policy) {
|
|
|
521
521
|
const env = { ...server.env ?? {} };
|
|
522
522
|
env.SOLONGATE_API_KEY = "${SOLONGATE_API_KEY}";
|
|
523
523
|
const proxyArgs = ["-y", "@solongate/proxy@latest"];
|
|
524
|
-
proxyArgs.push("--agent-name", serverName);
|
|
525
524
|
if (policy) {
|
|
526
525
|
proxyArgs.push("--policy", policy);
|
|
527
526
|
}
|
|
@@ -5789,12 +5788,13 @@ var SolonGateProxy = class {
|
|
|
5789
5788
|
httpAgentInfo = /* @__PURE__ */ new Map();
|
|
5790
5789
|
/** Per-request sub-agent info from HTTP headers (transient, overwritten per request) */
|
|
5791
5790
|
httpSubAgent = null;
|
|
5792
|
-
/** Server label from --agent-name flag (e.g. "filesystem", "playwright") */
|
|
5793
|
-
serverLabel = null;
|
|
5794
5791
|
constructor(config) {
|
|
5795
5792
|
this.config = config;
|
|
5796
5793
|
this.guardConfig = config.advancedDetection ? { ...DEFAULT_INPUT_GUARD_CONFIG, advancedDetection: config.advancedDetection } : DEFAULT_INPUT_GUARD_CONFIG;
|
|
5797
|
-
|
|
5794
|
+
if (config.agentName) {
|
|
5795
|
+
this.agentName = config.agentName;
|
|
5796
|
+
this.agentId = config.agentName.toLowerCase().replace(/\s+/g, "-");
|
|
5797
|
+
}
|
|
5798
5798
|
this.gate = new SolonGate({
|
|
5799
5799
|
name: config.name ?? "solongate-proxy",
|
|
5800
5800
|
apiKey: "sg_test_proxy_internal_00000000",
|
|
@@ -6007,19 +6007,10 @@ var SolonGateProxy = class {
|
|
|
6007
6007
|
this.server.oninitialized = () => {
|
|
6008
6008
|
if (this.server) {
|
|
6009
6009
|
const clientVersion = this.server.getClientVersion();
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
this.
|
|
6013
|
-
|
|
6014
|
-
} else if (clientName) {
|
|
6015
|
-
this.agentId = clientVersion?.version ? `${clientName}/${clientVersion.version}` : clientName;
|
|
6016
|
-
this.agentName = clientName;
|
|
6017
|
-
} else if (this.serverLabel) {
|
|
6018
|
-
this.agentId = this.serverLabel.toLowerCase().replace(/\s+/g, "-");
|
|
6019
|
-
this.agentName = this.serverLabel;
|
|
6020
|
-
}
|
|
6021
|
-
if (this.agentId) {
|
|
6022
|
-
log2(`Agent identified: ${this.agentName} (${this.agentId})`);
|
|
6010
|
+
if (clientVersion?.name) {
|
|
6011
|
+
this.agentId = clientVersion.name;
|
|
6012
|
+
this.agentName = clientVersion.name;
|
|
6013
|
+
log2(`Agent identified from MCP clientInfo: ${this.agentName}`);
|
|
6023
6014
|
}
|
|
6024
6015
|
}
|
|
6025
6016
|
};
|
|
@@ -6457,13 +6448,8 @@ ${msg.content.text}`;
|
|
|
6457
6448
|
const headerAgentId = req.headers["x-agent-id"];
|
|
6458
6449
|
const headerAgentName = req.headers["x-agent-name"];
|
|
6459
6450
|
if (headerAgentId) {
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
this.agentName = `${headerAgentName || headerAgentId} (${this.serverLabel})`;
|
|
6463
|
-
} else {
|
|
6464
|
-
this.agentId = headerAgentId;
|
|
6465
|
-
this.agentName = headerAgentName || headerAgentId;
|
|
6466
|
-
}
|
|
6451
|
+
this.agentId = headerAgentId;
|
|
6452
|
+
this.agentName = headerAgentName || headerAgentId;
|
|
6467
6453
|
log2(`Agent identified from HTTP headers: ${this.agentName} (${this.agentId})`);
|
|
6468
6454
|
}
|
|
6469
6455
|
}
|
package/dist/init.js
CHANGED
|
@@ -102,7 +102,6 @@ function wrapServer(serverName, server, policy) {
|
|
|
102
102
|
const env = { ...server.env ?? {} };
|
|
103
103
|
env.SOLONGATE_API_KEY = "${SOLONGATE_API_KEY}";
|
|
104
104
|
const proxyArgs = ["-y", "@solongate/proxy@latest"];
|
|
105
|
-
proxyArgs.push("--agent-name", serverName);
|
|
106
105
|
if (policy) {
|
|
107
106
|
proxyArgs.push("--policy", policy);
|
|
108
107
|
}
|
package/dist/lib.js
CHANGED
|
@@ -4229,12 +4229,13 @@ var SolonGateProxy = class {
|
|
|
4229
4229
|
httpAgentInfo = /* @__PURE__ */ new Map();
|
|
4230
4230
|
/** Per-request sub-agent info from HTTP headers (transient, overwritten per request) */
|
|
4231
4231
|
httpSubAgent = null;
|
|
4232
|
-
/** Server label from --agent-name flag (e.g. "filesystem", "playwright") */
|
|
4233
|
-
serverLabel = null;
|
|
4234
4232
|
constructor(config) {
|
|
4235
4233
|
this.config = config;
|
|
4236
4234
|
this.guardConfig = config.advancedDetection ? { ...DEFAULT_INPUT_GUARD_CONFIG, advancedDetection: config.advancedDetection } : DEFAULT_INPUT_GUARD_CONFIG;
|
|
4237
|
-
|
|
4235
|
+
if (config.agentName) {
|
|
4236
|
+
this.agentName = config.agentName;
|
|
4237
|
+
this.agentId = config.agentName.toLowerCase().replace(/\s+/g, "-");
|
|
4238
|
+
}
|
|
4238
4239
|
this.gate = new SolonGate({
|
|
4239
4240
|
name: config.name ?? "solongate-proxy",
|
|
4240
4241
|
apiKey: "sg_test_proxy_internal_00000000",
|
|
@@ -4447,19 +4448,10 @@ var SolonGateProxy = class {
|
|
|
4447
4448
|
this.server.oninitialized = () => {
|
|
4448
4449
|
if (this.server) {
|
|
4449
4450
|
const clientVersion = this.server.getClientVersion();
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
this.
|
|
4453
|
-
|
|
4454
|
-
} else if (clientName) {
|
|
4455
|
-
this.agentId = clientVersion?.version ? `${clientName}/${clientVersion.version}` : clientName;
|
|
4456
|
-
this.agentName = clientName;
|
|
4457
|
-
} else if (this.serverLabel) {
|
|
4458
|
-
this.agentId = this.serverLabel.toLowerCase().replace(/\s+/g, "-");
|
|
4459
|
-
this.agentName = this.serverLabel;
|
|
4460
|
-
}
|
|
4461
|
-
if (this.agentId) {
|
|
4462
|
-
log2(`Agent identified: ${this.agentName} (${this.agentId})`);
|
|
4451
|
+
if (clientVersion?.name) {
|
|
4452
|
+
this.agentId = clientVersion.name;
|
|
4453
|
+
this.agentName = clientVersion.name;
|
|
4454
|
+
log2(`Agent identified from MCP clientInfo: ${this.agentName}`);
|
|
4463
4455
|
}
|
|
4464
4456
|
}
|
|
4465
4457
|
};
|
|
@@ -4897,13 +4889,8 @@ ${msg.content.text}`;
|
|
|
4897
4889
|
const headerAgentId = req.headers["x-agent-id"];
|
|
4898
4890
|
const headerAgentName = req.headers["x-agent-name"];
|
|
4899
4891
|
if (headerAgentId) {
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
this.agentName = `${headerAgentName || headerAgentId} (${this.serverLabel})`;
|
|
4903
|
-
} else {
|
|
4904
|
-
this.agentId = headerAgentId;
|
|
4905
|
-
this.agentName = headerAgentName || headerAgentId;
|
|
4906
|
-
}
|
|
4892
|
+
this.agentId = headerAgentId;
|
|
4893
|
+
this.agentName = headerAgentName || headerAgentId;
|
|
4907
4894
|
log2(`Agent identified from HTTP headers: ${this.agentName} (${this.agentId})`);
|
|
4908
4895
|
}
|
|
4909
4896
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.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": {
|