@blogic-cz/agent-tools 1.6.14 → 1.6.16
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credential-guard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAmB,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAK5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAM/D,8CAA8C;AAC9C,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,+CAA+C;AAC/C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,CAAC;AAQF,+CAA+C;AAC/C,MAAM,MAAM,eAAe,GAAG;IAC5B,uBAAuB,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACxE,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC3E,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IACrD,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjF,kBAAkB,EAAE,CAAC,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C9E,eAAO,MAAM,kBAAkB,YAn6GC,MAAM,KAAK,MAAM,GAAG,IAm6Ga,CAAC"}
|
package/package.json
CHANGED
|
@@ -475,7 +475,9 @@ function unwrapProofCommand(words: string[], marker: string): string[] | undefin
|
|
|
475
475
|
let index = 0;
|
|
476
476
|
while (words[index] === "rtk" || words[index] === "command") {
|
|
477
477
|
if (words[index++] === "rtk") {
|
|
478
|
-
if (words[index
|
|
478
|
+
if (words[index] === "proxy") index++;
|
|
479
|
+
// RTK forwards this verified external binary without changing its argv roles.
|
|
480
|
+
else if (words[index] !== "herdr") return undefined;
|
|
479
481
|
} else if (words[index] === "--") index++;
|
|
480
482
|
}
|
|
481
483
|
if (words.slice(0, index + 1).some((word) => word.includes(marker))) return undefined;
|
|
@@ -1512,6 +1514,20 @@ function isJqObjectConstruction(argv: string[]): boolean {
|
|
|
1512
1514
|
if (argv[index] === "--") index++;
|
|
1513
1515
|
const filter = argv[index] ?? "";
|
|
1514
1516
|
if (argv.slice(index + 1).some((arg) => arg.startsWith("-"))) return false;
|
|
1517
|
+
// ponytail: one object-map level and one literal contains selector; no jq evaluator.
|
|
1518
|
+
const field = String.raw`\.[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)*`;
|
|
1519
|
+
const key = String.raw`[A-Za-z_][A-Za-z0-9_]*`;
|
|
1520
|
+
const flatEntry = String.raw`${key}(?:\s*:\s*${field})?`;
|
|
1521
|
+
const flatObject = String.raw`\{\s*${flatEntry}(?:\s*,\s*${flatEntry})*\s*\}`;
|
|
1522
|
+
const mapped = String.raw`${field}\s*\|\s*map\(\s*${flatObject}\s*\)`;
|
|
1523
|
+
const value = String.raw`(?:${field}|${mapped}|\(\s*${mapped}\s*\))`;
|
|
1524
|
+
const entry = String.raw`${key}(?:\s*:\s*${value})?`;
|
|
1525
|
+
const object = String.raw`\{\s*${entry}(?:\s*,\s*${entry})*\s*\}`;
|
|
1526
|
+
// JSON string escapes exclude jq interpolation, which starts with \(.
|
|
1527
|
+
const string = String.raw`"(?:[^"\\\x00-\x1f]|\\(?:["\\/bfnrt]|u[0-9a-fA-F]{4}))*"`;
|
|
1528
|
+
const selector = String.raw`select\(\s*${field}\s*\|\s*contains\(\s*${string}\s*\)\s*\)`;
|
|
1529
|
+
const traversal = String.raw`${field}(?:\[\])?\s*\|\s*(?:${selector}\s*\|\s*)?`;
|
|
1530
|
+
if (new RegExp(String.raw`^(?:${traversal})?${object}$`).test(filter)) return true;
|
|
1515
1531
|
const expression = filter
|
|
1516
1532
|
.replace(/\.[A-Za-z_][A-Za-z0-9_.-]*/g, "FIELD")
|
|
1517
1533
|
.replace(/\b[A-Za-z_][A-Za-z0-9_-]*\s*:/g, ":");
|
|
@@ -2004,6 +2020,51 @@ function isPassiveTextCommand(argv: string[]): boolean {
|
|
|
2004
2020
|
);
|
|
2005
2021
|
}
|
|
2006
2022
|
|
|
2023
|
+
/** Native data consumers only; ordinary path, expansion and redirect checks still apply. */
|
|
2024
|
+
function isReadonlyJqConsumer(argv: string[]): boolean {
|
|
2025
|
+
if (isPassiveTextCommand(argv)) return true;
|
|
2026
|
+
const name = argv[0]?.split("/").at(-1) ?? "";
|
|
2027
|
+
if (name === "sort")
|
|
2028
|
+
return argv
|
|
2029
|
+
.slice(1)
|
|
2030
|
+
.every(
|
|
2031
|
+
(arg) =>
|
|
2032
|
+
!arg.startsWith("-") || arg === "-" || arg === "--" || /^-[bdfgMhnRruVszcC]+$/.test(arg),
|
|
2033
|
+
);
|
|
2034
|
+
if (name === "uniq") return isReadonlyUniqConsumer(argv);
|
|
2035
|
+
if (["cat", "wc"].includes(name)) return isProvedCwdSubprocessRole(argv);
|
|
2036
|
+
return name === "tr";
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
/** uniq INPUT is a read; uniq INPUT OUTPUT is a write and cannot acquire this proof. */
|
|
2040
|
+
function isReadonlyUniqConsumer(argv: string[]): boolean {
|
|
2041
|
+
let operands = 0;
|
|
2042
|
+
let options = true;
|
|
2043
|
+
for (let index = 1; index < argv.length; index++) {
|
|
2044
|
+
const arg = argv[index] ?? "";
|
|
2045
|
+
if (options && arg === "--") {
|
|
2046
|
+
options = false;
|
|
2047
|
+
continue;
|
|
2048
|
+
}
|
|
2049
|
+
if (options) {
|
|
2050
|
+
if (/^-[cduiz]+$|^--(?:count|repeated|unique|ignore-case|zero-terminated)$/.test(arg))
|
|
2051
|
+
continue;
|
|
2052
|
+
const short = /^-[fsw]([0-9]*)$/.exec(arg);
|
|
2053
|
+
const long = /^--(?:skip-fields|skip-chars|check-chars)(?:=(.*))?$/.exec(arg);
|
|
2054
|
+
if (short || long) {
|
|
2055
|
+
const attached = short ? short[1] || undefined : long?.[1];
|
|
2056
|
+
const value = attached === undefined ? argv[++index] : attached;
|
|
2057
|
+
if (!/^[0-9]+$/.test(value ?? "")) return false;
|
|
2058
|
+
continue;
|
|
2059
|
+
}
|
|
2060
|
+
if (arg.startsWith("-") && arg !== "-") return false;
|
|
2061
|
+
}
|
|
2062
|
+
options = false;
|
|
2063
|
+
if (++operands > 1) return false;
|
|
2064
|
+
}
|
|
2065
|
+
return true;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2007
2068
|
/** One print program with optional numeric or escaped-regex addresses; no callbacks. */
|
|
2008
2069
|
function isReadonlySedPrint(argv: string[]): boolean {
|
|
2009
2070
|
if (argv[0]?.split("/").at(-1) !== "sed") return false;
|
|
@@ -2178,8 +2239,10 @@ function hasEnvironmentRead(
|
|
|
2178
2239
|
pipelines.some((pipeline) =>
|
|
2179
2240
|
pipeline.some(
|
|
2180
2241
|
(argv, index) =>
|
|
2181
|
-
literalSqlArgumentIndex(argv) !== undefined &&
|
|
2182
|
-
|
|
2242
|
+
(literalSqlArgumentIndex(argv) !== undefined &&
|
|
2243
|
+
pipeline.slice(index + 1).some((consumer) => !isPassiveTextCommand(consumer))) ||
|
|
2244
|
+
(isJqObjectConstruction(argv) &&
|
|
2245
|
+
pipeline.slice(index + 1).some((consumer) => !isReadonlyJqConsumer(consumer))),
|
|
2183
2246
|
),
|
|
2184
2247
|
)
|
|
2185
2248
|
)
|