@cyclonedx/cdxgen 10.3.5 → 10.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/README.md +2 -4
- package/analyzer.js +19 -21
- package/bin/cdxgen.js +78 -77
- package/bin/evinse.js +26 -26
- package/bin/repl.js +56 -62
- package/bin/verify.js +9 -9
- package/binary.js +55 -54
- package/cbomutils.js +6 -6
- package/db.js +17 -17
- package/display.js +30 -30
- package/display.test.js +2 -2
- package/docker.js +93 -90
- package/docker.test.js +30 -30
- package/envcontext.js +15 -15
- package/envcontext.test.js +1 -1
- package/evinser.js +94 -93
- package/evinser.test.js +24 -24
- package/index.js +522 -482
- package/package.json +8 -16
- package/piptree.js +6 -6
- package/postgen.js +2 -5
- package/postgen.test.js +5 -5
- package/protobom.js +37 -7
- package/protobom.test.js +6 -6
- package/server.js +16 -16
- package/types/analyzer.d.ts +7 -4
- package/types/analyzer.d.ts.map +1 -1
- package/types/binary.d.ts +12 -8
- package/types/binary.d.ts.map +1 -1
- package/types/cbomutils.d.ts +1 -1
- package/types/db.d.ts +22 -9
- package/types/db.d.ts.map +1 -1
- package/types/display.d.ts +1 -1
- package/types/docker.d.ts +52 -32
- package/types/docker.d.ts.map +1 -1
- package/types/envcontext.d.ts +40 -40
- package/types/evinser.d.ts +3436 -717
- package/types/evinser.d.ts.map +1 -1
- package/types/index.d.ts +66 -40
- package/types/index.d.ts.map +1 -1
- package/types/jest.config.d.ts +2 -2
- package/types/piptree.d.ts +6 -2
- package/types/postgen.d.ts +1 -1
- package/types/postgen.d.ts.map +1 -1
- package/types/protobom.d.ts +7 -3
- package/types/protobom.d.ts.map +1 -1
- package/types/server.d.ts +1 -1
- package/types/utils.d.ts +521 -303
- package/types/utils.d.ts.map +1 -1
- package/types/validator.d.ts +1 -1
- package/types/validator.d.ts.map +1 -1
- package/utils.js +748 -676
- package/utils.test.js +720 -674
- package/validator.js +20 -17
package/evinser.test.js
CHANGED
|
@@ -3,14 +3,14 @@ import { expect, test } from "@jest/globals";
|
|
|
3
3
|
import {
|
|
4
4
|
constructServiceName,
|
|
5
5
|
detectServicesFromUsages,
|
|
6
|
-
extractEndpoints
|
|
6
|
+
extractEndpoints,
|
|
7
7
|
} from "./evinser.js";
|
|
8
8
|
|
|
9
9
|
import { readFileSync } from "node:fs";
|
|
10
10
|
|
|
11
11
|
test("Service detection test", () => {
|
|
12
12
|
const usageSlice = JSON.parse(
|
|
13
|
-
readFileSync("./test/data/usages.json", { encoding: "utf-8" })
|
|
13
|
+
readFileSync("./test/data/usages.json", { encoding: "utf-8" }),
|
|
14
14
|
);
|
|
15
15
|
const objectSlices = usageSlice.objectSlices;
|
|
16
16
|
const servicesMap = {};
|
|
@@ -24,70 +24,70 @@ test("Service detection test", () => {
|
|
|
24
24
|
|
|
25
25
|
test("extract endpoints test", () => {
|
|
26
26
|
expect(
|
|
27
|
-
extractEndpoints("java", '@GetMapping(value = { "/", "/home" })')
|
|
27
|
+
extractEndpoints("java", '@GetMapping(value = { "/", "/home" })'),
|
|
28
28
|
).toEqual(["/", "/home"]);
|
|
29
29
|
expect(
|
|
30
30
|
extractEndpoints(
|
|
31
31
|
"java",
|
|
32
|
-
'@PostMapping(value = "/issue", consumes = MediaType.APPLICATION_XML_VALUE)'
|
|
33
|
-
)
|
|
32
|
+
'@PostMapping(value = "/issue", consumes = MediaType.APPLICATION_XML_VALUE)',
|
|
33
|
+
),
|
|
34
34
|
).toEqual(["/issue"]);
|
|
35
35
|
expect(extractEndpoints("java", '@GetMapping("/token")')).toEqual(["/token"]);
|
|
36
36
|
expect(
|
|
37
37
|
extractEndpoints(
|
|
38
38
|
"javascript",
|
|
39
|
-
'router.use("/api/v2/users",userRoutes.routes(),userRoutes.allowedMethods())'
|
|
40
|
-
)
|
|
39
|
+
'router.use("/api/v2/users",userRoutes.routes(),userRoutes.allowedMethods())',
|
|
40
|
+
),
|
|
41
41
|
).toEqual(["/api/v2/users"]);
|
|
42
42
|
expect(
|
|
43
43
|
extractEndpoints(
|
|
44
44
|
"javascript",
|
|
45
|
-
"app.use('/encryptionkeys', serveIndexMiddleware, serveIndex('encryptionkeys', { icons: true, view: 'details' }))"
|
|
46
|
-
)
|
|
45
|
+
"app.use('/encryptionkeys', serveIndexMiddleware, serveIndex('encryptionkeys', { icons: true, view: 'details' }))",
|
|
46
|
+
),
|
|
47
47
|
).toEqual(["/encryptionkeys"]);
|
|
48
48
|
expect(
|
|
49
49
|
extractEndpoints(
|
|
50
50
|
"javascript",
|
|
51
|
-
"app.use(express.static(path.resolve('frontend/dist/frontend')))"
|
|
52
|
-
)
|
|
51
|
+
"app.use(express.static(path.resolve('frontend/dist/frontend')))",
|
|
52
|
+
),
|
|
53
53
|
).toEqual(["frontend/dist/frontend"]);
|
|
54
54
|
expect(
|
|
55
55
|
extractEndpoints(
|
|
56
56
|
"javascript",
|
|
57
|
-
"app.use('/ftp(?!/quarantine)/:file', fileServer())"
|
|
58
|
-
)
|
|
57
|
+
"app.use('/ftp(?!/quarantine)/:file', fileServer())",
|
|
58
|
+
),
|
|
59
59
|
).toEqual(["/ftp(?!/quarantine)/:file"]);
|
|
60
60
|
expect(
|
|
61
61
|
extractEndpoints(
|
|
62
62
|
"javascript",
|
|
63
|
-
"app.use('/rest/basket/:id', security.isAuthorized())"
|
|
64
|
-
)
|
|
63
|
+
"app.use('/rest/basket/:id', security.isAuthorized())",
|
|
64
|
+
),
|
|
65
65
|
).toEqual(["/rest/basket/:id"]);
|
|
66
66
|
expect(
|
|
67
67
|
extractEndpoints(
|
|
68
68
|
"javascript",
|
|
69
|
-
"app.get(['/.well-known/security.txt', '/security.txt'], verify.accessControlChallenges())"
|
|
70
|
-
)
|
|
69
|
+
"app.get(['/.well-known/security.txt', '/security.txt'], verify.accessControlChallenges())",
|
|
70
|
+
),
|
|
71
71
|
).toEqual(["/.well-known/security.txt", "/security.txt"]);
|
|
72
72
|
expect(
|
|
73
73
|
extractEndpoints(
|
|
74
74
|
"javascript",
|
|
75
|
-
'router.post("/convert",async(ctx:Context):Promise<void>=>{constparameters=ctx.request.body;constbatchClient=newBatchClient({region:"us-west-1"});constcommand=newSubmitJobCommand({jobName:parameters?.jobName,jobQueue:"FOO-ARN",jobDefinition:"BAR-ARN",parameters,});try{constobjectsOutput=awaitbatchClient.send(command);ctx.response.body=objectsOutput;}catch(err){//Poorexceptionhandlingctx.response.body=err;}})'
|
|
76
|
-
)
|
|
75
|
+
'router.post("/convert",async(ctx:Context):Promise<void>=>{constparameters=ctx.request.body;constbatchClient=newBatchClient({region:"us-west-1"});constcommand=newSubmitJobCommand({jobName:parameters?.jobName,jobQueue:"FOO-ARN",jobDefinition:"BAR-ARN",parameters,});try{constobjectsOutput=awaitbatchClient.send(command);ctx.response.body=objectsOutput;}catch(err){//Poorexceptionhandlingctx.response.body=err;}})',
|
|
76
|
+
),
|
|
77
77
|
).toEqual(["/convert"]);
|
|
78
78
|
expect(
|
|
79
79
|
extractEndpoints(
|
|
80
80
|
"java",
|
|
81
|
-
'@RequestMapping(path = "/{name}", method = RequestMethod.GET)'
|
|
82
|
-
)
|
|
81
|
+
'@RequestMapping(path = "/{name}", method = RequestMethod.GET)',
|
|
82
|
+
),
|
|
83
83
|
).toEqual(["/{name}"]);
|
|
84
84
|
expect(
|
|
85
|
-
extractEndpoints("java", "@RequestMapping(method = RequestMethod.POST)")
|
|
85
|
+
extractEndpoints("java", "@RequestMapping(method = RequestMethod.POST)"),
|
|
86
86
|
).toEqual([]);
|
|
87
87
|
expect(
|
|
88
88
|
extractEndpoints(
|
|
89
89
|
"java",
|
|
90
|
-
'@RequestMapping(value = "/{accountName}", method = RequestMethod.GET)'
|
|
91
|
-
)
|
|
90
|
+
'@RequestMapping(value = "/{accountName}", method = RequestMethod.GET)',
|
|
91
|
+
),
|
|
92
92
|
).toEqual(["/{accountName}"]);
|
|
93
93
|
});
|