deepline 0.2.19 → 0.2.21
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/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/secret-guardrails.ts +0 -42
- package/dist/cli/index.js +418 -170
- package/dist/cli/index.mjs +388 -140
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/install-integrity.json +234 -0
- package/dist/plays/bundle-play-file.mjs +0 -30
- package/package.json +9 -5
|
@@ -160,7 +160,7 @@ export const SDK_RELEASE = {
|
|
|
160
160
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
161
161
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
162
162
|
// release keeps lazy paging semantics independent of row residency.
|
|
163
|
-
version: '0.2.
|
|
163
|
+
version: '0.2.21',
|
|
164
164
|
contracts: {
|
|
165
165
|
api: {
|
|
166
166
|
name: 'sdk-http-api',
|
|
@@ -5,34 +5,6 @@ const PRIVATE_KEY_PATTERN =
|
|
|
5
5
|
const BEARER_LITERAL_PATTERN = /\bBearer\s+[A-Za-z0-9._~+/=-]{16,}/i;
|
|
6
6
|
const ASSIGNMENT_SECRET_LITERAL_PATTERN =
|
|
7
7
|
/\b(?:api[_-]?key|token|secret|password)\b\s*[:=]\s*['"][^'"]{12,}['"]/i;
|
|
8
|
-
const HIGH_ENTROPY_LITERAL_PATTERN = /['"]([A-Za-z0-9+/=_-]{32,})['"]/g;
|
|
9
|
-
const UUID_IDENTIFIER_PATTERN =
|
|
10
|
-
/^((?:[A-Za-z0-9]+[-_])*)?([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i;
|
|
11
|
-
const BOOTSTRAP_RESOURCE_IDENTIFIER_PATTERN =
|
|
12
|
-
/^bootstrap-[0-9a-f]{32}(?:\/[a-z0-9][a-z0-9_-]{0,127})?$/i;
|
|
13
|
-
const SECRET_LABEL_PATTERN =
|
|
14
|
-
/(?:^|[-_])(?:api|auth|access|secret|token|key|password|credential|bearer|sk|pk|live)(?:[-_]|$)/i;
|
|
15
|
-
|
|
16
|
-
function shannonEntropy(value: string): number {
|
|
17
|
-
const counts = new Map<string, number>();
|
|
18
|
-
for (const char of value) counts.set(char, (counts.get(char) ?? 0) + 1);
|
|
19
|
-
return [...counts.values()].reduce((entropy, count) => {
|
|
20
|
-
const p = count / value.length;
|
|
21
|
-
return entropy - p * Math.log2(p);
|
|
22
|
-
}, 0);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function isNonSecretUuidIdentifier(value: string): boolean {
|
|
26
|
-
const match = UUID_IDENTIFIER_PATTERN.exec(value);
|
|
27
|
-
if (!match) return false;
|
|
28
|
-
const label = match[1] ?? '';
|
|
29
|
-
return !SECRET_LABEL_PATTERN.test(label);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function isNonSecretBootstrapResourceIdentifier(value: string): boolean {
|
|
33
|
-
return BOOTSTRAP_RESOURCE_IDENTIFIER_PATTERN.test(value);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
8
|
/**
|
|
37
9
|
* Returns the inline-secret findings in a string (empty if none). The throwing
|
|
38
10
|
* validator below and the workflows→plays migration validator both call this so
|
|
@@ -50,20 +22,6 @@ export function collectInlineSecretFindings(sourceCode: string): string[] {
|
|
|
50
22
|
if (ASSIGNMENT_SECRET_LITERAL_PATTERN.test(sourceCode)) {
|
|
51
23
|
findings.push('secret-looking assignment literal');
|
|
52
24
|
}
|
|
53
|
-
for (const match of sourceCode.matchAll(HIGH_ENTROPY_LITERAL_PATTERN)) {
|
|
54
|
-
const literal = match[1] ?? '';
|
|
55
|
-
// UUID-bearing resource names are structured identifiers, not opaque
|
|
56
|
-
// credentials. Keep secret-looking labels on the conservative path.
|
|
57
|
-
if (isNonSecretUuidIdentifier(literal)) continue;
|
|
58
|
-
// Named CI orgs use a deterministic public `bootstrap-<sha256-prefix>`
|
|
59
|
-
// slug. It is an address, not a credential, and owner-qualified ctx.runPlay
|
|
60
|
-
// references must embed it as a literal for static child resolution.
|
|
61
|
-
if (isNonSecretBootstrapResourceIdentifier(literal)) continue;
|
|
62
|
-
if (literal.length >= 40 && shannonEntropy(literal) >= 4.2) {
|
|
63
|
-
findings.push('high-entropy string literal');
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
25
|
return [...new Set(findings)];
|
|
68
26
|
}
|
|
69
27
|
|