@optimuslabs/harness-map-staging 1.5.19 → 1.5.20
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.
|
@@ -264,16 +264,46 @@ async function fetchManifest(endpointBase, machineUuid, uuids, timeoutMs = 8000)
|
|
|
264
264
|
// Enforce / remove
|
|
265
265
|
// ---------------------------------------------------------------------------
|
|
266
266
|
function setByPath(obj, path, value) {
|
|
267
|
-
const parts = path.split('.');
|
|
267
|
+
const parts = path.split('.').filter((part) => part.length > 0);
|
|
268
|
+
if (parts.length === 0)
|
|
269
|
+
return;
|
|
268
270
|
let current = obj;
|
|
269
271
|
for (let i = 0; i < parts.length - 1; i++) {
|
|
270
272
|
const part = parts[i];
|
|
271
|
-
if (
|
|
272
|
-
|
|
273
|
+
if (Array.isArray(current)) {
|
|
274
|
+
if (!/^\d+$/.test(part))
|
|
275
|
+
return;
|
|
276
|
+
const idx = Number(part);
|
|
277
|
+
if (idx >= current.length)
|
|
278
|
+
return;
|
|
279
|
+
current = current[idx];
|
|
280
|
+
continue;
|
|
273
281
|
}
|
|
274
|
-
current
|
|
282
|
+
if (current == null || typeof current !== 'object')
|
|
283
|
+
return;
|
|
284
|
+
const rec = current;
|
|
285
|
+
const next = rec[part];
|
|
286
|
+
if (Array.isArray(next)) {
|
|
287
|
+
current = next;
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
if (next == null || typeof next !== 'object') {
|
|
291
|
+
rec[part] = {};
|
|
292
|
+
}
|
|
293
|
+
current = rec[part];
|
|
294
|
+
}
|
|
295
|
+
const leaf = parts[parts.length - 1];
|
|
296
|
+
if (Array.isArray(current)) {
|
|
297
|
+
if (!/^\d+$/.test(leaf))
|
|
298
|
+
return;
|
|
299
|
+
const idx = Number(leaf);
|
|
300
|
+
if (idx >= 0 && idx < current.length)
|
|
301
|
+
current[idx] = value;
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
if (current != null && typeof current === 'object') {
|
|
305
|
+
current[leaf] = value;
|
|
275
306
|
}
|
|
276
|
-
current[parts[parts.length - 1]] = value;
|
|
277
307
|
}
|
|
278
308
|
/** Traverse a JSON object using dot-notation path. Returns undefined if any segment is missing. */
|
|
279
309
|
function getByPath(obj, path) {
|
|
@@ -57,6 +57,9 @@ const KNOWN_SECRET_PATTERNS = [
|
|
|
57
57
|
{ re: /dop_v1_[a-f0-9]{64}/i, label: 'DigitalOcean personal access token' },
|
|
58
58
|
{ re: /pat_[a-zA-Z0-9]{22}_[a-fA-F0-9]{59}/i, label: 'Atlassian API token' },
|
|
59
59
|
{ re: /Bearer\s+[a-zA-Z0-9\-_.]{20,}/i, label: 'Bearer token' },
|
|
60
|
+
// Isolated 32-hex (Azure OpenAI). Lookarounds keep a longer hex string from matching.
|
|
61
|
+
// Same pattern as HardcodedSecretRule — MCP tokens in args (ISO-005) are this shape.
|
|
62
|
+
{ re: /(?<![a-zA-Z0-9])[a-fA-F0-9]{32}(?![a-zA-Z0-9])/, label: 'Azure OpenAI key' },
|
|
60
63
|
];
|
|
61
64
|
const BASIC_AUTH_IN_URL = /[a-zA-Z0-9._%+-]+:[a-zA-Z0-9._%+-]+@/gi;
|
|
62
65
|
// Hyphens/underscores count as part of one token so hyphenated keys (ctx7sk-..., sk-ant-...)
|