From 93ccfe6b7b59a48bf83705dd8f211d5b0c45ef06 Mon Sep 17 00:00:00 2001 From: Asaf Gabai <77976014+asafgabai@users.noreply.github.com> Date: Thu, 9 Nov 2023 15:47:53 +0200 Subject: [PATCH 1/5] Support for downloading scan resources from an external repository (#141) * Added external resources repository option in the plugin's settings. --- .../configuration/JfrogCliServerConfig.java | 7 ++++++- .../ide/common/configuration/ServerConfig.java | 15 +++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/jfrog/ide/common/configuration/JfrogCliServerConfig.java b/src/main/java/com/jfrog/ide/common/configuration/JfrogCliServerConfig.java index c8068798..fbfbf509 100644 --- a/src/main/java/com/jfrog/ide/common/configuration/JfrogCliServerConfig.java +++ b/src/main/java/com/jfrog/ide/common/configuration/JfrogCliServerConfig.java @@ -87,7 +87,7 @@ public SSLContext getSslContext() { } @Override - public ProxyConfiguration getProxyConfForTargetUrl(String xrayUrl) { + public ProxyConfiguration getProxyConfForTargetUrl(String targetUrl) { return null; } @@ -101,6 +101,11 @@ public int getConnectionTimeout() { return 0; } + @Override + public String getExternalResourcesRepo() { + return null; + } + private String getValueFromJson(String fieldName) { return serverConfig.get(fieldName) != null ? serverConfig.get(fieldName).asText() : ""; } diff --git a/src/main/java/com/jfrog/ide/common/configuration/ServerConfig.java b/src/main/java/com/jfrog/ide/common/configuration/ServerConfig.java index 4b268982..c3b4aa9f 100644 --- a/src/main/java/com/jfrog/ide/common/configuration/ServerConfig.java +++ b/src/main/java/com/jfrog/ide/common/configuration/ServerConfig.java @@ -53,12 +53,12 @@ enum PolicyType {VULNERABILITIES, PROJECT, WATCHES} SSLContext getSslContext(); /** - * Reads the http proxy configuration set in IDE configuration and returns the proxy configuration for the Xray URL. + * Reads the HTTP proxy configuration set in IDE configuration and returns the proxy configuration for the target URL. * - * @param xrayUrl - Xray url. - * @return proxy config for the Xray URL. + * @param targetUrl The target URL. + * @return Proxy configuration for the target URL. */ - ProxyConfiguration getProxyConfForTargetUrl(String xrayUrl); + ProxyConfiguration getProxyConfForTargetUrl(String targetUrl); /** * @return connection retries. @@ -70,6 +70,13 @@ enum PolicyType {VULNERABILITIES, PROJECT, WATCHES} */ int getConnectionTimeout(); + /** + * Returns external resources repository name. If it's not configured, null is returned. + * + * @return External resources repository name, if configured. + */ + String getExternalResourcesRepo(); + @SuppressWarnings("unused") default boolean areCredentialsSet() { return isNoneBlank(getUsername(), getPassword()) && !isAllBlank(getUrl(), getXrayUrl(), getArtifactoryUrl()); From 10ba693c4fbe61039618a37f65872933e9c51fcb Mon Sep 17 00:00:00 2001 From: Asaf Gabai <77976014+asafgabai@users.noreply.github.com> Date: Thu, 9 Nov 2023 16:20:13 +0200 Subject: [PATCH 2/5] Audit only Gradle projects on release (#142) --- release/pipelines.release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/pipelines.release.yml b/release/pipelines.release.yml index 7972c923..8335eb6b 100644 --- a/release/pipelines.release.yml +++ b/release/pipelines.release.yml @@ -54,7 +54,7 @@ pipelines: - jf gradlec --use-wrapper --repo-resolve ecosys-maven-remote --repo-deploy ecosys-oss-release-local --deploy-maven-desc # Run audit - - jf audit + - jf audit --gradle --use-wrapper # Update version - sed -i "s/\(version=\).*\$/\1${NEXT_VERSION}/" gradle.properties From b07e66f706ff697cad042f1f0a91f272517d67f2 Mon Sep 17 00:00:00 2001 From: JFrog Pipelines Step Date: Thu, 9 Nov 2023 14:52:16 +0000 Subject: [PATCH 3/5] [artifactory-release] Release version 2.3.1 [skipRun] --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 9532f1bb..2e819839 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=2.3.x-SNAPSHOT +version=2.3.1 From ba7a77bcbef55bfbbce2149b9e94f754bd069fb1 Mon Sep 17 00:00:00 2001 From: JFrog Pipelines Step Date: Thu, 9 Nov 2023 14:55:31 +0000 Subject: [PATCH 4/5] [artifactory-release] Next development version [skipRun] --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 2e819839..9532f1bb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=2.3.1 +version=2.3.x-SNAPSHOT From 432db7ce2b1e87cf9471fde6a3e88d500953fdd1 Mon Sep 17 00:00:00 2001 From: Or Geva Date: Tue, 14 Nov 2023 13:50:11 +0200 Subject: [PATCH 5/5] Remove consolidatePaths from PackageFileFinder (#143) --- .../com/jfrog/ide/common/utils/PackageFileFinder.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/jfrog/ide/common/utils/PackageFileFinder.java b/src/main/java/com/jfrog/ide/common/utils/PackageFileFinder.java index 2fbfa1ba..84dd6640 100644 --- a/src/main/java/com/jfrog/ide/common/utils/PackageFileFinder.java +++ b/src/main/java/com/jfrog/ide/common/utils/PackageFileFinder.java @@ -36,7 +36,7 @@ public PackageFileFinder(Set projectPaths, Path basePath, String excludedP this.exclusions = FileSystems.getDefault().getPathMatcher("glob:" + excludedPaths); this.basePath = basePath; - for (Path projectPath : Utils.consolidatePaths(projectPaths)) { + for (Path projectPath : projectPaths) { Files.walkFileTree(projectPath, this); } if (!excludedDirectories.isEmpty()) { @@ -50,7 +50,7 @@ public PackageFileFinder(Set projectPaths, Path basePath, String excludedP /** * Get package.json directories and their directories. * - * @return List of package.json's parent directories. + * @return Set of package.json's parent directories. */ public Set getNpmPackagesFilePairs() { Set packageJsonDirectoriesSet = Sets.newHashSet(packageJsonDirectories); @@ -62,7 +62,7 @@ public Set getNpmPackagesFilePairs() { /** * Get package.json directories and their directories. * - * @return List of yarn.lock's parent directories. + * @return Set of yarn.lock's parent directories. */ public Set getYarnPackagesFilePairs() { return Sets.newHashSet(yarnLockDirectories); @@ -71,7 +71,7 @@ public Set getYarnPackagesFilePairs() { /** * Get build.gradle and build.gradle.kts directories and their directories. * - * @return List of build.gradle and build.gradle.kts's parent directories. + * @return Set of build.gradle and build.gradle.kts's parent directories. */ public Set getBuildGradlePackagesFilePairs() { return Sets.newHashSet(buildGradleDirectories); @@ -80,7 +80,7 @@ public Set getBuildGradlePackagesFilePairs() { /** * Get go.mod directories and their directories. * - * @return List of go.mod's parent directories. + * @return Set of go.mod's parent directories. */ public Set getGoPackagesFilePairs() { return Sets.newHashSet(goModDirectories);