@cyclonedx/cdxgen 8.6.0 → 9.0.0
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/README.md +51 -45
- package/analyzer.js +15 -19
- package/bin/{cdxgen → cdxgen.js} +69 -23
- package/binary.js +52 -52
- package/data/pypi-pkg-aliases.json +2 -0
- package/data/python-stdlib.json +2 -1
- package/docker.js +154 -127
- package/docker.test.js +18 -14
- package/index.js +488 -381
- package/jest.config.js +6 -180
- package/package.json +15 -14
- package/server.js +12 -12
- package/utils.js +376 -384
- package/utils.test.js +362 -319
- package/.eslintrc.js +0 -15
package/docker.test.js
CHANGED
|
@@ -1,43 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
getConnection,
|
|
3
|
+
parseImageName,
|
|
4
|
+
getImage,
|
|
5
|
+
removeImage,
|
|
6
|
+
exportImage
|
|
7
|
+
} from "./docker";
|
|
8
|
+
import { expect, test } from "@jest/globals";
|
|
3
9
|
|
|
4
10
|
test("docker connection", async () => {
|
|
5
|
-
const dockerConn = await
|
|
11
|
+
const dockerConn = await getConnection();
|
|
6
12
|
expect(dockerConn);
|
|
7
13
|
});
|
|
8
14
|
|
|
9
15
|
test("parseImageName tests", () => {
|
|
10
|
-
expect(
|
|
16
|
+
expect(parseImageName("debian")).toEqual({
|
|
11
17
|
registry: "",
|
|
12
18
|
repo: "debian",
|
|
13
19
|
tag: "",
|
|
14
20
|
digest: "",
|
|
15
21
|
platform: ""
|
|
16
22
|
});
|
|
17
|
-
expect(
|
|
23
|
+
expect(parseImageName("debian:latest")).toEqual({
|
|
18
24
|
registry: "",
|
|
19
25
|
repo: "debian",
|
|
20
26
|
tag: "latest",
|
|
21
27
|
digest: "",
|
|
22
28
|
platform: ""
|
|
23
29
|
});
|
|
24
|
-
expect(
|
|
30
|
+
expect(parseImageName("shiftleft/scan:v1.15.6")).toEqual({
|
|
25
31
|
registry: "",
|
|
26
32
|
repo: "shiftleft/scan",
|
|
27
33
|
tag: "v1.15.6",
|
|
28
34
|
digest: "",
|
|
29
35
|
platform: ""
|
|
30
36
|
});
|
|
31
|
-
expect(
|
|
32
|
-
dockerLib.parseImageName("localhost:5000/shiftleft/scan:v1.15.6")
|
|
33
|
-
).toEqual({
|
|
37
|
+
expect(parseImageName("localhost:5000/shiftleft/scan:v1.15.6")).toEqual({
|
|
34
38
|
registry: "localhost:5000",
|
|
35
39
|
repo: "shiftleft/scan",
|
|
36
40
|
tag: "v1.15.6",
|
|
37
41
|
digest: "",
|
|
38
42
|
platform: ""
|
|
39
43
|
});
|
|
40
|
-
expect(
|
|
44
|
+
expect(parseImageName("localhost:5000/shiftleft/scan")).toEqual({
|
|
41
45
|
registry: "localhost:5000",
|
|
42
46
|
repo: "shiftleft/scan",
|
|
43
47
|
tag: "",
|
|
@@ -45,7 +49,7 @@ test("parseImageName tests", () => {
|
|
|
45
49
|
platform: ""
|
|
46
50
|
});
|
|
47
51
|
expect(
|
|
48
|
-
|
|
52
|
+
parseImageName(
|
|
49
53
|
"quay.io/shiftleft/scan-java@sha256:5d008306a7c5d09ba0161a3408fa3839dc2c9dd991ffb68adecc1040399fe9e1"
|
|
50
54
|
)
|
|
51
55
|
).toEqual({
|
|
@@ -58,14 +62,14 @@ test("parseImageName tests", () => {
|
|
|
58
62
|
});
|
|
59
63
|
|
|
60
64
|
test("docker getImage", async () => {
|
|
61
|
-
const imageData = await
|
|
65
|
+
const imageData = await getImage("hello-world:latest");
|
|
62
66
|
if (imageData) {
|
|
63
|
-
const removeData = await
|
|
67
|
+
const removeData = await removeImage("hello-world:latest");
|
|
64
68
|
expect(removeData);
|
|
65
69
|
}
|
|
66
70
|
}, 120000);
|
|
67
71
|
|
|
68
72
|
test("docker getImage", async () => {
|
|
69
|
-
const imageData = await
|
|
73
|
+
const imageData = await exportImage("hello-world:latest");
|
|
70
74
|
expect(imageData);
|
|
71
75
|
}, 120000);
|