@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.
@@ -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,OAsBjC,CAAC"}
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
- let out = content;
8
- if (finding.ruleId === "tls-legacy-version") {
9
- out = out
10
- .replace(/((?:minVersion|maxVersion)\s*:\s*['"`])TLSv1(?:\.1)?(['"`])/g, "$1TLSv1.3$2")
11
- .replace(/(secureProtocol\s*:\s*['"`])TLSv1(?:_1)?_method(['"`])/g, "$1TLSv1_3_method$2");
12
- }
13
- else if (finding.ruleId === "tls-reject-unauthorized") {
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,IAAI,GAAG,GAAG,OAAO,CAAC;QAClB,IAAI,OAAO,CAAC,MAAM,KAAK,oBAAoB,EAAE,CAAC;YAC5C,GAAG,GAAG,GAAG;iBACN,OAAO,CAAC,8DAA8D,EAAE,aAAa,CAAC;iBACtF,OAAO,CAAC,yDAAyD,EAAE,oBAAoB,CAAC,CAAC;QAC9F,CAAC;aAAM,IAAI,OAAO,CAAC,MAAM,KAAK,yBAAyB,EAAE,CAAC;YACxD,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,mCAAmC,EAAE,QAAQ,CAAC,CAAC;QACnE,CAAC;QACD,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"}
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
@@ -3,5 +3,5 @@
3
3
  * the scan orchestrator can import it without creating a cycle through index.ts.
4
4
  * Keep in sync with packages/core/package.json.
5
5
  */
6
- export declare const VERSION = "0.4.0";
6
+ export declare const VERSION = "0.4.1";
7
7
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -3,5 +3,5 @@
3
3
  * the scan orchestrator can import it without creating a cycle through index.ts.
4
4
  * Keep in sync with packages/core/package.json.
5
5
  */
6
- export const VERSION = "0.4.0";
6
+ export const VERSION = "0.4.1";
7
7
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantakrypto/core",
3
- "version": "0.4.0",
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
- let out = content;
20
- if (finding.ruleId === "tls-legacy-version") {
21
- out = out
22
- .replace(/((?:minVersion|maxVersion)\s*:\s*['"`])TLSv1(?:\.1)?(['"`])/g, "$1TLSv1.3$2")
23
- .replace(/(secureProtocol\s*:\s*['"`])TLSv1(?:_1)?_method(['"`])/g, "$1TLSv1_3_method$2");
24
- } else if (finding.ruleId === "tls-reject-unauthorized") {
25
- out = out.replace(/(rejectUnauthorized\s*:\s*)false/g, "$1true");
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
@@ -3,4 +3,4 @@
3
3
  * the scan orchestrator can import it without creating a cycle through index.ts.
4
4
  * Keep in sync with packages/core/package.json.
5
5
  */
6
- export const VERSION = "0.4.0";
6
+ export const VERSION = "0.4.1";