@cyclonedx/cdxgen 8.1.7 → 8.1.9

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 CHANGED
@@ -262,6 +262,7 @@ cdxgen can retain the dependency tree under the `dependencies` attribute for a s
262
262
  | FETCH_LICENSE | Set this variable to fetch license information from the registry. npm and golang only |
263
263
  | USE_GOSUM | Set to true to generate BOMs for golang projects using go.sum as the dependency source of truth, instead of go.mod |
264
264
  | CDXGEN_TIMEOUT_MS | Default timeout for known execution involving maven, gradle or sbt |
265
+ | CDXGEN_SERVER_TIMEOUT_MS | Default timeout in server mode |
265
266
  | BAZEL_TARGET | Bazel target to build. Default :all (Eg: //java-maven) |
266
267
  | CLJ_CMD | Set to override the clojure cli command |
267
268
  | LEIN_CMD | Set to override the leiningen command |
package/index.js CHANGED
@@ -4167,6 +4167,10 @@ const createBom = async (path, options) => {
4167
4167
  case "kotlin":
4168
4168
  case "scala":
4169
4169
  case "jvm":
4170
+ case "gradle":
4171
+ case "mvn":
4172
+ case "maven":
4173
+ case "sbt":
4170
4174
  return await createJavaBom(path, options);
4171
4175
  case "jar":
4172
4176
  options.multiProject = true;
@@ -4192,6 +4196,7 @@ const createBom = async (path, options) => {
4192
4196
  case "javascript":
4193
4197
  case "typescript":
4194
4198
  case "ts":
4199
+ case "tsx":
4195
4200
  return await createNodejsBom(path, options);
4196
4201
  case "python":
4197
4202
  case "py":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyclonedx/cdxgen",
3
- "version": "8.1.7",
3
+ "version": "8.1.9",
4
4
  "description": "Creates CycloneDX Software Bill-of-Materials (SBOM) from source or container image",
5
5
  "homepage": "http://github.com/cyclonedx/cdxgen",
6
6
  "author": "Prabhu Subramanian <prabhu@appthreat.com>",
package/server.js CHANGED
@@ -9,6 +9,10 @@ const path = require("path");
9
9
  const bom = require("./index.js");
10
10
  const compression = require("compression");
11
11
 
12
+ // Timeout milliseconds. Default 10 mins
13
+ const TIMEOUT_MS =
14
+ parseInt(process.env.CDXGEN_SERVER_TIMEOUT_MS) || 10 * 60 * 1000;
15
+
12
16
  const app = connect();
13
17
 
14
18
  app.use(
@@ -68,9 +72,19 @@ const parseQueryString = (q, body, options = {}) => {
68
72
  return options;
69
73
  };
70
74
 
75
+ const configureServer = (cdxgenServer) => {
76
+ cdxgenServer.headersTimeout = TIMEOUT_MS;
77
+ cdxgenServer.requestTimeout = TIMEOUT_MS;
78
+ cdxgenServer.timeout = 0;
79
+ cdxgenServer.keepAliveTimeout = 0;
80
+ };
81
+
71
82
  const start = async (options) => {
72
83
  console.log("Listening on", options.serverHost, options.serverPort);
73
- http.createServer(app).listen(options.serverPort, options.serverHost);
84
+ const cdxgenServer = http
85
+ .createServer(app)
86
+ .listen(options.serverPort, options.serverHost);
87
+ configureServer(cdxgenServer);
74
88
  app.use("/sbom", async function (req, res) {
75
89
  const q = url.parse(req.url, true).query;
76
90
  let cleanup = false;