@solongate/proxy 0.82.35 → 0.82.37
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/commands/index.js +0 -9
- package/dist/index.js +6 -15
- package/dist/tui/index.js +5 -4
- package/package.json +1 -1
package/dist/commands/index.js
CHANGED
|
@@ -524,7 +524,6 @@ function flagBool(flags, name) {
|
|
|
524
524
|
var USAGE = usage("solongate policy", "manage cloud policies", [
|
|
525
525
|
["policy list", "list all policies"],
|
|
526
526
|
["policy show <id>", "show one policy (rules, mode)"],
|
|
527
|
-
["policy rules <id>", "list a policy's rules"],
|
|
528
527
|
["policy allow <id> --tool <p> [--command|--path|--url <val>]", "append an ALLOW rule"],
|
|
529
528
|
["policy revoke <id> <ruleId>", "remove a rule"],
|
|
530
529
|
["policy active", "show the resolved active policy"],
|
|
@@ -573,14 +572,6 @@ async function run(argv) {
|
|
|
573
572
|
printRules(p.rules);
|
|
574
573
|
return 0;
|
|
575
574
|
}
|
|
576
|
-
case "rules": {
|
|
577
|
-
const id = positionals[1];
|
|
578
|
-
if (!id) return err(" Usage: policy rules <id>"), 1;
|
|
579
|
-
const p = await api.policies.get(id);
|
|
580
|
-
if (json) return printJson(p.rules), 0;
|
|
581
|
-
printRules(p.rules);
|
|
582
|
-
return 0;
|
|
583
|
-
}
|
|
584
575
|
case "allow": {
|
|
585
576
|
const id = positionals[1];
|
|
586
577
|
if (!id) return err(" Usage: policy allow <id> --tool <pattern> [--command|--path|--url <val>]"), 1;
|
package/dist/index.js
CHANGED
|
@@ -8853,7 +8853,7 @@ function DryRunPanel({ focused }) {
|
|
|
8853
8853
|
} else if (input === "r" || input === "R") run10(pi, limit);
|
|
8854
8854
|
});
|
|
8855
8855
|
function commitLogs(raw) {
|
|
8856
|
-
const cap = totalLogs && totalLogs > 0 ? totalLogs :
|
|
8856
|
+
const cap = Math.min(MAX_LIMIT, totalLogs && totalLogs > 0 ? totalLogs : MAX_LIMIT);
|
|
8857
8857
|
const parsed = parseInt(raw.replace(/[^0-9]/g, ""), 10);
|
|
8858
8858
|
const next = Number.isFinite(parsed) && parsed > 0 ? Math.min(parsed, cap) : limit;
|
|
8859
8859
|
setEditLogs(null);
|
|
@@ -8946,11 +8946,11 @@ function DryRunPanel({ focused }) {
|
|
|
8946
8946
|
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: " logs " }),
|
|
8947
8947
|
/* @__PURE__ */ jsx3(Text3, { color: theme.warn, children: "how many recent logs to replay: " }),
|
|
8948
8948
|
/* @__PURE__ */ jsx3(TextInput2, { value: editLogs, onChange: setEditLogs, onSubmit: commitLogs }),
|
|
8949
|
-
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: totalLogs
|
|
8949
|
+
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: ` (max ${Math.min(MAX_LIMIT, totalLogs && totalLogs > 0 ? totalLogs : MAX_LIMIT)})` })
|
|
8950
8950
|
] }) : /* @__PURE__ */ jsxs3(Text3, { wrap: "truncate", children: [
|
|
8951
8951
|
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: " logs " }),
|
|
8952
8952
|
/* @__PURE__ */ jsx3(Text3, { color: theme.accent, children: "\u2039 " + String(limit) + " \u203A" }),
|
|
8953
|
-
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: ` press n to type a number${totalLogs
|
|
8953
|
+
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: ` press n to type a number max ${Math.min(MAX_LIMIT, totalLogs && totalLogs > 0 ? totalLogs : MAX_LIMIT)}${res?.sampled != null ? ` replayed ${res.sampled}` : ""}` })
|
|
8954
8954
|
] }),
|
|
8955
8955
|
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, wrap: "truncate", children: focused ? `\u2191\u2193 scroll \xB7 p policy \xB7 n logs \xB7 r re-run${above ? ` \xB7 \u25B2${above}` : ""}${below ? ` \xB7 \u25BC${below}` : ""}` : "press \u2192 to open" }),
|
|
8956
8956
|
running ? /* @__PURE__ */ jsx3(Text3, { color: theme.warn, children: "replaying recent traffic\u2026" }) : null,
|
|
@@ -8959,7 +8959,7 @@ function DryRunPanel({ focused }) {
|
|
|
8959
8959
|
/* @__PURE__ */ jsx3(Box3, { marginTop: 1, flexDirection: "column", children: win })
|
|
8960
8960
|
] }) });
|
|
8961
8961
|
}
|
|
8962
|
-
var DEFAULT_LIMIT, pendingPolicyId, pct;
|
|
8962
|
+
var DEFAULT_LIMIT, MAX_LIMIT, pendingPolicyId, pct;
|
|
8963
8963
|
var init_DryRun = __esm({
|
|
8964
8964
|
"src/tui/panels/DryRun.tsx"() {
|
|
8965
8965
|
"use strict";
|
|
@@ -8968,6 +8968,7 @@ var init_DryRun = __esm({
|
|
|
8968
8968
|
init_hooks();
|
|
8969
8969
|
init_theme();
|
|
8970
8970
|
DEFAULT_LIMIT = 1e3;
|
|
8971
|
+
MAX_LIMIT = 5e3;
|
|
8971
8972
|
pendingPolicyId = null;
|
|
8972
8973
|
pct = (n, d) => d ? (n / d * 100).toFixed(1) + "%" : "0%";
|
|
8973
8974
|
}
|
|
@@ -9063,7 +9064,7 @@ function PoliciesPanel({ focused }) {
|
|
|
9063
9064
|
});
|
|
9064
9065
|
setRules(res.rules);
|
|
9065
9066
|
setDirty(false);
|
|
9066
|
-
setStatus("\u2713 Saved
|
|
9067
|
+
setStatus("\u2713 Saved");
|
|
9067
9068
|
list6.reload();
|
|
9068
9069
|
} catch (e) {
|
|
9069
9070
|
setStatus("\u2717 " + (e instanceof Error ? e.message : String(e)));
|
|
@@ -11751,14 +11752,6 @@ async function run(argv) {
|
|
|
11751
11752
|
printRules(p.rules);
|
|
11752
11753
|
return 0;
|
|
11753
11754
|
}
|
|
11754
|
-
case "rules": {
|
|
11755
|
-
const id = positionals[1];
|
|
11756
|
-
if (!id) return err(" Usage: policy rules <id>"), 1;
|
|
11757
|
-
const p = await api.policies.get(id);
|
|
11758
|
-
if (json) return printJson(p.rules), 0;
|
|
11759
|
-
printRules(p.rules);
|
|
11760
|
-
return 0;
|
|
11761
|
-
}
|
|
11762
11755
|
case "allow": {
|
|
11763
11756
|
const id = positionals[1];
|
|
11764
11757
|
if (!id) return err(" Usage: policy allow <id> --tool <pattern> [--command|--path|--url <val>]"), 1;
|
|
@@ -11873,7 +11866,6 @@ var init_policy = __esm({
|
|
|
11873
11866
|
USAGE = usage("solongate policy", "manage cloud policies", [
|
|
11874
11867
|
["policy list", "list all policies"],
|
|
11875
11868
|
["policy show <id>", "show one policy (rules, mode)"],
|
|
11876
|
-
["policy rules <id>", "list a policy's rules"],
|
|
11877
11869
|
["policy allow <id> --tool <p> [--command|--path|--url <val>]", "append an ALLOW rule"],
|
|
11878
11870
|
["policy revoke <id> <ruleId>", "remove a rule"],
|
|
11879
11871
|
["policy active", "show the resolved active policy"],
|
|
@@ -16251,7 +16243,6 @@ function printHelp() {
|
|
|
16251
16243
|
head("Policies");
|
|
16252
16244
|
cmd("policy list", "list all policies");
|
|
16253
16245
|
cmd("policy show <id>", "show one policy (rules, mode)");
|
|
16254
|
-
cmd("policy rules <id>", "list a policy's rules");
|
|
16255
16246
|
cmd("policy allow <id> --tool <p> [--command|--path|--url <val>]", "add an ALLOW rule");
|
|
16256
16247
|
cmd("policy revoke <id> <ruleId>", "remove a rule");
|
|
16257
16248
|
cmd("policy activate <id> | --clear", "pin / unpin the active policy");
|
package/dist/tui/index.js
CHANGED
|
@@ -1913,6 +1913,7 @@ import TextInput2 from "ink-text-input";
|
|
|
1913
1913
|
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
1914
1914
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1915
1915
|
var DEFAULT_LIMIT = 1e3;
|
|
1916
|
+
var MAX_LIMIT = 5e3;
|
|
1916
1917
|
var pendingPolicyId = null;
|
|
1917
1918
|
function requestDryRun(policyId) {
|
|
1918
1919
|
pendingPolicyId = policyId;
|
|
@@ -1965,7 +1966,7 @@ function DryRunPanel({ focused }) {
|
|
|
1965
1966
|
} else if (input === "r" || input === "R") run(pi, limit);
|
|
1966
1967
|
});
|
|
1967
1968
|
function commitLogs(raw) {
|
|
1968
|
-
const cap = totalLogs && totalLogs > 0 ? totalLogs :
|
|
1969
|
+
const cap = Math.min(MAX_LIMIT, totalLogs && totalLogs > 0 ? totalLogs : MAX_LIMIT);
|
|
1969
1970
|
const parsed = parseInt(raw.replace(/[^0-9]/g, ""), 10);
|
|
1970
1971
|
const next = Number.isFinite(parsed) && parsed > 0 ? Math.min(parsed, cap) : limit;
|
|
1971
1972
|
setEditLogs(null);
|
|
@@ -2058,11 +2059,11 @@ function DryRunPanel({ focused }) {
|
|
|
2058
2059
|
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: " logs " }),
|
|
2059
2060
|
/* @__PURE__ */ jsx3(Text3, { color: theme.warn, children: "how many recent logs to replay: " }),
|
|
2060
2061
|
/* @__PURE__ */ jsx3(TextInput2, { value: editLogs, onChange: setEditLogs, onSubmit: commitLogs }),
|
|
2061
|
-
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: totalLogs
|
|
2062
|
+
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: ` (max ${Math.min(MAX_LIMIT, totalLogs && totalLogs > 0 ? totalLogs : MAX_LIMIT)})` })
|
|
2062
2063
|
] }) : /* @__PURE__ */ jsxs3(Text3, { wrap: "truncate", children: [
|
|
2063
2064
|
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: " logs " }),
|
|
2064
2065
|
/* @__PURE__ */ jsx3(Text3, { color: theme.accent, children: "\u2039 " + String(limit) + " \u203A" }),
|
|
2065
|
-
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: ` press n to type a number${totalLogs
|
|
2066
|
+
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: ` press n to type a number max ${Math.min(MAX_LIMIT, totalLogs && totalLogs > 0 ? totalLogs : MAX_LIMIT)}${res?.sampled != null ? ` replayed ${res.sampled}` : ""}` })
|
|
2066
2067
|
] }),
|
|
2067
2068
|
/* @__PURE__ */ jsx3(Text3, { color: theme.dim, wrap: "truncate", children: focused ? `\u2191\u2193 scroll \xB7 p policy \xB7 n logs \xB7 r re-run${above ? ` \xB7 \u25B2${above}` : ""}${below ? ` \xB7 \u25BC${below}` : ""}` : "press \u2192 to open" }),
|
|
2068
2069
|
running ? /* @__PURE__ */ jsx3(Text3, { color: theme.warn, children: "replaying recent traffic\u2026" }) : null,
|
|
@@ -2174,7 +2175,7 @@ function PoliciesPanel({ focused }) {
|
|
|
2174
2175
|
});
|
|
2175
2176
|
setRules(res.rules);
|
|
2176
2177
|
setDirty(false);
|
|
2177
|
-
setStatus("\u2713 Saved
|
|
2178
|
+
setStatus("\u2713 Saved");
|
|
2178
2179
|
list5.reload();
|
|
2179
2180
|
} catch (e) {
|
|
2180
2181
|
setStatus("\u2717 " + (e instanceof Error ? e.message : String(e)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.82.
|
|
3
|
+
"version": "0.82.37",
|
|
4
4
|
"description": "AI tool security proxy: protect any AI tool server with customizable policies, path/command constraints, rate limiting, and audit logging. No code changes required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|