-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for suspicious gradle-wrapper.jar #1434
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code translated from https://github.com/gradle/wrapper-validation-action/ should retain original copyright/license, with a link to the original source
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/internal/gradle/checksums/WrapperValidator.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/internal/gradle/checksums/WrapperValidator.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/internal/gradle/checksums/WrapperValidator.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/internal/gradle/checksums/WrapperValidator.java
Outdated
Show resolved
Hide resolved
...se.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/managers/GradleProjectImporterTest.java
Outdated
Show resolved
Hide resolved
...eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/GradleProjectImporter.java
Show resolved
Hide resolved
I haven't copied anything from https://github.com/gradle/wrapper-validation-action/. I have only used those class names that you sent. |
Well that code I translated from https://github.com/gradle/wrapper-validation-action/. |
I haven't used any code, but only the WrapperValidator, ValidationResult class names. |
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JobHelpers.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java
Outdated
Show resolved
Hide resolved
...eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/GradleProjectImporter.java
Outdated
Show resolved
Hide resolved
@@ -1367,4 +1443,9 @@ public Preferences setStaticImportOnDemandThreshold(int staticImportOnDemandThre | |||
defEclipsePrefs.put(CodeStyleConfiguration.ORGIMPORTS_STATIC_ONDEMANDTHRESHOLD, String.valueOf(this.staticImportOnDemandThreshold)); | |||
return this; | |||
} | |||
|
|||
class Sha256 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ChecksumWrapper
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java
Outdated
Show resolved
Hide resolved
...clipse.jdt.ls.core/src/org/eclipse/jdt/ls/internal/gradle/checksums/DownloadChecksumJob.java
Show resolved
Hide resolved
@fbricon I have updated the PR. |
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/internal/gradle/checksums/WrapperValidator.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/internal/gradle/checksums/WrapperValidator.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/internal/gradle/checksums/WrapperValidator.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/internal/gradle/checksums/WrapperValidator.java
Outdated
Show resolved
Hide resolved
...clipse.jdt.ls.core/src/org/eclipse/jdt/ls/internal/gradle/checksums/DownloadChecksumJob.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/internal/gradle/checksums/WrapperValidator.java
Show resolved
Hide resolved
...eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/managers/WrapperValidatorTest.java
Show resolved
Hide resolved
...eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/GradleProjectImporter.java
Outdated
Show resolved
Hide resolved
...eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/GradleProjectImporter.java
Outdated
Show resolved
Hide resolved
...eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/GradleProjectImporter.java
Outdated
Show resolved
Hide resolved
test this please |
File sha256Directory = WrapperValidator.getSha256CacheFile(); | ||
// test cache | ||
file = new File(sha256Directory, "gradle-6.4-wrapper.jar.sha256"); | ||
String sha256 = Files.lines(Paths.get(file.getAbsolutePath()), StandardCharsets.UTF_8).findFirst().get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
java.nio.file.NoSuchFileException: /Users/fbricon/Dev/projects/eclipse.jdt.ls/org.eclipse.jdt.ls.tests/target/gradle/checksums/gradle-6.4-wrapper.jar.sha256
at org.eclipse.jdt.ls.core.internal.managers.WrapperValidatorTest.testGradleWrapper(WrapperValidatorTest.java:63)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #1450
Signed-off-by: Snjezana Peco <[email protected]>
Signed-off-by: Snjezana Peco <[email protected]>
Thanks @snjeza ! |
Requires redhat-developer/vscode-java#1440
Signed-off-by: Snjezana Peco [email protected]