@quantakrypto/core 0.4.0 → 0.4.1
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/codemods/config-toggle.d.ts.map +1 -1
- package/dist/codemods/config-toggle.js +7 -9
- package/dist/codemods/config-toggle.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/codemods/config-toggle.ts +7 -8
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-toggle.d.ts","sourceRoot":"","sources":["../../src/codemods/config-toggle.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"config-toggle.d.ts","sourceRoot":"","sources":["../../src/codemods/config-toggle.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAO,MAAM,mBAAmB,EAAE,OAqBjC,CAAC"}
|
|
@@ -4,15 +4,13 @@ export const configToggleCodemod = {
|
|
|
4
4
|
return finding.ruleId === "tls-legacy-version" || finding.ruleId === "tls-reject-unauthorized";
|
|
5
5
|
},
|
|
6
6
|
apply(content, finding) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
out = out.replace(/(rejectUnauthorized\s*:\s*)false/g, "$1true");
|
|
15
|
-
}
|
|
7
|
+
// Normalize ALL insecure TLS config in one pass (not just this finding's
|
|
8
|
+
// aspect), so a file with both issues is fully fixed by a single patch — the
|
|
9
|
+
// pipeline dedupes patches by file, and a partial patch would drop a sibling.
|
|
10
|
+
const out = content
|
|
11
|
+
.replace(/((?:minVersion|maxVersion)\s*:\s*['"`])TLSv1(?:\.1)?(['"`])/g, "$1TLSv1.3$2")
|
|
12
|
+
.replace(/(secureProtocol\s*:\s*['"`])TLSv1(?:_1)?_method(['"`])/g, "$1TLSv1_3_method$2")
|
|
13
|
+
.replace(/(rejectUnauthorized\s*:\s*)false/g, "$1true");
|
|
16
14
|
if (out === content)
|
|
17
15
|
return null;
|
|
18
16
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-toggle.js","sourceRoot":"","sources":["../../src/codemods/config-toggle.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,mBAAmB,GAAY;IAC1C,EAAE,EAAE,eAAe;IACnB,OAAO,CAAC,OAAgB;QACtB,OAAO,OAAO,CAAC,MAAM,KAAK,oBAAoB,IAAI,OAAO,CAAC,MAAM,KAAK,yBAAyB,CAAC;IACjG,CAAC;IACD,KAAK,CAAC,OAAe,EAAE,OAAgB;QACrC,
|
|
1
|
+
{"version":3,"file":"config-toggle.js","sourceRoot":"","sources":["../../src/codemods/config-toggle.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,mBAAmB,GAAY;IAC1C,EAAE,EAAE,eAAe;IACnB,OAAO,CAAC,OAAgB;QACtB,OAAO,OAAO,CAAC,MAAM,KAAK,oBAAoB,IAAI,OAAO,CAAC,MAAM,KAAK,yBAAyB,CAAC;IACjG,CAAC;IACD,KAAK,CAAC,OAAe,EAAE,OAAgB;QACrC,yEAAyE;QACzE,6EAA6E;QAC7E,8EAA8E;QAC9E,MAAM,GAAG,GAAG,OAAO;aAChB,OAAO,CAAC,8DAA8D,EAAE,aAAa,CAAC;aACtF,OAAO,CAAC,yDAAyD,EAAE,oBAAoB,CAAC;aACxF,OAAO,CAAC,mCAAmC,EAAE,QAAQ,CAAC,CAAC;QAC1D,IAAI,GAAG,KAAK,OAAO;YAAE,OAAO,IAAI,CAAC;QACjC,OAAO;YACL,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;YAC3B,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,MAAM,EAAE,SAAS;SAClB,CAAC;IACJ,CAAC;CACF,CAAC"}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quantakrypto/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Shared post-quantum readiness library: crypto detectors, vulnerable-dependency database, inventory + SARIF reporting. Zero runtime dependencies.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Dandelion Labs <hello@dandelionlabs.io> (https://dandelionlabs.io)",
|
|
@@ -16,14 +16,13 @@ export const configToggleCodemod: Codemod = {
|
|
|
16
16
|
return finding.ruleId === "tls-legacy-version" || finding.ruleId === "tls-reject-unauthorized";
|
|
17
17
|
},
|
|
18
18
|
apply(content: string, finding: Finding): Patch | null {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
19
|
+
// Normalize ALL insecure TLS config in one pass (not just this finding's
|
|
20
|
+
// aspect), so a file with both issues is fully fixed by a single patch — the
|
|
21
|
+
// pipeline dedupes patches by file, and a partial patch would drop a sibling.
|
|
22
|
+
const out = content
|
|
23
|
+
.replace(/((?:minVersion|maxVersion)\s*:\s*['"`])TLSv1(?:\.1)?(['"`])/g, "$1TLSv1.3$2")
|
|
24
|
+
.replace(/(secureProtocol\s*:\s*['"`])TLSv1(?:_1)?_method(['"`])/g, "$1TLSv1_3_method$2")
|
|
25
|
+
.replace(/(rejectUnauthorized\s*:\s*)false/g, "$1true");
|
|
27
26
|
if (out === content) return null;
|
|
28
27
|
return {
|
|
29
28
|
path: finding.location.file,
|
package/src/version.ts
CHANGED