@aikidosec/ci-api-client 1.0.11 → 1.0.15
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/.github/workflows/build-and-release.yml +12 -7
- package/lib/aikidoApi.d.ts +1 -0
- package/lib/commands/scan.js +1 -1
- package/lib/commands/scanRelease.d.ts +1 -0
- package/lib/commands/scanRelease.js +9 -2
- package/lib/index.js +1 -1
- package/npm-shrinkwrap.json +1270 -0
- package/package.json +23 -20
- package/src/aikidoApi.ts +1 -0
- package/src/commands/scan.ts +1 -1
- package/src/commands/scanRelease.ts +15 -2
- package/src/index.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aikidosec/ci-api-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "CLI api client to easily integrate the Aikido public CI API into custom deploy scripts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bert Devriese <bert@builtinbruges.com>",
|
|
@@ -17,35 +17,38 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"start": "nodemon --watch 'src/**/*.ts' --esm --exec 'ts-node' src/index.ts",
|
|
19
19
|
"build": "tsc -p .",
|
|
20
|
-
"local": "
|
|
21
|
-
"local-rm": "
|
|
20
|
+
"local": "npm run build && npm install -g file:$PWD; aikido-api-client",
|
|
21
|
+
"local-rm": "npm uninstall -g @aikidosec/ci-api-client",
|
|
22
22
|
"format": "prettier --write 'src/**/*.ts'",
|
|
23
23
|
"//": {
|
|
24
|
-
"refresh": "rm -rf ./node_modules ./
|
|
24
|
+
"refresh": "rm -rf ./node_modules ./npm-shrinkwrap.json && npm install && npm shrinkwrap"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"axios": "
|
|
29
|
-
"chalk": "
|
|
30
|
-
"commander": "
|
|
31
|
-
"configstore": "
|
|
32
|
-
"dotenv": "
|
|
33
|
-
"ora": "
|
|
28
|
+
"axios": "1.8.3",
|
|
29
|
+
"chalk": "5.3.0",
|
|
30
|
+
"commander": "11.0.0",
|
|
31
|
+
"configstore": "6.0.0",
|
|
32
|
+
"dotenv": "16.3.1",
|
|
33
|
+
"ora": "6.3.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/chalk": "
|
|
37
|
-
"@types/commander": "
|
|
38
|
-
"@types/configstore": "
|
|
39
|
-
"@types/dotenv": "
|
|
40
|
-
"@types/node": "
|
|
41
|
-
"nodemon": "
|
|
42
|
-
"prettier": "
|
|
43
|
-
"ts-node": "
|
|
44
|
-
"typescript": "
|
|
36
|
+
"@types/chalk": "2.2.0",
|
|
37
|
+
"@types/commander": "2.12.2",
|
|
38
|
+
"@types/configstore": "6.0.0",
|
|
39
|
+
"@types/dotenv": "8.2.0",
|
|
40
|
+
"@types/node": "20.3.3",
|
|
41
|
+
"nodemon": "2.0.22",
|
|
42
|
+
"prettier": "2.8.8",
|
|
43
|
+
"ts-node": "10.9.1",
|
|
44
|
+
"typescript": "5.1.6"
|
|
45
45
|
},
|
|
46
46
|
"keywords": [
|
|
47
47
|
"aikido",
|
|
48
48
|
"security",
|
|
49
49
|
"cli"
|
|
50
|
-
]
|
|
50
|
+
],
|
|
51
|
+
"overrides": {
|
|
52
|
+
"form-data@<=4.0.4": "4.0.4"
|
|
53
|
+
}
|
|
51
54
|
}
|
package/src/aikidoApi.ts
CHANGED
package/src/commands/scan.ts
CHANGED
|
@@ -245,7 +245,7 @@ export const scan = async ({
|
|
|
245
245
|
const parseCliOptions = (userCliOptions: TScanUserCliOptions) => {
|
|
246
246
|
// Version provided to the API corresponds with the version in package.json
|
|
247
247
|
// of the cli client
|
|
248
|
-
const apiOptions: TScanApiOptions = { version: '1.0.
|
|
248
|
+
const apiOptions: TScanApiOptions = { version: '1.0.15' };
|
|
249
249
|
const cliOptions: TScanCliOptions = { pollInterval: 5 };
|
|
250
250
|
|
|
251
251
|
if (userCliOptions.pullRequestTitle) {
|
|
@@ -62,6 +62,7 @@ type TScanUserCliOptions = {
|
|
|
62
62
|
minimumSeverityLevel?: string;
|
|
63
63
|
pollInterval?: number;
|
|
64
64
|
baseBranch?: string;
|
|
65
|
+
slaMode?: boolean;
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
async function cli(
|
|
@@ -114,7 +115,12 @@ async function cli(
|
|
|
114
115
|
} else {
|
|
115
116
|
loader?.fail('Scan completed with issues');
|
|
116
117
|
|
|
117
|
-
if (
|
|
118
|
+
if (apiOptions.sla_mode) {
|
|
119
|
+
outputLog(
|
|
120
|
+
chalk.gray(
|
|
121
|
+
chalk.bold('Issues outside of SLA found: ') + pollResult.issues_outside_sla)
|
|
122
|
+
);
|
|
123
|
+
} else if (pollResult.new_issues_found) {
|
|
118
124
|
outputLog(
|
|
119
125
|
chalk.gray(
|
|
120
126
|
chalk.bold('Open issues found: ') + pollResult.new_issues_found
|
|
@@ -239,7 +245,7 @@ export const scan = async ({
|
|
|
239
245
|
const parseCliOptions = (userCliOptions: TScanUserCliOptions) => {
|
|
240
246
|
// Version provided to the API corresponds with the version in package.json
|
|
241
247
|
// of the cli client
|
|
242
|
-
const apiOptions: TScanApiOptions = { version: '1.0.
|
|
248
|
+
const apiOptions: TScanApiOptions = { version: '1.0.15' };
|
|
243
249
|
const cliOptions: TScanCliOptions = { pollInterval: 10 };
|
|
244
250
|
|
|
245
251
|
if (userCliOptions.pullRequestTitle) {
|
|
@@ -275,6 +281,9 @@ const parseCliOptions = (userCliOptions: TScanUserCliOptions) => {
|
|
|
275
281
|
if (userCliOptions.baseBranch) {
|
|
276
282
|
apiOptions.base_branch = userCliOptions.baseBranch;
|
|
277
283
|
}
|
|
284
|
+
if (userCliOptions.slaMode) {
|
|
285
|
+
apiOptions.sla_mode = true;
|
|
286
|
+
}
|
|
278
287
|
if (
|
|
279
288
|
userCliOptions.pollInterval &&
|
|
280
289
|
(isNaN(userCliOptions.pollInterval) || userCliOptions.pollInterval <= 0)
|
|
@@ -350,6 +359,10 @@ export const cliSetup = (program: Command) =>
|
|
|
350
359
|
'Base branch for the release gated scan.'
|
|
351
360
|
)
|
|
352
361
|
)
|
|
362
|
+
.option(
|
|
363
|
+
'--sla-mode',
|
|
364
|
+
'Let Aikido only fail only on open issues that have gone out of SLA.'
|
|
365
|
+
)
|
|
353
366
|
.description('Run a release scan of an Aikido repo.')
|
|
354
367
|
.action(cli);
|
|
355
368
|
|
package/src/index.ts
CHANGED
|
@@ -20,7 +20,7 @@ program
|
|
|
20
20
|
.description(
|
|
21
21
|
'CLI api client to easily integrate the Aikido public CI API into custom deploy scripts'
|
|
22
22
|
)
|
|
23
|
-
.version('1.0.
|
|
23
|
+
.version('1.0.15');
|
|
24
24
|
|
|
25
25
|
// Load in all app commands and set them up in the `program` instance
|
|
26
26
|
apiKey.cliSetup(program);
|