@solongate/proxy 0.45.0 → 0.47.0
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/hooks/guard.bundled.mjs +3 -3
- package/hooks/guard.mjs +6 -3
- package/package.json +1 -1
package/hooks/guard.bundled.mjs
CHANGED
|
@@ -6763,7 +6763,7 @@ function extractPaths(args) {
|
|
|
6763
6763
|
if (/^https?:\/\//i.test(s))
|
|
6764
6764
|
continue;
|
|
6765
6765
|
if (s.includes("/") || s.includes("\\") || s.startsWith("."))
|
|
6766
|
-
paths.push(s);
|
|
6766
|
+
paths.push(s.replace(/\\/g, "/"));
|
|
6767
6767
|
}
|
|
6768
6768
|
return paths;
|
|
6769
6769
|
}
|
|
@@ -6967,7 +6967,7 @@ async function getOpaWasmBytes(policy) {
|
|
|
6967
6967
|
try {
|
|
6968
6968
|
const res = await fetch(
|
|
6969
6969
|
API_URL + "/api/v1/policies/" + encodeURIComponent(policy.id) + "/wasm",
|
|
6970
|
-
{ headers: AUTH_HEADERS, signal: AbortSignal.timeout(
|
|
6970
|
+
{ headers: AUTH_HEADERS, signal: AbortSignal.timeout(8e3) }
|
|
6971
6971
|
);
|
|
6972
6972
|
if (!res.ok)
|
|
6973
6973
|
return stale;
|
|
@@ -7159,7 +7159,7 @@ process.stdin.on("end", async () => {
|
|
|
7159
7159
|
}
|
|
7160
7160
|
if (!dashboardPolicy) {
|
|
7161
7161
|
try {
|
|
7162
|
-
const res = await fetch(API_URL + "/api/v1/policies/active?agent_id=" + encodeURIComponent(AGENT_ID || ""), { headers: AUTH_HEADERS, signal: AbortSignal.timeout(
|
|
7162
|
+
const res = await fetch(API_URL + "/api/v1/policies/active?agent_id=" + encodeURIComponent(AGENT_ID || ""), { headers: AUTH_HEADERS, signal: AbortSignal.timeout(8e3) });
|
|
7163
7163
|
if (res.ok) {
|
|
7164
7164
|
const body = await res.json();
|
|
7165
7165
|
if (body && body.policy) {
|
package/hooks/guard.mjs
CHANGED
|
@@ -414,7 +414,10 @@ function extractPaths(args) {
|
|
|
414
414
|
const paths = [];
|
|
415
415
|
for (const s of scanStrings(args)) {
|
|
416
416
|
if (/^https?:\/\//i.test(s)) continue;
|
|
417
|
-
|
|
417
|
+
// Normalize Windows backslashes to forward slashes so paths match the
|
|
418
|
+
// compiled Rego patterns (which are also normalized to "/"). OPA glob.match
|
|
419
|
+
// does no separator translation, so raw "C:\..." never matched "/" patterns.
|
|
420
|
+
if (s.includes('/') || s.includes('\\') || s.startsWith('.')) paths.push(s.replace(/\\/g, '/'));
|
|
418
421
|
}
|
|
419
422
|
return paths;
|
|
420
423
|
}
|
|
@@ -731,7 +734,7 @@ async function getOpaWasmBytes(policy) {
|
|
|
731
734
|
try {
|
|
732
735
|
const res = await fetch(
|
|
733
736
|
API_URL + '/api/v1/policies/' + encodeURIComponent(policy.id) + '/wasm',
|
|
734
|
-
{ headers: AUTH_HEADERS, signal: AbortSignal.timeout(
|
|
737
|
+
{ headers: AUTH_HEADERS, signal: AbortSignal.timeout(8000) },
|
|
735
738
|
);
|
|
736
739
|
if (!res.ok) return stale; // API has no compiled WASM right now → last known good
|
|
737
740
|
const bundle = Buffer.from(await res.arrayBuffer());
|
|
@@ -1000,7 +1003,7 @@ process.stdin.on('end', async () => {
|
|
|
1000
1003
|
// Refresh from API if cache expired
|
|
1001
1004
|
if (!dashboardPolicy) {
|
|
1002
1005
|
try {
|
|
1003
|
-
const res = await fetch(API_URL + '/api/v1/policies/active?agent_id=' + encodeURIComponent(AGENT_ID || ''), { headers: AUTH_HEADERS, signal: AbortSignal.timeout(
|
|
1006
|
+
const res = await fetch(API_URL + '/api/v1/policies/active?agent_id=' + encodeURIComponent(AGENT_ID || ''), { headers: AUTH_HEADERS, signal: AbortSignal.timeout(8000) });
|
|
1004
1007
|
if (res.ok) {
|
|
1005
1008
|
const body = await res.json();
|
|
1006
1009
|
if (body && body.policy) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"description": "AI tool security proxy — protect any AI tool server with customizable policies, path/command constraints, rate limiting, and audit logging. Zero code changes required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|