Skip to content

Commit

Permalink
ORCH-490 Make default artifactory URL check less stringent
Browse files Browse the repository at this point in the history
  • Loading branch information
alain-kermis-sonarsource authored Mar 1, 2024
1 parent 6059d95 commit c20dba2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

public class ArtifactoryFactory {

private static final String DEFAULT_ARTIFACTORY_URL = "https://repox.jfrog.io/repox";
private static final String DEFAULT_ARTIFACTORY_PREFIX = "https://repox.jfrog.io";
private static final String DEFAULT_ARTIFACTORY_URL = DEFAULT_ARTIFACTORY_PREFIX + "/repox";

/**
* Two types of Artifactory are supported: Maven and Default.
Expand All @@ -40,7 +41,7 @@ public static Artifactory createArtifactory(Configuration configuration) {
File downloadTempDir = new File(configuration.fileSystem().workspace(), "temp-downloads");
String baseUrl = defaultIfEmpty(configuration.getStringByKeys("orchestrator.artifactory.url", "ARTIFACTORY_URL"), DEFAULT_ARTIFACTORY_URL);

if (baseUrl.startsWith(DEFAULT_ARTIFACTORY_URL)) {
if (baseUrl.startsWith(DEFAULT_ARTIFACTORY_PREFIX)) {
String accessToken = configuration.getStringByKeys("orchestrator.artifactory.accessToken", "ARTIFACTORY_ACCESS_TOKEN");
String apiKey = configuration.getStringByKeys("orchestrator.artifactory.apiKey", "ARTIFACTORY_API_KEY");
return new DefaultArtifactory(downloadTempDir, baseUrl, accessToken, apiKey);
Expand Down

0 comments on commit c20dba2

Please sign in to comment.