Class NpmPayloadBuilder
- java.lang.Object
-
- org.owasp.dependencycheck.data.nodeaudit.NpmPayloadBuilder
-
@ThreadSafe public final class NpmPayloadBuilder extends java.lang.Object
Class used to create the payload to submit to the NPM Audit API service.- Author:
- Steve Springett, Jeremy Long
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.json.JsonObject
build(javax.json.JsonObject lockJson, javax.json.JsonObject packageJson, org.apache.commons.collections4.MultiValuedMap<java.lang.String,java.lang.String> dependencyMap, boolean skipDevDependencies)
Builds an npm audit API payload.static javax.json.JsonObject
build(javax.json.JsonObject packageJson, org.apache.commons.collections4.MultiValuedMap<java.lang.String,java.lang.String> dependencyMap, boolean skipDevDependencies)
Attempts to build the request data for NPM Audit API call.
-
-
-
Method Detail
-
build
public static javax.json.JsonObject build(javax.json.JsonObject lockJson, javax.json.JsonObject packageJson, org.apache.commons.collections4.MultiValuedMap<java.lang.String,java.lang.String> dependencyMap, boolean skipDevDependencies)
Builds an npm audit API payload.- Parameters:
lockJson
- the package-lock.jsonpackageJson
- the package.jsondependencyMap
- a collection of module/version pairs that is populated while building the payloadskipDevDependencies
- whether devDependencies should be skipped- Returns:
- the npm audit API payload
-
build
public static javax.json.JsonObject build(javax.json.JsonObject packageJson, org.apache.commons.collections4.MultiValuedMap<java.lang.String,java.lang.String> dependencyMap, boolean skipDevDependencies)
Attempts to build the request data for NPM Audit API call. This may produce a payload that will fail.- Parameters:
packageJson
- a raw package-lock.json filedependencyMap
- a collection of module/version pairs that isskipDevDependencies
- whether devDependencies should be skipped populated while building the payload- Returns:
- the JSON payload for NPN Audit
-
-