snyk 1.942.0 → 1.943.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/dist/cli/756.index.js
CHANGED
|
@@ -157532,10 +157532,15 @@ function unpackJars(jarBuffers, desiredLevelsOfUnpacking, unpackedLevels = 0) {
|
|
|
157532
157532
|
desiredLevelsOfUnpacking,
|
|
157533
157533
|
requiredLevelsOfUnpacking,
|
|
157534
157534
|
});
|
|
157535
|
-
//
|
|
157536
|
-
//
|
|
157537
|
-
//
|
|
157538
|
-
|
|
157535
|
+
// we only care about JAR fingerprints. Other Java archive files are not
|
|
157536
|
+
// interesting enough on their own but are merely containers for JARs,
|
|
157537
|
+
// so no point in fingerprinting them
|
|
157538
|
+
if (jarBuffer.location.endsWith(".jar")) {
|
|
157539
|
+
// if any of the coords are null for this JAR we didn't manage to get
|
|
157540
|
+
// anything from the JAR's pom.properties manifest, so calculate the
|
|
157541
|
+
// sha so maven-deps can fallback to searching maven central
|
|
157542
|
+
fingerprints.push(Object.assign({ location: jarInfo.location, digest: jarInfo.coords ? null : (0, buffer_utils_1.bufferToSha1)(jarInfo.buffer), dependencies: jarInfo.dependencies }, jarInfo.coords));
|
|
157543
|
+
}
|
|
157539
157544
|
if (jarInfo.nestedJars.length > 0) {
|
|
157540
157545
|
// this is an uber/fat JAR so we need to unpack the nested JARs to
|
|
157541
157546
|
// analyse them for coords and further nested JARs (depth flag allowing)
|
|
@@ -160729,9 +160734,11 @@ exports.getJarFileContentAction = void 0;
|
|
|
160729
160734
|
const path = __webpack_require__(85622);
|
|
160730
160735
|
const stream_utils_1 = __webpack_require__(54540);
|
|
160731
160736
|
const ignoredPaths = ["/usr/lib", "gradle/cache"];
|
|
160737
|
+
const javaArchiveFileFormats = [".jar", ".war"];
|
|
160732
160738
|
function filePathMatches(filePath) {
|
|
160733
160739
|
const dirName = path.dirname(filePath);
|
|
160734
|
-
|
|
160740
|
+
const fileExtension = filePath.slice(-4);
|
|
160741
|
+
return (javaArchiveFileFormats.includes(fileExtension) &&
|
|
160735
160742
|
!ignoredPaths.some((ignorePath) => dirName.includes(path.normalize(ignorePath))));
|
|
160736
160743
|
}
|
|
160737
160744
|
exports.getJarFileContentAction = {
|