api-tests-coverage 1.0.13 → 1.0.14
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/src/pipeline/confidence.d.ts +70 -0
- package/dist/src/pipeline/confidence.d.ts.map +1 -0
- package/dist/src/pipeline/confidence.js +198 -0
- package/dist/src/pipeline/graph.d.ts +58 -0
- package/dist/src/pipeline/graph.d.ts.map +1 -0
- package/dist/src/pipeline/graph.js +199 -0
- package/dist/src/pipeline/index.d.ts +24 -0
- package/dist/src/pipeline/index.d.ts.map +1 -0
- package/dist/src/pipeline/index.js +41 -0
- package/dist/src/pipeline/orchestrator.d.ts +42 -0
- package/dist/src/pipeline/orchestrator.d.ts.map +1 -0
- package/dist/src/pipeline/orchestrator.js +115 -0
- package/dist/src/pipeline/stageInterface.d.ts +45 -0
- package/dist/src/pipeline/stageInterface.d.ts.map +1 -0
- package/dist/src/pipeline/stageInterface.js +17 -0
- package/dist/src/pipeline/stages/ast/abstractLayerTraversal.d.ts +38 -0
- package/dist/src/pipeline/stages/ast/abstractLayerTraversal.d.ts.map +1 -0
- package/dist/src/pipeline/stages/ast/abstractLayerTraversal.js +203 -0
- package/dist/src/pipeline/stages/ast/astStage.d.ts +19 -0
- package/dist/src/pipeline/stages/ast/astStage.d.ts.map +1 -0
- package/dist/src/pipeline/stages/ast/astStage.js +238 -0
- package/dist/src/pipeline/stages/ast/crossFileResolver.d.ts +23 -0
- package/dist/src/pipeline/stages/ast/crossFileResolver.d.ts.map +1 -0
- package/dist/src/pipeline/stages/ast/crossFileResolver.js +183 -0
- package/dist/src/pipeline/stages/ast/graphBuilder.d.ts +15 -0
- package/dist/src/pipeline/stages/ast/graphBuilder.d.ts.map +1 -0
- package/dist/src/pipeline/stages/ast/graphBuilder.js +268 -0
- package/dist/src/pipeline/stages/ast/importResolver.d.ts +22 -0
- package/dist/src/pipeline/stages/ast/importResolver.d.ts.map +1 -0
- package/dist/src/pipeline/stages/ast/importResolver.js +186 -0
- package/dist/src/pipeline/stages/ast/types.d.ts +85 -0
- package/dist/src/pipeline/stages/ast/types.d.ts.map +1 -0
- package/dist/src/pipeline/stages/ast/types.js +5 -0
- package/dist/src/pipeline/stages/dast/conflictEmitter.d.ts +25 -0
- package/dist/src/pipeline/stages/dast/conflictEmitter.d.ts.map +1 -0
- package/dist/src/pipeline/stages/dast/conflictEmitter.js +90 -0
- package/dist/src/pipeline/stages/dast/dastStage.d.ts +17 -0
- package/dist/src/pipeline/stages/dast/dastStage.d.ts.map +1 -0
- package/dist/src/pipeline/stages/dast/dastStage.js +203 -0
- package/dist/src/pipeline/stages/dast/types.d.ts +49 -0
- package/dist/src/pipeline/stages/dast/types.d.ts.map +1 -0
- package/dist/src/pipeline/stages/dast/types.js +9 -0
- package/dist/src/pipeline/stages/iast/iastStage.d.ts +17 -0
- package/dist/src/pipeline/stages/iast/iastStage.d.ts.map +1 -0
- package/dist/src/pipeline/stages/iast/iastStage.js +191 -0
- package/dist/src/pipeline/stages/iast/types.d.ts +48 -0
- package/dist/src/pipeline/stages/iast/types.d.ts.map +1 -0
- package/dist/src/pipeline/stages/iast/types.js +8 -0
- package/dist/src/pipeline/stages/merge/conflictDetector.d.ts +17 -0
- package/dist/src/pipeline/stages/merge/conflictDetector.d.ts.map +1 -0
- package/dist/src/pipeline/stages/merge/conflictDetector.js +60 -0
- package/dist/src/pipeline/stages/merge/coverageMappingBuilder.d.ts +15 -0
- package/dist/src/pipeline/stages/merge/coverageMappingBuilder.d.ts.map +1 -0
- package/dist/src/pipeline/stages/merge/coverageMappingBuilder.js +141 -0
- package/dist/src/pipeline/stages/merge/mergeRules.d.ts +39 -0
- package/dist/src/pipeline/stages/merge/mergeRules.d.ts.map +1 -0
- package/dist/src/pipeline/stages/merge/mergeRules.js +90 -0
- package/dist/src/pipeline/stages/merge/mergeStage.d.ts +20 -0
- package/dist/src/pipeline/stages/merge/mergeStage.d.ts.map +1 -0
- package/dist/src/pipeline/stages/merge/mergeStage.js +145 -0
- package/dist/src/pipeline/stages/merge/summaryComputer.d.ts +11 -0
- package/dist/src/pipeline/stages/merge/summaryComputer.d.ts.map +1 -0
- package/dist/src/pipeline/stages/merge/summaryComputer.js +46 -0
- package/dist/src/pipeline/stages/sca/ciDetector.d.ts +15 -0
- package/dist/src/pipeline/stages/sca/ciDetector.d.ts.map +1 -0
- package/dist/src/pipeline/stages/sca/ciDetector.js +87 -0
- package/dist/src/pipeline/stages/sca/dependencyClassification.d.ts +31 -0
- package/dist/src/pipeline/stages/sca/dependencyClassification.d.ts.map +1 -0
- package/dist/src/pipeline/stages/sca/dependencyClassification.js +296 -0
- package/dist/src/pipeline/stages/sca/dependencyDetector.d.ts +25 -0
- package/dist/src/pipeline/stages/sca/dependencyDetector.d.ts.map +1 -0
- package/dist/src/pipeline/stages/sca/dependencyDetector.js +416 -0
- package/dist/src/pipeline/stages/sca/scaStage.d.ts +21 -0
- package/dist/src/pipeline/stages/sca/scaStage.d.ts.map +1 -0
- package/dist/src/pipeline/stages/sca/scaStage.js +208 -0
- package/dist/src/pipeline/stages/sca/types.d.ts +61 -0
- package/dist/src/pipeline/stages/sca/types.d.ts.map +1 -0
- package/dist/src/pipeline/stages/sca/types.js +9 -0
- package/dist/src/pipeline/stages/tia/mockBoundaryDetector.d.ts +19 -0
- package/dist/src/pipeline/stages/tia/mockBoundaryDetector.d.ts.map +1 -0
- package/dist/src/pipeline/stages/tia/mockBoundaryDetector.js +118 -0
- package/dist/src/pipeline/stages/tia/parameterizedTestExpander.d.ts +20 -0
- package/dist/src/pipeline/stages/tia/parameterizedTestExpander.d.ts.map +1 -0
- package/dist/src/pipeline/stages/tia/parameterizedTestExpander.js +238 -0
- package/dist/src/pipeline/stages/tia/testEndpointMapper.d.ts +22 -0
- package/dist/src/pipeline/stages/tia/testEndpointMapper.d.ts.map +1 -0
- package/dist/src/pipeline/stages/tia/testEndpointMapper.js +134 -0
- package/dist/src/pipeline/stages/tia/testLayerClassifier.d.ts +16 -0
- package/dist/src/pipeline/stages/tia/testLayerClassifier.d.ts.map +1 -0
- package/dist/src/pipeline/stages/tia/testLayerClassifier.js +191 -0
- package/dist/src/pipeline/stages/tia/tiaStage.d.ts +20 -0
- package/dist/src/pipeline/stages/tia/tiaStage.d.ts.map +1 -0
- package/dist/src/pipeline/stages/tia/tiaStage.js +215 -0
- package/dist/src/pipeline/stages/tia/types.d.ts +52 -0
- package/dist/src/pipeline/stages/tia/types.d.ts.map +1 -0
- package/dist/src/pipeline/stages/tia/types.js +5 -0
- package/dist/src/pipeline/types.d.ts +128 -0
- package/dist/src/pipeline/types.d.ts.map +1 -0
- package/dist/src/pipeline/types.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CI platform detection.
|
|
4
|
+
*
|
|
5
|
+
* Detects the CI platform from project structure by checking
|
|
6
|
+
* for well-known CI configuration files.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.detectCiPlatform = detectCiPlatform;
|
|
43
|
+
const fs = __importStar(require("fs"));
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
const CI_DETECTION_RULES = [
|
|
46
|
+
{
|
|
47
|
+
platform: 'github-actions',
|
|
48
|
+
paths: ['.github/workflows'],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
platform: 'gitlab-ci',
|
|
52
|
+
paths: ['.gitlab-ci.yml', '.gitlab-ci.yaml'],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
platform: 'jenkins',
|
|
56
|
+
paths: ['Jenkinsfile', 'jenkins/Jenkinsfile'],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
platform: 'azure-devops',
|
|
60
|
+
paths: ['azure-pipelines.yml', 'azure-pipelines.yaml', '.azure-pipelines'],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
platform: 'circleci',
|
|
64
|
+
paths: ['.circleci/config.yml', '.circleci/config.yaml'],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
platform: 'travis-ci',
|
|
68
|
+
paths: ['.travis.yml', '.travis.yaml'],
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
/**
|
|
72
|
+
* Detect the CI platform from project structure.
|
|
73
|
+
*
|
|
74
|
+
* Returns the first matching platform, or 'none' if no CI configuration is found.
|
|
75
|
+
* Checks directories with `fs.existsSync` which handles both files and directories.
|
|
76
|
+
*/
|
|
77
|
+
function detectCiPlatform(projectRoot) {
|
|
78
|
+
for (const rule of CI_DETECTION_RULES) {
|
|
79
|
+
for (const relPath of rule.paths) {
|
|
80
|
+
const fullPath = path.join(projectRoot, relPath);
|
|
81
|
+
if (fs.existsSync(fullPath)) {
|
|
82
|
+
return rule.platform;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return 'none';
|
|
87
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency classification lookup table.
|
|
3
|
+
*
|
|
4
|
+
* Maps ~200 common dependency names to their functional category.
|
|
5
|
+
* Used by the SCA stage to classify project dependencies into
|
|
6
|
+
* httpClients, testFrameworks, assertionLibraries, mockingLibraries,
|
|
7
|
+
* securityLibraries, performanceTools, e2eFrameworks, and frameworks.
|
|
8
|
+
*/
|
|
9
|
+
import type { DependencyCategory } from './types';
|
|
10
|
+
/**
|
|
11
|
+
* Lookup table: dependency name (lowercased) → category.
|
|
12
|
+
*
|
|
13
|
+
* Entries are grouped by language ecosystem for readability.
|
|
14
|
+
* When matching, we also support partial/contains matching for
|
|
15
|
+
* certain patterns (e.g. "spring-security-*" → securityLibrary).
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEPENDENCY_CLASSIFICATION: Record<string, DependencyCategory>;
|
|
18
|
+
/**
|
|
19
|
+
* Prefix patterns for fuzzy matching.
|
|
20
|
+
* If a dependency name starts with any of these prefixes, it gets the associated category.
|
|
21
|
+
*/
|
|
22
|
+
export declare const DEPENDENCY_PREFIX_RULES: Array<{
|
|
23
|
+
prefix: string;
|
|
24
|
+
category: DependencyCategory;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Classify a dependency name into a category.
|
|
28
|
+
* Returns 'unknown' if no match is found.
|
|
29
|
+
*/
|
|
30
|
+
export declare function classifyDependency(name: string): DependencyCategory;
|
|
31
|
+
//# sourceMappingURL=dependencyClassification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencyClassification.d.ts","sourceRoot":"","sources":["../../../../../src/pipeline/stages/sca/dependencyClassification.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAoPxE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,kBAAkB,CAAA;CAAE,CAe3F,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAiBnE"}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Dependency classification lookup table.
|
|
4
|
+
*
|
|
5
|
+
* Maps ~200 common dependency names to their functional category.
|
|
6
|
+
* Used by the SCA stage to classify project dependencies into
|
|
7
|
+
* httpClients, testFrameworks, assertionLibraries, mockingLibraries,
|
|
8
|
+
* securityLibraries, performanceTools, e2eFrameworks, and frameworks.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.DEPENDENCY_PREFIX_RULES = exports.DEPENDENCY_CLASSIFICATION = void 0;
|
|
12
|
+
exports.classifyDependency = classifyDependency;
|
|
13
|
+
/**
|
|
14
|
+
* Lookup table: dependency name (lowercased) → category.
|
|
15
|
+
*
|
|
16
|
+
* Entries are grouped by language ecosystem for readability.
|
|
17
|
+
* When matching, we also support partial/contains matching for
|
|
18
|
+
* certain patterns (e.g. "spring-security-*" → securityLibrary).
|
|
19
|
+
*/
|
|
20
|
+
exports.DEPENDENCY_CLASSIFICATION = {
|
|
21
|
+
// ─── HTTP Clients ───────────────────────────────────────────────────────────
|
|
22
|
+
// JavaScript/TypeScript
|
|
23
|
+
axios: 'httpClient',
|
|
24
|
+
got: 'httpClient',
|
|
25
|
+
'node-fetch': 'httpClient',
|
|
26
|
+
'cross-fetch': 'httpClient',
|
|
27
|
+
'isomorphic-fetch': 'httpClient',
|
|
28
|
+
ky: 'httpClient',
|
|
29
|
+
superagent: 'httpClient',
|
|
30
|
+
undici: 'httpClient',
|
|
31
|
+
needle: 'httpClient',
|
|
32
|
+
request: 'httpClient',
|
|
33
|
+
// Java/Kotlin
|
|
34
|
+
'retrofit2': 'httpClient',
|
|
35
|
+
'okhttp': 'httpClient',
|
|
36
|
+
'okhttp3': 'httpClient',
|
|
37
|
+
'httpclient': 'httpClient',
|
|
38
|
+
'httpcore': 'httpClient',
|
|
39
|
+
'java-http-client': 'httpClient',
|
|
40
|
+
'spring-web': 'httpClient',
|
|
41
|
+
'webclient': 'httpClient',
|
|
42
|
+
'resttemplate': 'httpClient',
|
|
43
|
+
'feign-core': 'httpClient',
|
|
44
|
+
'spring-cloud-starter-openfeign': 'httpClient',
|
|
45
|
+
// Python
|
|
46
|
+
requests: 'httpClient',
|
|
47
|
+
httpx: 'httpClient',
|
|
48
|
+
aiohttp: 'httpClient',
|
|
49
|
+
urllib3: 'httpClient',
|
|
50
|
+
httplib2: 'httpClient',
|
|
51
|
+
// ─── Test Frameworks ────────────────────────────────────────────────────────
|
|
52
|
+
// JavaScript/TypeScript
|
|
53
|
+
jest: 'testFramework',
|
|
54
|
+
'ts-jest': 'testFramework',
|
|
55
|
+
mocha: 'testFramework',
|
|
56
|
+
jasmine: 'testFramework',
|
|
57
|
+
'jasmine-core': 'testFramework',
|
|
58
|
+
ava: 'testFramework',
|
|
59
|
+
tape: 'testFramework',
|
|
60
|
+
vitest: 'testFramework',
|
|
61
|
+
// Java
|
|
62
|
+
'junit-jupiter': 'testFramework',
|
|
63
|
+
'junit-jupiter-api': 'testFramework',
|
|
64
|
+
'junit-jupiter-engine': 'testFramework',
|
|
65
|
+
'junit-jupiter-params': 'testFramework',
|
|
66
|
+
'junit-vintage-engine': 'testFramework',
|
|
67
|
+
junit: 'testFramework',
|
|
68
|
+
'junit-platform-launcher': 'testFramework',
|
|
69
|
+
testng: 'testFramework',
|
|
70
|
+
'spring-boot-starter-test': 'testFramework',
|
|
71
|
+
// Kotlin
|
|
72
|
+
'kotest-runner-junit5': 'testFramework',
|
|
73
|
+
'kotest-framework-engine': 'testFramework',
|
|
74
|
+
'kotest-assertions-core': 'testFramework',
|
|
75
|
+
// Python
|
|
76
|
+
pytest: 'testFramework',
|
|
77
|
+
'pytest-asyncio': 'testFramework',
|
|
78
|
+
'pytest-xdist': 'testFramework',
|
|
79
|
+
'pytest-cov': 'testFramework',
|
|
80
|
+
unittest2: 'testFramework',
|
|
81
|
+
nose2: 'testFramework',
|
|
82
|
+
// Ruby
|
|
83
|
+
rspec: 'testFramework',
|
|
84
|
+
'rspec-core': 'testFramework',
|
|
85
|
+
'rspec-rails': 'testFramework',
|
|
86
|
+
minitest: 'testFramework',
|
|
87
|
+
// ─── Assertion Libraries ────────────────────────────────────────────────────
|
|
88
|
+
// JavaScript/TypeScript
|
|
89
|
+
chai: 'assertionLibrary',
|
|
90
|
+
'chai-http': 'assertionLibrary',
|
|
91
|
+
'chai-as-promised': 'assertionLibrary',
|
|
92
|
+
expect: 'assertionLibrary',
|
|
93
|
+
'power-assert': 'assertionLibrary',
|
|
94
|
+
'should': 'assertionLibrary',
|
|
95
|
+
'unexpected': 'assertionLibrary',
|
|
96
|
+
// Java
|
|
97
|
+
assertj: 'assertionLibrary',
|
|
98
|
+
'assertj-core': 'assertionLibrary',
|
|
99
|
+
hamcrest: 'assertionLibrary',
|
|
100
|
+
'hamcrest-core': 'assertionLibrary',
|
|
101
|
+
'hamcrest-all': 'assertionLibrary',
|
|
102
|
+
'truth': 'assertionLibrary',
|
|
103
|
+
// Python
|
|
104
|
+
'pytest-assume': 'assertionLibrary',
|
|
105
|
+
'assertpy': 'assertionLibrary',
|
|
106
|
+
// ─── Mocking Libraries ─────────────────────────────────────────────────────
|
|
107
|
+
// JavaScript/TypeScript
|
|
108
|
+
sinon: 'mockingLibrary',
|
|
109
|
+
nock: 'mockingLibrary',
|
|
110
|
+
'msw': 'mockingLibrary',
|
|
111
|
+
'jest-mock-extended': 'mockingLibrary',
|
|
112
|
+
testdouble: 'mockingLibrary',
|
|
113
|
+
proxyquire: 'mockingLibrary',
|
|
114
|
+
rewire: 'mockingLibrary',
|
|
115
|
+
// Java
|
|
116
|
+
'mockito-core': 'mockingLibrary',
|
|
117
|
+
'mockito-junit-jupiter': 'mockingLibrary',
|
|
118
|
+
'mockito-inline': 'mockingLibrary',
|
|
119
|
+
mockito: 'mockingLibrary',
|
|
120
|
+
powermock: 'mockingLibrary',
|
|
121
|
+
'powermock-api-mockito2': 'mockingLibrary',
|
|
122
|
+
easymock: 'mockingLibrary',
|
|
123
|
+
wiremock: 'mockingLibrary',
|
|
124
|
+
// Kotlin
|
|
125
|
+
mockk: 'mockingLibrary',
|
|
126
|
+
'mockk-android': 'mockingLibrary',
|
|
127
|
+
// Python
|
|
128
|
+
'pytest-mock': 'mockingLibrary',
|
|
129
|
+
'responses': 'mockingLibrary',
|
|
130
|
+
'requests-mock': 'mockingLibrary',
|
|
131
|
+
'vcrpy': 'mockingLibrary',
|
|
132
|
+
'httpretty': 'mockingLibrary',
|
|
133
|
+
'freezegun': 'mockingLibrary',
|
|
134
|
+
'time-machine': 'mockingLibrary',
|
|
135
|
+
// Ruby
|
|
136
|
+
'webmock': 'mockingLibrary',
|
|
137
|
+
'vcr': 'mockingLibrary',
|
|
138
|
+
'mocha-ruby': 'mockingLibrary',
|
|
139
|
+
// ─── Security Libraries ─────────────────────────────────────────────────────
|
|
140
|
+
// JavaScript/TypeScript
|
|
141
|
+
passport: 'securityLibrary',
|
|
142
|
+
'passport-jwt': 'securityLibrary',
|
|
143
|
+
'passport-local': 'securityLibrary',
|
|
144
|
+
helmet: 'securityLibrary',
|
|
145
|
+
cors: 'securityLibrary',
|
|
146
|
+
csurf: 'securityLibrary',
|
|
147
|
+
'express-rate-limit': 'securityLibrary',
|
|
148
|
+
jsonwebtoken: 'securityLibrary',
|
|
149
|
+
bcrypt: 'securityLibrary',
|
|
150
|
+
bcryptjs: 'securityLibrary',
|
|
151
|
+
'jose': 'securityLibrary',
|
|
152
|
+
// Java
|
|
153
|
+
'spring-security-core': 'securityLibrary',
|
|
154
|
+
'spring-security-web': 'securityLibrary',
|
|
155
|
+
'spring-security-config': 'securityLibrary',
|
|
156
|
+
'spring-security-test': 'securityLibrary',
|
|
157
|
+
'spring-boot-starter-security': 'securityLibrary',
|
|
158
|
+
'spring-security-oauth2': 'securityLibrary',
|
|
159
|
+
'java-jwt': 'securityLibrary',
|
|
160
|
+
'jjwt': 'securityLibrary',
|
|
161
|
+
'jjwt-api': 'securityLibrary',
|
|
162
|
+
'nimbus-jose-jwt': 'securityLibrary',
|
|
163
|
+
'keycloak-spring-boot-starter': 'securityLibrary',
|
|
164
|
+
// Python
|
|
165
|
+
'django-cors-headers': 'securityLibrary',
|
|
166
|
+
'python-jose': 'securityLibrary',
|
|
167
|
+
'pyjwt': 'securityLibrary',
|
|
168
|
+
'passlib': 'securityLibrary',
|
|
169
|
+
'python-multipart': 'securityLibrary',
|
|
170
|
+
'authlib': 'securityLibrary',
|
|
171
|
+
// ─── Performance Tools ──────────────────────────────────────────────────────
|
|
172
|
+
k6: 'performanceTool',
|
|
173
|
+
gatling: 'performanceTool',
|
|
174
|
+
'gatling-charts-highcharts': 'performanceTool',
|
|
175
|
+
locust: 'performanceTool',
|
|
176
|
+
artillery: 'performanceTool',
|
|
177
|
+
autocannon: 'performanceTool',
|
|
178
|
+
vegeta: 'performanceTool',
|
|
179
|
+
wrk: 'performanceTool',
|
|
180
|
+
'clinic': 'performanceTool',
|
|
181
|
+
'jmeter': 'performanceTool',
|
|
182
|
+
// ─── E2E Frameworks ────────────────────────────────────────────────────────
|
|
183
|
+
cypress: 'e2eFramework',
|
|
184
|
+
playwright: 'e2eFramework',
|
|
185
|
+
'@playwright/test': 'e2eFramework',
|
|
186
|
+
selenium: 'e2eFramework',
|
|
187
|
+
'selenium-webdriver': 'e2eFramework',
|
|
188
|
+
webdriverio: 'e2eFramework',
|
|
189
|
+
puppeteer: 'e2eFramework',
|
|
190
|
+
testcafe: 'e2eFramework',
|
|
191
|
+
nightwatch: 'e2eFramework',
|
|
192
|
+
'cucumber-js': 'e2eFramework',
|
|
193
|
+
'@cucumber/cucumber': 'e2eFramework',
|
|
194
|
+
// Java
|
|
195
|
+
'cucumber-java': 'e2eFramework',
|
|
196
|
+
'cucumber-junit': 'e2eFramework',
|
|
197
|
+
'cucumber-spring': 'e2eFramework',
|
|
198
|
+
'selenium-java': 'e2eFramework',
|
|
199
|
+
// Python
|
|
200
|
+
behave: 'e2eFramework',
|
|
201
|
+
'pytest-bdd': 'e2eFramework',
|
|
202
|
+
'selenium-python': 'e2eFramework',
|
|
203
|
+
splinter: 'e2eFramework',
|
|
204
|
+
// Ruby
|
|
205
|
+
capybara: 'e2eFramework',
|
|
206
|
+
'cucumber-ruby': 'e2eFramework',
|
|
207
|
+
// ─── Frameworks ────────────────────────────────────────────────────────────
|
|
208
|
+
// JavaScript/TypeScript
|
|
209
|
+
express: 'framework',
|
|
210
|
+
'@nestjs/core': 'framework',
|
|
211
|
+
'@nestjs/common': 'framework',
|
|
212
|
+
'fastify': 'framework',
|
|
213
|
+
koa: 'framework',
|
|
214
|
+
hapi: 'framework',
|
|
215
|
+
'@hapi/hapi': 'framework',
|
|
216
|
+
'next': 'framework',
|
|
217
|
+
nuxt: 'framework',
|
|
218
|
+
// Java
|
|
219
|
+
'spring-boot': 'framework',
|
|
220
|
+
'spring-boot-starter-web': 'framework',
|
|
221
|
+
'spring-boot-starter-webflux': 'framework',
|
|
222
|
+
'spring-webmvc': 'framework',
|
|
223
|
+
'ktor-server-core': 'framework',
|
|
224
|
+
'ktor-server-netty': 'framework',
|
|
225
|
+
'ktor-server-cio': 'framework',
|
|
226
|
+
'quarkus-resteasy': 'framework',
|
|
227
|
+
'micronaut-http-server-netty': 'framework',
|
|
228
|
+
// Python
|
|
229
|
+
django: 'framework',
|
|
230
|
+
'django-rest-framework': 'framework',
|
|
231
|
+
'djangorestframework': 'framework',
|
|
232
|
+
flask: 'framework',
|
|
233
|
+
fastapi: 'framework',
|
|
234
|
+
starlette: 'framework',
|
|
235
|
+
tornado: 'framework',
|
|
236
|
+
sanic: 'framework',
|
|
237
|
+
// Ruby
|
|
238
|
+
rails: 'framework',
|
|
239
|
+
sinatra: 'framework',
|
|
240
|
+
grape: 'framework',
|
|
241
|
+
// ─── Database ────────────────────────────────────────────────────────────
|
|
242
|
+
pg: 'database',
|
|
243
|
+
mysql2: 'database',
|
|
244
|
+
sequelize: 'database',
|
|
245
|
+
typeorm: 'database',
|
|
246
|
+
prisma: 'database',
|
|
247
|
+
'@prisma/client': 'database',
|
|
248
|
+
mongoose: 'database',
|
|
249
|
+
knex: 'database',
|
|
250
|
+
'better-sqlite3': 'database',
|
|
251
|
+
// ─── HTTP Testing ───────────────────────────────────────────────────────
|
|
252
|
+
supertest: 'testFramework',
|
|
253
|
+
'rest-assured': 'testFramework',
|
|
254
|
+
pactum: 'testFramework',
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Prefix patterns for fuzzy matching.
|
|
258
|
+
* If a dependency name starts with any of these prefixes, it gets the associated category.
|
|
259
|
+
*/
|
|
260
|
+
exports.DEPENDENCY_PREFIX_RULES = [
|
|
261
|
+
{ prefix: 'spring-security', category: 'securityLibrary' },
|
|
262
|
+
{ prefix: 'spring-boot-starter', category: 'framework' },
|
|
263
|
+
{ prefix: 'junit-jupiter', category: 'testFramework' },
|
|
264
|
+
{ prefix: 'mockito-', category: 'mockingLibrary' },
|
|
265
|
+
{ prefix: 'kotest-', category: 'testFramework' },
|
|
266
|
+
{ prefix: 'cucumber-', category: 'e2eFramework' },
|
|
267
|
+
{ prefix: '@nestjs/', category: 'framework' },
|
|
268
|
+
{ prefix: 'passport-', category: 'securityLibrary' },
|
|
269
|
+
{ prefix: 'chai-', category: 'assertionLibrary' },
|
|
270
|
+
{ prefix: 'rspec-', category: 'testFramework' },
|
|
271
|
+
{ prefix: 'pytest-', category: 'testFramework' },
|
|
272
|
+
{ prefix: 'ktor-server', category: 'framework' },
|
|
273
|
+
{ prefix: 'ktor-client', category: 'httpClient' },
|
|
274
|
+
{ prefix: '@playwright/', category: 'e2eFramework' },
|
|
275
|
+
];
|
|
276
|
+
/**
|
|
277
|
+
* Classify a dependency name into a category.
|
|
278
|
+
* Returns 'unknown' if no match is found.
|
|
279
|
+
*/
|
|
280
|
+
function classifyDependency(name) {
|
|
281
|
+
const lower = name.toLowerCase();
|
|
282
|
+
// Exact match first
|
|
283
|
+
const exact = exports.DEPENDENCY_CLASSIFICATION[lower];
|
|
284
|
+
if (exact)
|
|
285
|
+
return exact;
|
|
286
|
+
// Try original case for scoped packages
|
|
287
|
+
const original = exports.DEPENDENCY_CLASSIFICATION[name];
|
|
288
|
+
if (original)
|
|
289
|
+
return original;
|
|
290
|
+
// Prefix matching
|
|
291
|
+
for (const rule of exports.DEPENDENCY_PREFIX_RULES) {
|
|
292
|
+
if (lower.startsWith(rule.prefix))
|
|
293
|
+
return rule.category;
|
|
294
|
+
}
|
|
295
|
+
return 'unknown';
|
|
296
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency detector — parses manifest files to extract dependency names and versions.
|
|
3
|
+
*
|
|
4
|
+
* Supports:
|
|
5
|
+
* - package.json (JavaScript/TypeScript)
|
|
6
|
+
* - pom.xml (Java/Kotlin Maven)
|
|
7
|
+
* - build.gradle / build.gradle.kts (Java/Kotlin Gradle)
|
|
8
|
+
* - requirements.txt (Python)
|
|
9
|
+
* - pyproject.toml (Python)
|
|
10
|
+
* - Pipfile (Python)
|
|
11
|
+
* - Gemfile (Ruby)
|
|
12
|
+
* - go.mod (Go)
|
|
13
|
+
*/
|
|
14
|
+
import type { ParsedDependency, DependencyParseResult } from './types';
|
|
15
|
+
/** Manifest file names this detector handles. */
|
|
16
|
+
export declare const MANIFEST_FILES: readonly ["package.json", "pom.xml", "build.gradle", "build.gradle.kts", "requirements.txt", "pyproject.toml", "Pipfile", "Gemfile", "go.mod"];
|
|
17
|
+
/**
|
|
18
|
+
* Scan a project root for manifest files and parse all dependencies.
|
|
19
|
+
*/
|
|
20
|
+
export declare function detectDependencies(projectRoot: string): DependencyParseResult;
|
|
21
|
+
/**
|
|
22
|
+
* Parse a single manifest file and return dependency entries.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseManifest(fileName: string, content: string, sourceFile: string): ParsedDependency[];
|
|
25
|
+
//# sourceMappingURL=dependencyDetector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencyDetector.d.ts","sourceRoot":"","sources":["../../../../../src/pipeline/stages/sca/dependencyDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEvE,iDAAiD;AACjD,eAAO,MAAM,cAAc,gJAUjB,CAAC;AAEX;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,qBAAqB,CAqB7E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,gBAAgB,EAAE,CAwBpB"}
|