-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for cocoapods, nuget scanning
- Loading branch information
1 parent
4adb712
commit 56d99cb
Showing
37 changed files
with
893 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
core/src/main/java/io/snyk/plugins/artifactory/configuration/RepoPackageType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package io.snyk.plugins.artifactory.configuration; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/* | ||
* Enum of Artifactory repository package types | ||
*/ | ||
public enum RepoPackageType { | ||
cocoapods, | ||
nuget, | ||
gems; | ||
|
||
// Purl Type specification | ||
private static final Map<RepoPackageType, String> packageToPurlTypeMap; | ||
// Vulnerability Type at Snyk Security Vulnerability database | ||
private static final Map<RepoPackageType, String> packageToVulnTypeMap; | ||
|
||
static { | ||
packageToPurlTypeMap = new HashMap<>(); | ||
packageToPurlTypeMap.put(cocoapods, "cocoapods"); | ||
packageToPurlTypeMap.put(nuget, "nuget"); | ||
packageToPurlTypeMap.put(gems, "gem"); | ||
packageToVulnTypeMap = new HashMap<>(); | ||
packageToVulnTypeMap.put(cocoapods, "cocoapods"); | ||
packageToVulnTypeMap.put(nuget, "nuget"); | ||
packageToVulnTypeMap.put(gems, "rubygems"); | ||
} | ||
|
||
public String getPurlType() { | ||
return packageToPurlTypeMap.get(this); | ||
} | ||
|
||
public String getVulnType() { | ||
return packageToVulnTypeMap.get(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 7 additions & 2 deletions
9
core/src/main/java/io/snyk/plugins/artifactory/exception/SnykAPIFailureException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
core/src/main/java/io/snyk/plugins/artifactory/scanner/AbstractScannerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.snyk.plugins.artifactory.scanner; | ||
|
||
import io.snyk.plugins.artifactory.configuration.ConfigurationModule; | ||
import io.snyk.sdk.api.SnykClient; | ||
import org.artifactory.repo.RepoPath; | ||
import org.artifactory.repo.Repositories; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
interface AbstractScannerFactory { | ||
|
||
PackageScanner createScanner(@Nonnull ConfigurationModule configurationModule, @Nonnull Repositories repositories, @Nonnull RepoPath repoPath, String pluginVersion); | ||
SnykClient createSnykClient(@Nonnull ConfigurationModule configurationModule, String pluginVersion, Class client); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
core/src/main/java/io/snyk/plugins/artifactory/scanner/PackageScanner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
package io.snyk.plugins.artifactory.scanner; | ||
|
||
import io.snyk.sdk.model.TestResult; | ||
import io.snyk.sdk.model.ScanResponse; | ||
import org.artifactory.fs.FileLayoutInfo; | ||
import org.artifactory.repo.RepoPath; | ||
|
||
interface PackageScanner { | ||
TestResult scan(FileLayoutInfo fileLayoutInfo, RepoPath repoPath); | ||
public interface PackageScanner { | ||
//TestResult scan(FileLayoutInfo fileLayoutInfo, RepoPath repoPath); | ||
ScanResponse scan(FileLayoutInfo fileLayoutInfo, RepoPath repoPath); | ||
} |
Oops, something went wrong.